Site Tools


Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revision Both sides next revision
projects:misc [2019/05/24 15:01]
M.G.
projects:misc [2019/05/25 14:46]
M.G. [Interpreter Info]
Line 3: Line 3:
 ===== OF816 for Apple IIgs ===== ===== 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. +This is a cross-platform ​Forth interpreter ​(it also runs on the W65C816SXB, but we won't worry about that for now).  It's a ProDOS SYS file but requires an Apple IIgs.  It does not need GS/OS to run.
- +
-{{ :​projects:​forth-5ce83a9b.po |forth-5ce83a9b.po}}+
  
 +{{ :​projects:​forth-5ce84572.po |forth-5ce84572.po}}
 ==== Things to Try ==== ==== Things to Try ====
  
 **$GS-USERID** ( -- u ) return the Toolbox user ID of the running Forth. **$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).+**$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 (topmost on the Forth stack is bottommost ​on the return stack).
  
 Some pre-canned toolbox calls: Some pre-canned toolbox calls:
Line 36: Line 35:
 **_SYSFAILMGR** ( addr u -- ) call fatal error handler, u = error code, addr = address of packed string message or 0. **_SYSFAILMGR** ( addr u -- ) call fatal error handler, u = error code, addr = address of packed string message or 0.
  
 +==== Interpreter Info ====
 +
 +OF816 is a direct-threaded Forth with 32-bit cells and 8-bit characters.
 +
 +=== ANS Forth Conformance ===
 +
 +  * Providing the Core word set.
 +  * Providing ''​.('',​ ''​.R'',​ ''​0<>'',​ ''​0>'',​ ''​2>​R'',​ ''​2R@'',​ '':​NONAME'',​ ''<>'',​ ''?​DO'',​ ''​AGAIN'',​ ''​CASE'',​ ''​COMPILE,'',​ ''​ENDCASE'',​ ''​ENDOF'',​ ''​ERASE'',​ ''​EXPECT'',​ ''​FALSE'',​ ''​HEX'',​ ''​NIP'',​ ''​PAD'',​ ''​PARSE'',​ ''​PICK'',​ ''​REFILL'',​ ''​RESTORE-INPUT'',​ ''​ROLL'',​ ''​SAVE-INPUT'',​ ''​SOURCE-ID'',​ ''​SPAN'',​ ''​TO'',​ ''​TRUE'',​ ''​TUCK'',​ ''​U.R'',​ ''​U>'',​ ''​UNUSED'',​ ''​VALUE'',​ ''​WITHIN'',​ ''​[COMPILE]'',​ and ''​\''​ from the Core Extensions word set.
 +  * Providing ''​2CONSTANT'',​ ''​D+'',​ ''​D-'',​ ''​D.R'',​ ''​D>​S'',​ ''​DABS'',​ ''​DNEGATE'',​ and ''​2ROT''​ from thge Double-Number word set.
 +  * Providing the Exception word set.
 +  * Providing the Facility word set.
 +  * Providing Programming-Tools word set.
 +  * Providing '';​CODE'',​ ''​AHEAD'',​ ''​BYE'',​ ''​CODE'',​ ''​FORGET'',​ and ''​STATE''​ from the Programming-Tools Extensions word set.
 +  * Providing the Search Order word set.
 +  * Providing ''​-TRAILING'',​ ''​BLANK'',​ ''​SEARCH'',​ and ''​SLITERAL''​ from the String word set.
 +
 +=== Console I/O ===
 +
 +At startup, it initializes the slot 3 Pascal I/O interface which, on a IIgs, is always going to be the built in text display. ​ It sets up vectors for the input, output, and status calls. ​ These calls are the only thing that happen in emulation mode after Forth is initialized.
 +
 +The platform-independent portion of the code expects the output to accept ANSI sequences, and ''​PAGE''​ and ''​AT-XY''​ output them.  OF816 for the Apple IIgs' console driver translates some ANSI sequences for cursor position and erasing to equivalents recognized by the video firmware.
  
 +=== Data Space ===
  
 +The data space is acquired from the Toolbox and is currently set at 32K and is allowed to cross bank boundaries.