Post Reply 
FORTH for the SHARP PC-E500 (S)
09-19-2021, 07:14 PM
Post: #10
RE: FORTH for the SHARP PC-E500 (S)
I spent about a day and a half to write the core machine code and Forth definitions of the FLOATING and FLOATING-EXT word set implementation for Forth500. I really like the E500 CPU and the ROM FCS (file control system) and IOCS (IO control system). Unfortunately, I can't finish this and tests it for a couple of weeks.

The extension includes:

- All 31 words of the Forth standard FLOATING word set: >FLOAT, D>F, F!, F*, F+, F-, F/, F0<, F0=, F<, F>D, F@, FALIGN, FALIGNED, FCONSTANT, FDEPTH, FDROP, FDUP, FLITERAL, FLOAT+, FLOATS, FLOOR, FMAX, FMIN, FNEGATE, FOVER, FROT, FROUND, FSWAP, FVARIABLE, REPRESENT

- 18 words of the Forth standard FLOATING-EXT word set: F**, F., FABS, FACOS, FASIN, FATAN, FCOS, FEXP, FFIELD:, FLN, FLOG, FS., FSIN, FSQRT, FTAN, FVALUE, PRECISION, SET-PRECISION plus 16 words implicitly, because all single SFxxx and double DFxxx words are redundant (see next point): SF!, SF@, SFALIGN, SFALIGNED, SFFIELD:, SFLOAT+, SFLOATS, DF!, DF@, DFALIGN, DFALIGNED, DFFIELD:, DFLOAT+, DFLOATS, F>S, S>F

- Not implemented FLOATING-EXT words can in principle be added as Forth definitions: FACOSH, FALOG, FASINH, FATAN2, FATANH, FCOSH, FE., FEXPM1, FLNP1, FSINCOS, FSINH, FTANH, FTRUNC, F~

- All words work with both single precision (10 digits) and double precision (20) digits transparently, i.e. no special words are needed for either type

See float.s in the repo for my WIP.

The good news is that the entire addition only requires about 1.5K (float.s assembled is 1589 bytes). I decided to use internal RAM to copy floats to/from memory, which keeps the code compact and fast (the CPU has block-instructions to move blocks of data to/from internal RAM and operate on BCD in blocks). I expect the extended Forth500 implementation to use about 20K, still leaving plenty of space for user programs.

- 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 - 09-19-2021 07:14 PM



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