ca is the address of a transient region of RAM memory that can be used to hold data for intermediate processing.
Sets the cursor to the top left of the screen and clears the display by sending the ASCII character hex 0C.
char 'ccc<char>' - ca u
Parse ccc delimited by char. ca is the address within the input buffer and u is the length of the parsed string. If the parse area was empty u = 0.
Suspends current task and passes to next activated one in round-robin multitasking. In assembler this is
DECIMAL 13 ## TRAPA,
There is no action until the multitasker files are compiled.
char ca -
Store char at address ca synchronising the store with the E clock. The unused higher-order bits are all zeros.
ca - char
Fetch char from address ca synchronising the fetch with the E clock. The unused higher-order bits are all zeros.
? u - ? x
Remove u. Copy '(u+1)th' item to the top of the stack. 0 PICK is equivalent to DUP and 1 PICK is equivalent to OVER etc.
Assembler instruction, see assembler section and PJMP in Programming Manual. Syntax examples:
0 @R2 PJMP, \ Page jump to
\ address in registers R2
\ and R3, lower byte of R2
\ to code page register and
\ R3 to program counter
HEX F1234. PJMP, \ Page jump
\ to extended address F1234,
\ i.e. address 1234 in
\ page F
Assembler instruction, see assembler section and PJSR in Programming Manual. Syntax example:
HEX F1234. PJSR, \ Jump to
\ subroutine at extended
\ address F1234, i.e.
\ address 1234 in page F
ca1 u ca2 -
Take string at ca1 extending for u characters and put as counted string at ca2.
Defer execution compilation behaviour of name until run-time.
blink cursor on/off sh id lcdkind -
Initialises an alphanumeric LCD which uses driver chip HD44780 internally. PRIME is essential before using any other LCD words. The parameters needed are:
Sets the general interrupt priority level in the H8/532 microprocessor's status register.
0 = All interrupts enabled
7 = All interrupts disabled (except NMI)
Note that as well as this general enable, each interrupt also has its own enable bit and each interrupt group has its priority level register. An interrupt will only succeed if (i) It has its enable bit set (ii) The priority level for its group is equal to or above that set in the status register by PRIORITY .
Assembler instruction, see assembler section and PRTD in Programming Manual. Syntax examples:
B 8 ## PRTD, \ Page return
\ from subroutine and
\ deallocate 8 bytes of
\ stack by adding 8 to R7
$100 ## PRTD, \ Same but
\ deallocates hex 100 bytes
Assembler instruction, see assembler section and PRTS in Programming Manual. Syntax example:
PRTS, \ Page return from
\ subroutine that was
\ called with PJSR,
c n -
The character c is written to position n on the LCD. n = 0 for the most left position. PUT calls <PUT> through a user variable 'PUT which is set with the execution token of <PUT> at power-up or when COLD is executed. For certain LCDs it is necessary to point 'PUT at a user-defined version so that PUT will correctly address the particular LCD. See 'PUT <PUT> and AT .
Make user input the input source. Receive input into the terminal input buffer. Set terminal input buffer offset >IN to zero.
Clear return stack and enter text interpreter. This is the executing loop when you are interactively accessing Forth.
For I2C bus peripherals. Takes one bit from an I2C peripheral device. Sets clock to output and data to input, issues a clock pulse and reads the data in while the clock is at logic 1. See I2C! .
For I2C bus peripherals. Inputs one byte from an I2C device. Sets clock to output and data to input then issues 8 positive-going clock pulses, reading the data in each time the clock is at logic 1. This is formatted to the output byte. See I2C! .
EXECUTION: - x R: x -
Move x from the return stack to the data stack. Use should normally be balanced by >R in the same definition.
- x R: x - x
Copy x from return stack to data stack.
Choose the RAM data space when working with the words , ALIGN ALLOT C, CREATE HERE UNUSED
Append the execution action of the current definition to the current definition. E.g.
: TEST ." Another time "
1- ?DUP IF RECURSE THEN ;
Now try 4 TEST and 10 TEST to get the message the appropriate number of times.
- File #ANS.TDS needed -
Attempt to fill the input buffer from the input source, returning a true flag if successful. If the source is user input, set >IN to zero and return true flag. If the source is a string from EVALUATE return false and perform no other action.
COMPILATION: orig 2 dest 1 -
Append the run-time action below to the current definition, resolving the backward reference dest. Resolve the forward reference orig using the location following the appended execution action.
Unconditionally continue execution at the location specified by dest.
addr1 addr2 -
Assembler word. Ends the structure:
BEGIN, . xx WHILE, . REPEAT,
The addr1 and addr2 are used to assemble a branch at REPEAT, back to the start at BEGIN, and to fix up a branch left at WHILE, to make it go to after REPEAT, if the condition code xx is not true. See BEGIN, WHILE, IF, . Use only in a CODE definition.
Delay by approximately u x 0.8�s (u x 2.0�s using TDS2020DV). Neither of the two watchdogs is serviced so use only for delays up to 106ms. Over this use WAIT or MS .
- File #ANS.TDS needed -
xn.x1 n - flag
Restore the input source described by x1 to xn. Flag is true if the source cannot be restored.
Used instead of ; to end a high-level Forth word which is to execute on interrupt, and which will be the subject of an ASSIGN statement. RETURN; compiles code which will restore the main task when the interrupt is over and also compiles the RTE instruction at the end of the interrupting word. ASSIGN & LATER have examples.
?1 u - ?2
Remove u. Rotate u+1 items on top of the stack. For example
Here we work with 4 items (3 being the top number on the stack, which is then discarded). ROLL picks the lowest of the 4 items, here the number 3, and places it on top of the stack. The other 3 items get pushed down one place. Use of ROLL is generally not good Forth, try splitting the current definition into two or more parts.
Choose the dictionary data space when working with the words , ALIGN ALLOT C, CREATE HERE UNUSED
x1 x2 x3 - x2 x3 x1
Rotate the top three stack entries.
Assembler instruction, see assembler section and ROTL in Programming Manual. Syntax example:
B $FF00 ROTL, \ Rotate byte
\ at hex FF00 left with bit
\ 7 copied to carry bit
Assembler instruction, see assembler section and ROTR in Programming Manual. Syntax example:
R3 ROTR, \ Rotate R3 right
\ with bit 0 copied
\ to carry bit
Assembler instruction, see assembler section and ROTXL in Programming Manual. Syntax example:
B $FF00 ROTXL, \ 9-bit rotate
\ left of byte at hex FF00
\ including the carry bit
Assembler instruction, see assembler section and ROTXR in Programming Manual. Syntax example:
R3 ROTXR, \ 17-bit rotate
\ right of register 3,
\ including the carry bit
Set return stack pointer to address aa.
Address containing base of return stack.
Get return stack pointer address aa.
x1 u - x2
Logically right shift x1 u places, giving x2. Put zero into the most significant bits vacated by the shift. Not the same as a two's complement divide.
Assembler instruction, see assembler section and RTD in Programming Manual. Syntax examples:
B 8 ## RTD, \ Return from
\ subroutine and deallocate
\ 8 bytes of stack by
\ adding 8 to R7
$100 ## RTD, \ Same but
\ deallocates hex 100 bytes
Assembler instruction, see assembler section and RTE in Programming Manual. Syntax example:
RTE, \ Return from
\ exception or interrupt
Assembler instruction, see assembler section and RTS in Programming Manual. Syntax example:
RTS, \ Return from subroutine
An assembler word. Rx stands for any register R0 to R7 and is used as part of an assembler instruction. Registers R5 and R6 must be saved then restored at the end if needed in a CODE word. In interrupts, save and restore any of R2 R3 R4 R5 and R6 that will be used. RO will compile without showing an error but will not work -.be sure to type R0 for register 0. Register allocation of the Forth is: