Percom DoubleDOS 4.24 for the Model I - SYS4/SYS Disassembled
Page Customization
Page Index
SYS4/SYS
Other Navigation
Introduction/Summary
Percom DoubleDOS 4.24 SYS4/SYS Disassembly (Model I)
SYS4/SYS is the overlay of DoubleDOS (DBLDOS in Percom's manual) that shows the message of an error code. It is overlay 6 (directory record 06H): @ERROR, 4409H, jumps to 44B0H, which pushes Register Pair AF with the error code in Register A and gives request code 86H to the overlay dispatcher of SYS0/SYS (4BA2H). The dispatcher loads SYS4/SYS at 4E00H and calls it. SYS4/SYS is the one overlay whose absence stops the computer: the dispatcher HALTs when it is missing (43EBH), since there would be nothing to show the error with.
The file is 1210 bytes: a name record, the copyright record of 169 bytes, one load block, 4E00H-51F2H (1011 bytes), and the transfer address 4E00H. Every loaded byte is on exactly one row below. SYS4/SYS is the same in DoubleDOS 4.20, 4.23 (all three sets) and 4.24.
Load Map
| Addresses | Contents |
|---|---|
| 4E00H-4E13H | Take the error code off the stack, keep the registers (4E00H) |
| 4E14H-4E29H | Show the error code in decimal: never run (4E14H) |
| 4E2AH-4E5BH | Show the words of the message (4E2AH) |
| 4E5CH-4E72H | End the line, then return or leave the program (4E5CH) |
| 4E73H-4F35H | Show the device or file and the address of the call: never run (4E73H, 4F1BH) |
| 4F36H-4F83H | The texts of the parts never run (4F36H) |
| 4F84H-4FC3H | The message of each error number 00H-3FH (4F84H) |
| 4FC4H-502FH | The start of each word (4FC4H) |
| 5030H-515AH | The 53 words (5030H) |
| 515BH-51F2H | The lists of words of the messages (515BH) |
How a Message Is Shown
| Step | What the code does |
|---|---|
| 1 | The dispatcher's return address (4BFEH) is stored as the operand of the last jump (4E01H); the error code pushed by 44B0H is taken off the stack and the caller's registers saved. |
| 2 | The low six bits of the code are the error number. Its byte in the table at 4F84H is the low byte of a list of word numbers at 51xxH (4E2AH). |
| 3 | For each byte of the list, the word number in bits 5-0 gives the word's start in the table at 4FC2H and the next word's start its end; the word is shown through ROM 0033H and a space after it. Bit 7 marks the last word (4E31H). |
| 4 | A carriage return ends the line and the registers are restored (4E63H). |
| 5 | With bit 7 of the code set, SYS4/SYS returns through the dispatcher to the caller of 4409H with Register A the code; otherwise it jumps to 4030H, the abnormal exit, and the program ends at DOS READY (4E6CH). |
So the message is shown at the cursor with no error number and no other text: for example DISK SPACE FULL for code 1BH. Bit 6 of the code makes no difference.
The Messages
| Code | Message (as shown, each word followed by a space) Given by (the pages so far) |
|---|---|
| 00H | NO ERROR No file paged so far gives it |
| 01H | PARITY ERROR DURING HEADER READ No file paged so far gives it |
| 02H | SEEK ERROR DURING READ No file paged so far gives it |
| 03H | LOST DATA DURING READ SYS0/SYS read, status bit 2 (46C8H) |
| 04H | PARITY ERROR DURING READ SYS0/SYS read, bit 3 |
| 05H | DATA RECORD NOT FOUND DURING READ SYS0/SYS read, bit 4 |
| 06H | ATTEMPTED TO READ LOCKED/DELETED DATA RECORD SYS0/SYS read, bit 5 (the deleted data mark) |
| 07H | ATTEMPTED TO READ SYSTEM DATA RECORD SYS0/SYS read, bit 6 |
| 08H | DEVICE NOT AVAILABLE (bit 6 set on the last word) SYS0/SYS read, bit 7 (NOT READY) |
| 09H | PARITY ERROR DURING HEADER WRITE No file paged so far gives it |
| 0AH | SEEK ERROR DURING WRITE No file paged so far gives it |
| 0BH | LOST DATA DURING WRITE SYS0/SYS write, bit 2 |
| 0CH | PARITY ERROR DURING WRITE SYS0/SYS write, bit 3 |
| 0DH | DATA RECORD NOT FOUND DURING WRITE SYS0/SYS write, bit 4 |
| 0EH | WRITE FAULT ON DISK DRIVE SYS0/SYS write, bit 5 |
| 0FH | WRITE PROTECTED DISKETTE SYS0/SYS write, bit 6 |
| 10H | ILLEGAL LOGICAL FILE NUMBER SYS0/SYS write, bit 7 (NOT READY: a bug); a bad directory record (4B31H) |
| 11H | DIRECTORY READ ERROR SYS0/SYS (4AD1H) |
| 12H | DIRECTORY WRITE ERROR SYS0/SYS (4AEBH) |
| 13H | ILLEGAL FILE NAME (bit 6 set on the last word) SYS2/SYS |
| 14H | GAT READ ERROR SYS0/SYS (4B00H) |
| 15H | GAT WRITE ERROR SYS0/SYS (4B19H) |
| 16H | HIT READ ERROR SYS2/SYS, SYS3/SYS |
| 17H | HIT WRITE ERROR SYS2/SYS, SYS3/SYS |
| 18H | FILE NOT IN DIRECTORY (bit 6 set on the last word) SYS2/SYS; with bit 6, 58H, a missing overlay (43E6H) |
| 19H | FILE ACCESS DENIED (bit 6 set on the last word) SYS2/SYS, in code that never runs (4EACH) |
| 1AH | DIRECTORY SPACE FULL (bit 6 set on the last word) SYS2/SYS |
| 1BH | DISK SPACE FULL SYS0/SYS (4A85H) |
| 1CH | END OF FILE ENCOUNTERED SYS0/SYS |
| 1DH | RECORD NUMBER OUT OF RANGE SYS0/SYS |
| 1EH | DIRECTORY FULL - CAN'T EXTEND FILE SYS2/SYS |
| 1FH | PROGRAM NOT FOUND SYS0/SYS @LOAD, with bit 6 (5FH, 4C25H) |
| 20H | ILLEGAL DRIVE NUMBER (bit 6 set on the last word) SYS2/SYS |
| 21H | NO DEVICE SPACE AVAILABLE (bit 6 set on the last word) No file paged so far gives it |
| 22H | LOAD FILE FORMAT ERROR SYS0/SYS loader, with bit 6 (62H) |
| 23H | MEMORY FAULT SYS0/SYS loader, with bit 6 (63H) |
| 24H | ATTEMPTED TO LOAD READ ONLY MEMORY SYS0/SYS loader, with bit 6 (64H) |
| 25H | ILLEGAL ACCESS ATTEMPTED TO PROTECTED FILE SYS0/SYS, SYS3/SYS |
| 26H | FILE NOT OPEN (bit 6 set on the last word) SYS0/SYS, SYS3/SYS |
| 27H-3FH | UNKNOWN ERROR CODE No file paged so far gives these codes |
The read and write codes of SYS0/SYS are the base (01H for a read, 09H for a write) minus one plus the number of the lowest status bit counted from 1; the bits 0 and 1 (BUSY, DATA REQUEST) are dropped first, so the codes 01H, 02H, 09H and 0AH, the messages with HEADER and SEEK, are never given by SYS0/SYS. A drive that is not ready gives 08H on a read but 10H, ILLEGAL LOGICAL FILE NUMBER, on a write (46CDH).
The Parts That Are Never Run
Two parts of SYS4/SYS are in the file but are passed over. The jump at 4E12H is unconditional, so 4E14H-4E29H, which would show a new line, three star characters and ERRCOD= with the error number in decimal before the message, never runs; the BIT 6,B before it has no effect. At 4E60H-4E62H three NOP follow a BIT 6,A whose result is not used, and nothing calls 4E73H, which would show, on the lines after the message, three star characters, the device (<DEVICE=*XX>) or file (<FILE=NAME/EXT:D>) of the last file call's FCB at 430AH, and REFERENCED AT X' and the address of the CALL that made that file call (from 430CH). Which of the device or file forms it uses is chosen by bit 6 of the last byte of the message's list, which is set for the messages of the codes 08H, 13H, 18H, 19H, 1AH, 20H, 21H and 26H, those given while the FCB still holds the specification as text.
Differences From the Manual
Percom's manual gives no error messages; it refers to the TRSDOS manual. Percom's letter of September 8, 1980 says that COPY reported FILE NOT FOUND for a file that does not exist; no message of SYS4/SYS has those words (code 18H is FILE NOT IN DIRECTORY), so the words came from COPY/CMD (to be checked on that page).
Notes
Code 00H shows NO ERROR and, since its bit 7 is clear, ends the program through 4030H like any other code below 80H.
The words 03H (FORMAT) and 24H (OVERLAY) are in no message; word 2BH, FORMAT again, is the one used (LOAD FILE FORMAT ERROR). The two bytes at 4FC2H-4FC3H are both the entries of the error numbers 3EH and 3FH and the place of word 00H, which no list uses.
The routine at 4E73H, if it ran, would count 256 characters where 24 are meant: LD BC,0018H at 4EB5H loads Register B with 00H for the DJNZ. A specification with a password (up to 23 characters) would also write its > and carriage return past the end of the file text at 4F6FH into the text at 4F70H, and would show the password. These cannot happen in 4.24, since the routine is never called.
The operand at 4E6EH is written while SYS4/SYS runs; 4F42H-4F43H, 4F55H-4F56H and 4F60H on would be written by the parts that are never run (the Variables below).
Variables
SYS4/SYS's Own Bytes
| Address Size | Contents |
|---|---|
| 4E6EH-4E6FH 2 bytes | Return Address Into the Dispatcher Operand of JP M,nnnn at 4E6DH, stored by 4E01H: 4BFEH. |
| 4F42H-4F43H 2 bytes | Decimal Error Number The XX of ERRCOD=XX, stored by 4E20H (never run). |
| 4F55H-4F56H 2 bytes | Device Name The XX of DEVICE=*XX, stored by 4E94H (never run). |
| 4F60H-4F6FH 16 bytes | File Specification NNNNNNNN/EEE:D> and a carriage return, written by 4EB8H-4EC0H or 4ED0H-4EFCH (never run). |
Memory Outside SYS4/SYS
| Address Size | Contents |
|---|---|
| 430AH-430BH 2 bytes | FCB of the Last File Call Read by 4E7DH (never run). |
| 430CH-430DH 2 bytes | Return Address of the Last File Call Read by 4F0CH (never run). |
| 4200H-42FFH 256 bytes | Sector Buffer The directory sector read by 4AC1H for 4EC4H (never run). |
The Stack at 4E00H
| Place | Contents |
|---|---|
| SP+00H | 4BFEH, the return address of CALL 0000H at 4BFBH in the dispatcher |
| SP+02H | Register Pair AF pushed by 44B0H: the error code in Register A |
| SP+04H | The return address of the CALL 4409H (the dispatcher dropped the RST 28H return address) |
Outside Routines
| Address | Use |
|---|---|
| 0033H | ROM: Show a Character 4E4CH, 4E53H, 4E65H; 4F33H (never run). |
| 4030H | SYS0/SYS: The Abnormal Exit 4E70H. |
| 4467H | SYS0/SYS: Show a Text up to 03H or 0DH 4E27H, 4E77H, 4E9BH, 4F03H, 4F09H, 4F18H (never run). |
| 4AC1H | SYS0/SYS: Read a Directory Record 4EC4H (never run). |
| 4BFEH | SYS0/SYS: The Dispatcher After the Overlay Call Through 4E6DH: restores the BREAK flag 4315H and returns. |
Disassembly
4E00H - Show the Message of an Error Code
The transfer address of SYS4/SYS, overlay 6. @ERROR (4409H) jumps to 44B0H, which pushes Register Pair AF (the error code in Register A) and gives request code 86H to the overlay dispatcher of SYS0/SYS; the dispatcher calls 4E00H with the return address 4BFEH on top of the stack, the pushed error code under it and the return address of the caller of 4409H under that. SYS4/SYS shows the words of the message of the code's low six bits, ends the line, and then returns to the caller when bit 7 of the code is set, or else leaves the program through 4030H. Every register is kept. Bit 6 of the code has no effect in 4.24 (4E0EH, 4E5EH).
4E14H - Show the Error Code in Decimal (Never Run)
Bytes that no instruction reaches: the jump at 4E12H passes over them. They would write the number of the error in Register A as two decimal digits into the text at 4F42H and show the text at 4F36H, a new line, three asterisks and ERRCOD=nn and a comma, through 4467H; the message would follow on the same line.
4E2AH - Show the Words of the Message
Register Pair BC is the number of the error. The table at 4F84H gives the low byte of the message's list of word numbers in the page 5100H-51FFH. Each byte of the list names a word by its low six bits; the word table at 4FC2H gives the word's start, and the start of the next word is its end. Each word is shown through ROM 0033H followed by a space. Bit 7 of a byte marks the last word.
4E5CH - End the Line, Then Return or Leave
The message has been shown. The line is ended with a carriage return and the caller's registers are restored. An error code with bit 7 set returns to the caller of 4409H through the dispatcher; any other code ends the program through 4030H, the abnormal exit, which goes back to DOS READY (or into DEBUG when DEBUG is on).
4E73H - Show the Device or File and the Calling Address (Never Run)
No instruction calls 4E73H: the three NOP at 4E60H-4E62H stand where a call would be. The routine would show three asterisks on a line, then the device or the file of the FCB of the last file call (430AH) and the address of that call (430CH). Bit 6 of the last byte of the message's list chooses the form: set for the messages of codes 08H, 13H, 18H, 19H, 1AH, 20H, 21H and 26H, where the FCB still holds the specification as text.
4F1BH - Show Register Pair HL in Hexadecimal (Never Run)
Called only from 4F12H. Register H and then Register L are shown as two hexadecimal digits each through ROM 0033H; 4F20H shows Register A, 4F29H its low four bits.
4F36H - The Texts of the Parts Never Shown
The texts that 4E14H and 4E73H would show through 4467H, which stops at 03H (the cursor stays on the line) or at 0DH (the line ends). Neither routine runs in 4.24. Bytes C0H-FFH are the ROM's space compression codes: C0H plus n gives n spaces.
4F84H - The Message of Each Error Number
One byte for each error number 00H-3FH, the low six bits of the error code: the low byte of the address of the message's list of words in the page 5100H-51FFH (4E2AH-4E2FH). Every number from 27H on gives the list at 51F0H, UNKNOWN ERROR CODE.
4FC4H - The Start of Each Word
The table of words starts at 4FC2H: word n's start is the word at 4FC2H plus twice n, for the words 01H-35H, and the start of the next word is the end of each one (4E3DH-4E44H). The entry after word 35H, 515BH, ends the last word.
5030H - The Words
The 53 words of the messages, one after another with no end mark: the table at 4FC4H gives where each starts. Word 03H (FORMAT) and word 24H (OVERLAY) are in no message; word 2BH is FORMAT again.
515BH - The Lists of Words of the Messages
For each message, the numbers of its words in bits 5-0, one byte a word; bit 7 marks the last word. Bit 6 of the last byte, set in the messages of errors 08H, 13H, 18H, 19H, 1AH, 20H, 21H and 26H, is read only by 4E82H, which never runs; 4E32H drops it.