FORTH for the PC-G850(V)(S)
|
11-13-2022, 10:15 PM
(This post was last modified: 05-21-2023 12:47 PM by robve.)
Post: #8
|
|||
|
|||
RE: FORTH for the PC-G850(V)(S)
Forth850 can be extended "on the fly" with your own Z80 machine code using the PC-G850(V)(S) built-in Z80 Assembler.
To clarify, here are the steps. A BEEP example follows below.
Example BEEP word. In Forth850: Code: NFA, BEEP Code: ORG 20FA Assemble the code, which is 18 bytes long. Return to Forth850 with BASIC and CALL256 and enter: Code: 18 ALLOT Important: run the Assembler again to save the code in the ALLOTed space. Now BEEP works in Forth850. Alternatively, the BEEP word can also be defined with HEX codes in Forth850 as follows, which takes more effort but with the same result: Code: NFA, BEEP ( -- ) A simple example that flips the bytes of the TOS stored in register DE, which takes 5 bytes of machine code: Code: NFA, FLIP Code: ORG xxxxH As always when writing assembly, if something is seriously wrong with it then we may crash and have to start over. In the worst case we have to install Forth850 again when the dictionary is damaged by "random POKEs". However, it is often not necessary to reset the machine when asked for MEMORY CLEAR (Y/N) just say N (NO) and give it another try after fixing the problem. - 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... |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)