Go to Triangle Digital Support Home Page TDS9092 TECHNICAL MANUAL
Forth word list
C! to CURSOR
Live website search
Enter key words
 

ALPHANUMERIC WORD DEFINITIONS


C!

       b addr -

Store byte b at address addr.


C+!

       b addr -

Add lower byte of the second item on the stack to the byte at addr.


C,

       b -

Store byte b into the next available dictionary byte, advancing the dictionary pointer. See also and DP .


C/L

       - 64

This constant leaves the number of characters on an editing line.


C@

       addr - b

Fetch byte b from address addr.


CASE

       n -

Start of a CASE structure allowing a series of different operations dependent on the number input to the structure. The general form is:

 : TEST
    CASE w OF
. ENDOF
         x OF
. ENDOF
         y OF
. ENDOF
        
 . (more if needed) .
         R nx cond IFCASE 
. ENDOF
          
. (default if not any of above) .
ENDCASE

nx represents possible value(s) of n.  cond is any conditional such as > = or < . For example try this:

 : TEST

    CASE 1 OF ." 1st case"

           ENDOF

         2 OF ." 2nd case"

           ENDOF

         3 OF ." 3rd case"

           ENDOF

         R 10 < IFCASE

            ." 4th to 9th case"

           ENDOF

         ." not 1st to 9th case"

  ENDCASE ;


CBA,

       -

Assembler word. Compare accumulators B and A.


CFA

       pfa - cfa

Convert the parameter field address (pfa) of a definition to its code field address (cfa).


CFIGM

       - addr

A variable which holds the same content as the Port A and Port B configuration register. This register at address 01F0 is write only, it cannot be read back. Because of this is it useful to keep a copy in RAM so that one bit can be changed without affecting others. At power-up the content of CFIGM and the real configuration register is 00. Bits are allocated as follows:

Bit0:

0=Port A input

1=Port A output

Bit1:

0=Port B input

1=Port B output or keyboard

Bit2:

0=Not keyboard

1=Kbd mode

Other bits are unused. See INKEY   NEWKEY . E.g.

 CFIGM @ 2 OR DUP CFIGM !
 $01F0 C!

This sets Port B to be an output.


CIF

       -

Sets up editor control codes to match some Cifer dumb terminals.


CLC,

       -

Assembler word. Clears Carry flag.


CLI,

       -

Assembler word. Clear interrupt mask flag to allow interrupts.


CLIT

       -

May be compiled before an 8-bit literal in the Forth dictionary. At run-time the value of the literal is pushed on the stack.


CLR,

       n -

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

 B CLR,

will clear accumulator B.


CLRD,

       -

Assembler word. A macro which assembles A CLR,  B CLR, . Convenient for clearing the 16-bit D register (concatenated A and B).


CLV,

       -

Assembler word. Clears two's complement overflow flag.


CMI

       - 0803 (hex)

Gives address of jump table entry for Timer 2 Counter Match Interrupt.  Usually used before ASSIGN which places at this address a jump to the interrupt code.  To enable this interrupt set bit 6 of the Timer Control/Status Register 3 at addr 1B.


CMOVE

       from  to  count -

Move the specified number of bytes beginning at address 'from' to address 'to'. The content of address 'from' is moved first proceeding towards high memory. If source and destination address areas overlap use this to move to lower memory addresses, otherwise use CMOVE>  .


CMOVE>

       from  to  count -

Move the specified number of bytes beginning at address 'from' to address 'to'. The content of address 'to' is moved first proceeding towards low memory. If source and destination address areas overlap use this to move to higher memory addresses, otherwise use CMOVE .


CMP,

       n -

Assembler word. Compare immediate or memory content to accumulator. E.g.

 123 ## B ADD,

compares 123 to the content of accumulator B.


CODE

       -

Start of definition of a Forth word which is defined in assembler language and runs at machine code speed. E.g.

 CODE 4*

    PULD, ASLD, ASLD, PSHD,

 END-CODE

This example multiplies the top of the stack by 4 (using two 16-bit left shifts).


COLD

       -

The cold start procedure which deletes all user-defined definitions and restarts via ABORT . Unlike the power-up situation COLD does not (i) zero the real-time clock (ii) reset mass memory area defined for use as screens and blocks (iii) blank screens or (iv) change terminal type in use.


COM,

       n -

Assembler word. complement each bit of accumulator or memory address. E.g.

 B COM,

If B initially contained binary 00110111 it would be changed to 11001000.


COMD,

       -

Assembler word. A macro which assembles  A COM,  B COM, . Convenient for inverting the 16-bit D register (concatenated A and B).


COMPILE

       -

SYNTAX:
: cccc   .   COMPILE nnnn  .   ;

When the word cccc containing COMPILE executes, the execution address of nnnn is copied (compiled) into the dictionary. This allows compilation to be deferred until run-time.


CONSTANT

       n -
       - n

SYNTAX: n CONSTANT cccc

COMPILING: Creates a word cccc with its parameter field containing n.

EXECUTING: When cccc is executed it will push the value n on to the stack.


CONTEXT

       - addr

A user variable containing a pointer to the vocabulary first used for dictionary searches.


COPY

       n1 n2 -

Copies screen n1 to screen n2.  n1 and n2 must be 1 to 13 since the TDS9092 has just 13 screens, otherwise the error message  ? - MEM  RANGE  will occur.


COS

       n1 - n2

Used for fractional arithmetic. Converts n1 representing a fraction in radians, to n2 representing a fraction which is the cosine of the angle.  Range is 0 to pi/4.  See SIN for example.


COUNT

       addr1 - addr2 n

Leave the address addr2 and byte count n of text beginning at address addr1. It is presumed that the first byte at addr1 contains the text byte count and the actual text starts with the second byte. Typically COUNT is followed by TYPE .


CPX,

       n -

Assembler word. Compare immediate or memory content to 16-bit X register. E.g.

 $8000 ## CPX,

compares hex 8000 to the content of the X register.


CR

       -

Transmit a carriage return and line feed to the selected output device, Serial Port 1 by default. Zero variable OUT . See 'EMIT .


CREATE

       -

SYNTAX: CREATE cccc

COMPILING: A defining word used by such words as CODE and CONSTANT to create a dictionary header for a Forth definition. The code field contains the address of the word's parameter field. The new word is in the CURRENT vocabulary.


CS

       - 24 (hex)

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

Assembler word. Condition code for use before IF, WHILE, and UNTIL, . The IF, is true when in the status register C=1 (carry flag set). See IF, .


CSP

       - addr

A user variable temporarily storing the stack pointer position for compilation error checking.


CURRENT

       - addr

A user variable containing a pointer to the vocabulary to which definitions will be added. Also it is the vocabulary searched if a word is not found in the CONTEXT vocabulary.


CURSOR

        - addr

An LCD user variable.  Returns address where a flag is kept.  If the flag is 1 the LCD cursor is on, if 0 it is not.  Use DISPLAY-SET to send the flag to the LCD. CURSOR is initialised to 0 at power up and by COLD but is not changed by reset or re-start by the watchdog. E.g. To put the cursor on:

 1 CURSOR !   DISPLAY-SET

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