Go to Triangle Digital Support Home Page TDS2020F TECHNICAL MANUAL
Forth word list
T* to USER
Live website search
Enter key words
 

T*

 

ud u - ut

 

Multiplies an unsigned double number ud (32-bit) by an unsigned single number u (16-bit) to form an unsigned triple number ut (48-bit). See D*S D/ D/S M* T/ .

 

T/

 

ut u - ud

 

Divides an unsigned triple number ut (48-bit) by an unsigned single number u (16-bit) to form an unsigned double number ud (32-bit). See also D*S D/ D/S M* T* .

 

TAS,

 

-

 

Assembler instruction, see assembler section and TAS in Programming Manual. Can be used in implementing semaphores to control shared resources in system with multiple tasks. Syntax example:

B $FF00 )) TAS, \ Test byte

 \ at hex FF00, then set

 \ bit 7 to 1

 

THEN                    ANS

 

COMPILATION:   orig 2 -

Resolve the forward reference orig, using the location following the appended execution action.

 

RUN-TIME:   -

Continue execution.

 

THEN,

 

addr -

 

Assembler word, used in an IF, . ELSE, . THEN, structure. See IF, . It uses addr left by IF, to fix up the branch instruction assembled at IF, or at ELSE, . Use only in a CODE definition.

 

THROW                    ANS

 

?3 0 - ?3   or

?3 n - ?4 n

 

-If error code n is zero this is a no-operation.

 

-If error code n is non-zero and there is a CATCH at a higher level which has not terminated (e.g. on TDS2020F the one inside QUIT ) then:

Pop the topmost exception frame along with everything on the return stack above that frame. Then restore the input source specification in use before the corresponding CATCH and adjust the depths of the two stacks to those stored in the exception frame (?4 is the same value in CATCH and THROW ), put n on the data stack and transfer control to just after the CATCH that pushed the exception frame.

 

-If n is non-zero and there is not a CATCH at a higher level, as might happen in a stand-alone system if the structure recommended in THE INDEFINITE LOOP, page 233 is not followed:

Display the message associated with n as described under ERROR , then fall into the interactive Forth system by executing START and so falling into QUIT .

 

See OPERATION OF CATCH AND THROW, page 146.

 

TIB                    ANS

 

- ca

 

ca is the address of the terminal input buffer.

 

TICKS

 

- aa

 

A user variable forming part of the on-board clock. At power-up the Timer 3 Overflow Interrupt is configured to increment address addr 1125 times per minute. On the minute it is zeroed and the MINS system variable is incremented. After 1440 minutes (60  x  24) the DAYS variable is incremented. Words like .TIME (display current time) take their input from these three system variables. Another option is to have TICKS incremented once per second by the Non-Masked Interrupt from the PCF8583 clock chip. The choice depends on bit 1 of address hex FD05. If the bit is clear there are 1125 ticks/min and if set 60 ticks/min.

 

TIME&DATE                    ANS

 

- +n1 +n2 +n3 +n4 +n5 +n6

 

Return current date and time in the order n1 to n6: Second, Minute, Hour, Day, Month, Year. The year is a binary number equivalent to 4 digits, e.g. 2002 and is valid up to 2072.

 

TO                    ANS

 

Use TO and VALUE as a faster and neater way to implement variables.

 

INTERPRETATION:

x '<spaces> name' -

Store x in variable 'name'. If name was not defined by VALUE an 'UNDEFINED' error is generated.

 

COMPILATION:   '<spaces> name' -

Append the run-time action below to the current definition. If name was not defined by VALUE an 'UNDEFINED' error is generated.

 

RUN-TIME:   x -

Store x in name.

 

TOGGLE

 

ca char -

 

Exclusive 'or' char with bit pattern in the byte whose address is on top of the stack.

 

TPR

 

-

 

An assembler word. The Stack Page Register.

 

TRAP/VS,

 

-

 

Assembler instruction, see assembler section and TRAP/VS in Programming Manual. Syntax example:

TRAP/VS, \ Exception if

 \ overflow flag V set. Jumps

 \ to address 8809 (4009

 \ with TDS2020DV) in

 \ interrupt jump table

 

TRAPA,

 

-

 

Assembler instruction, see assembler section and TRAPA in Programming Manual. Another name for a software interrupt. Syntax example:

4 ## TRAPA, \ Trap Always to

 \ trap number 4, which will

 \ cause a jump to hex 8821

 \ (4021 with TDS2020DV) in

 \ interrupt jump table

 

TRUE                    ANS

 

- true

 

Return a true flag, a single-cell value with all bits set (-1).

 

TST,

 

-

 

Assembler instruction, see assembler section and TST in Programming Manual. Syntax examples:

R2 TST, \ Test register 2,

 \ setting condition codes V

 \ and C to 0 and N to Z as

 \ found in R2

0 @R7 TST, \ Same with word

 \ on top of stack

 

TUCK                    ANS

 

x1 x2 - x2 x1 x2

 

Copy the first stack item below the second stack item.

 

TYPE                    ANS

 

ca u -

 

If u is greater than zero, display the character string specified by ca and u. On the TDS2020F this is achieved using EMIT which can be redirected, allowing the string to be displayed on any device. At power-up the string is sent to serial Port 1.

 

U.                    ANS

 

u -

 

Display an unsigned 16-bit number u followed by a space.

 

U.R                    ANS

 

u n -

 

Display u right-aligned in a field n characters wide. If the number of characters required to display u is greater than n, all digits are displayed with no leading spaces in a field as wide as necessary.

 

U<                    ANS

 

u1 u2 - flag

 

Flag is true if u1 is less than u2.

 

U>                    ANS

 

u1 u2 - flag

 

Flag is true if u1 is greater than u2.

 

UM*                    ANS

 

u1 u2 - ud

 

Multiply 16-bit unsigned u1 by 16-bit unsigned u2 giving 32-bit unsigned product ud.

 

UM/MOD                    ANS

 

ud u1 - u2 u3

 

Divide 32-bit unsigned ud by 16-bit unsigned u1 giving 16-bit unsigned quotient u3 and 16-bit unsigned remainder u2.

 

UNLINKFP,

 

-

 

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

UNLINKFP, \ Unlink frame

  \ pointer, see LINKFP,

 

UNLOOP                    ANS

 

R:    n1 n2 -

 

Discard the loop-control parameters for the current nesting level. An UNLOOP is required for each DO . LOOP nesting level before the definition may be EXITed.

 

UNTIL                    ANS

 

COMPILATION:   dest 1 -

Append the run-time action below to the current definition, resolving the backward reference dest.

 

RUN-TIME:   x -

If x is zero continue execution at the location specified by dest.

 

UNTIL,

 

addr -

 

Assembler word. Used in the structure: BEGIN, xx UNTIL, . The xx is one of seven condition codes, see IF, . It can be followed by N to complement the condition. E.g.

CODE 8*  3 ## R3 MOVI,

 BEGIN, 0 @R7 SHAL, R3 DEC,

 EQ UNTIL, END-CODE

The word 8* will multiply the top of the stack by 8 using 3 16-bit left shifts. Use only in a CODE definition.

 

UNUSED                    ANS

 

- u

 

u is the number of bytes remaining in the region addressed by HERE . At power-up or after ROM this is dictionary space and after RAM it is RAM data space.

 

USA

 

-

 

Once USA has been executed the following date words will adopt the USA format of month.day.year, e.g.

12.25.02 DMY NOW (DATE) .DATE

It can be reversed by

$FD05 0 ZERO

 

USER

 

n '<spaces>name' -

 

Create a definition for name. Reserve one cell in the unique USER area for this particular task. In the TDS2020F there are nine free USER variables, starting with $50 USER xxxx in the default OPERATOR task, but other tasks can be allocated any number of USER variables. See PRE-EMPTIVE MULTITASKING, page 189.

 

name EXECUTION:   - aa

aa is the address of the reserved cell. A program should initialise its contents.

 

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