Go to Triangle Digital Support Home Page TDS2020F TECHNICAL MANUAL
Forth word list
E! to HRS
Live website search
Enter key words



x da -


Store x to 32-bit address da.




da - x


Fetch x from 32-bit address da.




char da -


Store char to 32-bit address da. The unused higher-order bits are all zeros.




da - char


Fetch char from 32-bit address da. The unused higher-order bits are all zeros.




da n -


Examine n locations from extended memory address da. Use to examine any part of the 1 megabyte of memory.






Enables Interrupt System by setting interrupt mask priority in the microprocessor status register to 0. To be active each interrupt must have its own enable bit set.


ELSE                    ANS




COMPILATION:   orig1 2 - orig2 2

Put the location of a new unresolved forward reference orig2 on to the stack. Append the run-time action below to the current definition. The structure will be incomplete until orig2 is resolved, e.g. by THEN . Resolve the forward reference orig1, using the location following the appended execution action.



Continue execution at the location specified by the resolution of orig2, e.g. after the next THEN .




addr1 - addr2


Assembler word. Used in a

xx IF, . ELSE, . THEN,

structure. See IF, . The addr1 is used to fix up a branch left at IF, so that it will point to after the ELSE, . ELSE, itself assembles a branch, leaving addr2 for use by THEN, which will fix it up to point to after the THEN, . Use only in a CODE definition.


EMIT                    ANS


x -


Send the lower byte of x to the current output device, discarding the upper byte. All bytes 0 to 255 are sent without any filtering. At power-up EMIT is configured to send the byte to serial Port 1, SIN1 on pin a25. It is vectored through 'EMIT to execute <EMIT> but that can be changed to allow EMIT to send data to an LCD, the second serial port, or elsewhere. See 'EMIT <EMIT> .

It is possible to completely revector the main Forth input-output. The example transfers control of the TDS2020F Forth to a connected LCD and keypad:



: TRANSFER ( - )


 ['] (KEY) 'KEY ! START ;

TRANSLATE converts key numbers to ASCII codes using a table that depends on your hardware, see MATRIX KEYPAD SUPPORT, page 110.






Ends definition of Forth word written in assembly language and which runs at machine code speed. It assembles an in-line version of NEXT for greatest speed. An alternative is NEXT JMP, .


ENDCASE                    ANS



   0 case-sys1 case-sys2 . 4 -

Mark the end of the . OF . ENDOF . part of the CASE structure. Use case-sys values to resolve the entire structure. Append the run-time action to the current definition. See CASE for syntax example.


RUN-TIME:   x -

Discard the case selector x and continue execution.


ENDOF                    ANS



   4 of-sys 5 - case-sys 4

Mark the end of the . OF . ENDOF . part of the CASE structure. The next location for a transfer of control resolves the reference given by of-sys. Append the run-time action to the current definition. Add case-sys to be resolved by ENDCASE .


RUN-TIME:      -

Continue execution at the location specified by the consumer of case-sys, i.e. ENDCASE .


ENVIRONMENT?                    ANS


- File #ANS.TDS needed -


ca u - false   or

ca u - ? true


ca is the address of a character string and u is the string's character count. u may have a value 0 to 31. The string should contain an ANS Forth defined keyword to be checked for correspondence with an attribute of the present environment. If the attribute is unknown the returned flag is false; otherwise it is true and a number of stack items represented by  ?  are returned as defined for the attribute queried. False is always returned by the definition included in the file.






Assembler word. The Extended Page Register.




-26 (hex)



CODE ccc . EQ IF, . THEN, .


Assembler word. Condition code for use before IF, WHILE, and UNTIL, - see IF, . The IF, is true when in the status register Z = 1 (zero flag set).


ERASE                    ANS


ca u -


If u is greater than zero, clear all bits in each of u successive addresses of memory beginning at ca.




n -


Display error message, if any, associated with error number n. Then clear the stack. At power-up ERROR is vectored through 'ERROR to execute <ERROR> .


EVALUATE                    ANS


- File #ANS.TDS needed -


?1 ca u - ?2


Save current input source specification, Ensure SOURCE-ID returns -1, make the string ca u the input source, set >IN to zero and interpret. When the source is exhausted restore original source specification. The stack parameter may have changed from ?1 to ?2 during the interpretation.


EXECUTE                    ANS


?1 xt - ?2


Remove execution token xt from the stack and perform the action identified by it. Other stack effects are due to the word that has been EXECUTEd.


EXIT                    ANS


R:   nest-sys -


Return control to calling definition specified by nest-sys. Before executing EXIT within a DO loop a program should discard loop parameters by executing UNLOOP .


EXPECT                    ANS


ca +n -


Like ACCEPT , but saves length of chars received in user variable SPAN .






Assembler instruction, see assembler section and EXTS in Programming Manual. Syntax example:

B R2 EXTS, \ Sign extend

 \ lower byte of R2 to all

 \ 16 bits. Must be byte-size






Assembler instruction, see assembler section and EXTU in Programming Manual. Syntax example:

B R2 EXTU, \ Unsigned

 \ extension of lower byte of

 \ R2, top byte is cleared.

 \ Must be byte-size.






Used to embed assembler within Forth words. See A>F for an example.


FALSE                    ANS


- false


Return a false flag (zero).


FILL                    ANS


ca u char -


If u is greater than zero, store char in each of u successive characters of memory beginning at ca.


FIND                    ANS


ca - ca 0   or

ca - xt 1   or

ca - xt -1


Find definition in the counted string at ca.

 - If not found return ca 0.

 - If found and immediate return xt 1.

 - If not found and not immediate return xt -1


FM/MOD                    ANS


- File #ANS.TDS needed -


d1 n1 - n2 n3


Divide 32-bit signed d1 by 16-bit signed n1 giving 16-bit signed quotient n3 and 16-bit signed remainder n2. Floored division.


FORGET                    ANS


- File #ANS.TDS needed -


Find name, then delete name from the dictionary along with all words afterwards. For example, to forget the definition of the word TASK along with all subsequent ones:


To completely erase the dictionary and start again use COLD . Use of MARKER is the preferred way to cut dictionary back since it more completely restores the state of the TDS2020F at the time it was used.


GET-CURRENT                    ANS


- wid


Return wid, the identifier of the compilation word list.


HERE                    ANS


- ca


Address ca is the data space pointer. At power-up or after ROM it is the next address in the dictionary and after RAM it is the next address in the RAM data space.


HE                    xANS




Sets the numeric conversion base to 16 for hexadecimal input and output.




- aa


A user variable that holds the address of the next character of text during numeric output conversion.


HOLD                    ANS


char -


Add char to the beginning of the pictured numeric output string. Must be used within a <# #> structure.






Sets LCD cursor and/or display to the first position.




hrs.mins.secs -


Use this to set the on-card clock to the correct time. The double number expected is in the format XX.YY.ZZ or XX/YY/ZZ where XX is hrs (0-23), YY is minutes, ZZ is seconds. E.g.

17.08.00 HRS

sets the clock to 5.08pm. This word is automatically used by TDS-PC for Windows at power-up. It sets the clock on the Forth computer to the time in the host PC. Note that each part of the input number must be two digits, made up with zeros if needed.


Go to Triangle Digital Support Home Page Go to top   Next page