Post Reply 
FORTH for the SHARP PC-E500 (S)
01-13-2022, 03:40 AM
Post: #61
RE: FORTH for the SHARP PC-E500 (S)
(01-12-2022 11:06 PM)Helix Wrote:  I'm still learning Forth, following the book Starting Forth 2nd edition. (I know it's outdated, but it's didactic and enjoyable. I have also the Forth Programmer's Handbook for a more modern reference.)

I have a problem with the KEY? word. If no key is pressed, it returns "error -57" instead of 0.
The same problem occurs with EKEY? Furthermore, if a key is pressed, EKEY? returns 255. I think it should be -1.

It is good to hear you are putting Forth500 through its paces Smile

You made a good point. The EKEY? word calls CHAR-READY? but then throws exception -57 if CHAR-READY? returns true. This is a small part of the older pceForth version, which looks wrong to me. The EKEY? Forth standard word requires EKEY? to return true or false.

I will correct this discrepancy soon and release an update.

I may also add a new module LOCALS.FTH that I wrote from scratch to implement the LOCALS word set (I heard that Forth purists turn their nose up to LOCALS, arguing that it is superfluous since everything can be done via the stacks.)

I was tinkering with some code I wrote to add dynamic scoping of arguments and locals to Forth definitions. This turns out to be surprisingly simple to implement in Forth itself, so I wouldn't be surprised if someone hasn't done this already.

- 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) - 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
RE: FORTH for the SHARP PC-E500 (S) - robve - 01-13-2022 03:40 AM



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