TDS9092 ALPHANUMERIC WORD DEFINITIONS
Used so often that zero is defined as a constant.
n - f
Leave a true flag if the number is less than zero (i.e. negative), otherwise leave a false flag.
n - f
Leave a true flag if the number is equal to zero, otherwise leave a false flag.
n - f
Flag f is 1 if n is not zero, and f is 0 if n is zero. The true/false status of the item on the stack is unchanged but 0=0= may be necessary before a logical operation. E.g.
01A0 C@ 4 AND 0=0=
01B0 C@ 8 AND 0=0= AND ;
This returns true if both bit 2 of input 01A0 and bit 3 of 01B0 are both logic 1. 0=0= is equivalent to 0= 0= or NOT NOT .
n - f
Leave f=1 if the number n is greater than zero, otherwise f=0.
Used with LCD displays. Clears the user variable AT which determines where the on the LCD the next character will be written. Sets the first position.
The run-time procedure to conditionally branch. If f is false (zero), the following in-line parameter is added to the interpretative pointer to branch ahead or back. Compiled by IF UNTIL and WHILE .
Uses free-running 16-bit timer. Use only in a colon definition together with ?TIME to measure execution time of a word in microseconds. Will upset timekeeping of on-board clock. See ?TIME .
Used so often that one is defined as a constant.
n - n+1
Increment n by 1. (faster than 1 + ).
n - n-1
Decrement n by 1. (faster than 1 - ).
Used so often that two is defined as a constant.
d addr -
Store double number d at address addr.
n1 - n2
Multiply n1 by 2 to leave n2. Faster than using 2 * .
n - n+2
Add 2 to n. (faster than 2 + ).
n - n-2
Subtract 2 from n. (faster than 2 - ).
n1 - n2
Divide n1 by 2 to leave n2. Faster than using 2 / .
Turns off the RS232 serial driver and DC-DC converter chip by setting bit 7 of port 2 to logic 1. This can save power when the serial interfaces are not in use.
Turns on the serial RS232 driver and DC-DC converter by setting bit 7 of port 2 to logic 0. It is in this state at power-up but 232OFF can be used to save power when serial ports are not needed.
n1 n2 -
Puts two single numbers (or one double number) from the stack to the return stack. Must be matched with 2R> . Not the same as >R >R which would put the items the other way round on the return stack. See 2R> and 2R .
addr - d
Fetch double number d from address addr.
1234567. 2CONSTANT TEST
Defining word to associate a name with a 32-bit constant. When the example word TEST executes it leaves the double number (32-bit) 1234567 on the stack.
n1 n2 -
Drops two numbers from the stack. Can also be considered to drop one double number (32 bits).
n1 n2 - n1 n2 n1 n2
Duplicates top two numbers on the stack. Can also be considered to duplicate a double number.
d1 d2 - d1 d2 d1
Copies second pair of number to top of stack. Can also be considered to perform OVER on two double numbers.
- n1 n2
Copies two numbers (or one double number) from the top of the return stack to the parameter stack.
- n1 n2
Transfers two numbers (or one double number) from the return stack to the parameter stack. It must be preceded by 2>R . Not the same as R> R> which would take the items the other way round from the return stack. See 2>R and 2R .
d1 d2 d3 - d2 d3 d1
Rotates top three double numbers on the stack. The lowest one is brought to the top.
Swaps two pairs of numbers on the stack. Can also be considered to swap two double numbers (32-bit).
SYNTAX: d 2VARIABLE cccc
COMPILING: Creates a dictionary entry for cccc and reserves 32 bits of space, which at compile-time is initialised to d. The position of the two cells is in line with the dictionary so don't use this word in a stand-alone system where it will end up in ROM.
EXECUTING: At run-time the address of the first of 4 reserved bytes is returned. The application is responsible for initialising the contents of the reserved memory.
Used so often that three is defined as a constant.