Go to Triangle Digital Support Home Page TDS2020F TECHNICAL MANUAL
Forth word list
0 to 3
Live website search
Enter key words
 

 

0

 

- 0

 

Used so often that zero is defined as a constant.

 

0<                    ANS

 

n - flag

 

Flag is true if n is less than zero.

 

0<>                    ANS

 

x - flag

 

Flag is true if n is not zero, and flag is false if n is zero. The true/false status of the item on the stack is unchanged but 0<> may be necessary before a logical operation. E.g.

: TEST

  81A0 C@ 4 AND 0<>

  81B0 C@ 8 AND 0<> AND ;

This returns true if both bit 2 of input 81A0 and bit 3 of 81B0 are both logic 1. 0<> is equivalent to 0= 0= .

 

0=                    ANS

 

x - flag

 

Flag is true if x is equal to zero.

 

0>                    ANS

 

n - flag

 

Flag is true if n is greater than zero.

 

0AT

 

-

 

Used with LCD displays. Clears the user variable AT which determines where the next character on the LCD will be written. Sets the first position.

 

0TIME

 

-

 

Uses Free Running Timer 3. Use only in a colon definition together with ?TIME to measure execution time of a word in microseconds. Will not upset timekeeping of on-board clock. See ?TIME .

 

1

 

- 1

 

Used so often that one is defined as a constant.

 

1+                    ANS

 

n1 - n2   or

u1 - u2

 

Add 1 to n1 or u1 giving the sum n2 or u2.

 

1-                    ANS

 

n1 - n2   or

u1 - u2

 

Subtract 1 from n1 or u1 giving the difference n2 or u2.

 

2

 

- 2

 

Used so often that two is defined as a constant.

 

2!                    ANS

 

x1 x2 aa -

 

Store the 32-bit pair x1 x2 at aligned address aa with x2 at aa and x1 at aa+2.

 

2*                    ANS

 

x1 - x2

 

x2 is the result of shifting x1 one bit left, filling the vacated least significant bit with zero.

 

2+

 

n1 - n2   or

u1 - u2

 

Add 2 to n1 or u1 giving the sum n2 or u2.

 

2-

 

n1 - n2   or

u1 - u2

 

Subtract 2 from n1 or u1 giving the difference n2 or u2.

 

2/                    ANS

 

x1 - x2

 

x2 is the result of shifting x1 one bit right, leaving the most significant bit unchanged.

 

232OFF

 

-

 

Disconnect power from RS232 driver chip.

 

232ON

 

-

 

Connect power to RS232 driver chip.

 

2>R                    ANS

 

EXECUTION:   x1 x2 -   R: - x1 x2

Transfer cell pair x1 x2 to the return stack. Equivalent to SWAP >R >R .

 

2@                    ANS

 

aa - x1 x2

 

Fetch the 32-bit pair x1 x2 from aligned address aa. x2 is stored at aa and x1 at aa+2.

 

2CONSTANT                    ANS

 

d '<spaces>name' -

 

Create a definition for name with the execution action defined below.

 

name EXECUTION:   - d

Place d on the stack.

 

2DEC,

 

-

 

Assembler instruction, see assembler section and ADD:Q in Programming Manual. ADD:Q # -2 in Hitachi code.

Syntax examples:

R2 2DEC, \ Subtract 2 from

         \ register 2

B $FF00 )) 2DEC, \ Subtract

         \ 2 from byte at

         \ address hex FF00

 

2DROP                    ANS

 

x1 x2 -

 

Drop the 32-bit pair x1 x2 from the stack.

 

2DUP                    ANS

 

x1 x2 - x1 x2 x1 x2

 

Duplicate the 32-bit pair x1 x2.

 

2INC,

 

-

 

Assembler instruction, see assembler section and ADD:Q in Programming Manual. ADD:Q # 2 in Hitachi code. Examples:

R2 2INC, \ Add 2 to

         \ register 2

B $FF00 )) 2INC, \ Add 2 to

     \ byte at address FF00

 

2LITERAL                    ANS

 

COMPILATION:   d -

Append the run-time action to current definition.

RUN-TIME:   - d

Place d on the stack.

 

2OVER                    ANS

 

x1 x2 x3 x4 - x1 x2 x3 x4 x1 x2

 

Copy the 32-bit pair x1 x2 to the top of the stack.

 

2R>                    ANS

 

EXECUTION:   - x1 x2   R:   x1 x2 -

Transfer cell pair x1 x2 from the return stack. Equivalent to R> R> SWAP .

 

2R@                    ANS

 

EXECUTION:  - x1 x2 R: x1 x2 - x1 x2

Copy cell pair x1 x2 from return stack to data stack. Equivalent to

R> R> 2DUP >R >R SWAP

 

2ROT                    ANS

 

d1 d2 d3 - d2 d3 d1

 

Rotate the top three cell pairs.

 

2SWAP                    ANS

 

x1 x2 x3 x4 - x3 x4 x1 x2

 

Exchange the top two 32-bit pairs.

 

2VARIABLE                    ANS

 

'<spaces>name' -

 

Create a definition for name. Reserve two cells of data space (uninitialised at compile-time).

name EXECUTION:   - aa

aa is the address of the first, lowest addressed, reserved cell. A program should initialise the contents.

 

3

 

- 3

 

Used so often that three is defined as a constant.

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