80-Bus News |
May–June 1983 · Volume 2 · Issue 3 |
Page 19 of 59 |
---|
These have the same functions as LIST and PRINT in 8k ROM BASIC, but output is directed to the printer. If a program halts for no obvious reason and LPRINT has been used, check that the printer is switched on and ‘on-line’!
This has the function of defining the starting addresses of assembly language subroutines; up to 10 such subroutines can be used. The format is:
DEFUSR <digit>=<X> where X is the starting address.
The arrays or vectors specified are deleted and may be redimensioned if required. The format is:
ERASE <array name 1>, ....... “array name n>
The format of these statements is:
(L)PRINT USING <string>;<list>
These print (on screen or printer) the values of the expressions in the <list> in a manner dictated by the <string>; the <list> contains constants, variables or expressions to be printed, separated by punctuation as in the PRINT statement.
The format for this statement is:
ON ERROR GOTO <line number>
When an error occurs, it diverts to the specified line; sets the variable ERR to the error code and ERL to the offending line number. ON ERROR GOTO O is used to disable error trapping.
This is used to restart program execution after error trapping. Normally, a line number is specified but if it is omitted or set to zero, then the program resumes at the statement where the error occurred. RESUME NEXT causes program execution to resume at the statement after the one where the error occurred.
A facility which allows the values of two variables to be exchanged. They must be of the same type – e.g. strings, integers or reals. The format is: SWAP <variable 1>,<variable 2>.
Enables the trace flag; this prints the line numbers of statements as they are executed and is useful for debugging. It can be used both as a command and as a statement.
Disables TRON; TRON is also automatically disabled by the ‘NEW’ command.
Operators are used to add, subtract, multiply etc. in statements; there is an established order of precedence as follows: parentheses – ‘brackets’ have the highest precedence and the rest follow in decreasing order; exponentiation (^), negation (-), multiplication (*) and division (/), integer division (\), modulo (MOD), addition (+) and subtraction (-) (subtraction is not the same as negation!), then the relational operators = , <> , < , > , <= , =< , >= , =>. The logical operators which follow are also in decreasing order of precedence: NOT, AND, OR, XOR, EQV and IMP. (XOR is exclusive OR, EQV is Equivalence and IMP is Implication.) All the logical operators are ‘bitwise’.
Page 19 of 59 |
---|