Post Reply 
FORTH for the SHARP PC-E500 (S)
09-12-2021, 02:00 AM
Post: #2
RE: FORTH for the SHARP PC-E500 (S)
(09-06-2021 11:41 PM)Helix Wrote:  Some of you may be interested:
http://www.silicium.org/forum/viewtopic....62#p559662
https://github.com/Robert-van-Engelen/Forth500
I still have to make a serial cable to transfer programs, so I can't test it for now. I hope floats will be implemented.

The good news is that Forth500 is already complete, functional and tested, except for floating point, but which will be supported! Testing the E500 floating point function drivers in assembly went well today. The drivers support fp operations on single and double floats, 10 digits for single and 20 digits for double precision mantissa in BCD, -99 to +99 exponent.

The bad news is that don't have time to write the required machine code for some time. I hope to get back and have fun continuing with this project in about five weeks.

I honestly did not use Forth much since writing Forth 83 code in the 80's, so my Forth was a bit rusty. It came all back rather quickly Smile

Sébastien Furic did a great job many years ago on his ANS pceForth implementation for the E500, which is pretty standard following the traditional dictionary structure and word calling conventions. But the old implementation was definitely not standards compliant, had some bugs and could not support some more advanced Forth methodologies, such as "caller cancelling" and "continuation passing" to name a few.

Finding documentation on the E500 CPU and system internals was made possible by sharppocketcomputers.com and others. I managed to got hold of the XASM assembler Pascal source code, translated the documentation to English and made a few changes to compile XASM with FreePascal.

I've largely rewritten the assembly and builtin Forth definitions in the 11KLOC Forth500 system source code:
- ensure standard Forth compliance (forth-standard.org) by adding missing definitions
- fixed/avoided several bugs in the old ANS pceForth implementation
- changed to case insensitive dictionary lookup
- improved execution speed and reduced code size
- improved robustness to Forth coding errors by adding stack overflow/underflow checks and dictionary overflow checks, while sill improving speed (i.e. rewrite in assembly).
- added support for printing to the CE-126P or RS232 printer via output redirection
- improved file system access commands
- improved/added graphics drawing commands and screen blitting

The Forth500 system occupies about 18K with 8.5K free space on an unexpanded 32K E500 and a (whopping) 45K free space on an expanded E500.

I don't have a serial cable (well I have the CE-134T but it won't work with a USB RS232 cable due to undervoltage). I load the object code via a wav file and cassette interface of the CE-126P printer.

- Rob

"I count on old friends" -- HP 71B,Prime|Ti VOY200,Nspire CXII CAS|Casio fx-CG50...|Sharp PC-G850,E500,2500,1500,14xx,13xx,12xx...
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
FORTH for the SHARP PC-E500 (S) - Helix - 09-06-2021, 11:41 PM
RE: FORTH for the SHARP PC-E500 (S) - robve - 09-12-2021 02:00 AM
RE: FORTH for the SHARP PC-E500 (S) - dmh - 10-02-2022, 02:29 PM
RE: FORTH for the SHARP PC-E500 (S) - dmh - 10-04-2022, 12:46 PM
RE: FORTH for the SHARP PC-E500 (S) - dmh - 10-04-2022, 10:55 PM



User(s) browsing this thread: 3 Guest(s)