ERROR - Error handling
Syntax:
CALL 400EH
or
JP 400EH
- Input:
A = Error code (0 - 17)
- Exit:
Jump to the BASIC interpreter
- Registers used:
AF, BC. DE, HL
- Error handling:
none
A powered-on drive is powered off. The drive motor stops and the LED on the front of the drive goes out.
An error message is output according to the error code transferred in the A register. A possibly switched on drive is switched off (with error code > 1).
This routine differs from the other routines insofar as it jumps to the BASIC interpreter instead of to the calling program.
The stack pointer is set to the BASIC stack.
Reg A |
Generated message |
Further process |
0 |
none |
to the BASIC interpreter (1B9AH) |
1 |
|
Release and further expiry about 1997H |
2 |
|
to the BASIC interpreter (1B9AH) |
3 |
|
to the BASIC interpreter (1B9AH) |
4 |
|
to the BASIC interpreter (1B9AH) |
5 |
|
to the BASIC interpreter (1B9AH) |
6 |
|
to the BASIC interpreter (1B9AH) |
7 |
|
to the BASIC interpreter (1B9AH) |
8 |
|
to the BASIC interpreter (1B9AH) |
9 |
|
to the BASIC interpreter (1B9AH) |
10 |
|
to the BASIC interpreter (1B9AH) |
11 |
|
to the BASIC interpreter (1B9AH) |
12 |
|
to the BASIC interpreter (1B9AH) |
13 |
|
to the BASIC interpreter (1B9AH) |
14 |
|
to the BASIC interpreter (1B9AH) |
15 |
|
to the BASIC interpreter (1B9AH) |
16 |
|
to the BASIC interpreter (1B9AH) |
17 |
|
to the BREAK routine (1DA0H) in BASIC |
Example:
...
LD A,7 ; Error code 7
CALL 400EH ; Output message "DISK FULL"
The message “?DISK FULL” is output and then BASIC responds with READY.
Note
Note:
Using the line number field in the BASIC communication area (78A2H), the ERROR routine distinguishes whether it is a direct command or a program command.
If field 78A2H/78A3H contains a value not equal to X’FFFF’, this is interpreted as a line number and this is output after the error message (error codes 1-16).
This function can perhaps also be useful when testing machine programs by setting specific values in 78A2H/78A3H which, if an error occurs, give you an indication of the corresponding point in the program.
Example:
...
OR A ; check if error occurred
JR Z,XY ; no, go on!
LD HL,10 ; set row identifier
JP 400EH ; call error routine
XY: ...
If A contains a value not equal to 0, the corresponding error message is output with information about the location of the occurrence. e.g. A= 3, then “?DIRECTORY FULL IN 10”.