Go to Triangle Digital Support Home Page TDS9092 TECHNICAL MANUAL
Forth word list
M* to OVER
Live website search
Enter key words
 

ALPHANUMERIC WORD DEFINITIONS


M*

       n1 n2 - d

d is the 32-bit signed product of 16-bit signed numbers n1 and n2.


M+

       d1 n - d2

Add signed single number n (16 bits) to the underlying signed double number d1 (32 bits) to make a signed double number d2.


M/

       d n1 - n2 n3

Divide 32-bit signed dividend d by 16-bit signed divisor n1 to give signed remainder n2 and signed quotient n3. The remainder takes its sign from the dividend.


M/MOD

       ud1 u2 - u3 ud4

Divide unsigned 32-bit dividend ud1 by unsigned 16-bit divisor u2 to give a 32-bit quotient ud4 and 16-bit remainder u3.


MAX

       n1 n2 - n3

n3 is the greater of n1 and n2.


MESSAGE

       n -

Display message n on the selected output device, normally a terminal on Serial Port 1. On the TDS9092 valid values for n are 0 to 13 (decimal).


MI

       - 2A (hex)

SYNTAX:
CODE cccc . MI IF, . THEN, .
  END-CODE

Assembler word. Condition code for use before IF, WHILE, and UNTIL, - see IF, . The IF, is true when in the status register N = 1 (negative flag set).


MIN

       n1 n2 - n3

n3 is the lesser of n1 and n2.


MINS

       - addr

A system variable forming part of the on-board clock. Contains minutes since midnight (or since power-on if clock has not been set). It is zeroed every 24 hrs, when the variable DAYS is incremented. See TICKS .


MINUS

       n1 -  -n1

n2 is the negation of n1. A preferred identity is NEGATE .


MOD

       n1 n2 - n3

Divide n1 by n2 giving the remainder n3. This has the same sign as n1.


MS

       n -

Suspend for approximately n milliseconds where n is 1 to 32767. This gives delays up to 32 seconds. On the TDS9092 the watchdog timer is serviced and interrupts may occur but nothing else happens. MS depends on software loops and the delay will be longer if interrupted. See also REST and WAIT .

The redefinition in file _TIMING.TDS gives real-time delay from 1 to 65535 milliseconds not based on software loops.


MUL,

       -

Assembler word. Unsigned multiply of accumulators A and B to give a 16-bit result stored in D (A and B put together with A the more significant byte).


N

       - 46 (hex)

Assembler word.  The address is the start of a 7 byte array used by the Forth system for temporary storage.  For example the word ASSIGN used to create a new Forth task assembles code to store the data in the N array to the stack so that it will not be corrupted by the new task.


NEG,

       n -

Assembler word. Negate memory location or accumulator. E.g.

 B NEG,

If B contained 126 it will end up containing -126 (two's complement notation).


NEGATE

       n1 -  -n1

n2 is the negation of n1.


NEWKEY

       - n (0 to 64)

Internally uses INKEY to scan a keyboard in a matrix of up to 8 x 8. See INKEY . Normally returns 0 but gives the key number if that key is different from last time NEWKEY was called. The key number is stored in system variable LASTKEY by this word and so the latest key is always available to the system. E.g.

 : TEST

    BEGIN NEWKEY -DUP

       IF DUP 1 = IF QUIT ELSE .

                  THEN

       THEN

    AGAIN ;

This displays key numbers as each is pressed until key number 1, when the program ends.


NEXT

       - addr

Assembler word. The address returned is a constant which is the entry point into the Forth system. NEXT is used inside  END-CODE and is sometimes needed in the form NEXT JMP, .


NFA

       pfa - nfa

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


NIP

       n1 n2 - n2

Drop the next to the top item from the stack. Equivalent to SWAP DROP .


NMI

       - 081B (hex)

Gives address of jump table entry for Non- Maskable Interrupt.   Usually used before ASSIGN which places at this address a jump to the interrupt code. A negative transition on the NMI* input will always cause this interrupt.


NOP

       -

Do nothing. Used to back-patch Forth code (not recommended).


NOP,

       -

Assembler instruction used for wasting time. E.g.

 NOP,


NOT

       n - f

If n is true (non-zero) then flag f=0, otherwise f=1. It is exactly the same as 0= . See also 0=0= .


NOT,

       -

SYNTAX:

CODE cccc .
   MI NOT, IF, 
. THEN, .    
END-CODE

Assembler word. Negates the effect of a condition code immediately

preceding it.  See STRUCTURED CONTROL IN ASSEMBLER.


NOW

       day.month.year -
      

Use this to set the date. The double number expected is in the format XX.YY.ZZ where XX is the day, YY the month and ZZ the year. E.g.

 23.06.95  NOW

sets 23rd June 1995. Note that each element must be two digits, made up with zeros if necessary. The development software TDS-PC uses this word on initialisation to set the clock in the TDS9092 to that in the user's PC.


NUMBER

       addr - d

The default action of this word is shown under <NUMBER> . The action of NUMBER is that of the word whose cfa is stored in 'NUMBER and so it can be changed. To do this make a new definition and vector it through 'NUMBER as shown:

 : NUMBER ..   etc ;

 ' NUMBER   CFA    'NUMBER !

When NUMBER is called it will now execute NUMBER instead of  <NUMBER> .


NY

       -

Sets editor control codes to match Newbury 8009 and some other dumb terminals.


OCI

       - 080F (hex)

Gives address of jump table entry for Timer 1 Output Compare Interrupts.  Usually used before ASSIGN which places at this address a jump to the interrupt code.  To enable interrupt  1 set bit 3 of the TCSR1 at address 08, and to enable interrupt 2 set bit 3 of the TCSR2 at address hex 0F.


OF

       n1 - n2

Part of a CASE structure. See CASE .


OFFSET

       - addr

A user variable whose contents are added to block and screen number requests.


OIM,

       addr imm -

Assembler word. Logically OR immediate data with the content of a memory location.

E.g.

 $8000 8 ## OIM,

will set bit 3 of the address hex 8000.


ONOFF

       - addr

An LCD user variable.  Returns address where a flag is kept.  If the flag is 1 the display is visible, if 0 it is not. Use DISPLAY-SET to send the flag to the LCD.  ONOFF is initialise to 1 at power-up and by COLD but is not changed by reset or re-start by the watchdog. E.g.

 0 ONOFF !   DISPLAY-SET

turns off display. Useful for creating flashing messages.


OR

       n1 n2 - n3

n3 is the bit by bit inclusive-or of n1 and n2.


ORA,

       n -

Assembler word. Logically OR immediate or memory content to accumulator. E.g.

 $9000 A ORA,

ORs the content of address hex 9000 with the content of accumulator A.


OUT

       - addr

A user variable incremented by EMIT and reset to zero by CR . It will normally contain the current output column number which the user can examine to control display formatting.


OVER

       n1 n2 - n1 n2 n1

Copy the second stack value to the top of the stack.

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