Copyright: Onset Computer Corp. 2001


TxTools Help

TxBASIC Commands

Keyboard Equivalents

Command Line Arguments


Index
TxBASIC COMMANDS

'How' error codes

 	ABS	ADLOOP	AINT	ASFLT

ASM	ATN	BURST	CALL

CBREAK	CHAN	COS	COUNT

DFREAD 	DFSAVE 	DFSIZE 	DIM

DISPLY 	DOFFLD 	DONE 	DSKOFF

 	DSKON	DTOA 	ELSE 	END

ENDIF 	EXP 	EXTENSION 	FIX

FLOAT	FOR	GET	GETS

GOSUB	GOTO	HALT	HYB

IF	IFF 	INPUT	INSTR

INT 	ITEXT	LABPTR 	LEFT

LEN	LET	LOG	LOG10

MID	MODEL 	NEXT 	OFFLD

ONERR	OTEXT 	PCLR 	PEEK

PEEKL 	PEEKW 	PERIOD	PIN

POKE	POKEL 	POKEW 	PRINT

PSET	PTOG	QUIT 	RATE

REM	REPEAT	RETURN 	RIGHT

RTIME 	RUN 	SCROLL 	SDI

SDO	SIN 	SLEEP	SQR

STEP 	STIME	STOP 	STORE

STR	TAN	TEMP 	TO

TONE	UGET	UNTIL 	USEND

VAL 	VARPTR	VGET	VSTORE

WEND 	WHILE	XMIT	XSHAKE

Read-only Variables

Assembly Language Subroutines

TxTools Help


KeyboardEquivalents
KEYBOARD EQUIVALENTS TO MOUSE ACTIONS

Main Menu Selections

 --------------------

 File        Alt-F

 Edit        Alt-E

 Search      Alt-S

 Tattletale  Alt-T

 CommPorts   Alt-C

 Windows     Alt-W

 Help        Alt-H

 Sub-Menu Selections

 -------------------

 File       | Open               F3

 File       | Save               F2

 File       | Quit               Alt-Q

 Edit       | Undo               Ctrl-U

 Edit       | Cut                Ctrl-X

 Edit       | Copy               Ctrl-C

 Edit       | Paste              CtrlV

 Edit       | Clear              Ctrl-Del

 Edit       | Date/time          Alt-D

 Search     | Find again         Ctrl-L

 Tattletale | Run                Alt-R

 Tattletale | Launch             Alt-L

 Tattletale | Parallel off-load  Alt-O

 Tattletale | Syntax check       Alt-Y

 CommPorts  | Serial port        Alt-P

 CommPorts  | Hex display        Alt-X

 CommPorts  | Capture to file    Alt-Z

 Windows    | Next               F6

 Windows    | Previous           Shift-F6

 Dialog Box

 ----------

 Cancel                 Escape

 OK                     Return

 Move within group      Up/Down arrow

 Toggle check box       Space

 Toggle radio button    Space

 Next group             Tab

 Editing Controls

 ----------------

 Move cursor            Arrow keys

 Cursor word left       Ctrl-Left arrow

 Cursor word right      Ctrl-Right arrow

 Del line               Ctrl-Y

 Del char to left       Backspace

 Marking blocks         Shift-Arrow keys

 Select to line start   Shift-Home

 Select to line end     Shift-End

 Select page up         Shift-PgUp

 Select page down       Shift-PgDn

 Begin marking block    Ctrl-K B

 End marking block      Ctrl-K K

 Move cursor a page     PgUp,PgDn

 Move to line start     Home

 Move to line end       End

 Delete to word end     Ctrl-T

 Delete character       Del

 Toggle insert mode     Ins

Index


ErrorCodes
'HOW' Error Codes

1: not used	28: XSHAKE time-out > 65535

2: array variable index out of range	29: STIME argument out of range

3:  not used	30: RTIME argument out of range

4: datafile store out of range	31: HYB interval > 65535

5: datafile read out of range	32: SDO requested <1 or >32 bits

6: divide by zero	33: CALL address > 65535

7: multiply overflow	34: not used

8: not used	35: not used

