home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / forth / compiler / fpc / help / kernel1.hlp < prev    next >
Encoding:
Text File  |  1989-07-06  |  24.4 KB  |  690 lines

  1. \ KERNEL1.HLP
  2.  
  3.         The first 8 bytes in the system are vectors to the Cold and
  4.         Warm start entries.  You can freely jump to them in code
  5.         anytime. The DPUSH and HPUSH labels are space savers.  We
  6.         jump to them in several CODE words when we want to push their
  7.         contents on the Parameter Stack. >NEXT is where all the
  8.         action is.  It is the guts of the Forth Virtual Machine. It
  9.         must advance the interpretive pointer held in the IP
  10.         register pair and jump indirect to what it points to.
  11.  
  12.         We define a few macros here to make our life a little easier
  13.         later.  Using NEXT as a macro allows us to put it inline
  14.         later.
  15.  
  16. INLINE_NEXT     ( -- flag )
  17.         Returns a true flag if we are generating NEXT as an in-line
  18.         macro in code definitions.
  19.  
  20. ?.INLINE        ( -- )
  21.         Prints the state of INLINE_NEXT
  22.  
  23. ]]      ( -- )          IN-META vocabulary
  24.         A simple redefinition of  ]  in the IN-META vocabulary.
  25.  
  26. [[      ( -- )          IN-META vocabulary
  27.         A redefinition of  [  within the IN-META vocabulary.
  28.  
  29. ORIGIN
  30.         Label of a code level instruction to JMP to the Cold-Start
  31.         location.  It is followed by a JMP to the Warm-Start location.
  32.  
  33. DPUSH
  34.         Label of a code sequence which pushes the DX register, then
  35.         pushes the AX register, followed by NEXT .
  36.  
  37. >NEXT
  38.         Label of the NEXT sequence.  This is the location we jump to
  39.         when we are NOT using in-line NEXT.
  40.  
  41. XSEQ    ( -- addr )
  42.         A variable which holds the value of the base of List space.
  43.  
  44. YSEG    ( -- addr )
  45.         A variable which holds the base of Head space.
  46.  
  47. ABNORM
  48.         Label of a code level routine used after a control-break
  49.         sequence to restore >NEXT and then jump to a warm-start.
  50.  
  51. BIOSBK
  52.         A label to go to upon an interrupt at the BIOS level when a
  53.         control-break key is encountered.
  54.  
  55. DOSBK
  56.         A label to go to upon an interrupt at the DOS level when a
  57.         control-break key is encountered.
  58.  
  59. RP      Used to hold the depth of the return stack
  60.  
  61. NEST    The runtime code for :  It pushs the current IP onto the
  62.         return stack and sets the IP to point to the parameter field
  63.         of the word being executed.
  64.  
  65. EXIT            ( --- )
  66.         Pop an entry off the return stack and place it into the
  67.         Interpretive Pointer.  Terminates a Hi Level definition.
  68.  
  69. ?EXIT           ( f1 --- )
  70.         If boolean f1 is true then perform EXIT above else continue
  71.         executing the current definition.
  72.  
  73. UNNEST          ( --- )
  74.         Same as exit.  Compiled by ; to help decompiling.
  75.  
  76. DODOES
  77.         The runtime portion of defining words.  First it pushes the
  78.         IP onto the return stack and then it pushes the BODY address
  79.         of the word being executed onto the parameter stack.
  80.  
  81. UP              ( --- a1 )
  82.         Holds a pointer to the current USER area. ( multitasking )
  83.  
  84. DOCONSTANT
  85.         The run time code for CONSTANT.  It takes the contents of
  86.         the parameter field and pushes it onto the stack.
  87.  
  88. DOUSER
  89.         The run time code for USER variables.  Places a pointer to
  90.         the current version of this variable on the stack. Needed
  91.         for multitasking.
  92.  
  93. DOVALUE
  94.         Same as DOCONSTANT, but is is assumed that the user may change
  95.         the value.
  96.  
  97. DOUSER-VARIABLE
  98.         Basic code routine for user variables.
  99.  
  100. (LIT)
  101.         The runtime code for literals.  Pushes the following
  102.         two bytes onto the parameter stack and moves the IP over
  103.         them.  It is compiled by the word LITERAL.
  104.  
  105. DOBEGIN         ( --- )
  106. DOTHEN          ( --- )
  107.         These words are really just NOOP's. They are used as place holders
  108.         for the Forth decompiler. I know they probably slow things down a
  109.         little bit, but I felt it was important to be able to decompile
  110.         back to source as much as possible.
  111.  
  112. DOAGAIN
  113. DOREPEAT  A special version of BRANCH that is used to mark a return point
  114.         for the decompiler.
  115.  
  116. ?WHILE
  117. ?UNTIL          ( f1 --- )
  118.         A special version of ?BRANCH that is used to mark a return point
  119.         for the decompiler.
  120.  
  121. BRANCH          ( --- )
  122.         Performs an unconditional branch.  Notice that we
  123.         are using absolute addresses insead of relative ones. (fast)
  124.  
  125. ?BRANCH         ( f1 --- )
  126.         Performs a conditional branch.  If the top of the
  127.         parameter stack in True, take the branch.  If not, skip
  128.         over the branch address which is inline.
  129.  
  130. LOOP-EXIT   is a common routine used by (LOOP) and (+LOOP)
  131.         It is called when the loop has terminated and is exited
  132.         normally.
  133.  
  134. UNDO            ( --- )
  135.         Cleans up the return stack so we can EXIT from the current loop
  136.         without crashing, as in DO and "UN"DO.
  137.  
  138. (LOOP)          ( --- )
  139.         the runtime procedure for LOOP.  Branches back to
  140.         the beginning of the loop if there are more iterations to
  141.         do.  Otherwise it exits.  The loop counter is incremented.
  142.  
  143. (+LOOP)         ( n1 --- )
  144.         Increment the loop counter by the value on the stack and
  145.         decide whether or not to loop again.  Due to the wierdness
  146.         of the 8080, you have to stand on your head to determine the
  147.         conditions under which you loop or exit.
  148.  
  149. (DO)            ( n1 n2 --- )
  150.         The runtime code compiled by DO. Pushes the inline address
  151.         onto the return stack along with values needed by (LOOP).
  152.  
  153. (?DO)           ( n1 n2 --- )
  154.         The runtime code compiled by ?DO.  The difference between
  155.         ?DO and DO is that ?DO will not perform any iterations if
  156.         the initial index is equal to the final index.
  157.  
  158. (OF)            ( n1 n2 -- n1 )  ( or )  ( n1 n1 -- )
  159.         The run-time code compiled of OF .  If the top two stack
  160.         elements are the same, the two items will be dropped from the
  161.         stack and the code following OF will be executed.  Otherwise,
  162.         only the top item is dropped from the stack, and a branch is
  163.         taken from the literal following the in-line (OF) .
  164.  
  165. BOUNDS          ( a1 n1 --- a2 a3 )
  166.         Given address a1 and length n1, return a2 and a3 the boundary
  167.         addresses for DO ... LOOP.
  168.  
  169. >NEXT           ( --- a1 )
  170.         The address of the inner interpreter.
  171.  
  172. >NEST           ( --- a1 )
  173.         The address of the NEST routine.
  174.  
  175. EXECUTE         ( a1 --- )
  176.         the word whose code field is on the stack.  Very useful for
  177.         passing executable routines to procedures!!!
  178.  
  179. PERFORM         ( a1 --- )
  180.         The word whose code field is stored at the address pointed to by
  181.         a1, the number on the stack.  Same as @ EXECUTE
  182.  
  183. GOTO            ( --   )
  184.         terminates execution of the current colon def used to avoid return
  185.         stack loading, and for execution speed by combining exit and next
  186.         also used by coroutines.
  187.  
  188. DODEFER  The runtime code for deferred words.  Fetches the
  189.         code field and executes it.
  190.  
  191. EXEC:           ( n -- )
  192.         Execute the n-th word following the word EXEC: in a high level
  193.         definition. Example:
  194.  
  195.                 : TEST  ( n1 -- )
  196.                         0 MAX 3 MIN
  197.                         EXEC: FUNC-0 FUNC-1 FUNC-2 FUNC-3 ;
  198.  
  199. DOUSER-DEFER    ( <word_dependent> )
  200.         The runtime code for User deferred words.  These are identical
  201.         to regular deferred words except that each task has its own
  202.         version.
  203.  
  204. GO              ( a1 --- )
  205.         Execute code at the given address.
  206.  
  207. NOOP            ( --- )
  208.         One of the most useful words in Forth.  Does nothing.
  209.  
  210. PAUSE           ( --- )
  211.         Used by the Multitasker to switch tasks.
  212.  
  213. I               ( --- n1 )
  214.         returns the current loop index.  It now requires a little more
  215.         calculation to compute it than in FIG Forth but the tradeoff is a
  216.         much faster (LOOP).  The loop index is stored on the Return Stack.
  217.  
  218. J               ( --- n1 )
  219.         returns the loop index of the next to inner loop in nested DO .. LOOPs.
  220.  
  221. K               ( -- n1 )
  222.         returns the loop index of the third loop outward in nested DO .. LOOPs.
  223.  
  224. (LEAVE)         ( --- )
  225.         Does an immediate exit of a DO ... LOOP structure.  Unlike
  226.         FIG Forth which waits until the next LOOP is executed.
  227.  
  228. (?LEAVE)        ( f1 --- )
  229.         Leaves if the flag on the stack is true.  Continues if not.
  230.  
  231. LEAVE           ( --- )
  232.         Jumps immediately to the end of a  DO ... LOOP structure.
  233.  
  234. @               ( a1 --- n1 )
  235.         Fetch a 16 bit value from addr.
  236.  
  237. !               ( n1 a1 --- )
  238.         Store a 16 bit value at addr.
  239.  
  240. C@              ( a1 --- b1 )
  241.         Fetch an 8 bit value from addr.
  242.  
  243. C!              ( b1 a1 --- )
  244.         Store an 8 bit value at addr.
  245.  
  246.  
  247. CMOVE           ( a1 a2 n1 --- )
  248.         Move a set of bytes from the from address to the to address.
  249.         The number of bytes to be moved is count.  The bytes are
  250.         moved from low address to high address, so overlap is
  251.         possible and in fact sometimes desired.
  252.  
  253. CMOVE>          ( a1 a2 n1 --- )
  254.         The same as CMOVE above except that bytes are moved in the
  255.         opposite direction, ie from high addresses to low addresses.
  256.  
  257. PLACE           ( from count to --- )
  258.         Move the characters at from to to with a preceding length
  259.         byte of len.
  260.  
  261. SP@             ( --- a1 )
  262.         Return the address of the top entry on the parameter stack.
  263.  
  264. SP!             ( a1 --- )
  265.         ( Warning, this is different from FIG Forth )
  266.         Sets the parameter stack pointer to the specified value.
  267.  
  268. RP@             ( --- a1 )
  269.         Return the address of the next entry on the return stack.
  270.  
  271. RP!             ( a1 --- )
  272.         ( Warning, this is different from FIG Forth )
  273.         Sets the return stack pointer to the specified value.
  274.  
  275. DROP            ( n1 --- )
  276.         Throw away the top element of the stack.
  277.  
  278. DUP             ( n1 --- n1 n1 )
  279.         Duplicate the top element of the stack.
  280.  
  281. SWAP            ( n1 n2 --- n2 n1 )
  282.         Exchange the top two elements on the stack.
  283.  
  284. OVER            ( n1 n2 --- n1 n2 n1 )
  285.         Copy the second stack element to the top.
  286.  
  287. PLUCK           ( n1 n2 n3 --- n1 n2 n3 n1 )
  288.         Copy the third stack element to the top.
  289.  
  290. TUCK            ( n1 n2 --- n2 n1 n2 )
  291.         Tuck the first element under the second one.
  292.  
  293. NIP             ( n1 n2 --- n2 )
  294.         Drop the second element from the stack.
  295.  
  296. ROT             ( n1 n2 n3 --- n2 n3 n1 )
  297.         Rotate the top three element, bringing the third to the top.
  298.  
  299. -ROT            ( n1 n2 n3 --- n3 n1 n2 )
  300.         The inverse of ROT.  Rotates the top element to third place.
  301.  
  302. FLIP            ( n1 --- n2 )
  303.         Exhange the hi and low halves of a word.
  304.  
  305. SPLIT           ( n1 --- n2 n3 )
  306.         SPLIT the 16 bit value n1 into two stack entries which are the LOW
  307.         and HIGH bytes of N1. The HIGH byte is on the top of the stack.
  308.  
  309. JOIN            ( n1 n2 -- n3 )
  310.         Join bytes into one word. The low byte of n2 becomes the high byte
  311.         of n3, and the low byte of n1 becomes the low byte of n3.
  312.  
  313. ?DUP            ( n1 --- n1 n1<>0 | n1=0 )
  314.         Duplicate the top of the stack if it is non-zero.
  315.  
  316. ?DROP           ( n1 false -- false | n1 true -- n1 true )
  317.         If the top item on the stack is false, then discard n1 and return
  318.         the false flag else leave the stack unchanged.
  319.  
  320. R>              ( --- n1 )
  321.         Pops a value off of the return stack and pushes it onto the
  322.         parameter stack.  It is dangerous to use this randomly!
  323.  
  324. R>DROP          ( --- )
  325.         Pops a value off of the return stack and discards it. It is
  326.         dangerous to use this randomly!
  327.  
  328. DUP>R           ( n1 --- n1 )
  329.         Duplicates the value on the parameter stack and pushes it onto
  330.         return stack.  It is dangerous to use this randomly!
  331.  
  332. >R              ( n1 --- )
  333.         Pops a value off of the parameter stack and pushes it onto
  334.         return stack.  It is dangerous to use this randomly!
  335.  
  336. 2R>             ( --- n1 n2 )
  337.         Pops two values off of the return stack and pushes them onto the
  338.         parameter stack.  It is dangerous to use this randomly!  This word
  339.         is equivalent to: R> R> SWAP  That is, the order of the operator on
  340.         the return stack is maintained when they are placed on the
  341.         parameter stack.
  342.  
  343.  
  344. 2>R             ( n1 n2 --- )
  345.         Pops two values off of the parameter stack and pushes them onto the
  346.         return stack.  It is dangerous to use this randomly!  This word
  347.         is equivalent to: "SWAP >R >R".  That is, the order of the operator
  348.         on the parameter stack is maintained when they are placed on the
  349.         return stack.
  350.  
  351. R@              ( --- n1 )
  352.         Copies the value on the return stack to the parameter stack.
  353.  
  354. 2R@             ( --- n1 n2 )
  355.         Copies the two top values from the return stack to the parameter
  356.         stack. Same as "R> R> 2DUP >R >R SWAP" that is the order of the
  357.         operator on the return stack is maintained when they are placed
  358.         on the parameter stack.
  359.  
  360. PICK            ( n1 --- n2 )
  361.         Reaches into the stack and grabs an element, copying it
  362.         to the top of the stack.  For example, if the stack has 1 2 3,
  363.         then 0 PICK is 3, 1 PICK is 2, and 2 PICK is 1.
  364.  
  365. RPICK           (R  n1 -- n2 )
  366.         Pick a copy of the n1-th item on the return stack and push onto the
  367.         return stack.
  368.  
  369. AND             ( n1 n2 --- n3 )
  370.         Returns the bitwise AND of n1 and n2 on the stack.
  371.  
  372. OR              ( n1 n2 --- n3 )
  373.         Returns the bitwise OR of n1 and n2 on the stack.
  374.  
  375. XOR             ( n1 n2 --- n3 )
  376.         Returns the bitwise Exclusive Or of n1 and n2 on the stack.
  377.  
  378. NOT             ( n1 --- n2 )
  379.         Does a ones complement of the top.  Equivalent to -1 XOR.
  380.  
  381. TRUE
  382. FALSE           ( --- f1 )
  383.         Constants for clarity.
  384.  
  385. CSET            ( n addr -- )
  386.         Set the contents of addr so that the bits that are 1 in n
  387.         are also 1 in addr.  Equivalent to DUP C@ ROT OR SWAP C!
  388.  
  389. CRESET          ( n a1 --- )
  390.         Set the contents of addr so the the bits that are 1 in n
  391.         are zero in addr.  Equivalent to DUP C@ ROT NOT AND SWAP C!
  392.  
  393. CTOGGLE         ( a1 n1 --- )
  394.         Flip the bits in addr by the value n.  Equivalent to
  395.         DUP C@ ROT XOR SWAP C!
  396.  
  397. ON              ( a1 --- )
  398.         Set the contents of addr to TRUE
  399.  
  400. OFF             ( a1 --- )
  401.         Set the contents of addr to FALSE
  402.  
  403. -1!             ( addr -- )
  404.         Set the contents of the 16 bit quantity at addr to -1
  405.         (all bits set).
  406.  
  407. 0!              ( addr -- )
  408.         Clear all 16 bits at the specified address.
  409.  
  410. INCR            ( addr -- )
  411.         Increment the word at the specified address by 1.
  412.  
  413. DECR            ( addr -- )
  414.         Decrement the word at the specified address by 1.
  415.  
  416. +               ( n1 n2 --- n3 )
  417.         Add the top two numbers on the stack and return the result.
  418.  
  419. NEGATE          ( n1 --- n2 )
  420.         Turn the number into its negative.  A twos complement op.
  421.  
  422. -               ( n1 n2 --- n3 )
  423.         Subtracts n2 from n1 leaving the result on the stack.
  424.  
  425. ABS             ( n1 --- n2 )
  426.         Return the absolute value of the 16 bit integer on the stack
  427.  
  428. D+!             ( d addr -- )
  429.         Add the double number to the contents of the double word at
  430.         the specified address.
  431.  
  432. +!              ( n1 a1 --- )
  433.         Increment the value at addr by n.  This is equivalent to
  434.         the following:   DUP @ ROT + SWAP ! but much faster.
  435.  
  436. C+!             ( b1 a1 --- )
  437.         Increment the byte value at addr by n1. This is equivalent the
  438.         following: "DUP C@ ROT + SWAP C!" but much faster.
  439.  
  440. PC@             ( port# -- n1 )
  441.         Read the 8 bit port# and return value n1.
  442.  
  443. P@              ( port# -- n1 )
  444.         Read the 16 bit port# and return value n1.
  445.  
  446. PC!             ( n1 port# --- )
  447.         Write the byte n1 to the 8 bit port#.
  448.  
  449. P!              ( n1 port# --- )
  450.         Write the value n1 to the 16 bit port#.
  451.  
  452. PDOS            ( a1 drive# --- f1 )
  453.         Read the current DOS path of drive# into the array at a1. The
  454.         string returned will be NULL terminated. F1 returns TRUE if an
  455.         error occured.
  456.  
  457. #THREADS        ( -- n )
  458.         Return the number of threads used in the dictionary.
  459.  
  460. 2*              ( n1 --- n2 )
  461.         Double the number on the Stack.
  462.  
  463. 2/              ( n1 --- n2 )
  464.         Shift the number on the stack right one bit.  Equivalent to
  465.         division by 2 for positive numbers.
  466.  
  467. U2/             ( n1 --- n2 )
  468.         16 bit logical right shift.
  469.  
  470. U16/            ( n1 --- n2 )
  471.         Four 16 bit logical right shifts. Unsigned divide by 16 decimal.
  472.  
  473. U8/             ( n1 --- n2 )
  474.         Three 16 bit logical right shifts.  Unsigned divide by 8.
  475.  
  476. 8*              ( n1 --- n2 )
  477.         Multiply the top of the stack by 8.
  478.  
  479. 1+              ( n1 --- n2 )
  480.         Increment the top of the stack by one.
  481.  
  482. 2+              ( n1 --- n2 )
  483.         Increment the top of the stack by two.
  484.  
  485. 1-              ( n1 --- n2 )
  486.         Decrement the top of the stack by one.
  487.  
  488. 2-              ( n1 --- n2 )
  489.         Decrement the top of the stack by two.
  490.  
  491. UM*             ( un1 un2 -- ud )
  492.         Return a 32 bit unsigned product of two 16 bit unsigned numbers.
  493.  
  494. *               ( n1 n2 -- n3 )
  495.         Returns a product of two numbers.  The numbers may be either
  496.         signed or unsigned.  The product will be correct as long as it
  497.         may be properly represented in 16 bits!
  498.  
  499. U*D     is a synonym for UM*
  500.  
  501. UM/MOD
  502.         The unsigned double numerator ud is divided by an unsigned
  503.         single denominator un to produce an unsigned quotient and
  504.         unsigned remainder.  The quotient is at the top of the stack.
  505.  
  506. 0=              ( n1 --- f1 )
  507.         Returns True if top is zero, False otherwise.
  508.  
  509. 0<              ( n1 --- f1 )
  510.         Returns true if top is negative, ie sign bit is on.
  511.  
  512. 0>              ( n1 --- f1 )
  513.         Returns true if top is positive.
  514.  
  515. 0<>             ( n1 --- f1 )
  516.         Returns true if the top is non-zero, False otherwise.
  517.  
  518. =               ( n1 n2 --- f1 )
  519.         Returns true if the two elements on the stack are equal,
  520.         False otherwise.
  521.  
  522. <>              ( n1 n2 --- f1 )
  523.         Returns true if the two element are not equal, else false.
  524.  
  525. ?NEGATE         ( n1 n2 --- n3 )
  526.         Negate the second element if the top is negative.
  527.  
  528. U<              ( n1 n2 --- f1 )
  529.         Compare the top two elements on the stack as unsigned
  530.         integers and return true if the second is less than the
  531.         first.  Be sure to use U< whenever comparing addresses, or
  532.         else strange things will happen beyond 32K.
  533.  
  534. U>              ( n1 n2 --- f1 )
  535.         Compare the top two elements on the stack as unsigned
  536.         integers.  True if n1 > n2 unsigned.
  537.  
  538. <               ( n1 n2 --- f1 )
  539.         Compare the top two elements on the stack as signed
  540.         integers and return true if n1 < n2.
  541.  
  542. >               ( n1 n2 --- f1 )
  543.         Compare the top two elements on the stack as signed
  544.         integers and return true if n1 > n2.
  545.  
  546. UMIN            ( n1 n2 --- n3 )
  547.         Return the minimum of n1 and n2 , treated as unsigned numbers.
  548.  
  549. UMAX            ( n1 n2 --- n3 )
  550.         Return the maximum of n1 and n2 , treated as unsigned numbers.
  551.  
  552. MIN             ( n1 n2 --- n3 )
  553.         Return the minimum of n1 and n2
  554.  
  555. MAX             ( n1 n2 --- n3 )
  556.         Return the maximum of n1 and n2
  557.  
  558. WITHIN          ( n lo hi --- f1 )
  559.         Return true if lo <= n < hi, otherwise false.  Signed comparison.
  560.  
  561. BETWEEN         ( n lo hi --- f1 )
  562.         Return true if lo <= n <= hi, otherwise false.  Signed comparison.
  563.  
  564. 2@              ( a1 --- d1 )
  565.         Fetch a 32 bit value from addr.
  566.  
  567. 2!              ( d1 a1 --- )
  568.         Store a 32 bit value at addr.
  569.  
  570. 2DROP           ( n1 n2 --- )
  571.         Drop the top two elements of the data stack.
  572.  
  573. 3DROP           ( n1 n2 n3 --- )
  574.         Drop the top three elements of the data stack.
  575.  
  576. 2DUP            ( n1 n2 --- n1 n2 n1 n2 )
  577.         Duplicate the top two elements of the data stack.
  578.  
  579. 3DUP            ( n1 n2 n3 --- n1 n2 n3 n1 n2 n3 )
  580.         Duplicate the top three elements of the data stack.
  581.  
  582. 2SWAP           ( n1 n2 n3 n4 --- n3 n4 n1 2n )
  583.         Swap the top two pairs of numbers on the stack.  You can use
  584.         this operator to swap two 32 bit integers and preserve
  585.         their meaning as double numbers.
  586.  
  587. 2OVER           ( n1 n2 n3 n4 --- n1 n2 n3 n4 n1 2n )
  588.         Copy the second pair of numbers over the top pair.  Behaves
  589.         like 2SWAP for 32 bit integers.
  590.  
  591. D+              ( d1 d2 --- d3 )
  592.         Add the two double precision numbers on the stack and
  593.         return the result as a double precision number.
  594.  
  595. DNEGATE         ( d1 d2 --- d3 )
  596.         Same as NEGATE except for double precision numbers.
  597.  
  598. S>D             ( n1 --- d1 )
  599.         Take a single precision number and make it double precision
  600.         by extending the sign bit to the upper half.
  601.  
  602. DABS            ( d1 --- d2 )
  603.         Return the absolute value of the 32 bit integer on the stack
  604.  
  605. D2*             ( d1 --- d2 )
  606.         32 bit left shift.
  607.  
  608.  
  609. D2/             ( d1 --- d2 )
  610.         32 bit arithmetic right shift. Equivalent to divide by 2.
  611.  
  612. D-              ( d1 d2 --- d3 )
  613.         Subtract the two double precision numbers.
  614.  
  615. ?DNEGATE        ( d1 n --- d2 )
  616.         Negate the double number if the top is negative.
  617.  
  618. D0=             ( d1 --- f1 )
  619.         Compare the top double number to zero.  True if d = 0
  620.  
  621. D=              ( d1 d2 --- f1 )
  622.         Compare the top two double numbers.  True if d1 = d2
  623.  
  624. DU<             ( d1 d2 --- f1 )
  625.         Performs unsigned comparison of two double numbers.
  626.  
  627. D<              ( d1 d2 --- f1 )
  628.         Compare the top two double numbers.  True if d1 < d2
  629.  
  630. D>              ( d1 d2 --- f1 )
  631.         Compare the top two double numbers.  True if d1 > d2
  632.  
  633. 4DUP            ( n1 n2 n3 n4 --- n1 n2 n3 n4 n1 n2 n3 n4 )
  634.         Duplicate the top four elements of the stack.
  635.  
  636. DMIN            ( d1 d2 --- d3 )
  637.         Return the lesser of the top two double numbers.
  638.  
  639. DMAX            ( d1 d2 --- d3 )
  640.         Return the greater of the the top two double numbers.
  641.  
  642. *D              ( n1 n2 --- d1 )
  643.         multiplies two singles and leaves a double.
  644.  
  645. M/MOD  divides a double by a single, leaving a single quotient
  646.         and a single remainder. Division is floored.
  647.  
  648. MU/MOD  divides a double by a single, leaving a double quotient
  649.         and a single remainder. Division is floored.
  650.  
  651. /               ( num den -- quot )
  652.         Divide two signed single precision numbers and return the
  653.         floored quotient.  Note that  -5 2 /  returns a value of -3 .
  654.  
  655. /MOD            ( num den -- rem quot )
  656.         Divide two signed single precision numbers and return the
  657.         floored quotient and modulus (remainder).  Note that this
  658.         function is designed to return a modulus which has the same
  659.         sign as the denominator (usually positive), independent of
  660.         the sign of the denominator.
  661.  
  662. MOD             ( num den -- modulus )
  663.         Return the modulus of the numerator and denominator, where
  664.         the quotient is "floored".  This is designed to yield a
  665.         result having the same sign as the denominator.  Note that
  666.         if the denominator is positive, the result is positive,
  667.         regardless of the sign of the numerator.
  668.  
  669. */MOD           ( n1 n2 n3 -- mod quot )
  670.         This returns the floored quotient and modulus of a 32 bit
  671.         numerator and a 16 bit denominator n3 .  The numerator is
  672.         an intermediate 32 bit product of the 16 bit quantities
  673.         n1 and n2 .  Note that the sign of the modulus is the same
  674.         as the sign of the denominator.
  675.  
  676. */      is a particularly useful operator, as it allows you to
  677.         do accurate arithmetic on fractional quantities.  Think of
  678.         it as multiplying n1 by the fraction n2/n3.  The intermediate
  679.         result is kept to full accuracy.  Notice that this is not the
  680.         same as * followed by /.  See Starting Forth for more examples.
  681.  
  682. ROLL            ( n1 --- n2 )
  683.         Similiar to ROCK.  Should be avoided.
  684.         1 ROLL is SWAP, 2 ROLL is ROT, etc.
  685.         ROLL can be useful, but it is slow.
  686.  
  687. 2ROT            ( n1 n2 n3 n4 n5 n6 --- n3 n4 n5 n6 n1 n2 )
  688.         Rotates top three double numbers.
  689.  
  690.