44
Example:
ON KEY 1 GOTO 1000
Remarks:
If a statement specified by the branch line number is non-executable, execution
will begin with the first executable statement following the branch line number.
If zero is specified as the branch line number, it is assumed that the KEY OFF
statement has been executed.
If the port number is omitted, port 1 is selected.
There should be only one ON KEY GOTO statement for each key number.
Key input will not be processed during execution of an assembly language pro-
gram.
The ON KEY GOTO statement is enabled with the KEY ON statement and dis-
abled with the KEY OFF statement.
Program Example:
10
OPEN #1,“TERM:(42)”
20
ON KEY 1 GOTO 100
30
ON KEY 2 GOTO 200
40
ON KEY 3 GOTO 300
50
KEY ON
100
PRINT “A”
110
GOTO 500
200
PRINT “B”
210
GOTO 5000
300
PRINT “C”
500
{cont. processing}
Program Remarks:
“A”, “B”, and “C” are displayed by pressing keys 1, 2, and 3, respectively. To can-
cel the specification, write 0 as the branch destination.
ON PC ... GOSUB Statement
Purpose:
Defines an interrupt service routine invoked by the PC
Format:
ON PC [<int num>] GOSUB <line>
<int num> is an integer from 1 to 15.
<line> is a valid line number.
Example:
ON PC 3 GOSUB 1000
Remarks:
In four-word mode, the interrupt source number is indicated with bits 04 to 07 (1
to F in hexadecimal) of word n+1. In two-word mode, the interrupt source num-
ber is indicated with bits 00 to 07 of word n.
An interrupt routine invoked by the ON PC statement cannot be interrupted by
another interrupt. If a new interrupt occurs during processing of a previous inter-
rupt, branching to handle the new interrupt will not take place until after the RE-
TURN statement of the first interrupt service routine is executed.
If the statement specified by the branch line number is non-executable, execu-
tion will begin with the first executable statement following the branch line num-
ber.
If zero is specified as the branch line number, it is assumed that the KEY OFF
statement has been executed.
If the interrupt number is omitted, the same branch destination is assumed for all
interrupt numbers, 1 to 15.
Commands, Statements, and Functions
Summary of Contents for C500-ASC04
Page 1: ...C500 ASC04 ASCII Unit Operation Manual Revised February 2001 ...
Page 5: ...iv ...
Page 7: ...vi ...