9: add or subtract overflow	36: VSTORE/VGET index > 31

10: ABS argument = -2147483648	37: UGET time-out >65535

11: A-D channel not supported	38: STIME out of range

12: I/O pin not supported	39: not used t

13: not used	40: PRINT {x,y} where y < x

14: input to TEMP out of range	41: PRINT field width > 255

15: not used	42: INT or FIX overflow

16: SDI requested <1 or >32 bits	43:OFFLD x,y where x > y

17: COUNT time-out > 65535	44: PIN number out of range

18: PERIOD argument bad	45: not used

19: not used	46: Attempt to RUN 2nd background task

20: not used	47: array index out of bounds

21: not used	48: DFSAVE or DFREAD out of bounds

22: OFFLD datafile out of range	49: RATE 0 attempted

23: OFFLD time-out > 65535	50: ADLOOP address out of range

24: SLEEP interval > 32767	51: stack running low

25: USEND/UGET baud out of range	52: not used

26: ITEXT time-out > 65535	53: Disk command: datafile wrong size

27: TONE parameter out of range

Index


CmdLine
Command Line Arguments

 TXTOOLS [file]... [-opt arg]...

The 'opt' must be a single letter.

It is permissible to have space between the option letter

(p,b,d) and the argument.

TXTOOLS: the name of this program

file: the name of a text file that will be opened in an edit window

opt 	arg

 ---	---

 p	a number from 1 to 4 specifies the Comm Port number

 b	baud rate is one of these: 300, 600, 1200, 2400, 4800, 9600, 19200 or 38400

 d	serial protocol is three characters with no intervening spaces

char 1 specifies number of data bits, must be '7' or '8'

char 2 is  parity must be 'N'(none),'E'(even) or 'O'(odd)

char 3 specifies number of stop bits must be '1' or '2'

The 'h' option is used to display this information as a reminder for the next time you run the program.

Index


ReadonlyVar
Read-Only Variables

 DFMAX	Gives the maximum datafile address. Datafile addresses start at 0 so, DFMAX = datafile size - 1.

 MODEL	Contains the model number for the Tattletale hardware.

 VERS	Contains the version number of TxBASIC running on Tattletale.

 FPERR	Holds the floating point errors that have occurred since the last check of FPERR or since the beginning of the program. Each of the five possible floating point errors has a bit assigned in FPERR:

Bit 0:	Underflow - set if an operation produced a value too close to zero (without being zero) to be represented.

Bit 1:	Overflow - set if an operation produced a value too large (or too negative) to be represented.

Bit 2:	Not-a-Number: set if an operation could not produce a result such as in taking the square root of a negative number.

Bit 3:	Loss of precision: set if a large integer was converted to a float and some bits of the value could not fit in the float.

Bit 4:	Could not compare: set if a float was compared with a Not-a-Number.

Index


ABS
ABS - Absolute value

ABS(x)

Returns absolute value of x. Return is same type (integer or floating point) as x.

Index


ADLOOP

ADLOOP

Start background A-D routine to datafile buffer (not for Model 8)

See also RATE

Index


AINT
AINT – Round float to nearest integer

AINT(x)

Returns integer part of x as float

Index


ASFLT
ASFLT – Interpret as float

ASFLT(x)

Interpret x as a floating point value

Index


ASM
ASM – Embedded assembly language

ASM $

Assemble 6301/6303 code inline.

ASM <addr>

Assemble 6301/6303 code at <addr>.

END

End of assembly block.

See also CALL, Assembly Language Subroutines, CPU Registers

Index


Assembly Language Subroutines

from Assembly: jsr H'<addr>

from BASIC: CALL &H<addr>,x [,v]

Name	Address	Synopsis

ANIN	FFCA	A-D conversion with no power-on/power-off.

ATOD	FFE5	Same as ANIN with power-on/power-off.

CHIBUF	FFC4	Show what next URTGET would return in A reg.

CONOFF	FFD0	Turn off A-D power.

CONON	FFCD	Turn on A-D power.

FLUSH	FFE2	Flush both input and output UART buffers.

GETMEM	FFD6	Get datafile byte at addr stored where X reg points.Return byte in A reg.

