6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Sat Nov 23, 2024 8:08 am

All times are UTC




Post new topic Reply to topic  [ 63 posts ]  Go to page 1, 2, 3, 4, 5  Next
Author Message
 Post subject: 65C02 Version of EhBasic
PostPosted: Fri Sep 27, 2019 2:40 am 
Offline
User avatar

Joined: Tue Mar 05, 2013 4:31 am
Posts: 1385
I finally got around to finishing up some new updates to my previous CMOS only version of EhBasic. It's based on the latest 2.22p4 from Klaus. To keep it short, some stuff removed, like all IRQ/NMI code, added an EXIT command, streamlined startup code for a RAM test (no user input) and added LOAD/SAVE using the Xmodem-CRC functions in my C02Monitor. The finished code is exactly 9.75KB in size (9984 bytes) and has a few other nice updates as well, like Mike Barry's change to the CHRGET (equivalent) routine, which is a measurable performance improvement. I'll get around to posting my latest version 2.03 C02BIOS and C02Monitor code shortly, which is what this version of EhBasic works with.

If anyone would like to use it with a different BIOS/Monitor, modifications should be very minimal. Hope others find it useful. Enjoy!

Attachment:
EhBasic.zip [210.04 KiB]
Downloaded 335 times

_________________
Regards, KM
https://github.com/floobydust


Top
 Profile  
Reply with quote  
PostPosted: Fri Sep 27, 2019 10:20 am 
Offline
User avatar

Joined: Wed Feb 14, 2018 2:33 pm
Posts: 1488
Location: Scotland
floobydust wrote:
I finally got around to finishing up some new updates to my previous CMOS only version of EhBasic. It's based on the latest 2.22p4 from Klaus. To keep it short, some stuff removed, like all IRQ/NMI code, added an EXIT command, streamlined startup code for a RAM test (no user input) and added LOAD/SAVE using the Xmodem-CRC functions in my C02Monitor. The finished code is exactly 9.75KB in size (9984 bytes) and has a few other nice updates as well, like Mike Barry's change to the CHRGET (equivalent) routine, which is a measurable performance improvement. I'll get around to posting my latest version 2.03 C02BIOS and C02Monitor code shortly, which is what this version of EhBasic works with.

If anyone would like to use it with a different BIOS/Monitor, modifications should be very minimal. Hope others find it useful. Enjoy!

Attachment:
EhBasic.zip


Thanks! Been using your earlier version without issues on my Ruby 65C02 system - might find time to test this, but I'm quite far down the 65816 route now with BBC Basic being my preferred "BASIC" for now.

Cheers,

-Gordon

_________________
--
Gordon Henderson.
See my Ruby 6502 and 65816 SBC projects here: https://projects.drogon.net/ruby/


Top
 Profile  
Reply with quote  
PostPosted: Wed Oct 02, 2019 12:46 am 
Offline
User avatar

Joined: Tue Mar 05, 2013 4:31 am
Posts: 1385
Thanks Gordon.

Simple changes... modified memory test, Load and Save vectors handle everything sans the actual Xmodem transfer and Mike Barry’s change makes it a tiny bit quicker. Can’t see having anything broken from the previous version, albeit some of the error messages are shorter, i.e., without goes to w/o.

_________________
Regards, KM
https://github.com/floobydust


Top
 Profile  
Reply with quote  
PostPosted: Fri Oct 04, 2019 4:47 pm 
Offline

Joined: Sun Feb 22, 2004 9:01 pm
Posts: 109
All the updates to ehBasic are sub-sub-versions of 2.22: 2.22, 2.22patch, 2.22patch2, 2.22patch3, 2.22patch4variantC. Shouldn't there be a co-ordinated rollover to 2.23? or 2.30?

_________________
--
JGH - http://mdfs.net


Top
 Profile  
Reply with quote  
PostPosted: Fri Oct 04, 2019 6:21 pm 
Offline
User avatar

Joined: Tue Mar 05, 2013 4:31 am
Posts: 1385
jgharston wrote:
All the updates to ehBasic are sub-sub-versions of 2.22: 2.22, 2.22patch, 2.22patch2, 2.22patch3, 2.22patch4variantC. Shouldn't there be a co-ordinated rollover to 2.23? or 2.30?


That's likely a good idea, however, I don't consider myself an owner and/or maintainer of any of the Enhanced Basic versions.

