home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1994 #1 / monster.zip / monster / PROG_GEN / FORTH_86.ZIP / GLOSSARY.4TH < prev    next >
Text File  |  1993-12-24  |  54KB  |  1,881 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.     4th_86 version 4.01             GLOSSARY                   page  1
  8.     
  9.     
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.     =============================================
  17.  
  18.     This is  not a complete glossary. Only the words which differ from more
  19.     conventional FORTHs are described. The glossary provided with the demo
  20.     version is further reduced in content to include only the most commonly
  21.     useable words.
  22.  
  23.            ** NOTE ** there is no difference between upper and lower case.
  24.     Some of the words below are in upper -- some in lower -- this just
  25.     depends on how they were defined. The system recognises upper and lower
  26.     as equivalent when searching the dictionary.
  27.     ==============================================
  28.  
  29.     $! (string store)
  30.  
  31.         Purpose: Moves the string at the source address on the NOS to
  32.         the destination address on the TOS
  33.  
  34.  
  35.     ' (tick or "defadr")
  36.  
  37.         Purpose: Gets the definition address to the TOS of the word
  38.         immediately following ' in the input stream.
  39.  
  40.  
  41.     '' (tick-tick or "datadr")
  42.  
  43.         Purpose: Gets the contents of the 4th and 5th bytes of the
  44.         definition whose address immediately follows '' in the input
  45.         stream. This is used with the words BLOCK, CONST, etc
  46.  
  47.             5 BLOCK ABC
  48.               '' ABC .H
  49.  
  50.         would define the block ABC and then print its actual memor
  51.         address.
  52.  
  53.            ABC .H
  54.  
  55.         would also print the actual address of ABC -- but there are
  56.         times (eg in cross-compile) when words such as ABC can not be
  57.         executed per-se and the address has to be found with tick-tick.
  58.  
  59.         Note that tick-tick is two apostrophes -- not a double quote
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.     4th_86 version 4.01             GLOSSARY                   page  2
  67.     
  68.     
  69.     +! (plus store)
  70.  
  71.         Purpose: Add NOS to contents of address at TOS and store at the
  72.         same address.
  73.  
  74.     -1* (negate)
  75.  
  76.         Purpose: Compute the 2's complement of the TOS
  77.  
  78.           examples   FF Hex  =>  FF01 Hex
  79.                       0 Hex  =>     0 Hex
  80.                       2 Hex  =>  FFFE Hex
  81.                    FFFF Hex  =>  0001 Hex
  82.  
  83.                     -2       =>   2
  84.  
  85.     ->L (rightshift logical)
  86.  
  87.         Purpose: Logical shift right the value at NOS by the number of
  88.         bytes on TOS
  89.  
  90.     ." (dot-quote)
  91.  
  92.         Purpose: Writes a styring of characters to the console device.
  93.         The TOS contains the address of the string. The first byte of
  94.         the string contains the length of the string.
  95.  
  96.         Note that defining the string by " ...string.." automatically
  97.         leaves the address of the string on the TOS.
  98.  
  99.         If the system is in high mode (ie compile) then the string is
  100.         stored in the definition being compiled. If the system is in
  101.         low mode (ie execute) then the string is stored in STRING and
  102.         its address is retorned on TOS.
  103.  
  104.  
  105.     .B ( dot-bee)
  106.  
  107.         Purpose: Prints the TOS as a binary number with a leading space.
  108.  
  109.  
  110.     .C (dot-see)
  111.  
  112.         Purpose: Writes the ASCII character on the TOS to the console
  113.         output device
  114.  
  115.  
  116.     .CL (dot-see-el)
  117.  
  118.          Same as .L but writes numerical value in a colour defined by
  119.          the current contents of GCOLR.
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.     4th_86 version 4.01             GLOSSARY                   page  3
  127.     
  128.     
  129.     . (dot)
  130.  
  131.         Purpose: Prints the TOS as a five digit decimal number with a
  132.         leading space
  133.  
  134.     .H (dot-aitch)
  135.  
  136.         Purpose: Prints the TOS as a four digit hexadecimal number with
  137.         a leading space.
  138.  
  139.     .HB (dot-aitch-bee)
  140.  
  141.         Purpose: Prints the TOS as a two digit hexadecimal number with
  142.         a leading space
  143.  
  144.  
  145.     .L ( dot-ell )
  146.  
  147.         Purpose: While this prints the TOS as a five digit decimal
  148.         number WITHOUT a leading space -- its purpose is to send ANSI
  149.         control parameters to the screen.
  150.  
  151.  
  152.     .Q ( dot-Q )
  153.  
  154.         Purpose: Prints the TOS as an octal number with a leading space.
  155.  
  156.  
  157.     0= (equal to zero)
  158.  
  159.         Purpose: To test if the TOS is zero
  160.  
  161.         Returns 0 for FALSE and 1 for TRUE
  162.  
  163.         Can also be used to negate flag on TOS (see below)
  164.  
  165.  
  166.     0> (positive)
  167.  
  168.         Purpose: Test if TOS is greater than zero.
  169.  
  170.         Returns 0 (false) if TOS is less than or equal to zero.
  171.  
  172.         Note that 0< is not implemented as such. It can be simulated
  173.         with 0> and 0=
  174.                         : 0<  0>  0=  ;
  175.  
  176.  
  177.     1+ (increment by one )
  178.  
  179.         Purpose: Increments the TOS by one
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.     4th_86 version 4.01             GLOSSARY                   page  4
  187.     
  188.     
  189.     1- ( decrement by one )
  190.  
  191.        Purpose: Decrements the TOS by one
  192.  
  193.     16DM
  194.  
  195.         Purpose: Dumps 16 lines of memory starting at the address on
  196.         TOS.
  197.                 example   8000H DM   will return the following memory
  198.                           dump and will ALSO leave on the TOS the
  199.                           address 8100 Hex ready for another 16DM
  200.  
  201.             ( see also DM and 8DM)
  202.  
  203.          8000  01E83281 887B747F 3E01E829 81407C74    *..2..{t.>..).@|t*
  204.          8010  7F3E01E8 CEF50000 0000E8C7 F5000080    *.>..............*
  205.          8020  3FE8C0F5 00000040 E8B9F500 002041E8    *?......@..... A.*
  206.          8030  B2F5CDCC CC3DE8FD 80EF014A 01FF7FBF    *.....=.....J....*
  207.          8040  02EF013E 01E8EE80 6576D002 91015A80    *...>....ev....Z.*
  208.          8050  EF014A01 0080E102 EF013E01 E8D780F8    *..J.......>.....*
  209.          8060  7FCC012D 053E01E8 CC808B76 5C803E01    *...-.>.....v\.>.*
  210.          8070  E871F5FC FFFFFFE8 BC80D175 7080AB75    *.q.........up..u*
  211.          8080  13773E01 5A5B0AC0 B000F512 073C0A73    *.w>.Z[.......<.s*
  212.          8090  03E90200 B0008807 4BFECA74 03E9E8FF    *........K..t....*
  213.          80A0  7303E90B 0043C607 01BA0800 03DAFE07    *s....C..........*
  214.          80B0  E95180E8 80801808 18081808 18083608    *.Q............6.*
  215.          80C0  FA013608 FA011808 3B080802 18084008    *..6.....;.....@.*
  216.          80D0  08026576 3680D002 9101BD81 C4011808    *..ev6...........*
  217.          80E0  FB049101 EE801D08 27080802 36806576    *........'...6.ev*
  218.          80F0  76010000 803FCA76 91010881 2F800180    *v....?.v..../...*
  219.  
  220.  
  221.     2+ (increment by two)
  222.  
  223.         Purpose: Increments the TOS by two
  224.  
  225.  
  226.     8/ (divide by eight)
  227.  
  228.         Purpose: Divides the TOS by eight
  229.  
  230.     8DM
  231.  
  232.         Purpose: Dumps 9 lines of memory starting at the address on
  233.         TOS. (see 16DM)
  234.  
  235.     : (colon)
  236.  
  237.         Purpose: Identifies the beginning of a high level definition. A
  238.         warning message will be given depending on the state of the
  239.         system variable REDEFINE (see later)
  240.  
  241.  
  242.  
  243.  
  244.  
  245.  
  246.     4th_86 version 4.01             GLOSSARY                   page  5
  247.     
  248.     
  249.     :ENTER (colon enter)
  250.  
  251.         Purpose: Allows the user to now use high level (Forth) words if
  252.         currently using low level (assembly) words.
  253.  
  254.     :EXIT (colon exit)
  255.  
  256.         Purpose: Allows the user to now use low level words (assembly)
  257.         if currently using high level (Forth) words.
  258.  
  259.     ; (semi-colon)
  260.  
  261.         Purpose: Terminates any definition and when executed returns
  262.         control to the threader. The words can be either high level (Forth)
  263.         or low level (assembly).
  264.  
  265.     ;NOTHREAD (semi-nothread)
  266.  
  267.         Purpose: Terminates only code definitions and when executed
  268.         does not return control to the threader. Normally used when
  269.         defining assembly language subroutines ending in RET or
  270.         equivalent.
  271.  
  272.     ;PUSH (semi-push)
  273.  
  274.     ?DUP
  275.  
  276.         Purpose: Copies the TOS to the NOS if and only if the TOS is
  277.         non-zero.
  278.  
  279.  
  280.     ABS (absolute value of)
  281.  
  282.         Purpose: Get the absolute value of the TOS
  283.  
  284.                 If the TOS is a signed negative number then its
  285.         positive value will be returned.
  286.  
  287.          example    FFFF Hex  =>  0001 Hex
  288.                     7FFF Hex  =>  7FFF Hex
  289.  
  290.     ASM
  291.  
  292.         Purpose: If the word being defined is a code definition
  293.            which is a subroutine with an assembly language return (or
  294.            equivalent), then the word ASM should be used after the
  295.            definition terminator and will cause the dictionary entry
  296.            flags to be set accordingly. This allows the interpreter to
  297.            avoid execution of the flagged word in immediate mode
  298.  
  299.                     example  CODE FRED ........ RET, ;NOTHREAD ASM
  300.  
  301.  
  302.  
  303.  
  304.  
  305.  
  306.     4th_86 version 4.01             GLOSSARY                   page  6
  307.     
  308.     
  309.     B! (byte store)
  310.  
  311.         Purpose: Stores NOS as one byte at address on TOS
  312.  
  313.            example   00EFH  534EH  B!   will store the byte value EF
  314.                       Hex at the address 534E Hex
  315.  
  316.     B@ (byte fetch)
  317.         Purpose: Fetch to the TOS the byte value whose address is on
  318.         the TOS
  319.  
  320.            example   assuming we have a word value 2435 Hex stored at
  321.         address 3705 Hex  (for example by an MASM DW 2435 statement)
  322.             then
  323.                  3705H B@  will return 35 Hex on the TOS
  324.                                    ( ie the low byte of the word 2435)
  325.  
  326.  
  327.     BEGIN ... END
  328.  
  329.         Purpose: Provides loop control over the execution of the code
  330.         between the BEGIN and END. The code is executed repeatedly
  331.         until the TOS has a true value when the END is executed. Note
  332.         that the code is always executed at least one time.
  333.                                                    (  see alse END[  )
  334.         example  : print_ten
  335.                    0           ( initialise loop counter)
  336.                    begin
  337.                      1+ dup .  ( increment counter and print it)
  338.                      dup 10 =  ( TOS=1 ( true) if done )
  339.                    end
  340.                    drop        ( loop counter)
  341.                  ;
  342.  
  343.     BLOAD
  344.  
  345.            Shells to DOS and calls the batch file ASMBL.BAT which then
  346.          calls MASM, LINK, and EXE2BIN in sequence. It will then load the
  347.          BIN file into 4th_86.
  348.  
  349.            The source file must have a suffix ASM [ eg TEST.ASM ] but the
  350.          command is
  351.  
  352.                             BLOAD TEST
  353.  
  354.            Before shelling to DOS the command will check the date of the
  355.          corresponding BIN and ASM files. It will also check the value of
  356.          HEAD against the origin at which any existing BIN file was
  357.          assembled. Only if the BIN file is "out of date" or non existent
  358.          or assembled at the wrong origin will the assembly be executed.
  359.  
  360.  
  361.  
  362.  
  363.  
  364.  
  365.     4th_86 version 4.01             GLOSSARY                   page  7
  366.     
  367.     
  368.                 Note that if the command is issued from text mode 3 -- the same
  369.         mode and video page will be returned to on EXIT from DOS.
  370.  
  371.            If however the command is issued from a graphics mode and page -
  372.         return is not necessarily to the same mode or video page. This is
  373.         because the exit to DOS is into video page 0 - and DOS text will
  374.         over-write; and leave garbage display on graphics page0.
  375.  
  376.            In the demonstration version -- which uses page0 only -- return
  377.         is always to text mode 3 page 0. In the registered version, an exit
  378.         to DOS will return to the mode it was initiated from -- and if this
  379.         was a video mode, to page 1.
  380.  
  381.  
  382.     BLOCK
  383.  
  384.         Purpose: Reserves a block of contiguous memory where the size
  385.         of the block is defined by the value on TOS and the name of the
  386.         block is the next word. When the name of the block is executed,
  387.         the address of the block associated with it is placed on the
  388.         TOS.
  389.              example     Reserve 25 bytes of memory and name it BUFFER
  390.  
  391.                     25 BLOCK BUFFER
  392.  
  393.         The address of the buffer is determined automatically at the
  394.         top end of memory. If we assume the address is D912 Hex, then
  395.  
  396.                    BUFFER .H   will print  D912 on the console
  397.  
  398.  
  399.     BR
  400.  
  401.         Purpose: Unconditional branch for direct threaded code.
  402.  
  403.     BRKOFF
  404.  
  405.         Disables the control-break function of DOS by redirecting the
  406.         ctrl-brk interrupt vector to an IRET. The original vectored
  407.         address is saved for restoring with BRKON. Gives error message
  408.         if BRKOFF is already in effect.
  409.             BRKOFF is normally implemented on initialisation of 4th_86.
  410.  
  411.     BRKON
  412.  
  413.         Makes the ctrl-brk key functional so that endless loops can be
  414.         exited. Dumps the user back to DOS however.
  415.  
  416.  
  417.  
  418.  
  419.  
  420.  
  421.     4th_86 version 4.01             GLOSSARY                   page  8
  422.     
  423.     
  424.     BRZ
  425.  
  426.         Purpose: Used to transfer control within direct threaded code
  427.         if the TOS is zero. If the test is true then the address
  428.         immediately following the BRZ is loaded into the Forth PC and
  429.         control is passed to the THREADer. If the test is false,
  430.         control will continue with the word immediately following the
  431.         branch address of BRZ
  432.  
  433.            example   ...... TEST 0= BRZ  ' SUBR  CONT ...
  434.  
  435.         will branch to the routine SUBR if the word TEST returns a TRUE
  436.         value -- otherwise will continue with the word CONT
  437.  
  438.     BS
  439.        Purpose: to send a backspace chracter to the screen
  440.  
  441.     BSWAP
  442.         Purpose: swap the bytes in the word at TOS
  443.  
  444.     BYE
  445.         Purpose: the normal exit from 4th_86 back to DOS. Closes all files
  446.         and resets the EGA card to normal text mode.
  447.  
  448.  
  449.     CASE .. ENDCASE .. OF .. ENDOF
  450.  
  451.         Purpose: Provides for selected code to be executed based on the
  452.         contents of TOS. The construct CASE .. ENDCASE defines the
  453.         scope of the case statement. The construcet OF .. ENDOF is used
  454.         inside the CASE .. ENDCASE to define the code to be executed if
  455.         the NOS equals the TOS.
  456.  
  457.         If NOS = TOS then both values are removed and the code between
  458.         OF .. ENDOF is executed. and control then passes to the code
  459.         following ENDCASE.
  460.  
  461.         If NOS is not equal to TOS then TOS is removed and control
  462.         continues following ENDOF -- which usually is another OF ..
  463.         ENDOF construct.
  464.  
  465.         See also the words  OF[ .. ]   and  THRU
  466.  
  467.         example    : FRED case
  468.                            23 of  " TOS was 23" ." endof
  469.                    32 of  " TOS was 32" ." endof
  470.  
  471.                             " TOS was neither 23 nor 32" ."
  472.                    drop  (TOS value on entry)
  473.                           endcase
  474.                    ;
  475.  
  476.  
  477.  
  478.  
  479.  
  480.  
  481.     4th_86 version 4.01             GLOSSARY                   page  9
  482.     
  483.     
  484.     CGAM
  485.  
  486.         Purpose: Initialise multi-function graphics card in 640x200
  487.         2 color CGA graphics mode -- and clear video buffer.
  488.         (see also NEGAM EGAM NCGAM NORM NNORM)
  489.  
  490.  
  491.     CIRCLE
  492.  
  493.         Purpose: Draws a circle at centre X Y of radius R and color C
  494.  
  495.            Input --    X  Y  R  C  <= TOS
  496.  
  497.         This is based on an algorithm in July '83 Dobbs Journal. Larger
  498.         circles will be drawn with a coarser dot pattern than will
  499.         smaller circles.
  500.  
  501.         The aspect ratio is corrected so that a true circle is produced
  502.         in the EGA high-res mode. Other modes may produce a flattened
  503.         circle.
  504.  
  505.         Note that the card must be initialised first with either EGAM
  506.         or CGAM.
  507.  
  508.  
  509.     CLOSE
  510.  
  511.         Purpose: Closes a file that has previously been opened. The TOS
  512.         contains the file handle number of the file to be closed.
  513.         If all files should be closed then the TOS should contain a zero.
  514.         No error code will be returned.
  515.  
  516.     CLS
  517.  
  518.          Purpose: to clear the screen as in DOS command.
  519.  
  520.     CODE
  521.  
  522.         Purpose: Identifies the beginning of an in-line low level
  523.         definition. Only 8080 mnemonics are implemented at this stage.
  524.  
  525.         example    CODE SWAP
  526.                       H POP, D POP, H PUSH, D PUSH,
  527.                    ;
  528.  
  529.         defines an assembly routine for SWAP
  530.  
  531.            8086 code can be assembled with MASM and loaded using GLOAD.
  532.  
  533.  
  534.  
  535.  
  536.  
  537.  
  538.     4th_86 version 4.01             GLOSSARY                   page  10
  539.     
  540.     
  541.     CONST
  542.  
  543.         Purpose: Defines a constant whose value is on TOS and whose
  544.         name folllows CONST. When the name is executed, the value
  545.         associated with that name is placed on TOS. Only single
  546.         precision integers may be used as the value of a constant.
  547.  
  548.  
  549.     COS
  550.  
  551.         Purpose to return on TOS the cosine of the angle curently there.
  552.            Angle must be in radians given as a floating point number.
  553.  
  554.  
  555.     CRLF
  556.  
  557.         Purpose: Prints a carriage return and line feed on the console
  558.  
  559.  
  560.     CROSS-COMPILE
  561.  
  562.         Purpose: All user definitions following CROSS-COMPILE are
  563.         compiled in a special segment of memory starting at offset 100H.
  564.         They can not be executed. The purpose is to create a standalone
  565.         executable COM file.
  566.  
  567.            See some of the xxx.DEM files for illustration.
  568.  
  569.     CSP@
  570.  
  571.        Return the value of the Control Stack Pointer ( carried in
  572.        register DI
  573.  
  574.  
  575.     CSP!
  576.  
  577.       Store the value on TOS in register DI (Control Stack Pointer)
  578.  
  579.  
  580.     CSPUSH
  581.  
  582.       Push code segment register on the stack
  583.  
  584.  
  585.     DATE
  586.  
  587.       Displays the date in Day Month Year format
  588.  
  589.     DAYTE
  590.  
  591.       Returns the date month and year as three parameters on the stack
  592.  
  593.  
  594.  
  595.  
  596.  
  597.  
  598.     4th_86 version 4.01             GLOSSARY                   page  11
  599.     
  600.     
  601.     D4PIX
  602.  
  603.         Purpose: Draws a "nybble" -- 4 consecutive pixels all the same
  604.         color -- at the specified co-ordinates. This is implemented for
  605.         speed of drawing where a coarse pattern is acceptable.
  606.  
  607.         The format is
  608.                       X Y C D4PIX
  609.                                      where X and Y are the
  610.  
  611.         co-ordinates and C is the color
  612.  
  613.     D>R
  614.  
  615.         Purpose: to convert degrees to radians. Degrees must be given as a
  616.         floating point number.
  617.  
  618.     DATA[
  619.  
  620.         Purpose: Defines a block of memory with the values between
  621.         DATA[ and ] with the name of the block following ]
  622.  
  623.         For further details see manual
  624.  
  625.     DBOX
  626.  
  627.         Purpose: Draws a filled box. The format is
  628.  
  629.                       X1 Y1 X2 Y2 C DBOX
  630.  
  631.              x1,y1  ------------------
  632.                    |                  |
  633.                    |                  |
  634.                    |                  |
  635.                    |                  |
  636.                     ------------------  x2,y2
  637.  
  638.                                             C is the color
  639.  
  640.     DLINE
  641.  
  642.         Purpose: Draws a line starting from the end of the previous
  643.         line drawn. To move the starting point to a new position, use
  644.         DLINE with a colour value equal to the background colour. The
  645.         format is
  646.                       X Y C DLINE
  647.                                      where X and Y are the end
  648.         co-ordinates and C is the color
  649.  
  650.  
  651.  
  652.  
  653.  
  654.  
  655.     4th_86 version 4.01             GLOSSARY                   page  12
  656.     
  657.     
  658.     DD (dump definition)
  659.  
  660.         Purpose: The word DD decompiles any Forth word.
  661.  
  662.           example    DD QUIT  will decompile the word QUIT
  663.  
  664.            see manual for fuller details, including DDH and DDL
  665.  
  666.     DDICT (dump dictionary)
  667.  
  668.         Purpose: The word DDICT has no arguments and dispalys each dictionary
  669.         entry of all the dictionaries (which are linked to each other).
  670.  
  671.         see manual for fuller details
  672.  
  673.     DDS (destructive display stack)
  674.  
  675.         Purpose: Displays to the console device all the stack entries
  676.         currently on the stack, in hexadecimal -- and leaves the stack
  677.         empty.
  678.  
  679.         If the stack is empty when DDS is executed, then the message
  680.         STACK EMPTY is printed.
  681.  
  682.         If the stack has underflowed (ie too many entries DROPped),
  683.         then printed on the console is the message:
  684.  
  685.              STACK UNDERFLOW ... RESETTING STACK.
  686.  
  687.  
  688.     DEBUG
  689.  
  690.         Purpose: The word DEBUG toggles the debug facility on and off.
  691.         The debug facility allows the operator to view the stack while
  692.         executing words interactively.
  693.  
  694.         see manual for fuller details
  695.  
  696.  
  697.     DEFINE
  698.  
  699.         Purpose: Builds a new entry into the dictionary ( but does NOT
  700.         of itself allow building the code in the definition area)
  701.  
  702.         The TOS is used as the flag byte. The word being defined
  703.         follows DEFINE. If the word is already in the dictionary, then
  704.         a message is displayed asking whether the word should be
  705.         redefined.
  706.  
  707.     DEPTH
  708.         Purpose: Brings to the TOS the total number of entries on the stack
  709.  
  710.  
  711.  
  712.  
  713.  
  714.  
  715.     4th_86 version 4.01             GLOSSARY                   page  13
  716.     
  717.     
  718.     DIR
  719.  
  720.        Purpose: Display the directory of current drive
  721.  
  722.           The format is:        DIR        or     DIR B: etc
  723.  
  724.            The current drive can be changed with A:   ---   D:
  725.            The subdirectory can be changed with CD
  726.            Paths are implemented -  DIR C:\FORTH\DOCS
  727.  
  728.     DM
  729.  
  730.         Purpose: Dumps one line of memory starting at the address on
  731.         TOS. (see 16DM)
  732.  
  733.     DO
  734.  
  735.         Purpose: Provides iterative loop control over the code between
  736.         the DO and the LOOP. The structure may be nested up to three
  737.         levels,
  738.  
  739.     DOUBLE
  740.  
  741.         Purpose: To convert a single precision number to double precision.
  742.  
  743.     DPIX
  744.  
  745.         Purpose: Draws a pixel at the specified co-ordinates
  746.         The format is
  747.                       X Y C DPIX
  748.                                      where X and Y are the
  749.         co-ordinates and C is the color
  750.  
  751.  
  752.     DROP
  753.  
  754.        Removes the value currently on TOS and throws it away.
  755.  
  756.     DS
  757.  
  758.         Purpose: Displays to the console device all the stack entries
  759.         currently on the stack, in hexadecimal -- and leaves the stack
  760.         unchanged.
  761.  
  762.         If the stack is empty when DS is executed, then the message
  763.         STACK EMPTY is printed.
  764.  
  765.         If the stack has underflowed (ie too many entries DROPped),
  766.         then printed on the console is the message:
  767.  
  768.              STACK UNDERFLOW ... RESETTING STACK.
  769.  
  770.  
  771.  
  772.  
  773.  
  774.  
  775.     4th_86 version 4.01             GLOSSARY                   page  14
  776.     
  777.     
  778.     DUP
  779.  
  780.         Duplicates the value currently on TOS
  781.  
  782.     DUP@
  783.  
  784.         Combination of DUP followed by @
  785.  
  786.     DUPB@
  787.  
  788.         Combination of DUP followed by B@
  789.  
  790.     DZHALTOFF
  791.  
  792.         Purpose: turns off display of divide by zero error messages
  793.  
  794.     DZHALTON
  795.  
  796.         Purpose: turns on display of divide by zero error messages
  797.  
  798.     DZINST
  799.  
  800.         Purpose: Installs divide by zero error handler. Both DZINST and
  801.         DZREST attempt to be reasonably intelligent about whether the
  802.         original handler is present or not -- even if 4th-86 is exited
  803.         to DOS and re-initiated.
  804.  
  805.  
  806.     DZREST
  807.  
  808.         Purpose: Restores original DOS divide by zero error handler
  809.  
  810.  
  811.     EDIT
  812.  
  813.         Purpose: To shell into DOS and run the chosen DOS editor file.
  814.         The file EDITR.BAT must be configured to call your specific DOS editor.
  815.         The file to be used is previously specified with the word USING
  816.  
  817.            Note that if the command is issued from text mode 3 -- the same
  818.         mode and video page will be returned to on EXIT from DOS.
  819.  
  820.            If however the command is issued from a graphics mode and page -
  821.         return is not necessarily to the same mode or video page. This is
  822.         because the exit to DOS is into video page 0 - and DOS text will
  823.         over-write; and leave garbage display on graphics page0.
  824.  
  825.            In the demonstration version -- which uses page0 only -- return
  826.         is always to text mode 3 page 0. In the registered version, an exit
  827.         to DOS will return to the mode it was initiated from -- and if this
  828.         was a video mode, to page 1.
  829.  
  830.  
  831.  
  832.  
  833.  
  834.  
  835.     4th_86 version 4.01             GLOSSARY                   page  15
  836.     
  837.     
  838.     EGAM
  839.  
  840.         Purpose: Initialise multi-function graphics card in 640x350
  841.         16 color EGA graphics mode -- and clear video buffer.
  842.         (see also NEGAM CGAM NCGAM NORM NNORM)EGAM
  843.  
  844.     ELAPSED
  845.  
  846.         Same as TD
  847.  
  848.     ELSE
  849.  
  850.            see IF ... ELSE .. THEN
  851.  
  852.     END
  853.  
  854.            see BEGIN ... END
  855.  
  856.     END[ (end left bracket)
  857.  
  858.         Purpose: Used instead of END in BEGIN .. END construct.
  859.         Instead of using the TOS as a boolean value like END this
  860.         uses the TOS to compare against the list between END[ and its
  861.         matching ]        If the TOS matches any of the values in the
  862.         brackets, then a true condition exists and the loop is exited.
  863.  
  864.           example   Given the address of text on TOS, search for the
  865.                     first occurrence of an alphanumeric character "A"
  866.         through "Z". "0" through "9"
  867.  
  868.             : FINDAN  ( find first occurrence of alphanumeric)
  869.                 BEGIN
  870.                  1+ ( bump pointer)
  871.                  DUPB@  ( get character)
  872.                 END[ "A" THRU "Z"  "0" THRU "9" ]
  873.             ;
  874.  
  875.     ENDIF
  876.  
  877.            see IFTRUE ... OTHERWISE ... ENDIF
  878.  
  879.     ENDOF
  880.  
  881.            see CASE ... ENDCASE .. OF ... ENDOF
  882.  
  883.     ENDWHILE
  884.  
  885.            see REPEAT ... WHILE ...  ENDWHILE
  886.  
  887.  
  888.  
  889.  
  890.  
  891.  
  892.     4th_86 version 4.01             GLOSSARY                   page  16
  893.     
  894.     
  895.     ERMSG
  896.  
  897.         Purpose: Provides a common exit back to the command line
  898.         interpreter whenever an error is detected.
  899.  
  900.         When executed, TOS contains the number of addresses on the
  901.         stack which point to strings containing parts of an error
  902.         message. The addresses should be placed on the stack such that
  903.         the first message to be printed is deeper into the stack.
  904.  
  905.     EXEC
  906.  
  907.         Purpose: Executes Forth words which may be defined to be
  908.         "immediate" words or entered interactively through the console
  909.         in low mode or execute mode. The TOS contains the address of
  910.         the word to execute.
  911.  
  912.     EXIT
  913.         Purpose: Provides an abnormal exit from a DO .. LOOP or
  914.         DO .. +LOOP structure. When executed, the flow of control will
  915.         be transferred to the statement imediately following LOOP or
  916.         +LOOP.
  917.  
  918.     F*   F+   F-   F-1*   F.   F/   F<   F=   F>   FABS
  919.  
  920.         Floating point operators similar to fixed point single precision
  921.  
  922.     FCIRCLE1
  923.  
  924.         Purpose: Draws a filled circle at centre X Y of radius R and color C
  925.  
  926.            Input --    X  Y  R  C  <= TOS
  927.  
  928.         The fill is done by drawing circles of continuously decreasing
  929.         radius.
  930.  
  931.         Note that the card must be initialised first with either EGAM
  932.         or CGAM.
  933.  
  934.     FCIRCLE2
  935.  
  936.         Purpose: Draws a filled circle at centre X Y of radius R and color C
  937.  
  938.            Input --    X  Y  R  C  <= TOS
  939.  
  940.         The fill is done by drawing horizontal lines between the boundaries
  941.         of the circumference.
  942.  
  943.         Note that the card must be initialised first with either EGAM
  944.         or CGAM.
  945.  
  946.  
  947.  
  948.  
  949.  
  950.  
  951.     4th_86 version 4.01             GLOSSARY                   page  17
  952.     
  953.     
  954.     FILES
  955.  
  956.         Displays a table of file handles and names with indications of
  957.         those that are open and closed.
  958.  
  959.     FILL
  960.  
  961.         Purpose: Fills memory starting at the address on TOS for a
  962.         count of NOS with the value at 3OS.
  963.  
  964.           example     11H 20H 8000H FILL
  965.  
  966.     FIND
  967.  
  968.         Purpose: Tries to find a word in a specified dictionary.
  969.         Returns either zero (if the word did not exist in the
  970.         dictionary) or the address of the dictionary entry of the word.
  971.         The TOS contains the address of the dictionary where the search
  972.         is to be started, and the NOS contains the address of the
  973.         string representing the word to find.
  974.  
  975.     FLOAD
  976.  
  977.         Purpose: To load a Forth source file from disk. Format is
  978.  
  979.                        FLOAD  FILENAME
  980.  
  981.         An alternative is  " FILENAME"  LOAD
  982.  
  983.  
  984.     FLOAT
  985.  
  986.          Converts a double precision number to floating point format
  987.  
  988.     FMEM
  989.  
  990.         Purpose: Similar to FILL, but uses an end address instead of a
  991.         count value.
  992.  
  993.         Fills memory starting at the address on TOS and ending at the
  994.         adress on  NOS with the value at 3OS.
  995.  
  996.             example    11H 8020H 8000H FMEM
  997.  
  998.     FORGET
  999.  
  1000.         format FORGET xxxx.  Removes the word xxx from dictionary -- along
  1001.         with ALL the words which were defined after it. Code belonging to
  1002.         the forgotten words will be over-written as new words are entered.
  1003.  
  1004.  
  1005.  
  1006.  
  1007.  
  1008.  
  1009.     4th_86 version 4.01             GLOSSARY                   page  18
  1010.     
  1011.     
  1012.     FSAVE
  1013.  
  1014.         Purpose: To allow the current state of the running 4th_86 --
  1015.         including all new words loaded -- to be saved under a
  1016.         specified name  xxxx  ==> use  FSAVE xxxx ( see also SAVESYS)
  1017.  
  1018.     GCOLR
  1019.  
  1020.         A variable which controls the colour of all characters printed
  1021.         with the word GCOUT ( or digits via .CL )
  1022.  
  1023.  
  1024.     GCOUT
  1025.  
  1026.         Prints ascii character on TOS in colour determined by value on
  1027.         variable GCOLR.
  1028.  
  1029.     GETCHR
  1030.  
  1031.         Purpose: When executed the TOS contains the next character
  1032.         entered at the console.
  1033.  
  1034.     GETCLI
  1035.  
  1036.         Purpose: Returns the tail of the command line that invoked a
  1037.         4th_86  program. The TOS contains the address of a 128 byte buffer
  1038.         which will receive the command line. When GETCLI is executed,
  1039.         the command line will be moved into the buffer with the first
  1040.         byte containing the length of the text read from the command
  1041.         line.
  1042.  
  1043.     GETLIN
  1044.  
  1045.         Purpose: Returns a line of text entered at the console. The TOS
  1046.         contains the address of the buffer which should receive the text
  1047.         with the first byte of the buffer containing the maximum length
  1048.         of the string to be collected. When GETLIN is executed, the
  1049.         second byte of the buffer will contain the actual number of
  1050.         bytes read from the console with the text beginning at the
  1051.         third byte of the buffer.
  1052.  
  1053.     GETLOC
  1054.  
  1055.         Purpose: Fetch to the TOS the address of the next location
  1056.         available for entering code into the current definition being
  1057.         defined.
  1058.  
  1059.     GETMODE
  1060.  
  1061.         Purpose: Return on TOS the active display page, and on NOS the
  1062.         number of columns (high byte) and the display mode (low byte)
  1063.  
  1064.  
  1065.  
  1066.  
  1067.  
  1068.  
  1069.     4th_86 version 4.01             GLOSSARY                   page  19
  1070.     
  1071.     
  1072.     GETSTS
  1073.  
  1074.         Purpose: When executed the TOS contains a 1 if a character was
  1075.         detected at the console, or a zero if no chartacter was detected.
  1076.  
  1077.     GETXY
  1078.  
  1079.         Purpose: To read the cursor location x,y
  1080.  
  1081.     GOTOXY
  1082.  
  1083.         Purpose: To specify the cursor location.
  1084.  
  1085.                : FRED 11 12 gotoxy " test" ." ;
  1086.  
  1087.        will print the word 'test' at the [ decimal ] x,y co-ordinates 11,12
  1088.  
  1089.     GTDFA
  1090.  
  1091.         Purpose: Searches the current dictionary for the word following
  1092.         GTDFA. If found, the definition address is returned to TOS.
  1093.  
  1094.     GVAL (get numeric value)
  1095.  
  1096.         Purpose: Evaluates a character string as a numeric string and
  1097.         converts it into a binary number. The TOS on entry is the
  1098.         address of the character string. On exit, the TOS is a flag:
  1099.         zero - returned value is single precision
  1100.         one  - returned value is double precision
  1101.           The NOS is the low order two bytes of the double precision,
  1102.         or floating point value, and the 3OS is the high order two
  1103.         bytes. If the value is single precision as denoted by TOS, then
  1104.         3OS must be DROPped.
  1105.  
  1106.     HEAD!
  1107.  
  1108.         Purpose: Stores a word in the definition currently being
  1109.         defined. The word on TOS is stored at the address in HEAD. The
  1110.         contents of HEAD are then incremented by two bytes.
  1111.  
  1112.     HEADB!
  1113.  
  1114.         Purpose: Identical to HEAD! but stores a byte value instead of
  1115.         a word value, and only increments HEAD by one.
  1116.  
  1117.     HELP
  1118.  
  1119.         Loads the file TUTORIAL.TXT [ into high memory ] as default, and
  1120.         initiates a colored split-screen window tutorial.
  1121.  
  1122.         See also TUTLOAD
  1123.  
  1124.  
  1125.  
  1126.  
  1127.  
  1128.  
  1129.     4th_86 version 4.01             GLOSSARY                   page  20
  1130.     
  1131.     
  1132.     HLINE
  1133.  
  1134.         Purpose: Draws a horizontal line of specified color.
  1135.         The format is
  1136.                       X1 X2 Y C DLINE
  1137.  
  1138.                                      where X1,Y and X2,Y are the end
  1139.  
  1140.         co-ordinates and C is the color
  1141.  
  1142.     I
  1143.         Innermost loop variable in DO ... LOOP construct
  1144.  
  1145.     IF .. ELSE .. THEN
  1146.  
  1147.         Purpose: Provides conditional execution of the code between IF
  1148.         and ELSE or ELSE and THEN.
  1149.  
  1150.     IFTRUE .. OTHERWISE .. ENDIF
  1151.  
  1152.         Purpose: A construct for conditionally ignoring segmentgs of
  1153.         the input stream. It is an immediate definition and is executed
  1154.         when encountered, even in high mode.
  1155.  
  1156.          IFTRUE ( evaluate the TOS)
  1157.           ....  ( execute code if TOS is true (non zero))
  1158.          OTHERWISE
  1159.           ....  ( execute code if TOS is false (zero))
  1160.          ENDIF
  1161.  
  1162.  
  1163.     IF[
  1164.  
  1165.         Purpose: Used instead of IF in IF .. THEN or IF .. ELSE .. THEN
  1166.         constructs. Similar in concept to END[  and OF[
  1167.  
  1168.     ILOAD
  1169.  
  1170.         Purpose: To allow a system image saved with ISAVE to be
  1171.         reloaded for further work to be done.
  1172.  
  1173.     IMMEDIATE
  1174.  
  1175.         Purpose: If the word being defined should not be compiled into
  1176.         a definition, but executed whenever detected, then the word
  1177.         IMMEDIATE should be used after the definition terminator
  1178.            ( see ASM )
  1179.  
  1180.  
  1181.  
  1182.  
  1183.  
  1184.  
  1185.     4th_86 version 4.01             GLOSSARY                   page  21
  1186.     
  1187.     
  1188.     INSRT
  1189.  
  1190.         Purpose: Removes the TOS, called n, and removes the NOS,
  1191.         called x. The resultant stack contains two less stack elements.
  1192.         x is inserted into the stack indexed by n.
  1193.  
  1194.         EXAMPLES      1 2 3 4 5 1 => 1 2 3 4 5
  1195.                       1 2 3 4 5 2 => 1 2 3 5 4
  1196.                       1 2 3 4 5 3 => 1 2 5 3 4
  1197.                       1 2 3 4 5 4 => 1 5 2 3 4
  1198.  
  1199.         NOTE THAT 1 insrt => nop  => 1 xtrct
  1200.                   2 insrt => swap => 2 xtrct
  1201.  
  1202.     INT3
  1203.  
  1204.         Provided 4th_86 has been entered from within a debugger shell
  1205.         [ for example by typing DEBUG 4TH86DEM.COM and then typing G at the
  1206.         DEBUG.COM prompt ]; INT3 will exit from 4TH_86 into the debugger
  1207.         that was used.
  1208.  
  1209.         To return to 4th_86 again -- make sure the CS: and DS: segment
  1210.         values have not been altered -- and then start operation at offset
  1211.         200H [ the address of THREAD ]. The relevant DEBUG.COM command is
  1212.         G=200
  1213.  
  1214.         4th_86 contains enough FORTH debugging facilities to make the use
  1215.         of a DOS debugger shell un-necessary. It can however be useful for
  1216.         stepping through assembly code -- or examining memory over a range
  1217.         of segments.
  1218.  
  1219.         Note also that unless screen-swapping is implemented; the original
  1220.         4th_86 screen display will be lost as you use DEBUG.COM.
  1221.  
  1222.     INTEGER
  1223.  
  1224.         Purpose: To convert a floating point number to a double precision
  1225.         integer value.
  1226.  
  1227.     ISAVE
  1228.  
  1229.         Purpose: To allow the current state of a partially meta-compiled
  1230.           system to be saved under a specified name xxxx
  1231.              ==> use  FSAVE xxxx
  1232.  
  1233.     J
  1234.  
  1235.         Innermost level plus one loop variable in DO ... LOOP construct
  1236.  
  1237.  
  1238.  
  1239.  
  1240.  
  1241.  
  1242.     4th_86 version 4.01             GLOSSARY                   page  22
  1243.     
  1244.     
  1245.     LINK
  1246.  
  1247.         Purpose: replaces one definition with another -- provided both
  1248.         definitions are already existent.
  1249.  
  1250.         example  LINK EGAM CGAM   will cause all references to EGAM to
  1251.         instead use CGAM.
  1252.  
  1253.         See UNLINK
  1254.  
  1255.     LOAD
  1256.  
  1257.         An alternative to FLOAD. Whereas we would usually say
  1258.  
  1259.            FLOAD filename
  1260.  
  1261.         It is possible to achieve the same result by typing
  1262.  
  1263.            " filename" LOAD
  1264.  
  1265.     LUM
  1266.  
  1267.         A system variable which keeps track of a pointer to the data
  1268.         storage area. As words like BLOCK and CONST are used, memory storage
  1269.         is allocated automatically and the pointer stored in LUM decreases.
  1270.  
  1271.     MON1
  1272.  
  1273.         Purpose: A call is made to the operating system and no value is
  1274.         returned. The TOS contains the function code and NOS contains
  1275.         any address requirted by the function.
  1276.  
  1277.     MON2
  1278.  
  1279.         Purpose: A call is made to the operating system and a value is
  1280.         returned on TOS. The stack values on entry are as for MON1
  1281.  
  1282.     MOVE (data move)
  1283.  
  1284.         Purpose: Move the number of bytes on the TOS to the address on
  1285.         NOS from the address on 3OS
  1286.  
  1287.     NCGAM
  1288.  
  1289.         Purpose: Initialise multi-function graphics card in 640x200
  1290.         2 color CGA graphics mode -- but do NOT clear video buffer.
  1291.         (see also NEGAM CGAM EGAM NORM NNORM)
  1292.  
  1293.  
  1294.  
  1295.  
  1296.  
  1297.  
  1298.     4th_86 version 4.01             GLOSSARY                   page  23
  1299.     
  1300.     
  1301.     NEGAM
  1302.  
  1303.         Purpose: Initialise multi-function graphics card in 640x350
  1304.         16 color EGA graphics mode -- but do NOT clear video buffer.
  1305.         (see also EGAM CGAM NCGAM NORM NNORM)
  1306.  
  1307.     NORM
  1308.         Purpose: Initialise multi-function graphics card in 80x25
  1309.         color text mode -- and clear video buffer.
  1310.         (see also NEGAM CGAM NCGAM NORM NNORM)
  1311.  
  1312.     NNORM
  1313.         Purpose: Initialise multi-function graphics card in 80x25
  1314.         color text mode -- but do NOT clear video buffer.
  1315.         (see also NEGAM CGAM NCGAM NORM NNORM)
  1316.  
  1317.     NUMBER
  1318.  
  1319.         Purpose: Evaluates a numeric string found in the input stream
  1320.         as a binary number and stores it into the current definition.
  1321.         The number may be eithert single or double precision.
  1322.  
  1323.     OMIT
  1324.  
  1325.         Purpose: To remove unwanted words from the dictionary - either
  1326.         for security - or to save space. Normally a file called
  1327.         OMITFILE is prepared containing a full list of all the words to
  1328.         be omitted.
  1329.  
  1330.             The code itself is not removed -- nor any threading from
  1331.         other WORDS to the code. Only the dictionary entry is removed.
  1332.        The gap created is closed up by moving the remaining dictionary
  1333.        entries up.
  1334.  
  1335.     OPEN
  1336.  
  1337.         Purpose: Opens a file for either input or output. The TOS contains
  1338.         a 1 for input or a 2 for output. The NOS contains the address of
  1339.         the ASCIIZ filename including any DOS paths, which
  1340.         is to be opened. If the file is opened for output, no data can
  1341.         be written to it. If the file is opened for
  1342.         output, any previous file will be deleted and a new file opened.
  1343.  
  1344.     PAGE0
  1345.  
  1346.         Switches video display to page 0 of current mode. Will work in both
  1347.         text mode 3 and graphics modes 4 or 10, Note that mode must be set
  1348.         first with one of NORM, EGAM, or CGAM.
  1349.  
  1350.            The Demonstration 4th_86 is configured to work entirely in page0
  1351.         as a default.
  1352.  
  1353.  
  1354.  
  1355.  
  1356.  
  1357.  
  1358.     4th_86 version 4.01             GLOSSARY                   page  24
  1359.     
  1360.     
  1361.     PAGE1
  1362.  
  1363.         Switches video display to page 1 of current mode. Will work in both
  1364.         text mode 3 and graphics modes 4 or 10, Note that mode must be set
  1365.         first with one of NORM, EGAM, or CGAM.
  1366.  
  1367.            The Demonstration 4th_86 is configured to work entirely in page0
  1368.         as a default. The command PAGE1 will have no effect.
  1369.  
  1370.  
  1371.     PAT
  1372.  
  1373.         Purpose: Allows one word in a definition to be changed to
  1374.         another word. The format is
  1375.  
  1376.                     address  PAT  word
  1377.  
  1378.         where address is the patch address, and word is the dictionary
  1379.         name of the word to store at address.
  1380.  
  1381.  
  1382.     PATCH
  1383.  
  1384.         Purpose: Alters a constant value in the definitions. PATCH uses
  1385.         the TOS as the value to patch at the word which follows PATCH
  1386.  
  1387.         example   suppose the constant LENGTH was defined with a value
  1388.                   of 100, and later a value of 200 was needed.
  1389.  
  1390.                         200 PATCH LENGTH   will do this
  1391.  
  1392.  
  1393.     PDICT
  1394.  
  1395.         Purpose: The dictionary entry of a single word is displayed
  1396.  
  1397.         example    PDICT  DUP    will display the entry for DUP
  1398.  
  1399.  
  1400.     PI
  1401.  
  1402.        A constant which puts the floating point value of PI on TOS.
  1403.  
  1404.  
  1405.     PI/2
  1406.  
  1407.        A constant which puts the floating point value of PI/2 on TOS.
  1408.  
  1409.  
  1410.  
  1411.  
  1412.  
  1413.  
  1414.     4th_86 version 4.01             GLOSSARY                   page  25
  1415.     
  1416.     
  1417.     PICK
  1418.  
  1419.         Purpose: Copy the TOSth element of the stack to TOS. The TOS is
  1420.         not counted as part of the stack.
  1421.  
  1422.         examples (all values in hex)
  1423.                   43 55 12 3e 4  =>  43 55 12 3e 43
  1424.                   43 55 12 3e 3  =>  43 55 12 3e 55
  1425.                   43 55 12 3e 2  =>  43 55 12 3e 12
  1426.                   43 55 12 3e 1  =>  43 55 12 3e 3e
  1427.  
  1428.            1 PICK => DUP   2 PICK => OVER
  1429.  
  1430.     POKE
  1431.  
  1432.         Purpose: Move the NOS into the TOSth place. The TOS and NOS are
  1433.         not included in the poke count
  1434.  
  1435.         examples (all values in hex)
  1436.                   43 55 12 3e 3  =>  3e 55 1
  1437.                   43 55 12 3e 2  =>  43 3e 12
  1438.                   43 55 12 3e 1  =>  43 55 3e
  1439.                   43 55 12 3e 0  =>  43 55 12
  1440.  
  1441.     PRINTLOAD
  1442.  
  1443.         Purpose: Controls whether a file being FLOADed is printed at
  1444.         the console or not
  1445.                OFF PRINTLOAD -- don't show file
  1446.                 ON PRINTLOAD -- show file as it loads
  1447.  
  1448.     PRINTLOC
  1449.  
  1450.         Purpose: Controls whether a file being FLOADed has the compile
  1451.         location of each line displayed on the console.
  1452.  
  1453.     R>D
  1454.  
  1455.         Purpose: to convert radians to degrees. Radians must be given as a
  1456.         floating point number.
  1457.  
  1458.     READ
  1459.         Purpose: Inputs data sequentially from a previously opened
  1460.         file. The TOS contains the file handle number of the already
  1461.         opened file to read from. The NOS contains the
  1462.         address of the buffer to read the data into. The 3OS contains
  1463.         the maximum number of bytes to read. When the input data has
  1464.         been moved into the buffer, or when an error occurs, then the
  1465.         TOS contains an error code and the NOS contains the actual
  1466.         number of bytes read into the buffer.
  1467.  
  1468.  
  1469.  
  1470.  
  1471.  
  1472.  
  1473.     4th_86 version 4.01             GLOSSARY                   page  26
  1474.     
  1475.     
  1476.     RECROSS
  1477.  
  1478.         Purpose: Allows cross-compile mode to be re-entered after it has
  1479.         been left by using UNCROSS.
  1480.  
  1481.     RECURSE
  1482.  
  1483.         Purpose: Allows a word being defined to thread back to its own
  1484.         definition.
  1485.  
  1486.                     : SERIES 5 > if dup . 1- recurse else drop then ;
  1487.  
  1488.         The command 123 SERIES  will print the numbers from 123 down through 6
  1489.  
  1490.             Note that the following will not work
  1491.  
  1492.                     : SERIES 5 > if dup . 1- recurse then drop ;
  1493.  
  1494.         because EVERY recursive execution of SERIES results in DROP being
  1495.        executed -- producing stack underflow. We only require DROP executed once.
  1496.  
  1497.      REDEFINE
  1498.  
  1499.         Purpose: Normally when a definition is created that has the
  1500.         same name as another definition, 4th_86 prompts with a warning
  1501.         message and queries for continuing or aborting. This feature is
  1502.         disabled by the command
  1503.  
  1504.                      ON REDEFINE and is restored by OFF REDEFINE
  1505.  
  1506.     REDIT
  1507.  
  1508.         Purpose: Equivalent to sequence EDIT  RELOAD ;
  1509.  
  1510.     RELOAD
  1511.  
  1512.         purpose: Same function as FLOAD -- but the name of the file to
  1513.         be FLOADed does not have to be specified. It is the same name
  1514.         which has previously been defined by USING -- ie the same as
  1515.         the name used by EDIT and REDIT.
  1516.  
  1517.     REPEAT .. WHILE .. ENDWHILE
  1518.  
  1519.         Purpose: Provides loop control over the code between REPEAT and
  1520.         ENDWHILE. The code following the ENDWHILE is executed when the
  1521.         WHILE is executed and the TOS is false, otherwise the code
  1522.         between the REPEAT .. ENDWHILE will be executed.
  1523.  
  1524.         The construct is the same as the BEGIN .. END structure except
  1525.         that the exit test is made at the top of the loop instead of
  1526.         the bottom of the loop.
  1527.  
  1528.  
  1529.  
  1530.  
  1531.  
  1532.  
  1533.     4th_86 version 4.01             GLOSSARY                   page  27
  1534.     
  1535.     
  1536.     RETURN
  1537.  
  1538.         Purpose: Provides an immediate exit from a high level definition.
  1539.         It can be used anywhere in a word except within a DO .. LOOP
  1540.         construct. When executed it is similar to encountering the word ;
  1541.  
  1542.  
  1543.     SAVESYS
  1544.  
  1545.         Purpose: To allow the current state of the running 4th_86 --
  1546.         including all new words loaded -- to be saved under the name
  1547.         4th_86.COM. (see also FSAVE)
  1548.  
  1549.             No parameters needed --- just type SAVESYS at any time. Any
  1550.          existing 4th_86.COM will be over-written.
  1551.  
  1552.  
  1553.     SECDELAY
  1554.  
  1555.         Causes a time delay of xx seconds where xx is the number on TOS. As
  1556.         the delay progresses a countdown is displayed on screen.
  1557.  
  1558.  
  1559.     SHL8
  1560.  
  1561.         Purpose: Move the low byte of TOS to the high byte
  1562.  
  1563.  
  1564.  
  1565.     SHR8
  1566.  
  1567.         Purpose: Move the high byte of TOS to the low byte
  1568.  
  1569.  
  1570.     SINGLE
  1571.  
  1572.         Purpose: To convert a double precision number to single precision.
  1573.  
  1574.  
  1575.     SIZE
  1576.  
  1577.         Purpose: Returns on TOS the number of bytes in the definition
  1578.         of the word which follows SIZE
  1579.  
  1580.  
  1581.     STATUS
  1582.  
  1583.         Purpose: Provides the user information concerning the space
  1584.         available in the dictionary and the definition tables. If in
  1585.         cross mode, the code and data start and stop addresses are also
  1586.         displayed
  1587.  
  1588.  
  1589.  
  1590.  
  1591.  
  1592.  
  1593.     4th_86 version 4.01             GLOSSARY                   page  28
  1594.     
  1595.     
  1596.     STRCAT
  1597.  
  1598.         Purpose: to concatenate two strings.
  1599.                        The format is Addr1  Addr2  STRCAT
  1600.  
  1601.         The string at address2 will be added to the end of the string at
  1602.         address1, and the concatenated result stored at addr1
  1603.  
  1604.  
  1605.         NOTE - the allocated space for string1 must be great enough to
  1606.         accomodate the concatenated result. If in doubt -- copy string 1 to
  1607.         a larger buffer area.
  1608.  
  1609.  
  1610.         For example - if we define  data[ " This is " "             "  ] st1
  1611.                                     data[ " a test " ] st2
  1612.  
  1613.         Then   ST1 ST2 STRCAT ST1 ." will print  " This is a test".
  1614.  
  1615.            whereas        data[ " This is " ] st1
  1616.                           data[ " a test " ] st2
  1617.  
  1618.            requires    data[ "                " ] st3
  1619.                  ST! ST3 $!    ST3 ST2 STRCAT ST3 ."
  1620.                     ST1 ST3 $!    ST3 ST2 STRCAT ST3 ."
  1621.  
  1622.  
  1623.  
  1624.     STRCMP
  1625.  
  1626.         Purpose: to compare two strings for a specified number of bytes.
  1627.            Returns 0 for mis-match and 1 for match
  1628.  
  1629.        The format is  Addr1  Addr2  Count  STRCMP
  1630.  
  1631.         Note --- : FRED " abcdef"  " abcde" 3 STRCMP ;
  1632.             will give a mis-match because the first byte of each string
  1633.             is the string-length byte. String one is 6 bytes long
  1634.             whereas string 2 is 5 bytes.
  1635.                  : FRED " abcdef" 1+ " abcde" 1+ 3 STRCMP ;
  1636.             will step over the count byte, and give a match.
  1637.  
  1638.     STRING
  1639.  
  1640.     SWAP
  1641.  
  1642.     SYNONYM
  1643.  
  1644.  
  1645.  
  1646.  
  1647.  
  1648.  
  1649.     4th_86 version 4.01             GLOSSARY                   page  29
  1650.     
  1651.     
  1652.     SYS
  1653.  
  1654.         Purpose: Causes the user to shell out to DOS. Return to 4th_86 is
  1655.         achieved by typing EXIT (not a Forth word -- a DOS command)
  1656.  
  1657.            Note that if the command is issued from text mode 3 -- the same
  1658.         mode and video page will be returned to on EXIT from DOS.
  1659.  
  1660.            If however the command is issued from a graphics mode and page -
  1661.         return is not necessarily to the same mode or video page. This is
  1662.         because the exit to DOS is into video page 0 - and DOS text will
  1663.         over-write; and leave garbage display on graphics page0.
  1664.  
  1665.            In the demonstration version -- which uses page0 only -- return
  1666.         is always to text mode 3 page 0. In the registered version, an exit
  1667.         to DOS will return to the mode it was initiated from -- and if this
  1668.         was a video mode, to page 1.
  1669.  
  1670.     SYSCLOSE
  1671.  
  1672.         Purpose: Closes a file. The TOS contains the file handle number
  1673.         of the already opened file to be closed, or zero if all files
  1674.         should be closed.
  1675.  
  1676.     SYSOPEN
  1677.  
  1678.         Purpose: Opens a file for either input or output. The TOS
  1679.         contains the access code (1=input 2=output) and the NOS
  1680.         contains the address of the filename which should be opened.
  1681.         Upon exit, the TOS contains the DOS file handle number
  1682.  
  1683.     SYSRBYTE
  1684.  
  1685.         Purpose: Writes one byte to a file. The TOS contains the
  1686.         file handle number of the already opened file to be
  1687.         written to. The NOS contains the byte to be written.
  1688.  
  1689.     SYSREAD
  1690.  
  1691.         Purpose: Reads a block from a file to a buffer. The TOS
  1692.         contains the file handle number of the already opened file
  1693.         to be read from. The NOS contains the address of the
  1694.         buffer to read into. The 3OS contains the number of bytes
  1695.        to read. Upon exit  from SYSREAD the TOS contains the actual
  1696.        number of bytes read.
  1697.  
  1698.     SYSWBYTE
  1699.  
  1700.         Purpose: Writes one byte to a file. The TOS contains the
  1701.         file handle number of the already opened file to be written to.
  1702.         The NOS contains the byte to be written.
  1703.  
  1704.  
  1705.  
  1706.  
  1707.  
  1708.  
  1709.     4th_86 version 4.01             GLOSSARY                   page  30
  1710.     
  1711.     
  1712.     SYSWRITE
  1713.  
  1714.         Purpose: Writes a block from a buffer to a file. The TOS
  1715.         contains the file handle number of the already opened file
  1716.         to be written into. The NOS contains the address of
  1717.         the buffer to write from. The 3OS contains the number of bytes
  1718.         to write.
  1719.  
  1720.     TAB
  1721.  
  1722.  
  1723.     TAG
  1724.  
  1725.  
  1726.     TCOLON
  1727.  
  1728.     TD (time and delay)
  1729.         Purpose: displays the time in hours, minutes, seconds, tenths.
  1730.         Also displays the time elapsed since the previous reference to
  1731.         TD
  1732.  
  1733.     TDLOCK
  1734.  
  1735.     THEN
  1736.  
  1737.         see  IF .. ELSE .. THEN
  1738.  
  1739.  
  1740.     THREAD
  1741.  
  1742.     TIME
  1743.            Same as TM
  1744.  
  1745.     TM (time)
  1746.  
  1747.         Purpose: displays the time in hours, minutes, seconds, tenths.
  1748.  
  1749.  
  1750.  
  1751.     TRACE
  1752.  
  1753.     TRACEL
  1754.  
  1755.     TRACEOFF
  1756.  
  1757.     TUTLOAD
  1758.  
  1759.     TYME
  1760.  
  1761.         Returns the hours minutes and seconds as parameters on the stack
  1762.  
  1763.  
  1764.  
  1765.  
  1766.  
  1767.  
  1768.     4th_86 version 4.01             GLOSSARY                   page  31
  1769.     
  1770.     
  1771.     TYPE (type file)
  1772.  
  1773.         Purpose: To display on the screen the contents of a disk text
  1774.         file.
  1775.  
  1776.            The format is
  1777.  
  1778.                   TYPE  FILENAME    or   TYPE B:\FORTH\FILENAME
  1779.  
  1780.            The current drive can be changed with A:   ---   D:
  1781.  
  1782.     U>
  1783.  
  1784.     UNCROSS
  1785.  
  1786.  
  1787.     UNLINK
  1788.  
  1789.         Purpose: Removes the latest patch established with LINK. If
  1790.         more than one pair of words have been LINKed, only the latest
  1791.         one can be UNLINKed. The others are un-recoverable.
  1792.  
  1793.     UNPAT
  1794.  
  1795.     UNSPLIT
  1796.  
  1797.     USING
  1798.  
  1799.         Purpose: Defines the file name to be subsequently used by the
  1800.         words EDIT  REDIT  RELOAD.
  1801.  
  1802.         Format        USING filename
  1803.  
  1804.     VAL
  1805.  
  1806.     VLINE
  1807.  
  1808.         Purpose: Draws a vertical line of specified color.
  1809.         The format is
  1810.                       X Y1 Y2 C HLINE
  1811.  
  1812.                                      where X,Y1 and X,Y2 are the end
  1813.  
  1814.         co-ordinates and C is the color
  1815.  
  1816.     WORD
  1817.  
  1818.         Purpose: Fetches a word from the input stream and stores it in
  1819.         ATOM, returning the address of ATOM on TOS. A word is defined
  1820.         in the input stream as ANY sequence of ASCII printable
  1821.         characters delineated by at least one space or blank.
  1822.  
  1823.  
  1824.  
  1825.  
  1826.  
  1827.  
  1828.     4th_86 version 4.01             GLOSSARY                   page  32
  1829.     
  1830.     
  1831.     WRITE
  1832.         Purpose: Outputs data sequentially to a previously opened
  1833.         file. The TOS contains the file handle number of the already
  1834.         opened file to write to. The NOS contains the
  1835.         address of the buffer to write the data from. The 3OS contains
  1836.         the number of bytes to write. When the input data has
  1837.         been moved into the buffer, or when an error occurs, then the
  1838.         TOS contains an error code.
  1839.  
  1840.     XTRCT
  1841.         Purpose: Removes the TOS called n and extracts (moves) the
  1842.         stack element indexed by n to the TOS
  1843.  
  1844.         example      1 2 3 4 5 1  =>  1 2 3 4 5
  1845.                      1 2 3 4 5 2  =>  1 2 3 5 4
  1846.                      1 2 3 4 5 3  =>  1 2 4 5 3
  1847.                      1 2 3 4 5 4  =>  1 3 4 5 2
  1848.                      1 2 3 4 5 5  =>  2 3 4 5 1
  1849.  
  1850.  
  1851.     [COMPILE]
  1852.  
  1853.         Purpose: Stores the definition address of a word declared to be
  1854.         immediate by the word IMMEDIATE into the current definition.
  1855.  
  1856.         Format     [COMPILE]  xxxxx    where xxxxx is the word
  1857.  
  1858.     [[
  1859.         Purpose: Toggles from execute mode to compile mode
  1860.  
  1861.     ]]
  1862.  
  1863.     |   ( 7C Hex ascii )
  1864.  
  1865.         Purpose: used before a label in CODE definitions.
  1866.  
  1867.     │    ( graphics character 83 Hex )
  1868.  
  1869.          Purpose: Can be used in 4th_86 source files which are FLOADed as a
  1870.          comment character. It is ignored by 4th_86 ( actually converted to a
  1871.          space 20 Hex.)  The intended application is at the left margin to
  1872.          format the display of
  1873.                             IF
  1874.                              │ IF
  1875.                              │  │
  1876.                              │ ELSE
  1877.                              │  │
  1878.                              │ THEN
  1879.                              │
  1880.                             THEN
  1881.