STRMEM	FFD3	Store byte from A reg in datafile at addr stored where X reg points.

TSTOUT	FFC7	Return number of chars in UART output buffer in A reg.

URTGET	FFDC	Return next UART buffer char in A reg.

URTSND	FFDF	Send char in A register to UART buffer.

URTTST	FFD9	Return number of chars in UART input buffer in A reg.

See also ASM, CALL, CPU Registers

Index


ATN
ATN - Arctangent

ATN(x)

Arctan of x

See also COS, SIN, TAN

Index


BURST

BURST v, x[, f]

Store first x channels of A-D in datafile using pointer v

with optional form f

 Form f: None (store most significant 8 bits)

         = 0  (store least significant 8 bits)

         = 1  (store most significant 8 bits)

         = 2  (store all bits using 2 bytes)

See also CHAN

Index


CALL
CALL - Call asm subroutine

CALL x1,x2[,v]

Call x1 with registers = x2; returning in v.

See also ASM, Assembly Language Subroutines, CPU Registers

Index


CBREAK
CBREAK - Ctrl-C vector

CBREAK label

Go to label if Ctrl-C character detected

CBREAK

Return Ctrl-C handling to default behavior

Index


CHAN
CHAN - A-D conversion

CHAN(x)

A-D conversion of channel x.

see also BURST

Index


COS
COS - Cosine

COS(x)

Return the cosine of x degrees

See also ATN, SIN, TAN

Index


COUNT
COUNT - Count digital pulses