The CMOS version I've done is more for my own use, which is limited. It doesn't really contain any new commands, sans the EXIT command that goes back to my Monitor. I've also deleted some of the code which, according to Klaus, didn't really work properly, like the IRQ and NMI functions. All of the other changes are to reduce code size, gain a slight performance advantage and make it easier to move between 65C02 systems.

Perhaps some of the other players out here could chime in on a possible version change, I simply added the "C" to the version to specify that it's a CMOS only version.

_________________
Regards, KM
https://github.com/floobydust


Top
 Profile  
Reply with quote  
PostPosted: Sat Oct 05, 2019 1:06 pm 
Offline

Joined: Sun Feb 22, 2004 9:01 pm
Posts: 109
floobydust wrote:
jgharston wrote:
All the updates to ehBasic are sub-sub-versions of 2.22: 2.22, 2.22patch, 2.22patch2, 2.22patch3, 2.22patch4variantC. Shouldn't there be a co-ordinated rollover to 2.23? or 2.30?

That's likely a good idea, however, I don't consider myself an owner and/or maintainer of any of the Enhanced Basic versions.

The CMOS version I've done is more for my own use, which is limited. It doesn't really contain any new commands, sans the EXIT command that goes back to my Monitor. I've also deleted some of the code which, according to Klaus, didn't really work properly, like the IRQ and NMI functions. All of the other changes are to reduce code size, gain a slight performance advantage and make it easier to move between 65C02 systems.

Perhaps some of the other players out here could chime in on a possible version change, I simply added the "C" to the version to specify that it's a CMOS only version.

By removing the tokens related to IRQ and NMI, you've made almost all the token numbers change, so a program saved on p4C won't load on non-p4C and vice versa. If you're going to remove the functionality of IRQ, RETIRQ, NMI, RETNMI, OFF you should do it by removing the code, not by removing the token numbers. So, your code should still have:
Code:
TK_RESTORE        = TK_IF+1         ; RESTORE token
TK_GOSUB          = TK_RESTORE+1    ; GOSUB token
TK_RETIRQ         = TK_GOSUB+1      ; RETIRQ token
TK_RETNMI         = TK_RETIRQ+1     ; RETNMI token
TK_RETURN         = TK_RETNMI+1     ; RETURN token

and the dispatch table something like:
Code:
      .word LAB_GOSUB-1       ; GOSUB
      .word SYNTAX_ERROR
      .word SYNTAX_ERROR
      .word LAB_RETURN-1      ; RETURN

Otherwise, for example, a program with PRINT "Hello" saved from non-p4C when loaded to p4C will say LIST "Hello".

_________________
--
JGH - http://mdfs.net


Top
 Profile  
Reply with quote  
PostPosted: Sat Oct 05, 2019 1:09 pm 
Offline

Joined: Sun Feb 22, 2004 9:01 pm
Posts: 109
floobydust wrote:
jgharston wrote:
The CMOS version I've done is more for my own use, which is limited. It doesn't really contain any new commands, sans the EXIT command that goes back to my Monitor.

In BASICs EXIT typically exits a program structure, you exit the BASIC itself with QUIT. Eg:
Code:
FOR A=1 TO 10
  IF A=5 THEN EXIT:REM Drop out of FOR/NEXT loop
  PRINT A
NEXT A
QUIT:REM Quit BASIC, return to caller/monitor/etc

_________________
--
JGH - http://mdfs.net


Top
 Profile  
Reply with quote  
PostPosted: Sat Oct 05, 2019 3:40 pm 
Offline
User avatar

Joined: Tue Mar 05, 2013 4:31 am
Posts: 1385
jgharston wrote:
floobydust wrote:
jgharston wrote:
All the updates to ehBasic are sub-sub-versions of 2.22: 2.22, 2.22patch, 2.22patch2, 2.22patch3, 2.22patch4variantC. Shouldn't there be a co-ordinated rollover to 2.23? or 2.30?

That's likely a good idea, however, I don't consider myself an owner and/or maintainer of any of the Enhanced Basic versions.

The CMOS version I've done is more for my own use, which is limited. It doesn't really contain any new commands, sans the EXIT command that goes back to my Monitor. I've also deleted some of the code which, according to Klaus, didn't really work properly, like the IRQ and NMI functions. All of the other changes are to reduce code size, gain a slight performance advantage and make it easier to move between 65C02 systems.

Perhaps some of the other players out here could chime in on a possible version change, I simply added the "C" to the version to specify that it's a CMOS only version.

