TRS-80 DOS - TRSDOS v1.3 - SYS10/SYS Disassembled

General:

SYS10/SYS is the overlay the source calls SYSTEM 10 - DIRECTORY FOR BASIC. It has two jobs: the short directory display $DSPDIR (4419H, used by Disk BASIC's CMD"D:d") and the texts of BASIC's error messages for Disk BASIC.

Program Overview

SYS10 loads at 4E00H-51D1H (978 bytes in four load records, transfer address 4E00H). SYSLD (4B82H) runs it through RST 28H with the request code in Register A and the caller's BC, DE and HL kept. START masks the code to bits 7-4 and picks one of two entries:

Entry 0, request 8AH: DODIR, the directory display. $DSPDIR at 4419H in SYS0 is LD A,8AH / RST 28H. The caller stores the drive as an ASCII digit ('0'-'3') in D10SAV (4271H); Disk BASIC's CMD"D:d" stores the character after the colon there and calls 4419H. DODIR clears OVLFLG (SYS6 is no longer resident), keeps bits 1-0 of D10SAV as the drive number, clears the screen, turns the cursor on and checks the drive against MAXDRV (4413H); a drive above it gives error 2 (Disk Drive Not in System) through ERROR with bits 6 and 7 set, so SYS4 shows the full text and returns to the caller. It then shows 'DRIVE :n' in the first 15 character column, reads sectors 2-18 of the directory track into 4300H one at a time through XREAD (4675H), and shows the name of each record whose attribute byte is not 00H and has neither bit 6 (system file) nor bit 3 (invisible file) set, as NAME/EXT padded to 15 characters, four columns to a line. A read error goes to ERROR with bits 6 and 7 set. The last 0DH is shown through a JUMP to 0033H, whose RET returns to the caller; all registers are changed.

Entry 1, request 9AH: DOERR, the BASIC error messages. SYSS10 at 427BH in SYS0 is LD A,9AH / RST 28H, and Disk BASIC puts JP 427BH into the ROM's error vector at 41A6H. The ROM's error routine calls 41A6H (at 19ECH) with Register E = BASIC's error code (twice the error number minus 2). DOERR turns the code into the number of a message in ERRTAB: errors 1-24 are messages 1-24, the disk errors 51-70 (codes 64H-8AH) are messages 25-44, and every other code gives message 20, 'Unprintable error'. It finds the message by counting the 00H bytes of the table and jumps to the ROM's 1A01H with Register Pair HL pointing to the text, which the ROM shows in place of its two letter code and ' Error', followed by the line number and READY.

Two faults in the shipped code. DIRLOP calls TRKGET (4B3EH) without loading Register C, so the directory track comes from the DIRTRK entry of whatever drive number Register C held when the caller ran 4419H (the source, SYS10.SRC, has an LD C,A that the file does not have). And DIRLO1 starts at sector 2, which is the HIT, so the five 48 byte pieces of the HIT are looked at as directory records before sectors 3-18. The zaps page has the patches for both (SYS10 at 4E2EH with 508AH, or 4E2AH, and 4E47H).

Memory Map

Address RangeLabelContents
4E00H-4E06HSTARTEntry point: mask the request code in Register A and go to DOERR (90H) or fall into DODIR (80H)
4E07H-4E29HDODIR, DIRGETClear OVLFLG, take the drive from D10SAV, clear the screen, turn the cursor on, check the drive against MAXDRV
4E2AH-4E63HDIRLOP, DIRLO1, DIRLO2Get the directory track (TRKGET), show 'DRIVE :n', read each sector 2-18 of the directory track into 4300H (XREAD)
4E64H-4ED9HNOERR, LOOP0, LOOP1, OUT0, OUT00, OUT1, LOOP2, OUT2, LOOP3, NXTNAM, TOTNXTShow each visible user file of the sector as NAME/EXT in a 15 character column, four columns to a line; end with 0DH through 0033H
4EDAH-4EEFHDRIVE, TRK, DRVMSG, DRV, SAVE3, S10SEC, NUMVariables and the heading text 'DRIVE :0' with seven spaces and 03H
4EF0H-4F10HDOERR, START1, START2, START3, START4Turn BASIC's error code in Register E into a message number, find the message in ERRTAB and jump to the ROM's 1A01H
4F11H-51D1HERRTAB00H, then 44 error messages, each ending with 00H

Complete Variable List

AddressLabelDescription
4271H
1 byte
D10SAVIn SYS0: the drive for $DSPDIR as an ASCII digit, stored by the caller (Disk BASIC's CMD"D:d" stores the character after the colon). DODIR (4E0BH) keeps bits 1-0.
442BH
1 byte
OVLFLGIn SYS0: the overlay flag byte. DODIR (4E08H) stores 00H, clearing bit 4 (SYS6 resident) and bit 7 (load only).
4413H
1 byte
MAXDRVIn SYS0: the highest drive number in the system. DODIR (4E1FH) refuses a drive above it with error 2.
4300H-43FFH
256 bytes
BUFF1In SYS0: the first disk buffer. XREAD puts each directory sector here; LOOP0 looks at its records at 4300H, 4330H, 4360H, 4390H and 43C0H.
4E56H
1 byte
SAVTRKThe operand of LD D,00H at 4E55H (the source's SAVTRK EQU $+1): the directory track, stored by 4E32H from TRKGET's Register D and used as the track for XREAD. 00H in the file.
4EDAH
1 byte
DRIVEThe drive number 0-3 being shown, stored by DIRGET (4E10H) and read at 4E1BH, 4E2AH and 4E51H. 00H in the file.
4EDBH
1 byte
TRKNo instruction reads or writes it. 00H in the file.
4EDCH-4EEBH
16 bytes
DRVMSG'DRIVE :0' with seven spaces (15 characters, the width of a column) and 03H, shown by PRINT (021BH) at 4E43H without a new line.
4EE3H
1 byte
DRVThe drive digit in DRVMSG ('0' in the file), stored by 4E38H.
4EECH-4EEDH
2 bytes
SAVE3The address of the directory record being looked at (4300H in the file), set by NOERR (4E67H) and moved on by 30H at TOTNXT (4EC6H).
4EEEH
1 byte
S10SECThe number of the next directory sector to read: 02H from DIRLO1 (4E48H), counted up by DIRLO2 (4E4FH) to 13H (19), where the display ends. 00H in the file.
4EEFH
1 byte
NUMThe count of 15 character columns used on the current line: 01H after the heading (4E3DH), then counted up after each name; at 4 a 0DH is shown and it becomes 00H (4EBCH). 00H in the file.
4F11H-51D1H
705 bytes
ERRTAB00H, then the 44 error messages, each ending with 00H; START4 (4F07H) counts the 00H bytes to find a message.
41A6H
3 bytes
The ROM's error vector: Disk BASIC stores JP 427BH there, so the ROM's error routine (19ECH) reaches DOERR through SYSS10.

Major Routine List

AddressLabelDescription / Entry-Exit
4E00HSTARTIn: Register A = request code 8AH ($DSPDIR, 4419H) or 9AH (SYSS10, 427BH); BC, DE and HL as the caller had them. Goes to DOERR for 9AH, falls into DODIR for 8AH.
4E07HDODIR$DSPDIR. In: (4271H) = ASCII drive digit. Shows the visible user files of the drive. Out: returns to the caller through 0033H with all registers changed, or through ERROR (bit 7 set) with error 2 or a read error.
4E2AHDIRLOPGets the directory track through TRKGET (4B3EH) into SAVTRK and shows 'DRIVE :n'.
4E46HDIRLO1Sets S10SEC to 2.
4E4BHDIRLO2Reads sector S10SEC of the directory track into 4300H through XREAD (4675H) and counts S10SEC up.
4E64HNOERRPoints SAVE3 to the first record of the sector.
4E6AHLOOP0Skips a record whose attribute byte is 00H or has bit 6 or bit 3 set; otherwise shows the name.
4E7DHLOOP1Shows the name, up to 8 characters, stopping at a space.
4E89HOUT0, OUT00Steps Register Pair HL to the extension at record offset 0DH.
4E91HOUT1, LOOP2Shows '/' and the 3 characters of the extension when its first character is not a space.
4EA6HOUT2, LOOP3Fills the column to 15 characters with spaces; after the fourth column of a line shows 0DH.
4EBFHTOTNXTMoves SAVE3 to the next record (30H on); after five records reads the next sector, after sector 18 shows 0DH and returns.
4EF0HDOERRIn: Register E = BASIC's error code. Works out the message number (START1, START2, START3), finds the message (START4) and jumps to the ROM's 1A01H with Register Pair HL = the message. Does not return.
4F11HERRTABThe table of the 44 messages.

Cross-references and Analysis Notes

Callers. $DSPDIR (4419H in SYS0, LD A,8AH / RST 28H) runs entry 0; the manual gives its entry condition as (X'4271') = ASCII-coded drive number '0', '1', '2' or '3' and its exit condition as all registers changed. SYSS10 (427BH in SYS0, LD A,9AH / RST 28H) runs entry 1, reached from the ROM's error vector 41A6H.

Source and file. The release file and the file assembled in the source tree (S:\2\SYS10) load the same 978 bytes. SYS10.SRC is a later version: it has LD C,A ;INTO C ALSO after the PUSH AF in DIRLOP, which the file does not have, so every address of the file after 4E2DH is one lower than that source assembles to. The page shows the file's bytes; the labels and comments come from SYS10.SRC.

Message numbers. Message n of ERRTAB is shown for error n (code 2n-2) when n is 1-24, and for error n+26 (code 2n+50) when n is 25-44; message 20 is also shown for errors 25-50 and for codes 8BH and up. The messages '?' (31, 34 and 35) belong to errors 57, 60 and 61. The manual lists the disk errors as 51 Field overflow, 52 Internal error, 53 Bad file number, 54 File not found, 55 Bad file mode, 58 Disk I/O error, 62 Disk full, 63 Input past end, 64 Bad record number, 65 Bad file name, 67 Direct statement in file, 68 Too many files, 69 Disk write-protect and 70 File access.

Zaps. The zaps page patches of SYS10 link into this page at 4E2AH (LD A,(4EDAH) becomes LD A,B / LD C,A / NOP), 4E2EH (CALL 4B3EH to CALL 508AH), 4E47H (the 02H of LD A,02H to 03H) and 508AH (the first four bytes of 'Disk Basic Feature' to LD C,A / JP 4B3EH).

Disassembly:

4E00H - START - Entry point: pick the directory display (request 8AH) or the BASIC error message (request 9AH)

 
ORG 4E00H
4E00START
AND 0F0H E6 F0
START: SYSLD (4B82H) enters SYS10 here with Register A = the overlay request code: 8AH from $DSPDIR (4419H, LD A,8AH / RST 28H) or 9AH from SYSS10 (427BH, LD A,9AH / RST 28H); bits 6-4 are the entry number and bits 3-0 the SYS number 10. SYSLD keeps the caller's BC, DE and HL. MASK Register A against 0F0H (1111 0000) to keep only bits 7-4, which leaves 80H for $DSPDIR and 90H for SYSS10.
Original Source Code Comment: MASK SYSTEM NUMBER
4E02
CP 90HCP VECT10 FE 90
Compare Register A (the masked request code, 80H or 90H) against 90H (VECT10, entry 1: the BASIC error message). If Register A equals 90H the Z FLAG is set; for 80H (entry 0, the directory) the NZ FLAG is set.
Original Source Code Comment: ERROR MESSAGES?
4E04
If the Z FLAG is set (request 9AH, a BASIC error message, Register E = BASIC's error code), JUMP to 4EF0H (DOERR). Otherwise fall through into DODIR, the directory display ($DSPDIR).
Original Source Code Comment: YES

4E07H - DODIR - Entry 0, $DSPDIR: take the drive from D10SAV, clear the screen and check the drive

4E07DODIR
XOR A AF
DODIR: Set Register A to 00H (and clear the CARRY FLAG) for OVLFLG below.
Original Source Code Comment: SHOW SYS 6 NOT IN MEMORY
4E08
Store 00H (Register A) into 442BH (OVLFLG, the overlay flag byte in SYS0). This clears bit 4 (SYS6 resident) and bit 7 (load only): SYS10 was loaded at 4E00H-51D1H, and the next library command must load SYS6 again.
4E0B
Fetch Register A = the byte at 4271H (D10SAV, the drive save area for SYS10 in SYS0). The caller of $DSPDIR stores the drive there as an ASCII digit, 30H-33H ('0'-'3'); Disk BASIC's CMD"D:d" stores the character typed after the colon.
Original Source Code Comment: GET THE DRIVE NUMBER
4E0E
AND 03HAND TOPDRV-1 E6 03
MASK Register A (the ASCII drive digit from D10SAV) against 03H (TOPDRV-1, four drives) to keep only bits 1-0, which turns '0'-'3' (30H-33H) into the drive number 0-3. Any other character also gives 0-3 (its bits 1-0).
Original Source Code Comment: MASK ALL BUT DRIVE
4E10DIRGET
DIRGET: Store Register A (the drive number 0-3) into 4EDAH (DRIVE, SYS10's own drive byte; the source's local DRIVE, not SYS0's drive select byte at 4423H). No instruction jumps to DIRGET.
Original Source Code Comment: SAVE THE DRIVE NUMBER
4E13
GOSUB to the ROM's CLS routine at 01C9H to clear the screen: it shows 1CH (home the cursor) and 1FH (clear to the end of the screen) through 033AH. Registers BC and HL are kept; A is changed.
Original Source Code Comment: CLEAR SCREEN
4E16
LD A,0EH 3E 0E
LET Register A = 0EH, the display code that turns the cursor on.
Original Source Code Comment: CURSOR ON CHAR
4E18
GOSUB to the ROM's $DSP at 0033H to send 0EH (Register A) to the display, which turns the cursor on. 0033H keeps BC, HL, IX and IY and changes AF and DE.
Original Source Code Comment: TURN CURSOR BACK ON
4E1B
Fetch Register A = the drive number 0-3 from 4EDAH (DRIVE, stored at 4E10H); Register A was changed by the CLS and 0033H calls.
Original Source Code Comment: GET THE DRIVE NUMBER
4E1E
LD B,A 47
Copy Register A (the drive number 0-3) into Register B for the comparison with the highest drive number.
Original Source Code Comment: INTO (B)
4E1F
Fetch Register A = the byte at 4413H (MAXDRV in SYS0): the highest drive number in the system (the number of drives minus 1, set at boot).
Original Source Code Comment: GET THE MAXIMUM DRIVE IN SYSTEM
4E22
CP B B8
Compare Register A (MAXDRV, the highest drive number) against Register B (the requested drive number 0-3). If MAXDRV is equal to or higher than the requested drive the NC FLAG is set; if the drive is above MAXDRV the CARRY FLAG is set.
Original Source Code Comment: WE TRYING FOR A NON-EXISTANT DRIVE?
4E23
If the NC FLAG is set (the drive in Register B is in the system), JUMP to 4E2AH (DIRLOP) to show its directory.
Original Source Code Comment: NO, CONTINUE
4E25
LD A,0C2HLD A,EDNS+0C0H 3E C2
The drive is above MAXDRV: LET Register A = 0C2H, error 2 (EDNS, Disk Drive Not in System) with bit 6 set (show the full text) and bit 7 set (return to the caller after the message).
Original Source Code Comment: DRIVE NOT IN SYSTEM ERROR
4E27
JUMP to 4409H (ERROR in SYS0), which pushes AF and runs SYS4 with error code 0C2H (Register A). Because this is a JUMP, the address on top of the STACK is the return address of the program that called $DSPDIR, so with bit 7 set SYS4 shows the message and returns to that program (a running DO file makes SYS4 abort to TRSDOS Ready instead).
Original Source Code Comment: REPORT AND RETURN

4E2AH - DIRLOP - Get the directory track, show the heading, then read each sector 2-18 of the directory track into 4300H

4E2ADIRLOP
DIRLOP: Fetch Register A = the drive number 0-3 from 4EDAH (DRIVE).
Original Source Code Comment: GET BINARY DRIVE
4E2D
PUSH AF F5
Save Register Pair AF (Register A = the drive number 0-3) to the top of the STACK; it is restored at 4E35H for the drive digit of the heading.
Original Source Code Comment: SAVE IT
4E2E
GOSUB to 4B3EH (TRKGET in SYS0), which returns Register D = the directory track of drive C from DIRTRK (4457H + Register C), keeps BC and changes HL. No instruction of SYS10 has loaded Register C: SYSLD, CLS (01C9H) and 0033H keep BC, so Register C still holds the value the caller of $DSPDIR had in it, not the drive number in Register A. The source (SYS10.SRC) has LD C,A after the PUSH AF; the file does not. The zaps page has the patches for this call (4E2EH CALL 508AH, with LD C,A / JP 4B3EH written over 508AH-508DH, or 4E2AH LD A,B / LD C,A / NOP).
Original Source Code Comment: GET THE DIRECTORY S10SEC FOR THIS DRIVE
4E31
LD A,D 7A
Copy Register D (the directory track TRKGET returned from DIRTRK) into Register A.
Original Source Code Comment: GET IT
4E32
Store Register A (the directory track) into 4E56H (SAVTRK), the operand byte of LD D,00H at 4E55H, so the XREAD call at 4E5AH reads from that track.
Original Source Code Comment: SAVE THE TRACK NUMBER
4E35
POP AF F1
Restore Register Pair AF from the top of the STACK: Register A = the drive number 0-3 saved at 4E2DH.
4E36
ADD A,30H C6 30
ADD 30H to Register A (the drive number 0-3) to make its ASCII digit, 30H-33H ('0'-'3').
Original Source Code Comment: MAKE IT ASCII
4E38
Store Register A (the ASCII drive digit) into 4EE3H (DRV), the digit after 'DRIVE :' in DRVMSG.
Original Source Code Comment: STORE IN DRIVE MESSAGE
4E3B
LD A,01HLD A,1 3E 01
LET Register A = 01H for NUM: the heading DRVMSG fills the first of the four 15 character columns of the first line.
4E3D
Store 01H (Register A) into 4EEFH (NUM), the count of the columns used on the current screen line.
4E40
LET Register Pair HL = 4EDCH, the address of DRVMSG ('DRIVE :n' with seven spaces, 15 characters, then 03H).
Original Source Code Comment: POINT TO DRIVE # MSG
4E43
GOSUB to the ROM's PRINT routine at 021BH to show the text at Register Pair HL (DRVMSG) up to the 03H at 4EEBH; the 03H ends the text without a new line, so the first file name follows on the same line. Register Pair HL comes back past the text; BC is kept.
Original Source Code Comment: PRINT IT
4E46DIRLO1
LD A,02HLD A,2 3E 02
DIRLO1: LET Register A = 02H, the first sector of the directory track to read. Sector 2 is the HIT (the hash index table); the directory records are in sectors 3-18, so this loop also reads the HIT and treats it as five 48 byte records (the zaps page patch at 4E47H changes this 02H to 03H). The operand byte at 4E47H is the address the zaps page links to.
Original Source Code Comment: SET FOR SECTOR 2
4E48
Store Register A (02H, the first sector number) into 4EEEH (S10SEC, the next directory sector to read).
Original Source Code Comment: STORE FOR USE
4E4BDIRLO2
DIRLO2: LET Register Pair HL = 4EEEH, the address of S10SEC (the next directory sector to read).
Original Source Code Comment: POINT TO TRACK
4E4E
LD A,(HL) 7E
Fetch Register A = the sector number at (HL), S10SEC (2-18): the sector this pass reads.
Original Source Code Comment: GET SEC NUM
4E4F
INC (HL) 34
INCrement S10SEC at (HL) by 1, so it holds the number of the sector after the one being read; 4ED0H compares it with 19.
Original Source Code Comment: SET FOR NEXT SEC, NXT LOOP
4E50
LD E,A 5F
Copy Register A (the sector number to read, 2-18) into Register E, the sector XREAD reads.
Original Source Code Comment: PUT IN E FOR CALL
4E51
Fetch Register A = the drive number 0-3 from 4EDAH (DRIVE).
Original Source Code Comment: GET PRESENT DRIVE
4E54
LD C,A 4F
Copy Register A (the drive number 0-3) into Register C, the drive XREAD reads from.
Original Source Code Comment: PUT IN C FOR CALL
4E55
LD D,00HLD D,0 16 00
LET Register D = the directory track, the operand at 4E56H (SAVTRK) that 4E32H stored from TRKGET (00H in the file). Register D is the track XREAD reads.
Original Source Code Comment: DIRECTORY TRACK SAVED HERE
4E57
LD HL,4300HLD HL,BUFF1 21 00 43
LET Register Pair HL = 4300H (BUFF1, the first 256 byte disk buffer in SYS0), where XREAD puts the sector.
Original Source Code Comment: WHERE TO STORE IT
4E5A
GOSUB to 4675H (XREAD in SYS0) to read the sector in Register E of track D on drive C into the buffer at Register Pair HL (4300H). XREAD returns the Z FLAG set when the read worked, or the NZ FLAG set with Register A = the TRSDOS error code.
Original Source Code Comment: READ DIR TRACK IN MEM
4E5D
If the Z FLAG is set (the sector is in 4300H-43FFH), JUMP to 4E64H (NOERR) to show its file names.
Original Source Code Comment: GOOD READ
4E5F
OR 0C0H F6 C0
The read failed: OR Register A (the error code from XREAD) with 0C0H (1100 0000) to set bit 6 (show the full text) and bit 7 (return to the caller after the message).
Original Source Code Comment: SET DETAIL MESSAGE BIT ON
4E61
JUMP to 4409H (ERROR in SYS0) with Register A = the error code from XREAD with bits 6 and 7 set. As at 4E27H, the address on top of the STACK is the return address of the program that called $DSPDIR, and SYS4 returns there after the message.
Original Source Code Comment: REPORT ERROR AND EXIT

4E64H - NOERR - Show the name of every visible user file in the sector at 4300H, four columns of 15 characters to a line

4E64NOERR
LD HL,4300HLD HL,BUFF1 21 00 43
NOERR: LET Register Pair HL = 4300H (BUFF1), the start of the sector just read: its first 48 byte record.
Original Source Code Comment: POINT TO BUFFER
4E67
Store Register Pair HL (4300H, the address of the first record) into 4EECH-4EEDH (SAVE3, the pointer to the record being looked at).
Original Source Code Comment: SAVE IT
4E6ALOOP0
LOOP0: Fetch Register Pair HL = the address of the record being looked at, from 4EECH-4EEDH (SAVE3): 4300H, 4330H, 4360H, 4390H or 43C0H.
Original Source Code Comment: GET POINTER
4E6D
LD A,(HL) 7E
Fetch Register A = byte 00H of the record at (HL), the attribute byte: 00H for a record that holds no file; bit 6 set for a system file, bit 3 set for an invisible file. In the HIT (sector 2) this byte is a file's hash code instead.
Original Source Code Comment: GET CHARACTER FROM DIR
4E6E
OR A B7
OR Register A with itself to set the FLAGS from the attribute byte (and clear the CARRY FLAG): the Z FLAG is set when it is 00H.
Original Source Code Comment: BLANK FILE?
4E6F
If the Z FLAG is set (the record holds no file), JUMP to 4EBFH (TOTNXT) to go on to the next record.
Original Source Code Comment: YES
4E71
AND 48H E6 48
MASK Register A (the attribute byte) against 48H (0100 1000) to keep only bit 6 (system file) and bit 3 (invisible file). The NZ FLAG is set when either bit is set.
Original Source Code Comment: SYSTEM OR INVISIBLE FILE?
4E73
If the NZ FLAG is set (a system or invisible file), JUMP to 4EBFH (TOTNXT) and do not show it.
Original Source Code Comment: SKIP IF SO
4E75
LD B,08HLD B,8 06 08
LET Register B = 08H, the most characters a file name has (the name field at record offsets 05H-0CH).
Original Source Code Comment: MAX LENGTH OF NAME
4E77
LD C,0FHLD C,15 0E 0F
LET Register C = 0FH (15), the width of a column: the name, the slash and extension, and the spaces after them add up to 15 characters. Every character shown below counts Register C down; the rest are spaces.
Original Source Code Comment: NAME/EXT+SPACES

The next 3 instructions add 05H to Register L, so HL points to the name at record offset 05H.

4E79
LD A,L 7D
Copy Register L (the low byte of the record address in Register Pair HL: 00H, 30H, 60H, 90H or C0H) into Register A, to add 5 to it.
Original Source Code Comment: GET LSB INTO A
4E7A
ADD A,05HADD A,5 C6 05
ADD 05H to Register A (the low byte of the record address): the offset of the file name in the record. No record crosses a page, so no carry into Register H is needed.
Original Source Code Comment: SET FOR BEGIN OF NAME
4E7C
LD L,A 6F
Copy Register A back into Register L, so Register Pair HL points to the first character of the file name (record offset 05H).
Original Source Code Comment: PUT BACK FOR ADDRESS
4E7DLOOP1
LD A,(HL) 7E
LOOP1: Fetch Register A = the character of the file name at (HL).
Original Source Code Comment: GET A CHARACTER FROM NAME
4E7E
INC HL 23
INCrement Register Pair HL by 1 to point to the next character of the name (or, after the eighth, to the extension at record offset 0DH).
4E7F
CP 20HCP ' ' FE 20
Compare Register A (the name character) against 20H (a space): the name field is padded with spaces after the name. If Register A is a space the Z FLAG is set.
Original Source Code Comment: SPACE?
4E81
If the Z FLAG is set (the end of a name shorter than 8 characters), JUMP to 4E89H (OUT0) with Register B = the characters of the field not yet passed.
Original Source Code Comment: DONE IF SO
4E83
GOSUB to the ROM's $DSP at 0033H to show the name character in Register A. BC and HL are kept.
Original Source Code Comment: PRINT OTHERWISE
4E86
DEC C 0D
DECrement Register C (the characters left in the 15 character column) by 1 for the character just shown.
Original Source Code Comment: DEC TOTAL COUNTER
4E87
DECrement Register B (the characters of the name field left) and LOOP back to 4E7DH (LOOP1) until all 8 have been shown; with B = 0, Register Pair HL points to the extension and the code falls into OUT0.
Original Source Code Comment: PRINT ALL OF NAME
4E89OUT0
LD A,B 78
OUT0: Copy Register B (the characters of the name field not passed: 0 after a full 8 character name, else 8 minus the number of characters shown) into Register A.
Original Source Code Comment: GET COUNT
4E8A
OR A B7
OR Register A with itself to set the FLAGS from that count: the Z FLAG is set when it is 0.
Original Source Code Comment: SET FLAGS
4E8B
If the Z FLAG is set (the name used all 8 characters and Register Pair HL already points to the extension), JUMP to 4E91H (OUT1).
Original Source Code Comment: NOTHING TO DO
4E8D
DEC HL 2B
DECrement Register Pair HL by 1, back onto the space that ended the name (LOOP1 had already stepped past it).
Original Source Code Comment: BACK POINT UP ONE
4E8EOUT00
INC HL 23
OUT00: INCrement Register Pair HL by 1, one position along the rest of the name field.
4E8F
DECrement Register B (the characters of the name field not passed) and LOOP back to 4E8EH (OUT00) until it is 0. Register Pair HL then points to the extension at record offset 0DH.

At this point Register Pair HL points to the extension of the record (offset 0DH).

4E91OUT1
LD A,(HL) 7E
OUT1: Fetch Register A = the first character of the extension at (HL), record offset 0DH.
Original Source Code Comment: NOW AT EXT
4E92
CP 20HCP ' ' FE 20
Compare Register A (the first character of the extension) against 20H (a space). If it is a space the Z FLAG is set: the file has no extension.
Original Source Code Comment: ANY EXT?
4E94
If the Z FLAG is set (no extension), JUMP to 4EA6H (OUT2) to fill the column with spaces.
Original Source Code Comment: IF NOT, SKIP
4E96
LD A,2FHLD A,'/' 3E 2F
LET Register A = 2FH (/), the character shown between the name and the extension.
Original Source Code Comment: PRINT A SEPERATOR
4E98
GOSUB to the ROM's $DSP at 0033H to show the / in Register A. BC and HL are kept.
4E9B
DEC C 0D
DECrement Register C (the characters left in the column) by 1 for the /.
Original Source Code Comment: DEC TOTAL COUNTER
4E9C
LD B,03HLD B,3 06 03
LET Register B = 03H, the length of the extension field (record offsets 0DH-0FH).
Original Source Code Comment: 3 CHARS IN EXT
4E9ELOOP2
LD A,(HL) 7E
LOOP2: Fetch Register A = the character of the extension at (HL).
Original Source Code Comment: GET A CHAR OF EXT
4E9F
INC HL 23
INCrement Register Pair HL by 1 to point to the next character of the extension.
Original Source Code Comment: POINT TO NEXT
4EA0
GOSUB to the ROM's $DSP at 0033H to show the extension character in Register A (a space when the extension is shorter than 3). BC and HL are kept.
Original Source Code Comment: PRINT IT
4EA3
DEC C 0D
DECrement Register C (the characters left in the column) by 1 for the character just shown.
Original Source Code Comment: DEC TOTAL COUNTER
4EA4
DECrement Register B (the extension characters left) and LOOP back to 4E9EH (LOOP2) until all 3 have been shown.
Original Source Code Comment: PRINT ALL OF EXT
4EA6OUT2
LD B,C 41
OUT2: Copy Register C (the characters left in the 15 character column: at least 3, since a name takes at most 8 and the extension 4 with its /) into Register B as the count of spaces.
Original Source Code Comment: GET TOTAL NUMBER
4EA7LOOP3
LD A,20HLD A,' ' 3E 20
LOOP3: LET Register A = 20H (a space).
Original Source Code Comment: OUTPUT SPACES
4EA9
GOSUB to the ROM's $DSP at 0033H to show the space in Register A. BC and HL are kept.
4EAC
DECrement Register B (the spaces left) and LOOP back to 4EA7H (LOOP3) until the column is 15 characters wide.
4EAE
Fetch Register A = the count of columns used on this screen line from 4EEFH (NUM): 1-3 (the heading counts as the first column of the first line), or 0 after a new line.
Original Source Code Comment: GET HOW MANY THIS LINE
4EB1
INC A 3C
INCrement Register A (the column count) by 1 for the name just shown.
Original Source Code Comment: ADD ONE TO IT
4EB2
CP 04HCP 4 FE 04
Compare Register A (the new column count) against 04H, the four columns of 15 characters on a line. If it is below 4 the CARRY FLAG is set.
Original Source Code Comment: 3 NAMES ON SCREEN?
4EB4
If the CARRY FLAG is set (the line has room), JUMP to 4EBCH (NXTNAM) to store the count.
Original Source Code Comment: IF NOT, KEEP GOING THIS LINE

The fourth column of this line is used: end the line and start the count again.

4EB6
LD A,0DH 3E 0D
The fourth column of the line is used: LET Register A = 0DH (carriage return).
Original Source Code Comment: OUT A CR FOR NEXT LINE
4EB8
GOSUB to the ROM's $DSP at 0033H to show the 0DH in Register A, which moves the cursor to the start of the next line.
4EBB
XOR A AF
Set Register A to 00H (and clear the FLAGS): no column of the new line is used yet.
Original Source Code Comment: CLEAR NUMBER COUNTER
4EBCNXTNAM
NXTNAM: Store Register A (the column count: 1-3, or 0 after a new line) into 4EEFH (NUM).
Original Source Code Comment: SAVE COUNTER

4EBFH - TOTNXT - Go on to the next record, the next sector, or end the display

4EBFTOTNXT
TOTNXT: Fetch Register Pair HL = the address of the record just looked at, from 4EECH-4EEDH (SAVE3).
Original Source Code Comment: GET BUFFER POINTER

The next 3 instructions add 30H to Register L, so HL points to the next record.

4EC2
LD A,L 7D
Copy Register L (the low byte of the record address: 00H, 30H, 60H, 90H or C0H) into Register A, to add 30H to it.
Original Source Code Comment: PUT LSB INTO A
4EC3
ADD A,30H C6 30
ADD 30H (48, the length of a directory record) to Register A, the low byte of the record address.
Original Source Code Comment: POINT TO NEXT NAME
4EC5
LD L,A 6F
Copy Register A back into Register L, so Register Pair HL = the address of the next record (Register H stays 43H).
Original Source Code Comment: PUT BACK FOR ADDRESS
4EC6
Store Register Pair HL (the address of the next record) into 4EECH-4EEDH (SAVE3).
Original Source Code Comment: PUT ADJUSTED BACK
4EC9
CP 0F0H FE F0
Compare Register A (the low byte of the next record address) against 0F0H. A sector holds five records at offsets 00H, 30H, 60H, 90H and C0H; F0H is past the last one. If Register A is below 0F0H the CARRY FLAG is set.
Original Source Code Comment: WE AT END OF THIS SECTOR?
4ECB
If the CARRY FLAG is set (another record is in this sector), JUMP back to 4E6AH (LOOP0) to look at it.
Original Source Code Comment: NEXT NAME IF NOT DONE

All five records of this sector have been looked at: go on to the next sector.

4ECD
The five records of this sector are done: fetch Register A = S10SEC from 4EEEH, the number of the sector after the one just read (3-19).
Original Source Code Comment: GET PRESENT TRACK
4ED0
CP 13HCP 19 FE 13
Compare Register A (the next sector number) against 13H (19), one past the last sector of the directory track (18). If it is below 19 the CARRY FLAG is set.
Original Source Code Comment: ALL DIR TRACKS YET?
4ED2
If the CARRY FLAG is set (sectors are left), JUMP back to 4E4BH (DIRLO2) to read the next one.
Original Source Code Comment: IF NOT, KEEP GOING
4ED5
LD A,0DH 3E 0D
Sectors 2-18 have been shown: LET Register A = 0DH (carriage return) to end the last line.
Original Source Code Comment: NEW LINE PLEASE
4ED7
JUMP to the ROM's $DSP at 0033H to show the 0DH in Register A. The RET at the end of 0033H returns to the program that called $DSPDIR (Disk BASIC's CMD"D" code, or a program that calls 4419H). AF, BC, DE and HL are changed, as the manual's exit conditions for $DSPDIR say (All registers are changed).
Original Source Code Comment: DISPLAY AND EXIT

4EDAH - DRIVE - Variables and the heading text DRVMSG

4EDADRIVE
DEFB 00H 00
DRIVE: the drive number 0-3 being shown. DIRGET (4E10H) stores it from D10SAV; 4E1BH, 4E2AH and 4E51H read it. 00H in the file.
4EDBTRK
DEFB 00H 00
TRK: no instruction of SYS10 reads or writes this byte (the directory track is kept in SAVTRK, 4E56H). 00H in the file.
4EDC-4EE2DRVMSG
DEFM "DRIVE :" 44 52 49 56 45 20 3A
DRVMSG: 'DRIVE :', the start of the heading that 4E40H points Register Pair HL to and PRINT (021BH) shows at 4E43H.
4EE3DRV
DEFB 30H 30
DRV: the drive digit of the heading, '0' (30H) in the file; 4E38H stores the ASCII digit of the drive being shown (30H-33H).
4EE4-4EEA
DEFM " " 20 x 7
Seven spaces, which make the heading 15 characters wide, the width of one column of names.
4EEB
DEFB 03H 03
03H: ends DRVMSG for PRINT without a new line, so the first file name follows on the same line.
4EEC-4EEDSAVE3
DEFW 4300HDEFW BUFF1 00 43
SAVE3: the address of the directory record being looked at, 4300H (BUFF1) in the file. NOERR (4E67H) sets it to 4300H for each sector and TOTNXT (4EC6H) moves it on by 30H.
4EEES10SEC
DEFB 00H 00
S10SEC: the number of the next directory sector to read. DIRLO1 (4E48H) sets 02H, DIRLO2 (4E4FH) counts it up after taking the sector number, and 4ED0H ends the display when it reaches 13H (19). 00H in the file.
4EEFNUM
DEFB 00H 00
NUM: the count of 15 character columns used on the current line. 4E3DH sets 01H (the heading uses the first column), NXTNAM (4EBCH) stores the count after each name, 00H after the fourth column. 00H in the file.

4EF0H - DOERR - Entry 1: find the text for BASIC's error code in Register E and show it through the ROM's error routine

4EF0DOERR
LD A,E 7B
DOERR: Copy Register E (BASIC's error code, which the ROM's error routine passes at 19E3H: twice the error number minus 2, so error 1 is 00H and error 70 is 8AH) into Register A. SYS10 is entered here from SYSS10 (427BH), which Disk BASIC puts into the ROM's error vector 41A6H (JP 427BH); the ROM calls 41A6H at 19ECH with Register Pair HL = its own error table 18C9H.
4EF1
CP 8BH FE 8B
Compare Register A (BASIC's error code) against 8BH, one past 8AH (error 70, the last message in ERRTAB). If Register A is 8BH or higher the NC FLAG is set.
Original Source Code Comment: HIGHER THAN ALLOWABLE ERROR?
4EF3
If the NC FLAG is set (an error code past the table), JUMP to 4EFDH (START1) to show 'Unprintable error'.
Original Source Code Comment: YES, FORCE TO 'UNPRINTABLE' ERROR
4EF5
CP 63H FE 63
Compare Register A (the error code, below 8BH) against 63H. Codes 63H-8AH are the disk errors 51-70 (64H is error 51, FIELD overflow). If Register A is 63H or higher the NC FLAG is set.
Original Source Code Comment: DISK ERROR?
4EF7
If the NC FLAG is set (a disk error code, 63H-8AH), JUMP to 4EFFH (START2) to take 34H off it.
Original Source Code Comment: YES, DO IT
4EF9
CP 2FH FE 2F
Compare Register A (the error code, below 63H) against 2FH. Codes 00H-2EH are errors 1-24, which have messages in ERRTAB. If Register A is below 2FH the CARRY FLAG is set.
4EFB
If the CARRY FLAG is set (errors 1-24), JUMP to 4F01H (START3) with the code as it is. Codes 2FH-62H (errors 25-50, which have no message) fall through into START1.

Codes 2FH-62H (errors 25-50) fall through into START1 and get the Unprintable error message.

4EFDSTART1
LD A,5AH 3E 5A
START1: LET Register A = 5AH. After the SUB 34H, RRCA and INC A below, 5AH gives 20 (14H), the number of 'Unprintable error' in ERRTAB (505AH).
Original Source Code Comment: FORCE TO 'UNPRINTABLE' ERROR
4EFFSTART2
SUB 34H D6 34
START2: SUBtract 34H from Register A. For a disk error code 64H-8AH this gives 30H-56H, so that START3 makes the message numbers 25-44 (FIELD overflow ... File access DENIED); from START1, 5AH becomes 26H.
4F01START3
RRCA 0F
START3: Rotate Register A (the even error code, or the value from START2) right by one bit; bit 0, which is 0 for every even code, goes into bit 7 and the CARRY FLAG. This halves the code: 00H becomes 00H, 2EH becomes 17H, 56H becomes 2BH.
4F02
INC A 3C
INCrement Register A by 1, making the message number in ERRTAB: 1 for error 1 (NEXT without FOR) ... 24 for error 24, 20 for 'Unprintable error', 25-44 for the disk errors 51-70.
4F03
LD B,A 47
Copy Register A (the message number, 1-44) into Register B, the count of 00H bytes for START4 to pass.
4F04
LET Register Pair HL = 4F11H (ERRTAB), the 00H that starts the table of messages.
Original Source Code Comment: HL => TABLE

At this point Register B holds the message number: START4 passes that many 00H bytes of ERRTAB.

4F07START4
LD A,(HL) 7E
START4: Fetch Register A = the byte of ERRTAB at (HL).
Original Source Code Comment: GET A CHARACTER
4F08
INC HL 23
INCrement Register Pair HL by 1 to point to the next byte of ERRTAB.
Original Source Code Comment: BUMP TO NEXT CHARACTER
4F09
OR A B7
OR Register A with itself to set the FLAGS from the byte just fetched: the Z FLAG is set at the 00H that ends a message (or the 00H at 4F11H that starts the table).
Original Source Code Comment: END OF THIS ERROR MESSAGE?
4F0A
If the NZ FLAG is set (a character of a message), LOOP back to 4F07H (START4) for the next byte.
Original Source Code Comment: NO, LOOP TILL FOUND

A 00H was found: one more message has been passed.

4F0C
A 00H has been passed and Register Pair HL points to the first character of the message after it. DECrement Register B (the message number still to find) and LOOP back to 4F07H (START4) until it is 0. With B = 1 at the start, the first pass ends at the 00H at 4F11H and HL = 4F12H ('NEXT without FOR').
Original Source Code Comment: LOOP FOR ERROR NUMBER
4F0E
JUMP to the ROM's 1A01H with Register Pair HL = the first character of the message, which ends with 00H. 1A01H pushes HL, swaps in the line number from 40EAH and shows the message through STROUT (28A7H) in place of the ROM's '?', two letter code and ' Error', then the line number through 0FA7H when the error happened in a program line, and goes on to BASIC's READY (1A19H). The return address of the ROM's CALL 41A6H (19EFH) is left on the STACK.
Original Source Code Comment: JP TO ERROR HANDLER

4F11H - ERRTAB - The 44 BASIC error messages, each ending with 00H

4F11ERRTAB
DEFB 00H 00
ERRTAB: the 00H before the first message. LD HL,4F11H (4F04H) points here, so the first pass of START4 ends at this byte; each 00H passed counts Register B down by 1, and when B reaches 0 Register Pair HL points to the message after the last 00H passed (4F12H, message 1, when B was 1).
Original Source Code Comment: START OF TABLE
4F12-4F21
DEFM "NEXT without FOR" 4E 45 58 54 20 77 69 74 68 6F 75 74 20 46 4F 52
Message 1: 'NEXT without FOR', shown for BASIC error 1 (code 00H).
4F22
DEFB 00H 00
00H: the end of message 1, which START4 (4F09H) tests for.
4F23-4F2E
DEFM "Syntax Error" 53 79 6E 74 61 78 20 45 72 72 6F 72
Message 2: 'Syntax Error', shown for BASIC error 2 (code 02H).
4F2F
DEFB 00H 00
00H: the end of message 2, which START4 (4F09H) tests for.
4F30-4F43
DEFM "RETURN without GOSUB" 52 45 54 55 52 4E 20 77 69 74 68 6F 75 74 20 47 4F 53 55 42
Message 3: 'RETURN without GOSUB', shown for BASIC error 3 (code 04H).
4F44
DEFB 00H 00
00H: the end of message 3, which START4 (4F09H) tests for.
4F45-4F4F
DEFM "Out of DATA" 4F 75 74 20 6F 66 20 44 41 54 41
Message 4: 'Out of DATA', shown for BASIC error 4 (code 06H).
4F50
DEFB 00H 00
00H: the end of message 4, which START4 (4F09H) tests for.
4F51-4F65
DEFM "Illegal function call" 49 6C 6C 65 67 61 6C 20 66 75 6E 63 74 69 6F 6E 20 63 61 6C 6C
Message 5: 'Illegal function call', shown for BASIC error 5 (code 08H).
4F66
DEFB 00H 00
00H: the end of message 5, which START4 (4F09H) tests for.
4F67-4F6E
DEFM "Overflow" 4F 76 65 72 66 6C 6F 77
Message 6: 'Overflow', shown for BASIC error 6 (code 0AH).
4F6F
DEFB 00H 00
00H: the end of message 6, which START4 (4F09H) tests for.
4F70-4F7C
DEFM "Out of memory" 4F 75 74 20 6F 66 20 6D 65 6D 6F 72 79
Message 7: 'Out of memory', shown for BASIC error 7 (code 0CH).
4F7D
DEFB 00H 00
00H: the end of message 7, which START4 (4F09H) tests for.
4F7E-4F92
DEFM "Undefined line number" 55 6E 64 65 66 69 6E 65 64 20 6C 69 6E 65 20 6E 75 6D 62 65 72
Message 8: 'Undefined line number', shown for BASIC error 8 (code 0EH).
4F93
DEFB 00H 00
00H: the end of message 8, which START4 (4F09H) tests for.
4F94-4FA9
DEFM "Subscript out of range" 53 75 62 73 63 72 69 70 74 20 6F 75 74 20 6F 66 20 72 61 6E 67 65
Message 9: 'Subscript out of range', shown for BASIC error 9 (code 10H).
4FAA
DEFB 00H 00
00H: the end of message 9, which START4 (4F09H) tests for.
4FAB-4FBD
DEFM "Redimensioned array" 52 65 64 69 6D 65 6E 73 69 6F 6E 65 64 20 61 72 72 61 79
Message 10: 'Redimensioned array', shown for BASIC error 10 (code 12H).
4FBE
DEFB 00H 00
00H: the end of message 10, which START4 (4F09H) tests for.
4FBF-4FCE
DEFM "Division by zero" 44 69 76 69 73 69 6F 6E 20 62 79 20 7A 65 72 6F
Message 11: 'Division by zero', shown for BASIC error 11 (code 14H).
4FCF
DEFB 00H 00
00H: the end of message 11, which START4 (4F09H) tests for.
4FD0-4FDD
DEFM "Illegal direct" 49 6C 6C 65 67 61 6C 20 64 69 72 65 63 74
Message 12: 'Illegal direct', shown for BASIC error 12 (code 16H).
4FDE
DEFB 00H 00
00H: the end of message 12, which START4 (4F09H) tests for.
4FDF-4FEB
DEFM "Type mismatch" 54 79 70 65 20 6D 69 73 6D 61 74 63 68
Message 13: 'Type mismatch', shown for BASIC error 13 (code 18H).
4FEC
DEFB 00H 00
00H: the end of message 13, which START4 (4F09H) tests for.
4FED-4FFF
DEFM "Out of string space" 4F 75 74 20 6F 66 20 73 74 72 69 6E 67 20 73 70 61 63 65
Message 14: 'Out of string space', shown for BASIC error 14 (code 1AH).
5000
DEFB 00H 00
00H: the end of message 14, which START4 (4F09H) tests for.
5001-500F
DEFM "String too long" 53 74 72 69 6E 67 20 74 6F 6F 20 6C 6F 6E 67
Message 15: 'String too long', shown for BASIC error 15 (code 1CH).
5010
DEFB 00H 00
00H: the end of message 15, which START4 (4F09H) tests for.
5011-502A
DEFM "String formula too complex" 53 74 72 69 6E 67 20 66 6F 72 6D 75 6C 61 20 74 6F 6F 20 63 6F 6D 70 6C 65 78
Message 16: 'String formula too complex', shown for BASIC error 16 (code 1EH).
502B
DEFB 00H 00
00H: the end of message 16, which START4 (4F09H) tests for.
502C-5039
DEFM "Can't Continue" 43 61 6E 27 74 20 43 6F 6E 74 69 6E 75 65
Message 17: 'Can't Continue', shown for BASIC error 17 (code 20H).
503A
DEFB 00H 00
00H: the end of message 17, which START4 (4F09H) tests for.
503B-5043
DEFM "No RESUME" 4E 6F 20 52 45 53 55 4D 45
Message 18: 'No RESUME', shown for BASIC error 18 (code 22H).
5044
DEFB 00H 00
00H: the end of message 18, which START4 (4F09H) tests for.
5045-5058
DEFM "RESUME without error" 52 45 53 55 4D 45 20 77 69 74 68 6F 75 74 20 65 72 72 6F 72
Message 19: 'RESUME without error', shown for BASIC error 19 (code 24H).
5059
DEFB 00H 00
00H: the end of message 19, which START4 (4F09H) tests for.
505A-506A
DEFM "Unprintable error" 55 6E 70 72 69 6E 74 61 62 6C 65 20 65 72 72 6F 72
Message 20: 'Unprintable error', shown for BASIC error 20 (code 26H). DOERR also gives this message for errors 25-50 (codes 2FH-62H) and for codes 8BH and up (START1, 4EFDH).
506B
DEFB 00H 00
00H: the end of message 20, which START4 (4F09H) tests for.
506C-507A
DEFM "Missing operand" 4D 69 73 73 69 6E 67 20 6F 70 65 72 61 6E 64
Message 21: 'Missing operand', shown for BASIC error 21 (code 28H).
507B
DEFB 00H 00
00H: the end of message 21, which START4 (4F09H) tests for.
507C-5088
DEFM "BAD File Data" 42 41 44 20 46 69 6C 65 20 44 61 74 61
Message 22: 'BAD File Data', shown for BASIC error 22 (code 2AH).
5089
DEFB 00H 00
00H: the end of message 22, which START4 (4F09H) tests for.
508A-509B
DEFM "Disk Basic Feature" 44 69 73 6B 20 42 61 73 69 63 20 46 65 61 74 75 72 65
Message 23: 'Disk Basic Feature', shown for BASIC error 23 (code 2CH). The zaps page patch writes LD C,A / JP 4B3EH over the first four bytes, 508AH-508DH, and calls it from 4E2EH.
509C
DEFB 00H 00
00H: the end of message 23, which START4 (4F09H) tests for.
509D-50B3
DEFM "Undefined User Function" 55 6E 64 65 66 69 6E 65 64 20 55 73 65 72 20 46 75 6E 63 74 69 6F 6E
Message 24: 'Undefined User Function', shown for BASIC error 24 (code 2EH).
50B4
DEFB 00H 00
00H: the end of message 24, which START4 (4F09H) tests for.
50B5-50C2
DEFM "FIELD overflow" 46 49 45 4C 44 20 6F 76 65 72 66 6C 6F 77
Message 25: 'FIELD overflow', shown for BASIC error 51 (code 64H).
50C3
DEFB 00H 00
00H: the end of message 25, which START4 (4F09H) tests for.
50C4-50D1
DEFM "Internal error" 49 6E 74 65 72 6E 61 6C 20 65 72 72 6F 72
Message 26: 'Internal error', shown for BASIC error 52 (code 66H).
50D2
DEFB 00H 00
00H: the end of message 26, which START4 (4F09H) tests for.
50D3-50E1
DEFM "Bad file number" 42 61 64 20 66 69 6C 65 20 6E 75 6D 62 65 72
Message 27: 'Bad file number', shown for BASIC error 53 (code 68H).
50E2
DEFB 00H 00
00H: the end of message 27, which START4 (4F09H) tests for.
50E3-50F0
DEFM "File not found" 46 69 6C 65 20 6E 6F 74 20 66 6F 75 6E 64
Message 28: 'File not found', shown for BASIC error 54 (code 6AH).
50F1
DEFB 00H 00
00H: the end of message 28, which START4 (4F09H) tests for.
50F2-50FE
DEFM "Bad file mode" 42 61 64 20 66 69 6C 65 20 6D 6F 64 65
Message 29: 'Bad file mode', shown for BASIC error 55 (code 6CH).
50FF
DEFB 00H 00
00H: the end of message 29, which START4 (4F09H) tests for.
5100-5110
DEFM "File already open" 46 69 6C 65 20 61 6C 72 65 61 64 79 20 6F 70 65 6E
Message 30: 'File already open', shown for BASIC error 56 (code 6EH).
5111
DEFB 00H 00
00H: the end of message 30, which START4 (4F09H) tests for.
5112
DEFM "?" 3F
Message 31: '?', shown for BASIC error 57 (code 70H). This error has no text of its own: only a question mark is shown.
5113
DEFB 00H 00
00H: the end of message 31, which START4 (4F09H) tests for.
5114-5121
DEFM "Disk I/O error" 44 69 73 6B 20 49 2F 4F 20 65 72 72 6F 72
Message 32: 'Disk I/O error', shown for BASIC error 58 (code 72H).
5122
DEFB 00H 00
00H: the end of message 32, which START4 (4F09H) tests for.
5123-5135
DEFM "File already exists" 46 69 6C 65 20 61 6C 72 65 61 64 79 20 65 78 69 73 74 73
Message 33: 'File already exists', shown for BASIC error 59 (code 74H).
5136
DEFB 00H 00
00H: the end of message 33, which START4 (4F09H) tests for.
5137
DEFM "?" 3F
Message 34: '?', shown for BASIC error 60 (code 76H). This error has no text of its own: only a question mark is shown.
5138
DEFB 00H 00
00H: the end of message 34, which START4 (4F09H) tests for.
5139
DEFM "?" 3F
Message 35: '?', shown for BASIC error 61 (code 78H). This error has no text of its own: only a question mark is shown.
513A
DEFB 00H 00
00H: the end of message 35, which START4 (4F09H) tests for.
513B-5143
DEFM "Disk full" 44 69 73 6B 20 66 75 6C 6C
Message 36: 'Disk full', shown for BASIC error 62 (code 7AH).
5144
DEFB 00H 00
00H: the end of message 36, which START4 (4F09H) tests for.
5145-5152
DEFM "Input past end" 49 6E 70 75 74 20 70 61 73 74 20 65 6E 64
Message 37: 'Input past end', shown for BASIC error 63 (code 7CH).
5153
DEFB 00H 00
00H: the end of message 37, which START4 (4F09H) tests for.
5154-5164
DEFM "Bad record number" 42 61 64 20 72 65 63 6F 72 64 20 6E 75 6D 62 65 72
Message 38: 'Bad record number', shown for BASIC error 64 (code 7EH).
5165
DEFB 00H 00
00H: the end of message 38, which START4 (4F09H) tests for.
5166-5172
DEFM "Bad file name" 42 61 64 20 66 69 6C 65 20 6E 61 6D 65
Message 39: 'Bad file name', shown for BASIC error 65 (code 80H).
5173
DEFB 00H 00
00H: the end of message 39, which START4 (4F09H) tests for.
5174-5180
DEFM "Mode-mismatch" 4D 6F 64 65 2D 6D 69 73 6D 61 74 63 68
Message 40: 'Mode-mismatch', shown for BASIC error 66 (code 82H).
5181
DEFB 00H 00
00H: the end of message 40, which START4 (4F09H) tests for.
5182-5199
DEFM "Direct statement in file" 44 69 72 65 63 74 20 73 74 61 74 65 6D 65 6E 74 20 69 6E 20 66 69 6C 65
Message 41: 'Direct statement in file', shown for BASIC error 67 (code 84H).
519A
DEFB 00H 00
00H: the end of message 41, which START4 (4F09H) tests for.
519B-51A8
DEFM "Too many files" 54 6F 6F 20 6D 61 6E 79 20 66 69 6C 65 73
Message 42: 'Too many files', shown for BASIC error 68 (code 86H).
51A9
DEFB 00H 00
00H: the end of message 42, which START4 (4F09H) tests for.
51AA-51BD
DEFM "Disk write protected" 44 69 73 6B 20 77 72 69 74 65 20 70 72 6F 74 65 63 74 65 64
Message 43: 'Disk write protected', shown for BASIC error 69 (code 88H).
51BE
DEFB 00H 00
00H: the end of message 43, which START4 (4F09H) tests for.
51BF-51D0
DEFM "File access DENIED" 46 69 6C 65 20 61 63 63 65 73 73 20 44 45 4E 49 45 44
Message 44: 'File access DENIED', shown for BASIC error 70 (code 8AH).
51D1
DEFB 00H 00
00H: the end of message 44, which START4 (4F09H) tests for.
 
END 4E00H