home *** CD-ROM | disk | FTP | other *** search
/ Dream 48 / Amiga_Dream_48.iso / Atari / forth / forst.zoo / forst / lib / what.s < prev    next >
Text File  |  1990-12-10  |  1KB  |  49 lines

  1. ( what.s: description of the functions of a word)
  2. ( usage: what <name>)
  3.  
  4. hex macros
  5.  
  6. : what { 5 regs cfa ffa nfa pfa length }
  7.  
  8.   cr head to cfa
  9.   cfa 5 - -1 traverse to nfa
  10.   cfa 4- to ffa  cfa 4+ to pfa
  11.  
  12.   nfa id. [ascii] : emit
  13.   nfa c@ 40 and 0=  if ." not " then
  14.   ." immediate" cr
  15.  
  16.   ffa w@ 3ff and  to length
  17.   ." code length in bytes: "
  18.   length if length 1+ 2* . else ." not specified"  then cr
  19.  
  20.   ffa c@ f8 and
  21.   case
  22.      20 of " no edges expected and 1 returned" endof
  23.      80 of " 1 edge expected and none returned" endof
  24.     0a0 of " 1 edge expected and 1 returned" endof
  25.     0b0 of " 1 edge exected and 2 returned" endof
  26.     0f0 of " 2 edges expected and 2 returned" endof
  27.     0e0 of " 2 edges expected and 1 returned" endof
  28.     0e8 of " 2 edges expected and a test result returned" endof
  29.     0a8 of " 1 edge expected and a test result returned" endof
  30.       0 of " no edges specified" endof
  31.            " unclassified edge specification" ( default)
  32.   endcase   type ( the message) cr
  33.  
  34.   ffa 2+ w@
  35.   case
  36.         0 of " no POP specified" endof
  37.     0ffff of " no optimisation of leading edge" endof
  38.     0fffe of " no optimisation of leading edge" endof
  39.      2d00 of " the top edge is POP D0" endof
  40.      2d08 of " the top edge if POP A0" endof
  41.              " unclassified POP expected" ( default)
  42.   endcase  type cr
  43.  
  44.   ." code or data address is " pfa @ os> . cr
  45.  
  46. ;
  47.  
  48. decimal
  49.