6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Thu Nov 21, 2024 4:36 pm

All times are UTC




Post new topic Reply to topic  [ 10 posts ] 
Author Message
 Post subject: V2.20
PostPosted: Tue Apr 27, 2010 1:35 am 
Offline

Joined: Fri Aug 30, 2002 2:05 pm
Posts: 347
Location: UK
V2.20 Fixes an undocumented feature of IF as well as adding an optional ELSE clause and can be found here ..

http://www.themotionstore.com/leeedavison/6502/ehbasic/index.html

Lee.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue Apr 27, 2010 6:51 pm 
Offline

Joined: Wed May 20, 2009 1:06 pm
Posts: 491
Lee,

Would it be easy to port your Basic to a WDC 65C816?

Chuck


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue Apr 27, 2010 11:23 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 9:02 pm
Posts: 1748
Location: Sacramento, CA
Chuck,

I am running EHBasic in native mode on my SBC-3 so I know it can be done.

I have notes on my website on the changes I made.

http://sbc.rictor.org/download/EhBASIC.zip

Daryl


EDIT: I have made most of the changes to the new version of EHBasic and was able to run a simple program on WDC65816 in native mode. I did have some trouble with the load and save functions, that's most likely my support code, not EHBasic.

Once I have it all complete, I'll update my website and post it here.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed Apr 28, 2010 1:31 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 9:02 pm
Posts: 1748
Location: Sacramento, CA
Great job Lee!!!

Thanks for continuing to develop this program!

I discovered one thing to look out for when upgrading to version 2.20.

My method of saving EHBasic programs is to scan RAM from smeml, smemh until I find the end of the program. I then do a binary save of that range to disk.

When loading a program written in v2.10 into v2.20, some of the tokenized commands are changed, due to the insertion of new tokens in the table.

what was

20 FOR x = 1 to 10
30 PRINT X , X^2

becomes

20 FOR x > 1 ELSE 10
30 PRINT X, X/2

The good side is that a conversion tool could easily be written to update the program files.

Daryl


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed Apr 28, 2010 5:58 pm 
Offline

Joined: Fri Aug 30, 2002 2:05 pm
Posts: 347
Location: UK
Quote:
When loading a program written in v2.10 into v2.20, some of the tokenized commands are changed, due to the insertion of new tokens in the table.

Yes, sorry about that but it is pretty much unavoidable. I've given up on bianry LOADs and SAVEs on my systems for this very reason.

Quote:
The good side is that a conversion tool could easily be written to update the program files.

As there is only one new token, TK_ELSE - which is $AC, it should just be a case of scanning the program from start to end and incrementing every token byte of $AC or more.

Lee.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed Apr 28, 2010 7:48 pm 
Offline

Joined: Fri Aug 30, 2002 2:05 pm
Posts: 347
Location: UK
Quote:
The good side is that a conversion tool could easily be written to update the program files.

The DEEK in line 63010 needs to be to Smeml which is $79 in my case.

Code:
62999 END
63000 el=62999
63010 nl=DEEK($79)
63020 DO
63030   ln=DEEK(nl+2) : IF ln<0 THEN ln=ln+$10000
63040   ? "Line"; ln
63050   ad=nl+3
63060   nl=DEEK(nl)
63070   DO
63080     INC ad
63090     b=PEEK(ad)
63100     IF b>$AB THEN INC b : POKE ad,b
63110   LOOP WHILE b
63120 LOOP WHILE ln<el
63130 ? "All done!"

This can be appended to the end of any program and executed with RUN 63000

Lee.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed Apr 28, 2010 9:50 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 9:02 pm
Posts: 1748
Location: Sacramento, CA
Lee,

I understand the need for the change and it no real problem. You've already created the tool to adjust it which is great too.

I have completed the changes for V2.20 to run on SBC-3 (my earlier problem was in my supporting routines). I'll get the updated version loaded on my site soon.

thanks again Lee!

Daryl


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Apr 29, 2010 1:19 am 
Offline

Joined: Sat Jan 04, 2003 10:03 pm
Posts: 1706
leeeeee wrote:
Quote:
When loading a program written in v2.10 into v2.20, some of the tokenized commands are changed, due to the insertion of new tokens in the table.

Yes, sorry about that but it is pretty much unavoidable. I've given up on bianry LOADs and SAVEs on my systems for this very reason.


Tokenization is a good thing to do for several reasons, but for the purposes of data import and export, its primary value is in the compression it offers. After studying LZ78 compression, you start to realize that a tokenized source file is completely equivalent to an LZ78-compressed text file with a statically predetermined dictionary.

In other words, you can get all the same benefits of tokenized source code if you just compress your raw text source (e.g., using PKZIP, for example). Perhaps, then, a binary load/save command can be added which is nothing more than a raw text load/save command piped through a post-compression or pre-decompression stage first.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri May 07, 2010 2:55 pm 
Offline

Joined: Mon Dec 23, 2002 8:47 pm
Posts: 70
I've taken a couple cracks at adding the 2.20 changes to my port of 2.10. Since my 2.10 is so heavily hacked this is a bit trickier. Probably "third time's the charm" though.

In my case, a redundant token (CATALOG, which was intended to produce an 80-column-wide directory listing while CAT produced a 40-column listing - like BASIC.SYSTEM) could be recycled. I have no room for new tokens.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri May 07, 2010 10:43 pm 
Offline

Joined: Fri Aug 30, 2002 2:05 pm
Posts: 347
Location: UK
I've put the details of the changes made here

Lee.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 10 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 4 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: