DOSPLUS 3.5 for the Model I - SYS5/SYS Disassembled
Page Customization
Page Index
SYS5/SYS
Other Navigation
Introduction/Summary
DOSPLUS 3.5 SYS5/SYS Disassembly - ERROR@ and the Error Messages (Model I)
SYS5/SYS is the low overlay of ERROR@ (4409H, request code 43H): it displays the message of an error code and then returns to the caller or leaves through ABORT@. The file is a load module of 3 blocks, 753 bytes, from 4E00H to 50F0H, with the transfer address 4E00H; most of it is the text of the messages, kept as a table of 64 words and, for each of the 64 error numbers, a list of word numbers.
The Parts of SYS5/SYS
| Address | Contents |
|---|---|
| 4E00H-4E05H | The routine table (routines 2 and 3) and routine 2 (4E00H, 4E04H). |
| 4E06H-4E54H | ERROR@: the stack, the frame, the last error, the return or ABORT@ (4E06H). |
| 4E55H-4E92H | The message display (4E55H). |
| 4E93H-5023H | The word table, 64 words (4E93H). |
| 5024H-50F0H | The message list, errors 00H-3FH (5024H). |
ERROR@
Register A brings the error number in bits 5-0, bit 6 clear for a message framed in asterisks and bit 7 set to return to the caller, as the manual says. ERROR@ pushes Register Pair AF before its RST 28H, so the routine finds on the stack the overlay handler's return (49DDH), the word the handler saved from 4307HH-4308HH, that AF and the caller's return. It drops the handler's return, keeps the saved word at 4E53H, takes AF off and puts the word back above the caller's return (4E06H-4E12H). After the message and a carriage return the error code, bits 7 and 6 included, is stored to 4304HH, the last error, which the ERROR library command (SYS12/SYS) reads. With bit 7 set, 4307HH-4308HH are restored and the routine returns straight to the caller of ERROR@ with Register A = the code; with bit 7 clear it puts 402DH (EXIT@) on the stack and jumps to ABORT@ (4030H), which is a jump to EXIT@, or to DEBUG@ when DEBUG is on (4E3FH).
The Messages
The message of error n is found by counting the marked bytes (bit 7 set) of the message list (4E55H); each byte of the message is a word number, and the word is found by counting the marked bytes of the word table. The first word of a message is displayed with its first letter as stored (upper case) and every other character is ORed with 20H, so the messages come out as "Crc error during header read"; a space follows each word. The emphasized frame displayed before and after the message is the text at 4E4EH, an asterisk, a space, an asterisk and a space. Errors 33H-3FH all have the one word Unknown error code.
Differences from the Manual
The manual shows the emphasized frame as two asterisks; the bytes have an asterisk, a space and an asterisk, and every message ends with a space before the closing frame or the carriage return. The texts of errors 00H-32H agree with the manual's table (T/56-T/57) word for word.
Variables
Memory Outside SYS5/SYS
| Address Size | Contents |
|---|---|
| 4304HH 1 byte | Last Error The error code with bits 7 and 6 (4E38H). |
| 4307HH-4308HH 2 bytes | Request Save Word Restored when ERROR@ returns (4E49H). |
In SYS5/SYS
| Address Size | Contents |
|---|---|
| 4E4EH-4E52H 5 bytes | Frame The asterisk frame and 03H (4E4EH). |
| 4E53H-4E54H 2 bytes | Saved Word The handler's saved word (4E53H). |
| 4E93H-5023H 401 bytes | Word Table 4E93H |
| 5024H-50F0H 205 bytes | Message List 5024H |
Registers
| Register | Contents |
|---|---|
| A | Entry: the error (bits 5-0 the number, bit 6 normal, bit 7 return). Return: the same. |
| B | The error with its bits, tested for bit 6 (4E19H). |
| C | The error number, then 00H or 20H, the case of the next word (4E1CH, 4E8BH). |
Outside Routines
| Address | Contents |
|---|---|
| 4467H | SYS0/SYS: DSPLY@ (4E22H). |
| 4030H | SYS0/SYS: ABORT@ (4E45H). |
| 0033H | ROM: display the character in Register A (4E2FH, 4E79H). |
Disassembly
4E00H - The Routine Table
Data: SYS5/SYS's table of routines 2 and 3, one word each, used by SYS0/SYS's overlay request handler (its 49C9H-49DCH) for the request codes 42H and 43H. ERROR@ (4409H) requests 43H; no file of the diskette requests 42H.
4E04H - Routine 2
Nothing to do when SYS0/SYS's record locator brings SYS5/SYS back.
4E06H - ERROR@ - Posting an Error
Routine 3, requested by ERROR@ (4409H, PUSH AF / LD A,43H / RST 28H) with the error in Register A: bits 5-0 the error code, bit 6 clear for the message framed in asterisks, bit 7 set to return to the caller (clear to leave through ABORT@). The stack holds the overlay handler's return 49DDH, the word it saved from 4307H-4308H, the AF that ERROR@ pushed and the caller's return. The routine takes them apart itself, displays the message, stores the error to 4304H and either restores 4307H-4308H and returns to the caller of ERROR@, or jumps to ABORT@ (4030H).
4E55H - Displaying a Message
Displays the message of error number Register C (00H-3FH) from the message list at 5024H: each message is a list of word numbers, the first with bit 7 set; each word number picks a word from the word table at 4E93H, where each word begins with a character with bit 7 set. The first word is displayed with a capital letter and the rest in lower case (OR 20H on every other character); each word is followed by a space. Register Pair HL is kept.
4E93H - The Word Table
Data: the 64 words of the error messages, each with bit 7 set on its first character; 4E6BH counts the marked bytes to find word n. The byte at 5023H (A0H, a marked space) ends the last word.
5024H - The Message List
Data: the messages of the errors 00H-3FH, each a list of word numbers with bit 7 set on the first; 4E5AH counts the marked bytes to find message n. Errors 33H-3FH all give word 64, Unknown error code. The byte at 50F0H (80H) ends the last message.