By removing the tokens related to IRQ and NMI, you've made almost all the token numbers change, so a program saved on p4C won't load on non-p4C and vice versa. If you're going to remove the functionality of IRQ, RETIRQ, NMI, RETNMI, OFF you should do it by removing the code, not by removing the token numbers. So, your code should still have:
Code:
TK_RESTORE        = TK_IF+1         ; RESTORE token
TK_GOSUB          = TK_RESTORE+1    ; GOSUB token
TK_RETIRQ         = TK_GOSUB+1      ; RETIRQ token
TK_RETNMI         = TK_RETIRQ+1     ; RETNMI token
TK_RETURN         = TK_RETNMI+1     ; RETURN token

and the dispatch table something like:
Code:
      .word LAB_GOSUB-1       ; GOSUB
      .word SYNTAX_ERROR
      .word SYNTAX_ERROR
      .word LAB_RETURN-1      ; RETURN

Otherwise, for example, a program with PRINT "Hello" saved from non-p4C when loaded to p4C will say LIST "Hello".


All valid points... but again, the changes made were for my own use. Also, as LOAD and SAVE were never really implemented in the base code, Lee suggested that intercepting the LIST command for SAVE would be his preferred method as it would be an ASCII file, which would be easier to examine, edit and LOAD into other BASIC implementations. But I understand your points and they're completely valid.

Also, on the EXIT vs QUIT (another valid point). As EhBasic doesn't have an EXIT command, picking EXIT was a choice, which can be easily changed.

Adding in the older tokens to preserve the original token numbers can be easily done of course. It's unclear how valuable it would be, beyond declaring full token compatibility with the original 2.22 source.

_________________
Regards, KM
https://github.com/floobydust


Top
 Profile  
Reply with quote  
PostPosted: Sat Oct 05, 2019 5:31 pm 
Offline
User avatar

Joined: Sun Jun 30, 2013 10:26 pm
Posts: 1949
Location: Sacramento, CA, USA
I have been running into the same quandary regarding version numbers (or letters) on my VTL02. I have been intermittently fiddling with version C, squeezing a few bytes here and there, but I haven't added any new features, so I don't want to release anything as version D until I have enough space inside 1K to add something noticeable to the end user. Also, many of my source changes have been untested, because SBASM3 uses Python, and assembling stuff with it isn't as fun as I thought it would be on Windoze.

_________________
Got a kilobyte lying fallow in your 65xx's memory map? Sprinkle some VTL02C on it and see how it grows on you!

Mike B. (about me) (learning how to github)


Top
 Profile  
Reply with quote  
PostPosted: Sun Oct 06, 2019 1:05 am 
Offline

Joined: Sun Feb 22, 2004 9:01 pm
Posts: 109
barrym95838 wrote:
I have been running into the same quandary regarding version numbers (or letters) on my VTL02. I have been intermittently fiddling with version C, squeezing a few bytes here and there, but I haven't added any new features, so I don't want to release anything as version D until I have enough space inside 1K to add something noticeable to the end user. Also, many of my source changes have been untested, because SBASM3 uses Python, and assembling stuff with it isn't as fun as I thought it would be on Windoze.

My parallel fork I've ended up having to call it v2.22p4a !

_________________
--
JGH - http://mdfs.net


Top
 Profile  
Reply with quote  
PostPosted: Sun Oct 06, 2019 7:39 pm 
Offline
User avatar

Joined: Wed Feb 14, 2018 2:33 pm
Posts: 1488
Location: Scotland
floobydust wrote:
All valid points... but again, the changes made were for my own use. Also, as LOAD and SAVE were never really implemented in the base code, Lee suggested that intercepting the LIST command for SAVE would be his preferred method as it would be an ASCII file, which would be easier to examine, edit and LOAD into other BASIC implementations. But I understand your points and they're completely valid.


For my use, I ignored SAVE (and LOAD) and treated it as write-only, to the point that I use a text editor to write the small ehBasic programs I've written so-far, then *EXEC them into ehBasic. This is a command borrowed from Acorn land which allows keyboard input to come from a file. similarly, when I've made a few changes, then *SPOOL then list, then tweak it in a text editor...

floobydust wrote:
Also, on the EXIT vs QUIT (another valid point). As EhBasic doesn't have an EXIT command, picking EXIT was a choice, which can be easily changed.


Or *REBOOT in my system... (sorry - the advantages of having what might be considered an operating system vs. a "monitor")

-Gordon

_________________
--
Gordon Henderson.
See my Ruby 6502 and 65816 SBC projects here: https://projects.drogon.net/ruby/


Top
 Profile  
Reply with quote  
PostPosted: Wed Oct 09, 2019 2:03 am 
Offline
User avatar

Joined: Tue Mar 05, 2013 4:31 am
Posts: 1385
drogon wrote:
floobydust wrote:
All valid points... but again, the changes made were for my own use. Also, as LOAD and SAVE were never really implemented in the base code, Lee suggested that intercepting the LIST command for SAVE would be his preferred method as it would be an ASCII file, which would be easier to examine, edit and LOAD into other BASIC implementations. But I understand your points and they're completely valid.


For my use, I ignored SAVE (and LOAD) and treated it as write-only, to the point that I use a text editor to write the small ehBasic programs I've written so-far, then *EXEC them into ehBasic. This is a command borrowed from Acorn land which allows keyboard input to come from a file. similarly, when I've made a few changes, then *SPOOL then list, then tweak it in a text editor...

floobydust wrote:
Also, on the EXIT vs QUIT (another valid point). As EhBasic doesn't have an EXIT command, picking EXIT was a choice, which can be easily changed.


Or *REBOOT in my system... (sorry - the advantages of having what might be considered an operating system vs. a "monitor")

-Gordon


I've also been using a text editor for simple basic programs. Using the Serial terminal program (OSX), I just can just copy and paste the program into the terminal window for loading. Doing a LIST, then copy/paste also allows saving a program as text. Enabling LOAD and SAVE seemed like a nice idea...

While my Monitor isn't considered an OS, it does provide a RESET function (does a cold start). It also has a large amount of function for a Monitor... which is pretty handy at times.

************************************************************
Memory Ops: [C]ompare, [D]isplay, [E]dit, [F]ill, [G]o Exec,
[H]ex Find, [I]nput Text, [M]ove, [T]ext Find

Register Ops: R,A,X,Y,S,P

Counter/Timer Ops: ,= set ms|mult, .= exe ms, /= exe ms*mult, \= exe (?)*ms*mult
[B]enchmark clear/start, [Q]uit benchmark/display elapsed time

Macro: (= Init )= Run

CTRL[?]: [A]ssemble, [B]asic, [D]isassemble, [E]dit EEPROM, [L]oad, [P]rogram,
[Q]uery Cmds ,[R]eset, [S]ave, [T]ime up, [V]ersion, [Z]ero RAM/Reset

************************************************************
Unfortunately, the Assembler isn't finished yet.... actually, I haven't started working on it yet, so that one is a place holder :shock:

_________________
Regards, KM
https://github.com/floobydust


Top
 Profile  
Reply with quote  
PostPosted: Thu Jan 23, 2020 3:39 am 
Offline
User avatar

Joined: Tue Mar 05, 2013 4:31 am
Posts: 1385
As Klaus has implemented some updates to EhBasic (resulting in 2.22p5), I've added these updates to my CMOS version as well. Attached is a zip file with the updated version.

Attachment:
EhBasic-222p5c.zip [209.24 KiB]
Downloaded 180 times

_________________
Regards, KM
https://github.com/floobydust


Top
 Profile  
Reply with quote  
PostPosted: Thu Jan 23, 2020 6:02 am 
Offline
User avatar

Joined: Sun Jun 30, 2013 10:26 pm
Posts: 1949
Location: Sacramento, CA, USA
Hey, thanks for the shout-out on line 7440! :) Your assembler is going to have the Rockwell BBSx/BBRx/RMBx/SMBx stuff too, right?

_________________
Got a kilobyte lying fallow in your 65xx's memory map? Sprinkle some VTL02C on it and see how it grows on you!

Mike B. (about me) (learning how to github)


Top
 Profile  
Reply with quote  
PostPosted: Thu Jan 23, 2020 6:27 am 
Offline
User avatar

Joined: Tue Mar 05, 2013 4:31 am
Posts: 1385
barrym95838 wrote:
Hey, thanks for the shout-out on line 7440! :) Your assembler is going to have the Rockwell BBSx/BBRx/RMBx/SMBx stuff too, right?


Hey, thanks for the code update, it does save some execution time! I use the WDC Tools package. The WDC W65C02 supports all of the Rockwell enhancements plus STOP (STP) and WAIT (WAI) opcodes. I use a lot of those instructions in my current BIOS and Monitor versions.

Adding this line to the source code enables ALL of the extended opcodes and addressing modes:

CHIP W65C02S ;Enable WDC 65C02 instructions

_________________
Regards, KM
https://github.com/floobydust


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 63 posts ]  Go to page 1, 2, 3, 4, 5  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 41 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: