home *** CD-ROM | disk | FTP | other *** search
/ Dream 52 / Amiga_Dream_52.iso / RiscOS / APP / DEVS / FORTH / WIMPFO.ZIP / !WimpForth / DesignNote < prev    next >
Text File  |  1996-03-21  |  1KB  |  26 lines

  1.  
  2.         Code Structure of the WimpForth dictionary
  3.  
  4.     The Header Structure:
  5.       Dummy bytes, so that the                 00 00
  6.       NAME FIELD: name-characters length-byte  'F' 'O' 'R' 'T' 'H' 05
  7.         ends word aligned
  8.       VIEW FIELD: line number in source file   xx xx xx xx
  9.       LINK FIELD: address of previous word
  10.         in this thread                         yy yy yy yy
  11.       CODE FIELD: code
  12.       
  13.     The NEXT macro consists of the instruction
  14.          ldr pc, [ ip ], # 4
  15.     This means that after the header NEXT expects code at the CFA.
  16.     Code words will start their viscious work immediately.
  17.     Deferred words load the pc from the next cell: ldr pc, [ pc, # -4 ]
  18.     Other words will branch with link to their DO***** routines
  19.     (see beginning of fkernel for details).
  20.     
  21.     Win32Forth by Andrew McKewan and Tom Zimmer, from which WimpForth
  22.     is heavily derived, expects a pointer to code in the CFA.
  23.     This makes WimpForth programs incompatible with utilities in
  24.     Win32Forth. But you can fix it by replacing every @ on CFAs
  25.     with a CALL@.
  26.