Site Tools


This is an old revision of the document!


Miscellaneous Projects, Demos, and Tests

OF816 for Apple IIgs

This is a Forth interpreter. It's a ProDOS SYS file but requires an Apple IIgs. It does not need GS/OS to run.

forth-5ce83a9b.po

Things to Try

$GS-USERID ( – u ) return the Toolbox user ID of the running Forth.

$GS-TOOLCALL ( i*n i t1 j t2 tool# – j*n ) call Toolbox, passing i arguments to the tool, and receiving j results. t1 and t2 are the type bits for the arguments and results, respectively, where b0 = the first arg, b1 the second arg, etc. A 1 bit means the argument or result is a long, 0 indicates a word. Arguments and results are specified/received in reverse order from the toolbox call (first off the Forth stack is first on the return stack).

Some pre-canned toolbox calls:

_TOTALMEM ( – u ) return total system memory

_READBPARAM ( u1 – u2 ) read battery RAM parameter u1

_READTIMEHEX ( – u1 u2 u3 u4 ) read time in hex format

_READASCIITIME ( addr – ) read 20 byte time string into adds.

decimal 20 alloc-mem value timebuf
timebuf _readasciitime
timebuf 20 type

_FWENTRY ( addr y x a – y x a p ) call firmware entry in bank 0

ff2d 0 0 0 _fwentry
ERR

_SYSBEEP ( – ) play system bell

_SYSFAILMGR ( addr u – ) call fatal error handler, u = error code, addr = address of packed string message or 0.