COUNT(x

Return number of I/O Pin 13 transitions in x * 10mS period. Model 8 defaults to I/O line 4 for input.

COUNT v

Start counting I/O Pin 13 transitions as interrupt.  Update results in v. Model 8 defaults to I/O line 4 for input.

COUNT

Stop background count

See also PERIOD

Index


DFREAD

DFREAD x1, v[,x2]

Read disk block x1 into datafile returning error code in v.

x2 (if present) specifies which of two half-datafile to read.

See also DFSAVE

Index


DFSAVE

DFSAVE x1, v[,x2]

Write datafile to disk block x1 returning error code in v.

x2 (if present) specifies which of two half-datafile to write.

See also DFREAD

Index


DFSIZE

DFSIZE c

Set on-board datafile size to c. The argument 'c' must be a constant.

(for Models 4A and 5 only, not for Models 5F, 5F-LCD or other models).

Index


DIM
DIM - Dimension array

DIM <label> (size)

Dimension variable <label> to 'size'

DIM <label> (xsize, ysize)

Two-dimension <label> to 'xsize' and 'ysize'

Index


DISPLY

DISPLY "s",[#n][,x][,\x][,{x,y}][;]

Display strings, values of expressions, portions of datafile

on LCD (5F-LCD only). Four characters maximum.

See also PRINT, SCROLL

Index


DOFFLD

DOFFLD x1, x2, v

Disk file off-load with datafile x1 - x2, errors in variable v.  Uses parallel port, if available, on Model 6F.

See also OFFLD

Index


DONE

DONE

Puts the Model 4A into its lowest power mode. Only exit is reset.

Index


DSKON

DSKON v

Apply power to hard disk. Disables disk power-off in DFREAD and DFSAVE until DSKOFF is used.

See also DSKOFF, DFREAD, DFSAVE

Index


DSKOFF

DSKOFF

Turn off power to hard disk. Enables disk power-off in DFREAD and DFSAVE.

See also DSKON, DFREAD, DFSAVE

Index


DTOA

DTOA x

Set duty cycle of I/O pin 12 to x/65536 percent and exit.

Signal continues until "DTOA 0" executed. Not yet available for Model 8.

See also TONE

Index


EXP
EXP - Power of base of natural log

EXP(x)

Return e (base of the natural logarithms = 2.7182818...) raised to the x power

see also LOG,LOG10

Index


EXTENSION

EXTENSION extname [, extname]…

Declares that Model 8 language extension 'extname' will be used in

program. The name of the extension is case sensitive. Extensions are

treated like functions when used in the body of the program so all

arguments must be enclosed in parentheses. MODEL 8 ONLY.

Index


FIX
FIX - Convert float to integer

FIX(x)

Integer part of x as integer closer to zero

See also INT, FLOAT

Index


FLOAT
FLOAT - Convert integer to float

FLOAT(x)

Convert integer x to float

See also FIX, INT

Index


FOR
FOR - For...Next loop

FOR v=x1 TO x2 [STEP x3]

Command

Block

NEXT v

Execute command block until contents of v reaches x2.

Add x3 to x1 each iteration. Default STEP is 1.

See also WHILE, REPEAT

Index


GET

Get(v, [#n])

Return integer formed from n bytes in datafile pointed to by v

See also STORE, GETS

Index


GETS

GETS(v)

Return binary string from datafile at address pointed to by v

See also STORE, GET

Index


GOSUB
GOSUB - Call subroutine

GOSUB label

Execute subroutine at label

RETURN - Return from subroutine

RETURN

Return from subroutine

Index


GOTO
GOTO - Go to label

GOTO label

Continue execution of program at label

Index


HALT
HALT - Lowest power mode

HALT

Put Tattletale in lowest power mode. Only way out of this is reset or cycling power.

Index


HYB
HYB - Lowest power mode with time-out

HYB x

Put Tattletale in lowest power mode for 'x' seconds.

Index


IF
IF - Conditional execution

IF x command

Execute command if x <> 0 (i.e. true)

see also IFF

Index


IFF

IFF

   ...command...

   ...block 1...

[ELSE…]

   ...command...

   ...block 2...

ENDIF

Execute 1st command block if x is true, else 2nd block.

See also IF

Index


INPUT
INPUT - Read console

INPUT [s] v [,#x1] [,\x2] [,x3] [;]

Prompt with s, load variable v. Notice, no comma between s and v.

 Option x1 is # of characters to input (default is 255).

 Option x2 is terminating character (default is CR).

 Option x3 is time-out (default is no time-out).

 If ';' used, no CR-LF output.

 Option x1, x2, x3 in any order.

Index


INSTR
INSTR – Search for substring

INSTR([i,] string1, string2)

Return position in string1 where string2 is first found optionally beginning at offset i. Offset must be a value from 1 to 255. Return 0 if error or string not found.

see also MID

Index


INT
INT - Convert float to integer

INT(x)

Integer part of x as integer more negative

see also FIX, FLOAT

Index


ITEXT

ITEXT v[,\x1][,x2]

Store UART's string to datafile using pointer v terminator x1,

time-out x2; if x2 = 0 then 1 character only

See also OTEXT

Index


LABPTR

LABPTR(label)

Address of label (not for Model 8)

See also VARPTR

Index


LEFT

LEFT(string, n)

Return left-most n characters of string

See also MID, RIGHT

Index


LEN
LEN - Get length of string

LEN(string)

Return length of string

Index


LET
LET - Assign value to variable

LET v1=x1 [,v2=x2 . . . ]

Assign value to variable. Notice multiple assignments can be listed if they are separated by commas. The LET keyword is optional.

Index


LOG
LOG - Natural logarithm

LOG(x)

Natural logarithm of x

see also LOG10

Index


LOG10
LOG10 - Common logarithm

LOG10(x)

Common logarithm of x

see also LOG

Index


MID
MID - Return n-character substring

MID(string,i,n)

Return n characters of string starting at offset i.

Offset must be a value from 1 to 255.

see also INSTR

Index


MODEL

MODEL <c>

The Tattletale model this program is intended for. The argument <c> must be a constant from this table:

Model	<c>

2A	210

2A-32	220

2B	230

2B-1M	240

3	300

5	500

5F	510

5F-LCD	520

6	600

6-1M	610

6F	620

8	800

Multiple MODEL commands may be used for similar models in some cases. For instance, to write a program for the Models 6, 6-1M and 6F, use:

MODEL 600 : MODEL 610 : MODEL 620

Index


OFFLD

OFFLD x1, x2, [,x3,v]

Datafile off-load x1 - x2, time-out x3,errors in variable v

See also DOFFLD

Index


ONERR
ONERR - Error vector

ONERR label [,v]

Go to label if error encountered [, error in v]

ONERR

Return error handling to default behavior

Index


OTEXT

OTEXT v [,\x] [;]

Send out UART string from datafile by pointer v with terminator x

See also ITEXT

Index


PCLR
PCLR – Clear I/O pin

PCLR x1 [,x2 . . . ]

Clear specified I/O pins to low state

see also PSET, PTOG, PIN

Index


PEEK
PEEK - Read memory byte

PEEK(addr)

Return byte at address 'addr'

PEEKW(addr)

Return word (2 bytes) at address 'addr'

PEEKL(addr)

Return long word (4 bytes) at address 'addr'

see also POKE, CPU Registers

Index


PERIOD
PERIOD - Measure period of signal

PERIOD(x1, x2)

Time for x1 cycles at D13; x2*10 mS time-out. Model 8 defaults to D4 for input.

see also COUNT

Index


PIN
PIN - Return state of I/O pins

PIN(x1 [,x2, . . . ])

Value formed from the state of the specified input pins

see also PCLR, PSET, PTOG

Index


POKE
POKE - Store byte at address

POKE  addr, value

Store byte 'value' at address 'addr'

POKEW  addr, value

Store word (2 bytes) at address 'addr'

POKLE  addr, value

Store long word (4 bytes) at address 'addr'

see also PEEK, CPU Registers

Index


PRINT
PRINT - Print to console

PRINT "s", [#n][,x][,\x][,\{x,y}][;]

Print strings and/or values of expressions

see also STORE

Index


PSET
PSET - Set I/O pin

PSET x1 [,x2 . . . ]

Set specified I/O pin to high state

see also PCLR, PTOG, PIN

Index


PTOG
PTOG - Toggle state of I/O pin

PTOG x1 [,x2 . . . ]

Toggle state of specified I/O pin

see also PCLR, PSET, PIN

Index


QUIT

Put Model 6F or Model 8 in lowest power mode where only exit is a reset

Index


RATE
RATE - Change Sleep interval

RATE x

Increase ADLOOP interrupts to x * 100 per second and reduce SLEEP interval to 10mS/x. Valid arguments are 1, 2, 3, 4, 6, 8, 12, 16, 24, 32, 48 and 96. For models with a 9.8 MHz crystal, 64 and 192 are valid, too. For Model 8, valid arguments are 1, 2, 4, 5, 8, 10, 20, 25, 40, 50, 100, 200.

see also SLEEP

Index


REM

Ignore rest of source line

Index


REPEAT
REPEAT - Loop until true

Enter body text here.

REPEAT

Command

Block

UNTIL x

Repeat command block until x is true

See also FOR, WHILE

Index


RIGHT

RIGHT(string,n)

Return right-most n characters of string

See also LEFT, MID

Index


RTIME

RTIME

Read real-time clock to '?' array

RTIME v

Read variable v to '?' array

See also STIME

Index


RUN

RUN label

Start background routine at label (not for Model 8)

Index


SCROLL

SCROLL "s",[#n][,x][,\x][,{x,y}][;]

Display strings, values of expressions, portions of datafile

by scrolling across LCD (5F-LCD only)

See also DISPLY, PRINT

Index


SDI
SDI - Synchronous data in

SDI(x)

Return x shifted bits on D9; D3 latch, D5 clock

See also SDOSDO

Index


SDO
SDO - Synchronous data out

SDO x1, x2

Send x1 using x2 bits on D11,D2 latch,D5 clock

SDO "s",[#n][,x][,\x][,\{x,y}][;]

Send 8-bit characters out serially as above

See also SDI, PRINT

Index


SIN
SIN - Sine

SIN(x)

Return the sine of x degrees

See also ATN, COS, TAN

Index


SLEEP
SLEEP - Lower power state with time-out

SLEEP x

Sleep till x*10 mS from last SLEEP command. The resolution can be made less than 10mS using RATE.

see also RATE

Index


SQR
SQR - Square root

SQR(x)

Return the square root of x

Index


STIME
STIME - Convert real-time to seconds

STIME

Convert real-time in '?' array to '?' variable

STIME v

Convert real-time in '?' array to time (in seconds-since-1980) in variable v

see also RTIME

Index


STOP
STOP - Stop program

STOP

End program execution

Index


STORE
STORE - Store to datafile

STORE v, [#n],x...

Store x..., using n bytes, using pointer v. If x is a string, length byte is stored first (use GETS to read).

STORE v,"s",[#n][,x][,\x][,\{x,y}][;]

Store characters starting at location pointed to by v

see also GET, GETS, PRINT

Index


STR
STR - Construct string

STR(x)

Return string representing value of x. Type (integer or float) of x determines type of conversion.

see also VAL

Index


TAN
TAN - Tangent

TAN(x)

Return the tangent of x degrees

see also ATN, COS, SIN

Index


TEMP
TEMP - Convert A-D to degrees C

TEMP(x)

Convert x to degrees C (times 100) for thermistor input

See also CHAN

Index


TONE
TONE - Output square wave

TONE x1, x2

Send x2 cycles, period x1 * 1.6276 microsec out I/O Pin 3. If x2 = 0, begin continuous square wave and exit. Halt continuous mode with TONE 0,0.

see also DTOA

Index


UGET
UGET - Auxiliary UART input

UGET x1,x2,v,x3

Store x2 bytes at x1 baud input from pin D7 to the datafile using pointer v;time-out x3 * 10 mS

see also USEND

Index


USEND
USEND - Auxiliary UART output

USEND x1,x2,v

Send x2 bytes at x1 baud out pin D8 from the datafile using pointer v.

USEND x1, "s", [#n][,x][,\x][,\{x,y}][;]

Send 8-bit characters out serially as above

see also UGET

Index


VAL

v = VAL(string)

Numeric value of string can only be assigned to an integer or floating point variable. Type of value is determined by type of v.

See also STR

Index


VARPTR
VARPTR - Address of variable

VARPTR(v)

Address of variable v.

see also LABPTR

Index


VGET
VGET - Read user EEPROM

VGET(x)

Value from EEPROM addr x

see also VSTORE

Index


VSTORE

VSTORE x1, x2

Store x2 to EEPROM addr  x1 (not for Model 5)

See also VGET

Index


WHILE
WHILE - Loop while true

WHILE x

Command

Block

 WEND

Execute command block while x is true

See also FOR, REPEAT

Index


XMIT
XMIT - Enable/disable console output

XMIT-

Suppress hardware UART output

XMIT+

Enable hardware UART output

Index


XSHAKE

XSHAKE x

Enable XON/XOFF with time-out x*10 mS (not for Model 8)

Index


CPU Registers

 6301/6303 Processor Registers

Register	Address	Description

P2DDR	01	Port 2 data direction reg

PORT2	03	Port 2 data register

TCSR1	08	Timer control/status reg 1

FRCH	09	Free running counter MSB

FRCL	0A	Free running counter LSB

OCR1H	0B	Output compare reg 1 MSB

OCR1L	0C	Output compare reg 1 LSB

ICRH	0D	Input capture register MSB

ICRL	0E	Input capture register LSB

TCSR2	0F	Timer control/status reg 2

RMCR	10	Rate/mode control register

TRCSR1	11	Tx/Rx control status reg 1

RDR	12	Receive data register

TDR	13	Transmit data register

RP5CR	14	RAM/port 5 control reg

PORT5	15	Port 5 data register

P6DDR	16	Port 6 data direction reg

PORT6	17	Port 6 data register

PORT7	18	Port 7 data register

OCR2H	19	Output compare reg 2 MSB

OCR2L	1A	Output compare reg 2 LSB

TCSR3	1B	Timer control/status reg 3

TCONR	1C	Time constant register

T2CNT	1D	Timer 2 up counter

TRCSR2	1E	Tx/Rx control status reg 1

TSTREG	1F	Test register - DO NOT ACCESS!

P5DDR	20	Port 5 data direction reg

P6CSR	21	Port 6 control/status reg

Addresses 00, 02, 04, 05, 06 and 07 are decoded externally.

Accessing Port 7 has unknown consequences.

see also ASM, Assembly Language Subroutines, PEEK, POKE

Index