DOSPLUS 3.5 for the Model III - ERROR/OVL Disassembled
Page Customization
Page Index
ERROR/OVL
Other Navigation
Introduction/Summary
DOSPLUS 3.5 ERROR/OVL Disassembly - The Long Error Messages of Extended Disk BASIC (Model III)
ERROR/OVL is the overlay of DOSPLUS Extended Disk BASIC 1.7 (BASIC/CMD) that shows an error in words: the full message instead of the ROM's two letter code, the line number, and the statement in error after an arrow. It is a load module of 4 blocks, 807 bytes, from 5200H to 5526H, with the transfer address 5200H. Unlike the SYS and CMD files of DOSPLUS it has no comment records (no 05H name or copyright record): the file starts with its first load block. The file is 1024 bytes, four sectors; after the transfer record (file offsets 0337H-033AH) come 197 bytes E5H, the rest of the fourth sector, which are never loaded and are not shown below. The Model I and Model III files are identical byte for byte, and so are the two pages apart from their links.
The Parts of ERROR/OVL
| Address | Contents |
|---|---|
| 5200H-5260H | The routine: the message, the line and the statement (5200H). |
| 5261H-5265H | The arrow --> and a space, ended by 00H (5261H). |
| 5266H-5526H | The list of the 44 messages, after a first 00H (5266H). |
How BASIC/CMD Uses It
The ROM's error routine (19A2H) first passes an error to an ON ERROR GOTO handler; when there is none it calls the Disk BASIC link 41A6H at 19ECH with Register E = the offset of the error (the ERR value). BASIC/CMD's error hook (5C00H) reads its state byte 62F5H: bit 1 set loads ERROR/OVL with LOAD@ into 5200H, the area of the high overlays, through the file control block of file area 0, keeps the transfer address in 62F8H-62F9H and sets OVLYH$ so that the next library command reads its overlay again; bit 0 set returns into ERROR/OVL. When the file is not on the diskette BASIC/CMD goes on with the ROM's two letter codes, and every disk error is shown as UE, as the manual says. A library command run by CMD loads over ERROR/OVL, so BASIC/CMD sets bit 1 again and the next error loads it afresh.
Finding the Message
The list holds the messages one after another, each ended by 00H. The routine turns the offset into the number of a message (5204H): the offsets 00H-2EH (the 23 errors of the ROM's table, NEXT without FOR to DISK BASIC feature, and 2EH, Undefined user function) are taken as they are; the disk error offsets 64H-8AH (error codes 51-70, FIELD overflow to File access DENIED) have 34H subtracted, so that they follow the first 24 messages; every other offset (2FH-62H and 8BH-FFH) is shown as Unprintable error, offset 26H. Half of the result, plus one, is the number of 00H bytes to pass from 5266H, done with the ROM's text scan at 1F07H (5219H). The offsets 70H, 76H and 78H (error codes 57, 60 and 61) have the text ? only; BASIC/CMD's map of the DOS errors (6CB6H) and its own error exits never produce them.
| Offsets | Error code | Messages |
|---|---|---|
| 00H-2CH | 1-23 | The ROM's errors, NEXT without FOR (NF) to DISK BASIC feature (L3), in the ROM's order. |
| 2EH | 24 | Undefined user function (BASIC/CMD's FN). |
| 30H-62H | 25-50 | No message: Unprintable error. |
| 64H-8AH | 51-70 | The disk errors, FIELD overflow to File access DENIED (? for 57, 60 and 61). |
| 8CH-FEH | 71-128 | No message: Unprintable error. |
What Is Shown
The message is shown without the ROM's question mark and without the word Error (5220H). BASIC/CMD's 6C47H then clears the run flag; a program loaded with access level 6 or 7, which may not be listed, is wiped there, RUN access only is shown and BASIC goes to READY without coming back (5223H). What follows depends on the current line number in 40A2H-40A3H:
| Line number | Then |
|---|---|
| FFFEH | The start-up of BASIC: BASIC/CMD's start-up copies the ROM's table (18F7H) to 4080H, and the table holds FFFEH for 40A2H. An error before any line has run, such as a program named after BASIC that cannot be loaded, ends BASIC with a new line and EXIT@ (5226H). The ROM goes to its restart at 0674H in this case. |
| FFFFH | Direct mode: READY (1A19H) at once (5235H). |
| Any other | The text in and the line number (the ROM's 0FA7H), a new line, the arrow and the statement in error (523CH). |
The statement is found through 40F7H-40F8H, where the ROM's error routine keeps the text pointer of the statement in error: the byte before the statement, a colon inside a line or the 00H that ends the line before (5242H). After a colon the line is shown from the colon on, which gives the manual's example, NEXT without FOR in 30 and then --> : NEXT J. After a 00H the next line's link is tested: a link of 0000H (the end of the program) goes to READY without an arrow; otherwise the text of that line is shown from its first statement, without a colon. BASIC/CMD's 64CDH expands the tokenized text into file area 0's buffer and shows it (525BH), and the routine ends at the ROM's READY.
Differences from the Manual
The manual (Disk BASIC, pages 5-40 and 5-57) agrees with the bytes: the message texts and their error codes and ERR values are those of its table, and the display is the message, in, the line number, and the arrow before the statement. The manual does not say that the error codes 57, 60 and 61, which its table leaves out, show the text ?, that an error during the start-up of BASIC returns to the DOS, or that a run only program is wiped after the message.
The Model I and the Model III
The two files are the same, and the ROM addresses ERROR/OVL uses (1F07H, 28A7H, 20F9H, 0FA7H, its text at 1924H, 1A19H, and the table entry FFFEH at 1919H-191AH) are the same in the Model I and Model III ROMs; the page of each model links to that model's BASIC/CMD and SYS0/SYS pages.
Variables
Memory Outside ERROR/OVL
| Address Size | Contents |
|---|---|
| 40A2H-40A3H 2 bytes | Current line number FFFEH during the start-up, FFFFH in direct mode (5226H). |
| 40F7H-40F8H 2 bytes | Text pointer of the statement in error Saved by the ROM's error routine at 19CDH (5242H). |
| 62F5H 1 byte | ERROR/OVL state BASIC/CMD: bit 0 use ERROR/OVL, bit 1 load it first (5C00H). |
| 62F8H-62F9H 2 bytes | ERROR/OVL entry BASIC/CMD: the transfer address 5200H that LOAD@ returned (5C10H). |
In ERROR/OVL
| Address Size | Contents |
|---|---|
| 5261H-5265H 5 bytes | Arrow The text --> and a space, ended by 00H (5261H). |
| 5266H-5526H 705 bytes | Message list A 00H, then the 44 messages, each ended by 00H (5266H). |
Registers
| Register | Contents |
|---|---|
| E | Entry: the offset of the error (the ERR value). Then the number of 00H bytes still to pass (5215H). |
| HL | The message list pointer, then the line number, then the text of the statement in error (5201H, 5226H, 5242H). |
Outside Routines
| Address | Contents |
|---|---|
| 6C47H | BASIC/CMD: clear the run flag and wipe a run only program (5223H). |
| 64CDH | BASIC/CMD: expand and show the text of a line (525BH). |
| 402DH | SYS0/SYS: EXIT@ (5232H). |
| 1F07H | ROM: scan the text to its next 00H (5219H). |
| 28A7H | ROM: show the text up to its 00H (5220H, 5257H). |
| 20F9H | ROM: a new line when the cursor is not at the start of one (522FH, 523FH). |
| 0FA7H | ROM: the text in and the line number (523CH). |
| 1A19H | ROM: READY (5239H, 524DH, 525EH). |
Disassembly
5200H - Long Error Message
ERROR/OVL's transfer address. BASIC/CMD's error hook at 5C00H (link 41A6H) loads ERROR/OVL into 5200H on the first error and then returns into it, with Register E = the offset of the error (ERR) and, on the stack, the return address of the ROM's CALL 41A6H at 19ECH; the ROM has already passed the errors to an ON ERROR GOTO handler. ERROR/OVL turns the offset into the number of a message in its list, shows the message, lets BASIC/CMD wipe a run only program, and then: during the start-up of BASIC (line number FFFEH) goes back to the DOS; in direct mode (FFFFH) goes to READY; in a program shows in and the line number, then --> and the statement in error with the rest of its line, and goes to READY.
5266H - The Messages
The 44 messages, each ended by 00H, after a first 00H at 5266H. Message n (counted from 0) is found after n + 1 bytes 00H: the messages 0-23 are those of the offsets 00H-2EH (the ROM's 23 errors and Undefined user function), the messages 24-43 those of the disk error offsets 64H-8AH (error codes 51-70). Offsets 70H, 76H and 78H (error codes 57, 60 and 61) have the text ? only; BASIC/CMD raises none of them.