TDS9092 ALPHANUMERIC WORD DEFINITIONS
n addr -
Store 16 bits of n at address addr.
Saves the stack position in CSP . Used as part of the compiler security.
"ccc " -
string ccc delimited by " (double-quote) and compile as a literal.
: TEST " Hello" ;
When TEST is subsequently used it leaves the address of character H and the length 5 on the stack. For another example see -TEXT . Brodie calls this LIT" .
The set of words "A "B "e ") etc. The ASCII value of the second character is left on the stack. This is more convenient and gives better documentation than using the number equivalent. E.g.
: TEST "A . ;
TEST gives 65 (decimal) These words can be used both in and out of definitions. See also ^_ .
d1 - d2
SYNTAX: <# # # # # #>
SYNTAX: 34 ## B LDA,
Assembler word. Used before an assembly mnemonic to indicate immediate data. Use just after the data. The example loads number 34 to accumulator B.
d - addr count
SYNTAX: <# # # #>
An LCD user variable preset to 0 at power-up. The number (0 to 7) in #LCD indicates which one of 8 address pairs in the range 01C0 to 01CE will be used for LCD writing words such as PUT and LCDEMIT . This enables up to 8 LCDs to be driven, provided a 3-to-8 line decoder is added externally to further decode LCD chip select line CS01C0. See MORE THAN ONE LCD.
d1 - d2
SYNTAX: <# #S #>
These are 4 sets of words for indicating hex numbers irrespective of the current BASE . E.g.
These words enable the easy mixture of decimal and hex constants in definitions:
DECIMAL : TEST 78 $9000 C! ;
This puts the decimal number 78 to hex address 9000. A more cumbersome alternative is:
9000 C! ;
SYNTAX: ' cccc
COMPILING: An immediate word which if compiling compiles the parameter field address (pfa) of cccc as a literal.
EXECUTING: At run-time the pfa of dictionary word cccc is put on the stack. The word can also be used during execution to return the pfa of a word. If the word is not found after a search of the CONTEXT and CURRENT vocabularies the message ? - UNDEFINED is given.
A user variable vectoring (KEY) . The address addr contains the code field address (cfa) of the word which will actually execute when (KEY) is called. By default at power-up this is <(KEY)> . The selected input device can be changed by putting the code field address of a new input word into '(KEY) . See (KEY) and <(KEY)> .
A user variable vectoring ?TERMINAL . The address addr contains the code field address (cfa) of the word which will actually execute when ?TERMINAL is called. By default at power-up this is <?TERMINAL> . See ?TERMINAL and <?TERMINAL> .
A user variable vectoring EMIT . The address addr contains the code field address (cfa) of the word which will actually execute when EMIT is called. By default at power-up this is <EMIT> . The selected output device can be changed by putting the code field address of a new output word into 'EMIT . See EMIT and <EMIT>
A user variable vectoring INTERPRET . The address addr contains the code field address (cfa) of the word which will actually execute when INTERPRET is called. By default at power-up this is <INTERPRET> . See INTERPRET and <INTERPRET> .
A user variable vectoring NUMBER . The address addr contains the code field address (cfa) of the word which will actually execute when NUMBER is called. By default at power-up this is <NUMBER> . See NUMBER and <NUMBER> .
An LCD user variable vectoring PUT . The address addr contains the code field address (cfa) of the word which will actually execute when PUT is called. On the TDS9092 by default at power-up this is <PUT> . It can be changed to point to any alternative user defined word which takes the same stack conditions as PUT . E.g. for LM020L
DUP 7 >
IF 38 + THEN 80 +
AWAIT LCD C!
AWAIT LCDDATA C! ;
After this the word PUT will use this special version instead of the default <PUT> . See AT PUT .
A user variable vectoring R/W . The address addr contains the code field address (cfa) of the word which will actually execute when R/W is called. On the TDS9092 by default at power-up this is <R/W> . See R/W and <R/W> .
SYNTAX: ( ccc dddd ee)
Ignore a comment that will be delimited by a right parenthesis on the same line. May occur during execution or in a colon-definition. A blank after the leading parenthesis is required.
The run-time procedure compiled by +LOOP , which increments the loop index by n and tests for loop completion. See +LOOP .
The run-time procedure, compiled by ." which transmits the following in-line text to the selected output device. See ."
The run-time procedure, compiled by ;CODE, that rewrites the code field of the most recently defined word to point to the following machine code sequence. See ;CODE .
n - addr 8
Convert day number n to displayable date string of length 8 at address addr. Day numbers start from zero at 1st Jan 1984. Format of the string is 25.12.95 (25 Dec 1995). See TIMEKEEPING for USA format.
The run-time procedure compiled by DO which move the loop control parameters to the return stack. See DO .
addr1 addr2 -
pfa b tf
Searches the dictionary starting at the name field address addr2 matching to the address at addr1. Returns parameter field address, length byte of name field and boolean true for a good match. If no match is found, only a boolean false is left.
On power-up (KEY) is configured to wait until a byte is received at the serial port SIN1 on pin a25. It is vectored through '(KEY) to execute <(KEY)> but that can be changed. Use (KEY) when receiving binary data and KEY for user-typed ASCII. KEY calls (KEY) but resets bit 7 to 0 and converts rubout (FF) to backspace (08). See '(KEY) <(KEY)> KEY .
n1 n2 - addr count
Convert the line number n1 and the screen n2 to the buffer address containing the data. A count of 64 indicates the full line text length.
The run-time procedure compiled by LOOP which increments the loop index and tests for loop completion. See LOOP .
d1 addr1 - d2 addr2
Convert the ASCII text beginning at addr+1 with regard to BASE . The new value is accumulated into double number d1, being left as d2. addr2 is the address of the first unconvertible digit. Used by NUMBER .
d - addr 8
A double number, representing the 'ticks' since midnight, is converted into a displayable time string of 8 characters at address addr. This format is suitable for use by TYPE or -TEXT . The string is in the form XX.YY.ZZ where XX is the hour (0-23), YY minutes and ZZ seconds.
n1 n2 - n1 * n2
Leave the signed product of two signed numbers on the stack.
Receives byte from the second serial port, pin SIN2. The reception is done by software so *(KEY) will take the full time needed to receive a byte. The format assumes one start bit, 8 data bits and at least one stop bit. Use RBAUD to set the baud rate. The logic levels needed at SIN2 should be at least -3V for logic 1 and +3V for logic 0 as defined by the specification. See *?TERMINAL for an example.
n1 n2 - n3
Used in fractional arithmetic. Multiplies two fractions. See also D>F .
n1 n2 n3 - n4
Leave the ratio n4 = n1*n2/n3 where all are signed numbers. Use of an intermediate 31-bit product permits greater accuracy than would be available with n1 n2 * n3 /
n1 n2 n3 - n4 n5
Leave the quotient n5 and remainder n4 of the operation n1*n2/n3. A 31 bit intermediate product is used as for */ .
Examines the second serial input port SIN2 and returns 1 if logic 0 (busy) or 0 if logic 1 (idle). It is similar to ?TERMINAL on the main serial port but responds to any character, not just ctrl+C. Since reception of a byte by *(KEY) on this serial port is software controlled, use *?TERMINAL to know when to go into *(KEY) . E.g.
*?TERMINAL IF *(KEY) THEN
This must be passed through every x ms where 2x is the time for one bit.
Sends a byte to the second serial port on pin SOUT2. The transmission is accomplished by software so *EMIT will take the full time needed to send a byte. One start bit, 8 data bits, and two stop bits are sent. Use TBAUD to set the baud rate. The logic levels at SOUT2 are proper RS232C ones (-9V and +9V for 1 and 0).
n1 n2 - n1+n2
Leave the sum n1+n2 on the stack.
n addr -
Add n to the value at the address.
n1 n2 - n3
Apply the sign of n2 to n1, which is left as n3.
- 16384 (decimal)
Used in fractional arithmetic. +1 returns the fractional value equivalent to 1.0000.
addr1 - addr2 f
Advance the block buffer address addr1 to the address of the next buffer addr2. Flag f is false when addr2 is the buffer presently pointed to by variable PREV .
addr n2 -
: cccc . DO . n1 +LOOP . ;
COMPILING: At compile-time +LOOP compiles the run-time word (LOOP) and the branch offset computed from HERE to the address left on the stack by DO . n2 is used for compile time error checking.
EXECUTING: At run-time +LOOP selectively controls branching back to the corresponding DO based on n1, the loop index and the loop limit. The signed increment n1 is added to the index and the total compared to the limit. The branch back to DO occurs until the new index is equal to or greater than the limit (n1>=0), or until the new index is equal to or less than the limit (n1=<0). Upon exiting the loop, the parameters are discarded and execution continues ahead.
n - addr
Leave the memory address relative by n to the origin parameter area. n is the number of bytes of offset. This definition is used to access or modify the cold start parameters in the origin area.
Enables the 16-bit Timer Overflow Interrupt. At power-up this interrupt is used for the on-board time-keeping. -TIMER stops the clock and +TIMER restarts it.
Store n as two bytes into the next available dictionary memory word, advancing the dictionary pointer 2 bytes. See also C, and DP .
Assembler word. Use address pointed to by X register, but offset by value u. E.g.
56 ,X ROL,
Rotate left the byte in memory at the address which is the sum of the content of the X register and 56. u can be 0 to 255 decimal.
n1 n2 - n1-n2
Leave the difference n1-n2 on the stack
Continue interpretation with the next screen.
n1 - n1 (if n1=0)
Reproduce n1 only if it is non-zero. This is usually used to copy a value just before IF to eliminate the need for an ELSE part to drop it.
- pfa b tf (found)
Accepts the next text word (delimited by blanks) in the input stream to HERE and searches the CONTEXT then CURRENT vocabularies for a matching entry. If found, the dictionary's entry parameter field address, its length byte and a boolean true are left. Otherwise only a boolean false is left.
n1 n2 n3 - n3 n1 n2
Rotate the top three values on the stack. Put the top one to third position. The reverse of ROT and equivalent to ROT ROT
addr1 n addr2 - f
Compares two text strings. The string at address addr1 of length n bytes is compared with that at addr2. It compares strings word by word, not byte by byte so that the strings should have an even number of characters. If they are the same flag f=0, and f=1 otherwise. Comparison is done byte by byte. E.g.
: PLACE " This is a message"
$8000 SWAP CMOVE ;
: TEST " This is a message"
IF ." Different"
ELSE ." Same" THEN ;
Use PLACE to put the text at address hex 8000 and then use TEST to see if it is the same as the message there. The answer will be 'Same'. Now corrupt the message at the pad with 0 $8000 C! for example and try TEST again. Now the strings are different. See " .
Disables the 16-bit Timer Overflow Interrupt. At power-up this interrupt is used for the on board timekeeping so -TIMER will stop the update of the clock.
addr n1 - addr n2
Adjusts the character count n1 of a text string beginning at address addr, to suppress the output of trailing blanks. i.e. the characters at addr+n2 to addr+n1 are blanks.
Display a number from a signed 16-bit two's complement value n, converted according to the current numeric BASE . One trailing blank follows.
SYNTAX: ." cccc"
COMPILING: Compiles an in-line string cccc (delimited by the trailing " ).
EXECUTING: At run-time transmits the text to the selected output device (Serial Port 1 by default). If executed outside a definition, ." will immediately print the text until the final " . The maximum number of characters is 255. See (.") .
d n -
Display a double number d formatted with n decimal places. For example:
As with other number formatting words this can be put on an LCD by re-vectoring EMIT to point to LCDEMIT .
Displays the date set in the on-board clock in the format XX.YY.ZZ where XX is the day, YY the month and ZZ the year. Valid from 1984 to 2073. Since EMIT is vectored the date can be sent to an LCD or other outputs by re-vectoring EMIT . See LCDEMIT . See TIMEKEEPING for USA format.
Used for fractional arithmetic. Prints n, representing a fractional number, to 4 decimal places. The range printed is -1.9999 to +1.9999 corresponding the (decimal) equivalent of -32768 to +32767 of n. See D>F for example.
line scr -
Display a line of text from blocks by its line and screen number. Trailing blanks are suppressed.
n1 n2 -
Display the number n1 right aligned in a field whose width is n2. No following blank is displayed.
Non-destructive display of stack content for use during development. Displays EMPTY STK if nothing is on the stack. Note that all errors leave 2 items on the stack (corresponding to current values in BLK and IN ).
Displays the current time in the format XX.YY.ZZ followed by a space. XX is the hours 0-23, YY minutes, ZZ seconds. The time is since power-up if it has not been set. Since EMIT is vectored the time can also be displayed on an LCD or sent elsewhere. See (TIME) and LCDEMIT .
n1 n2 - n1/n2
Leave the signed quotient n1/n2.
n1 n2 -
Used in fractional arithmetic. Divides two fractions. See also D>F .
n1 n2 - rem. quot.
Leave the remainder and signed quotient n1/n2. The remainder has the sign of the dividend.