Go to Triangle Digital Support Home Page TDS9092 TECHNICAL MANUAL
Forth word list
PAD to RTS,
Live website search
Enter key words
 

ALPHANUMERIC WORD DEFINITIONS


PAD

       - addr

Leave the address of a transient region which can be used to hold data for intermediate processing. The position of this area is altered if new definitions are made or deleted. The Forth system itself never uses this area.


PAGE

       -

Sets the cursor to the top left of the screen and clears the display. If this does not work see HOME .


PFA

       nfa - pfa

Convert the name field address (nfa) of a definition to its parameter field address (pfa).


PICK

       N - n

Take the Nth item on the stack (not including N) and place it on top of the stack. For example 2 PICK is equivalent to OVER . Use of PICK is sometimes bad Forth. Try splitting the definition to reduce the number of items on the stack.


PREV

        - addr

A variable containing the address of the buffer most recently accessed. The UPDATE command marks this buffer to be later written to mass memory.


PRIME

       -

Initialises an alphanumeric LCD which uses driver chip HD44780 internally. PRIME is essential before using any other Forth words. Before using, check that the values set in the variables LCDKIND I/D SH ONOFF CURSOR and BLINK are those needed. See each of these words for full details.


PSHA,

       -

Assembler word. Push accumulator A onto the stack. Note that this is 8 bits only and another byte will be needed to make up one Forth item.


PSHB,

       -

Assembler word. Push accumulator B onto the stack. Note that this is 8 bits only and another byte will be needed to make up one Forth item.


PSHD,

       -

Assembler macro. Push accumulators B then A to the stack, i.e. register D.


PSHX,

       -

Assembler word. Push register X onto the stack.


PULA,

       -

Assembler word. Pull accumulator A from the stack. Note that this is 8 bits only and another byte will be needed to remove one Forth item.


PULB,

       -

Assembler word. Pull accumulator B from the stack. Note that this is 8 bits only and another byte will be needed to remove one Forth item.


PULD,

       -

Assembler macro. Pull accumulators A then B from the stack, i.e. register D.


PULX,

       -

Assembler word. Pull register X from the stack.


PUSHBA

       - addr

Assembler word. The address returned is a constant which an entry point into the Forth system which first pushes accumulators B, then A then executes NEXT . Use it to end a CODE definition in this way in place of END-CODE : E.g.

 PUSHBA JMP, SMUDGE


PUT

       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 code field address (cfa) 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 .


QUERY

       -

Input 80 characters of text (or until a return) from the operator's terminal (Serial Port 1 by default at power-up). Text is placed at the address contained in the user variable TIB and the pointer user variable IN is set to zero.


QUIT

       -

Clear the return stack, set interpret state, accept new input from the current input device and begin interpretation. No message is displayed.


R

       - n

Copy n from the return stack to the data stack.


R#

       - addr

A user variable which may contain the location of an editing cursor or other file-related function.


R/L

       -

An LCD user variable.  Returns address where a flag is kept.  If the flag is 1, SHIFT will cause a right shift of the message, if 0 a left one.  R/L is initialised to 1 at power-up and by COLD but is not changed by reset or by re-start by the watchdog.  E.g.

 0 R/L ! SHIFT

moves the LCD one place left.  See S/C and SHIFT .


R/W

       addr  blk  f -

At power-up R/W is vectored to execute <R/W> . R/W is the primitive which controls all access to mass storage.  See <R/W> .


R0

       - addr

A user variable containing the initial location of the return stack. See RP! .


R1BIT

       - f

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! .


R1BYTE

       - b

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! .


R>

       - n

Move n from return stack to the data stack.


RB

       - addr

A user variable needed by RBAUD , but not normally useful otherwise. It returns the address where is stored a double number related to the second serial port. See library program _SERIAL2.TDS.


RBAUD

       -

Sets the receive baud rate for the second serial port, available on pins SIN2 and SOUT2. It is independent of the transmit baud rate. E.g.

 1200 RBAUD   75 TBAUD

to set Prestel rates. Non-standard baud rates can be used. See also *EMIT   *(KEY)  *?TERMINAL  TBAUD .


RECURSE

       -

SYNTAX: : cccc . RECURSE . ;
   ( RECURSE executes cccc )

Allows recursion. This is an immediate word which compiles the code field address (cfa) of the word currently being defined. 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.


REPEAT

       addr n -
       -

SYNTAX:  : cccc .
   BEGIN . WHILE . REPEAT . ;

COMPILING: At compile-time REPEAT compiles BRANCH and the offset from HERE to addr. n is used for error checking.

EXECUTING: At run-time forces an unconditional branch back to just after the corresponding BEGIN .


REPEAT,

       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, .


REST

       n -

On the TDS9092 delay by n x 3.26�s approx. The watchdog timer is not serviced so use only for delays up to 106ms. Over this use WAIT or MS .


RETURN;

       -

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 RTI instruction at the end of the interrupting word. ASSIGN and LATER have examples.


RIGHT

       -

Moves the terminal cursor right one position. If this does not work see HOME .


ROL,

       n -

Assembler word. Rotate left accumulator or memory location. Carry bit goes into bit 0 and bit 7 is moved into the carry. E.g.

 B ROL,

rotates accumulator B left.


ROLL


     
n -

Rolls nth item on stack to the top, others move down one place. Its use is not good Forth. Try splitting the definition so that the stack depth is not so great.


ROR,

       n -

Assembler word. Rotate right accumulator or memory location. Carry bit goes into bit 7 and bit 0 is moved into the carry. E.g.

 $8000 ROR,

rotates right the content of address hex 8000.


ROT

       n1 n2 n3 - n2 n3 n1

Rotate the top 3 stack entries.


RP

       - 44 (hex)

Assembler word.  The address provided contains the pointer to the Forth system return stack.


RP!

       -

Initialise the return stack pointer from the user variable R0 . Clears the return stack.


RTI,

       -

Return from Interrupt assembler instruction ending a code definition which makes that definition an interrupt routine. E.g.

 RTI,  SMUDGE


RTS,

       -

Return from Subroutine assembler instruction ending a code definition which makes that definition a subroutine. E.g.

 RTS,  SMUDGE

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