TRS-80 DOS - NEWDOS/80 v2.0 for the Model I - SUPERZAP/CMD Disassembled

Page Customization

Introduction/Summary

NEWDOS/80 v2.0 SUPERZAP/CMD Disassembly - Apparat's SUPERZAP/80 (Model I)

SUPERZAP/CMD (manual section 6.1) shows and changes 256-byte disk sectors and pages of main memory. It can show a sector of a drive (by relative sector or by track and sector), of a file, a page of memory or a page of a memory dump file made by DUMP; search them for one to four bytes; change them byte by byte; verify, zero and copy ranges of sectors; copy any string of bytes from one place on a diskette to another; and show the codes the DOS stores for a password and for a file name and type. The display and the questions identify it as APPARAT'S SUPERZAP/80.

The file has four load blocks: 5200H-52FFH (code and a zero block the stack uses), 5420H-543FH (the FCB template), 5480H-5486H and 5491H-6FFDH (the variables, the code, the tables and messages, and 254 unused zero bytes); transfer address 54C5H. 5300H-541FH (sector buffer and FCB), 5440H-547FH (the answer line) and 5487H-5490H (number text) are not in the file. The page shows every byte of the file once, in address order; each row says what every register and address it uses holds at that moment.

Menu Functions

The menu answer is looked up in the command table at 690DH by 54C5H. An empty answer is DD. ,P after DD, DM, DFS, DTS or DMDB prints as well (ILLEGAL PRINTER REQUEST for the others). An X typed as a numeric answer, or an empty filespec, goes back to the menu. Numbers are decimal unless they end in H.

CommandWhat it does
DDDisplay a disk sector: DRIVE AND RELATIVE-SECTOR-WITHIN-DRIVE #'S? (5584H). With ,P: SECTOR COUNT? and the sectors are printed.
DMDisplay main memory: MAIN MEMORY ADDRESS?, cut to its 256-byte page (564FH). With ,P: BYTE COUNT?.
DFSDisplay a file's sector: FILESPEC?, then RELATIVE-SECTOR-WITHIN-FILE #? (55CAH, 5641H).
DTSDisplay a track's sector: DRIVE, TRACK AND SECTOR #'S? (5545H).
DMDBDisplay a memory dump block: FILESPEC?, the dump's base address is shown, then DUMP MAIN MEMORY ADDRESS? (55F7H). Bytes below the base or past the end show as FFH.
VDSVerify disk sectors: PAUSE WHEN SECTOR READ PROTECTED??? (Y OR N), the drive and first sector, SECTOR COUNT?. Each sector is read; up-arrow stops (5BA6H).
ZDSZero disk sectors: each sector is read, zeroed and written back with its read protection status (5B9EH).
CDSCopy disk sectors: SOURCE and DESTINATION drive and sector, SECTOR COUNT?. Each destination gets the source's read protection status (5B4DH).
CDDCopy disk data: SOURCE and DESTINATION drive, sector and BYTE OFFSET WITHIN SECTOR?, BYTE COUNT? (59E0H).
DPWEDisplay password encode: PASSWORD?, shown as the four hexadecimal digits of a directory entry (5E49H).
DNTHDisplay name/type hash code: FILE NAME? and FILE TYPE?, shown as two hexadecimal digits (5EA0H).
RRTNot in the menu: read the raw track holding a relative sector into memory from 7000H and show the range (5EDFH). Refused under DOS-CALL.
EXITEnd SUPERZAP through 402DH (581BH).

ZDS, CDS and CDD first ask SURE YOU WANT TO DO THIS???. CDS and CDD copy from the last byte down when the destination range starts inside the source range on the same drive (6111H).

Display Mode

The page (5FB2H) fills the screen: 16 rows of the offset (or address), 16 bytes in hexadecimal and the same bytes as characters. At the left of a disk sector DRV (drive), DRS (relative sector within the drive), TRK (track) and TRS (sector within the track) are shown, each in decimal and hexadecimal; for DFS DRV, DRS and FRS (sector within the file); DMDB shows MD. Row 15, column 1 holds the sector status: E not read, P read protected, a space for a normal sector. The keys of a command are echoed down column 6 (5DF7H) and need no ENTER except F and L; a wrong key shows the page again.

KeyAction (56BAH, 571BH)
XBack to the menu.
EXITEnd SUPERZAP.
RRead the same sector again (or show the same page).
+ or ;The next sector or page.
- or =The previous sector or page; - at sector 0 gives SOURCE SECTOR OUT OF RANGE.
JStart the function again with all its questions (DM only shows the page again).
KStart again keeping the first answer: the drive (DD, DTS) or the file (DFS, DMDB); DM asks the address.
SCOPYDD and DTS: copy the sector shown to another sector, asking whether it is to be read protected (5795H).
MODxxNot DMDB: the modify mode with the cursor on byte xx (5C5AH).
F,aa,bb,cc,ddSearch for one to four hexadecimal bytes from the start of the drive, file, memory or dump (5821H). Fxx,aa,... starts at byte xx of the page shown; F, or Fxx with ENTER uses the last bytes; F and ENTER goes on after the last match. Up-arrow stops the search. A match is marked with a blinking thin cursor; at the end NO MATCH and K.
L,aa,bb,cc,ddDFS only: the same search through a load module, comparing only the bytes of load blocks (593CH).

Printing (,P; 613AH) copies the screen lines to the printer: H stops the printing, P pauses it until ENTER.

Modify Mode

MODxx puts a blinking block on the first digit of byte xx (5C5AH). A hexadecimal digit replaces the digit under the cursor at once (the memory itself for DM, the sector buffer otherwise) and moves on; after the last digit of byte FFH the cursor wraps to byte 00H and the next digit is refused. Space and right arrow move one digit on, left arrow one back, shift right and shift left two bytes, down arrow and up arrow 16 bytes. ZTxx zeroes from the cursor to byte xx, RTxx,jk fills that range with jk (5D45H). ENTER ends: for a sector REPLY 'Y' IF OK TO WRITE MODIFIED SECTOR TO DISK, and Y writes it keeping its read protection (5D01H). Q drops the changes of a sector by reading it again. Any other key gives INVALID MODIFICATION MODE CHAR. and waits for an asterisk.

Messages

Every text is a string of bytes ended by 03H, shown by 6255H. Bytes below 60H are shown as they are, except 08H, which means the next word gets no space before it. Bytes 60H-96H stand for the words of the list after 696BH (60H the first), bytes 97H-DDH for the words after 6A23H (97H the first). A word ends with a byte that has bit 7 set and gets a space before it when it follows another word. So the menu text at 6C30H takes 219 bytes. The rows of the message area give each message as it is displayed.

Disk Errors

Every sector is read with SYS0 4436H and written with 443CH (write with verify) through the one FCB at 5400H, whose NEXT and EOF count sectors of the whole diskette (or of the file for DFS and DMDB). Error 06H (the sector carries the read protection mark) is not an error for SUPERZAP: the status becomes P, and a write of a sector with status P sets the mark again. Other errors (64BCH) clear the screen, show the location (DRIVE, DRS or FRS, TRACK, SECTOR) with SOURCE SECTOR READ ERROR, DESTINATION SECTOR WRITE ERROR or DESTINATION SECTOR VERIFY ERROR, and the text from the table at 6BEDH:

CodesText
02H, 0AHSEEK ERROR
03H, 0BHLOST DATA
04H, 0CHPARITY ERROR
05H, 0DHDATA RECORD NOT FOUND
08H, 10HDEVICE NOT AVAILABLE
0EHDRIVE WRITE FAULT
0FHWRITE PROTECTED DISKETTE
1CH, 1DHAT/BEYOND END OF DISKETTE/FILE
20HILLEGAL DRIVE #

Other codes are shown by the DOS (DFS, DMDB) or as SYSTEM ERROR CODE n. Then VDS, ZDS and CDS ask R (retry), S (skip the sector) or X (terminate); CDD and RRT go back to the menu; the display functions show the buffer, which may hold some or all of the sector.

Variables

Variables in the File

Address
Size
Contents
5480H-5486H
7 bytes
Output Line and Page
5480H printer echo flag (bit 6), 5481H page skip flag, 5482H printed lines left, 5483H columns left, 5484H line width, 5485H display width 64, 5486H printer width 132.
5491H
1 byte
Command Flags
Bit 0 ,P allowed, 1 ,P given, 3 DMDB, 4 DTS, 5 DM, 6 DFS, 7 the last disk operation was a write.
5492H
1 byte
Second Command Flags
Bit 7 VDS, 6 ZDS, 5 CDS, 4 CDD, 3 RRT.
5493H
1 byte
State Flags
Bit 4 mark a search match, 5 VDS pauses at a read protected sector, 6 no retry question, 7 copy backwards.
5494H
1 byte
Sector Status
E (45H) not read, P (50H) read protected, space (20H) normal.
5495H-5496H
2 bytes
Page Address
The 256 bytes shown: 5300H, or the DM memory page.
5497H-5498H
2 bytes
Modify Cursor
Stored by the modify mode, never read.
5499H
1 byte
Drive
The drive of the last drive answer (the destination of CDS and CDD).
549AH
1 byte
Source Drive
CDS and CDD.
549BH
1 byte
Sectors per Track
From 430EH.
549CH
1 byte
Granules per Lump
From 430FH.
549DH
1 byte
Sectors per Granule
05H, fixed.
549EH
1 byte
Track
The DTS answer or the track of the sector shown.
54A0H
1 byte
Sector Within the Track
The DTS answer or the sector shown.
54A2H-54A3H
2 bytes
Relative Sector
Within the drive, or within the file for DFS; the destination of CDS and CDD.
54A4H-54A5H
2 bytes
Source Relative Sector
CDS and CDD.
54A6H-54A7H
2 bytes
Sector of the Last Disk Operation
Shown in an error report.
54A8H-54A9H
2 bytes
Sectors on the Drive
Tracks x sectors per track.
54AAH-54ABH
2 bytes
Sectors on the Source Drive
CDS and CDD.
54ACH-54ADH
2 bytes
Count
SECTOR COUNT or BYTE COUNT, counted down.
54AEH
1 byte
Byte Offset
The offset answer (destination for CDD) or the byte a search found.
54AFH
1 byte
Source Byte Offset
CDD.
54B0H-54B1H
2 bytes
Echo Position
Down column 6 of the display from 3C06H.
54B2H-54B3H
2 bytes
Dump Base Address
The first two bytes of the DMDB file.
54B4H-54B5H
2 bytes
Memory Page
DM and DMDB.
54B6H-54B8H
3 bytes
Search Position
Byte, then sector (or address).
54B9H-54BDH
5 bytes
Search String
Up to four bytes and their number (54BDH).
54BEH-54C0H
3 bytes
Load Module Search
54BEH 4CH for L, 54BFH and 54C0H the bytes left in the load block.
54C2H-54C4H
3 bytes
Search Page
54C2H the offset, 54C3H-54C4H the memory page of the search.

Self-Modified Operands

Address
Size
Contents
5AD6H
1 byte
Destination Status
Operand of the LD A,nn at 5AD5H, stored by 5B11H after each CDD destination read.
5D9CH
1 byte
Fill Value
Operand of the LD A,nn at 5D9BH: 00H for ZT, jk for RT (5D77H).
5DE1H
1 byte
Cursor Character
Operand of the LD (HL),nn at 5DE0H: 95H match, BFH modify (5DBCH).
5F7CH-5F7DH
2 bytes
RRT End
Operand of the LD DE,nnnn at 5F7BH, stored by 5F54H.
63ECH
1 byte
Output Device
Displacement of the JR at 63EBH: 22H display, 00H printer (638CH).
6434H-6435H
2 bytes
Return Address
Operand of the JP at 6433H, stored by 6428H.
6442H-6443H
2 bytes
Jump Address
Operand of the JP at 6441H, stored by 6437H (no instruction calls 6436H).
64BAH-64BBH
2 bytes
Disk Operation Return
Operand of the JP at 64B9H, stored by 6499H.

Buffers Outside the File

Address
Size
Contents
4200H-42FFH
256 bytes
Second Sector Buffer
SCOPY destination, DMDB file reads, CDD source sectors.
5300H-53FFH
256 bytes
Sector Buffer
The sector or dump page shown; CDD destination.
5400H-541FH
32 bytes
FCB
Copied from 5420H at every menu.
5440H-547FH
64 bytes
Answer Line
Every answer, in upper case.
5487H-548BH
5 bytes
Number Text
Decimal and hexadecimal digits.
7000H up
one track
Raw Track
RRT.

Outside Routines Called

AddressContents
0013HROM: read a byte of a file through the FCB at DE (5997H, 6198H).
002BH / 0049HROM: scan the keyboard / wait for a key (6206H, 620CH).
0033H / 003BHROM: display / print a character (6422H, 6404H).
0040HROM: read a line (6356H).
0060HROM: delay (6318H).
402DHSYS0: DOS READY (581EH).
4409HSYS0: display a DOS error and return (55C7H, 651AH, 657AH).
4424HSYS0: open an existing file (55E0H).
4436H / 443CHSYS0: read / write with verify (645BH, 5EF8H / 6489H).
444EHSYS0: position a file at a byte (5994H).
445EHSYS0: test for a diskette in a drive (67BFH).
4309H, 430DH-430FH, 4311HSYS0: select latch value, tracks, sectors per track, granules per lump, disk I/O flags of the current drive.
436AH, 436CH, 4370HSYS0: system flags (bit 5 refuses RRT), option AI (bit 4), option AX (the printer's highest code).
37E1H, 37ECH-37EFHDrive select latch and the disk controller's registers (RRT).

Disassembly

5200H - Display Address of a Dump Page

Called by the DM and DMDB print loop at 5692H before each page. For DM the page to show is the memory page itself, so its address at 54B4H is copied to 5495H, the address of the 256 bytes the display routine shows. For DMDB (bit 3 of 5491H) the page has been read into the sector buffer at 5300H, which 5495H already holds, so nothing is changed. Returns Register A = the command flags at 5491H.

5200
LD A,(5491H) 3A 91 54
Load Register A with the command flags at 5491H (bit 3 set for DMDB, bit 5 for DM), so that the caller can test them after the return as well.
5203
BIT 3,A CB 5F
Test bit 3 of Register A, the DMDB flag: the NZ FLAG is set when the pages come from a memory dump file read into 5300H.
5205
RET NZ C0
If the NZ FLAG is set (DMDB), RETURN to the caller with Register A still holding the flags: 5495H stays 5300H, the buffer the dump page was read into.
5206
LD HL,(54B4H) 2A B4 54
Load Register Pair HL with the memory address at 54B4H, the page DM is showing (low byte 00H, page number in 54B5H).
5209
LD (5495H),HL 22 95 54
Store Register Pair HL (the memory page address) at 5495H, the address of the 256 bytes the display routine at 5FB2H shows and MOD changes.
520C
RET C9
RETURN to the caller (5692H) with Register A = the command flags from 5491H.

520DH - Search: Start Positions

Two entries used by the F and L search (5856H, 585DH) when the search is to start at the very beginning. 520DH sets Register L, Register H and Register C to Register E (00H): the 24-bit file position in Register C, Register H and Register L is 0, and 54C3H, the page address shown during a memory search, becomes 0000H. 5214H is the DMDB form: the page address becomes the dump's base page (the high byte at 54B3H with a low byte of Register L).

520D
LD L,E 6B
Copy Register E (00H from 5854H) into Register L, the low byte of the search position (the byte within the sector or page).
520E
LD H,E 63
Copy Register E (00H) into Register H, the middle byte of the search position (the sector number low byte, or the memory page).
520F
LD C,E 4B
Copy Register E (00H) into Register C, the high byte of the search position (the sector number high byte); the position is now 0.
5210
LD (54C3H),HL 22 C3 54
Store Register Pair HL at 54C3H, the memory page address the search shows when it stops or finds a match (0000H from 520DH, the dump's base page from 5214H).
5213
RET C9
RETURN to the search at 5859H with Register C, Register H and Register L holding the start position.
5214
LD A,(54B3H) 3A B3 54
Load Register A with the byte at 54B3H, the high byte of the dump's base address (54B2H-54B3H, the first two bytes of the DMDB file).
5217
LD H,A 67
Copy Register A (the base address high byte) into Register H; Register L is still 00H, so Register Pair HL = the dump's base page.
5218
JUMP back to 5210H to store Register Pair HL (the base page) at 54C3H and return to the search.

521AH - Stack Area (Zero Bytes)

No instruction in SUPERZAP reads these 230 zero bytes or jumps into them. The Stack Pointer is set to 5300H at 54C5H and 56C1H, so the stack grows down from 52FFH into this block.

521A-52FF
NOP x 230 00 x 230
Zero bytes in the file, 521AH-52FFH. The Stack Pointer is set to 5300H at 54C5H and 56C1H, so the stack uses the top of this block, growing down from 52FFH.

5300H - Sector Buffer and FCB (not in the file)

These areas are not loaded from the file. 5300H-53FFH is the main sector buffer (the DD, DTS and DFS sector, the DMDB page, the destination sector of CDD); 5400H-541FH is the one FCB SUPERZAP uses for every disk access, filled from the template at 5420H by the LDIR at 54DEH.

5300-53FF
DEFS 256
The main sector buffer, 256 bytes: the sector or dump page on the display (5495H = 5300H), the sector ZDS writes after zeroing it (5C23H), the destination sector of CDD and CDS. The FCB buffer field 5403H-5404H points here except during SCOPY (57B2H), DMDB reads (6181H) and the CDD source reads (5AB6H), which use 4200H.
5400-541F
DEFS 32
The FCB, 32 bytes, copied from the template at 5420H-543FH by the LDIR at 54DEH and filled by the DOS when DFS or DMDB opens a file (55E0H). Register Pair DE = 5400H is passed to SYS0 at 55D8H, 5991H, 5EF5H, 618CH, 64ABH and 67BCH; 5403H-5404H (buffer), 5405H (NEXT low byte), 5406H (drive), 540AH-540BH (NEXT) and 540CH-540DH (EOF) are set directly.

5420H - FCB Template

Data loaded from the file and copied to 5400H-541FH by the LDIR at 54DEH (Register Pair HL = 5420H, Register Pair DE = 5400H, Register Pair BC = 0020H) every time the menu is shown. The layout is the NEWDOS/80 FCB: open, with NEXT and EOF counted in sectors of the whole diskette, so that 4436H and 443CH read and write any sector of a drive.

5420
DEFB 82H 82
FCB byte +0 = 82H: bit 7 set = the file is open, bit 1 set = NEXT and EOF are sector numbers of the whole diskette, not of a file. 6474H sets bit 0 for a write with the directory mark.
5421
DEFB 60H 60
FCB byte +1 = 60H: bit 6 set = EOF only moves forward, bit 5 set = the buffer does not hold the sector at NEXT; bits 0-2 = 0 = FULL access.
5422
DEFB 00H 00
FCB byte +2 = 00H: none of the flags taken from a directory entry's byte 1 are set.
5423-5424
DEFW 5300H 00 53
FCB bytes +3/+4 = buffer address 5300H, the main sector buffer (54CFH also stores 5300H here before the copy).
5425
DEFB 00H 00
FCB byte +5 = NEXT low byte (the byte within the sector) = 00H; 64B0H clears the copy at 5405H before every read and write.
5426
DEFB 00H 00
FCB byte +6 = drive number 00H. The copy at 5406H is set from every drive answer (671BH) and by 5B49H.
5427
DEFB 0FFH FF
FCB byte +7 = directory entry code (DEC) FFH: the FCB belongs to no directory entry.
5428
DEFB 00H 00
FCB byte +8 = EOF low byte = 00H, the byte within the last sector.
5429
DEFB 00H 00
FCB byte +9 = logical record length = 00H, which means 256 bytes per record.
542A-542B
DEFW 0000H 00 00
FCB bytes +10/+11 = NEXT middle and high byte, the sector number, 0000H. The copy at 540AH is set before every read or write (55B4H, 5600H, 57BBH, 5B42H, 64B3H).
542C-542D
DEFW 0FFFFH FF FF
FCB bytes +12/+13 = EOF middle and high byte = FFFFH. The copy at 540CH is set to the drive's sector count at 55AAH and 5EECH.
542E-5435
DEFB 0FFH x 8 FF x 8
FCB bytes +14 to +21 = the first four extent elements, all FFH (the end of the extent list).
5436-5437
DEFW 0FFFFH FF FF
FCB bytes +22/+23 = the number of granules before the second group of extent elements, FFFFH.
5438-543F
DEFB 0FFH x 8 FF x 8
FCB bytes +24 to +31 = four more extent elements, all FFH.

5440H - Variables

The input line buffer 5440H-547FH and the number text buffer 5487H-5490H are not in the file. The variables at 5480H-5486H and 5491H-54C4H are loaded with the values shown; the Variables section of the introduction gives each one's use in the two-line form.

5440-547F
DEFS 64
The input line buffer, 64 characters: every answer typed to a question is read here by ROM 0040H (6351H) and turned into upper case; DNTH builds the name and type here, DPWE the password, and their results are written here.
5480
DEFB 00H 00
The printer echo flag: bit 6 set = whatever goes to the printer is also shown on the display (6408H). Only the routines at 636AH, 639FH and 63A8H change it, and no instruction calls them.
5481
DEFB 00H 00
The page skip flag: not 00H = six carriage returns are printed after every 60 printed lines (63C2H). No instruction stores to it, so it stays 00H.
5482
DEFB 00H 00
The printed lines left on the current page, counted down by 63BCH after every printed carriage return and set back to 3CH (60) at 63D3H.
5483
DEFB 00H 00
The character positions left on the current output line, counted down by 62FAH for each printable character and set to the line width at 639AH and 63D9H.
5484
DEFB 40H 40
The width of the current output line, 40H (64) in the file; 6397H copies the display width (5485H) or the printer width (5486H) here.
5485
DEFB 40H 40
The display line width, 40H (64 characters), copied to 5484H when the output is switched to the display (638FH).
5486
DEFB 84H 84
The printer line width, 84H (132 characters), copied to 5484H when the output is switched to the printer (6394H).
5487-5490
DEFS 10
Not in the file. The number text buffer: 68D1H writes five decimal digits at 5487H-548BH, 660DH and 6649H write hexadecimal digits at 5487H, and DMDB builds the base address text there (560DH).
5491
DEFB 00H 00
The command flags, from the command table at 552BH: bit 0 ,P allowed, bit 1 ,P given, bit 3 DMDB, bit 4 DTS, bit 5 DM, bit 6 DFS (a file is open); bit 7 is set by 6497H when the last disk operation was a write.
5492
DEFB 00H 00
The second command flags, from the command table at 5530H: bit 7 VDS, bit 6 ZDS, bit 5 CDS, bit 4 CDD, bit 3 RRT (refused under DOS-CALL). 00H for the display commands.
5493
DEFB 00H 00
The state flags, cleared at 54C9H: bit 4 a search match is to be marked (5935H), bit 5 VDS pauses at a read protected sector (5BB1H), bit 6 no retry question after an error (644FH, 5EE7H), bit 7 copy in descending order (6137H).
5494
DEFB 45H 45
The status of the sector in the buffer: 45H (E) not read successfully, 50H (P) read protected, 20H (space) readable and not read protected. Shown at the bottom left of the display (60E7H) and used by every write (6479H).
5495-5496
DEFW 0000H 00 00
The address of the 256 bytes on the display: 5300H for a sector or a dump page (54D2H, 56BAH), the memory page for DM (5209H, 56BDH). MOD changes the bytes there.
5497-5498
DEFW 0000H 00 00
The modify mode cursor, stored at 5C69H every time the cursor moves (Register L = the byte offset); no instruction reads it back.
5499
DEFB 00H 00
The drive of the last drive answer (55EDH, 671FH): the drive of DD, DTS, DFS, DMDB, VDS and ZDS, and the destination drive of CDS and CDD.
549A
DEFB 00H 00
The source drive of CDS and CDD, copied from the first drive answer (59F4H, 5B5EH) before the destination is asked; compared with 5499H by 6111H.
549B
DEFB 00H 00
The sectors per track of the drive, copied from 430EH by 67C8H every time a drive is checked.
549C
DEFB 00H 00
The granules per lump of the drive, copied from 430FH by 67CEH; used to turn a DFS extent element into a sector of the drive (6099H).
549D
DEFB 05H 05
The sectors per granule, 05H, used by the DFS display to find the drive sector of a file sector (604CH, 60A1H). No instruction changes it.
549E-549F
DEFW 0000H 00 00
The track number: 549EH is set from the DTS answer (6747H) and from the display (60CBH); 549FH is never used on its own.
54A0-54A1
DEFW 0000H 00 00
The sector within the track: 54A0H is set from the DTS answer (6766H) and from the display (60C7H); 54A1H is never used on its own.
54A2-54A3
DEFW 0000H 00 00
The relative sector being shown or worked on: the sector within the drive (DD, DTS, VDS, ZDS, the destination of CDS and CDD) or within the file (DFS). Set by 679EH and stepped by the display keys and the copy loops.
54A4-54A5
DEFW 0000H 00 00
The source relative sector of CDS and CDD, copied from 54A2H (59FAH, 5B64H) and stepped by 5ACBH and 5C47H.
54A6-54A7
DEFW 0000H 00 00
The sector number of the last read or write, stored by 64B6H from FCB NEXT; the error report (65DCH) shows it.
54A8-54A9
DEFW 0000H 00 00
The number of sectors on the drive of the last drive answer (430DH tracks x 549BH, stored by 67DDH): the upper limit for DD, VDS, ZDS and every destination.
54AA-54AB
DEFW 0000H 00 00
The number of sectors on the source drive of CDS and CDD, copied from 54A8H (5A06H, 5B6AH) and used as the source limit.
54AC-54AD
DEFW 0000H 00 00
The count: the SECTOR COUNT or BYTE COUNT answer (6782H), counted down by the loops; for DM,P and DMDB,P the bytes still to be printed.
54AE
DEFB 00H 00
The byte offset within the sector: the BYTE OFFSET WITHIN SECTOR answer (6703H, the destination offset for CDD), or the offset of the byte a search found (5906H).
54AF
DEFB 00H 00
The source byte offset of CDD, copied from 54AEH at 5A00H before the destination offset is asked.
54B0-54B1
DEFW 0000H 00 00
The echo position on the display: 5FB5H sets it to 3C06H (row 0, column 6) and 5E13H moves it down one row for every key shown, so display mode commands appear down column 6.
54B2-54B3
DEFW 0000H 00 00
The memory dump's base address, the first two bytes of the DMDB file (5609H); used to find a page's place in the file (61BFH) and the start of a search (5214H).
54B4-54B5
DEFW 0000H 00 00
The memory address of the page shown by DM or DMDB, with the low byte 00H (5630H, 565CH); stepped by the display keys and by a search.
54B6-54B8
DEFB 00H, 00H, 00H 00 00 00
The search position, three bytes: the byte within the sector (or the memory address low byte), then the sector number (or the address high byte and a page overflow byte). Set at 5896H, moved on by 58DEH.
54B9-54BC
DEFB 00H, 00H, 00H, 00H 00 00 00 00
The search string, one to four bytes typed after F or L (58ABH); kept for the next F without a string.
54BD
DEFB 00H 00
The number of bytes in the search string, 1 to 4 (58BBH).
54BE
DEFB 00H 00
The search kind: 4CH (L) for a load module search, which only compares the bytes of load blocks, or 00H for F (5836H).
54BF
DEFB 00H 00
The bytes left in the current load block during an L search (5986H, 5968H); 54C0H keeps it between searches.
54C0-54C1
DEFW 0000H 00 00
54C0H keeps the load block byte count of an L search between two searches (583AH, 58E8H); 54C1H is never used.
54C2
DEFB 00H 00
The byte offset of the search position within its sector or page (5874H, 58FBH), copied to 54AEH for the match cursor.
54C3-54C4
DEFW 0000H 00 00
The memory page address the search is in (5845H, 5210H, 5916H), copied to 54B4H at every comparison so that the page reached is shown when the search stops.

54C5H - Start and the Menu

SUPERZAP's transfer address. Every function comes back here when it ends: the X key, an empty filespec, PRESS 'ENTER' TO RETURN TO MENU (658BH), an X typed as a parameter (681DH). The stack is put back at 5300H, the state flags are cleared, the FCB is set up again from its template and the menu is shown. The answer is looked up in the command table at 690DH; an empty answer is DD.

54C5
LD SP,5300H 31 00 53
Load the Stack Pointer with 5300H: the stack grows down from 52FFH, below the sector buffer, and whatever a function left on it is dropped.
54C8
XOR A AF
Set Register A to 00H (XOR A with itself), to clear the state flags.
54C9
LD (5493H),A 32 93 54
Store Register A (00H) at 5493H, the state flags: no match to mark, no VDS pause, retry questions on, ascending copies.
54CC
LD HL,5300H 21 00 53
Load Register Pair HL with 5300H, the main sector buffer.
54CF
LD (5423H),HL 22 23 54
Store Register Pair HL (5300H) at 5423H, the buffer field of the FCB template, so that the FCB copied below reads into 5300H.
54D2
LD (5495H),HL 22 95 54
Store Register Pair HL (5300H) at 5495H, the address of the 256 bytes the display routine shows.
54D5
LD HL,5420H 21 20 54
Load Register Pair HL with 5420H, the FCB template.
54D8
LD DE,5400H 11 00 54
Load Register Pair DE with 5400H, the FCB every disk access uses.
54DB
LD BC,0020H 01 20 00
Load Register Pair BC with 0020H, the 32 bytes of an FCB.
54DE
LDIR ED B0
Copy Register Pair BC (32) bytes from Register Pair HL (5420H) to Register Pair DE (5400H): the FCB is open again, with whole-diskette sector numbers, drive 0 and the buffer at 5300H.
54E0
LD HL,6C30H 21 30 6C
Load Register Pair HL with 6C30H, the menu: the screen is cleared, APPARAT'S SUPERZAP/80 and the list of functions are shown.
54E3
GOSUB to 634EH to display the menu and read the answer into 5440H in upper case. Register Pair HL returns 5440H, Register A the first character and the Z FLAG if the line is empty.
54E6
LD DE,690FH 11 0F 69
Load Register Pair DE with 690FH, the flags byte of the first command table entry (DD), used when the answer is empty.
54E9
If the Z FLAG is set (only ENTER was pressed), JUMP to 550BH with Register Pair DE at DD's flags byte: an empty answer runs DD.
54EB
DEC DE 1B
Decrement Register Pair DE (690FH, DD's flags byte) to 690EH, the second letter of DD.
54EC
DEC DE 1B
Decrement Register Pair DE to 690DH, the first character of the first command name in the table.

Command Search Loop
Register Pair DE = the first character of a table entry, Register Pair HL = 5440H, the answer.

54ED
PUSH HL E5
Save Register Pair HL (5440H, the answer) on the stack. When a name matches, this word stays on the stack and is the one DNTH takes back at 5EDAH.
54EE
DEC HL 2B
Decrement Register Pair HL to one before the answer, because the compare loop steps first.
54EF
DEC DE 1B
Decrement Register Pair DE to one before the entry's name, for the same reason.
54F0
INC DE 13
Increment Register Pair DE to the next character of the table entry.
54F1
INC HL 23
Increment Register Pair HL to the next character of the answer.
54F2
LD A,(DE) 1A
Load Register A with the table byte at Register Pair DE (a letter of the name, or the entry's flags byte, which has bit 7 set).
54F3
CP (HL) BE
Compare Register A (the table byte) with the answer character at Register Pair HL: the Z FLAG is set while they agree.
54F4
If the Z FLAG is set, LOOP BACK to 54F0H to compare the next character.
54F6
BIT 7,A CB 7F
Test bit 7 of Register A, the table byte where the answer differs: bit 7 set means the whole name had matched and this is the flags byte.
54F8
If the NZ FLAG is set (the name matched), JUMP to 550BH to check what follows it in the answer, with Register Pair DE at the flags byte and Register Pair HL after the name.

Skip to the Next Entry

54FA
INC DE 13
Increment Register Pair DE to the next byte of the entry.
54FB
LD A,(DE) 1A
Load Register A with the entry byte at Register Pair DE.
54FC
BIT 7,A CB 7F
Test bit 7 of Register A: the flags byte, which ends the name, has bit 7 set.
54FE
If the Z FLAG is set (still a letter), LOOP BACK to 54FAH.
5500
INC DE 13
Increment Register Pair DE past the flags byte (also reached from 5517H and 5524H when the answer goes on past a matching name).
5501
INC DE 13
Increment Register Pair DE past the second flags byte.
5502
INC DE 13
Increment Register Pair DE past the low byte of the handler address.
5503
INC DE 13
Increment Register Pair DE past the high byte: Register Pair DE now points at the next entry's name.
5504
POP HL E1
Restore Register Pair HL (5440H, the answer) from the stack.
5505
LD A,(DE) 1A
Load Register A with the byte at Register Pair DE, the first byte of the next entry (00H at the end of the table).
5506
OR A B7
OR Register A with itself to set the Z FLAG if it is 00H.
5507
If the NZ FLAG is set (another entry), LOOP BACK to 54EDH to compare it with the answer.
5509
JUMP back to 54C5H: no command matched, so the menu is shown again.

550BH - Command Found: ,P and the Flags

Register Pair DE is at the entry's flags byte and Register Pair HL at the answer character after the name. Only ,P or nothing may follow; anything else continues the search with the next entry (so DM can fail and DMDB match). ,P needs bit 0 of the flags. The flags go to 5491H (with bit 1 for ,P) and 5492H; a function with bit 3 of the second byte (RRT) is refused under DOS-CALL. Then the handler is entered with JP (HL).

550B
LD B,00H 06 00
Load Register B with 00H, the printer bit: no ,P so far.
550D
LD A,(HL) 7E
Load Register A with the answer character at Register Pair HL, the one after the command name.
550E
CP 2CH FE 2C
Compare Register A with 2CH (a comma), the start of the ,P suffix.
5510
If the NZ FLAG is set (no comma), JUMP to 5521H to require the end of the line.
5512
INC HL 23
Increment Register Pair HL to the character after the comma.
5513
LD A,(HL) 7E
Load Register A with the answer character at Register Pair HL.
5514
CP 50H FE 50
Compare Register A, the character after the comma, with 50H (P): only ,P may follow a command.
5516
INC HL 23
Increment Register Pair HL past it (INC does not change the flags of the compare).
5517
If the NZ FLAG is set (not ,P), JUMP to 5500H: this entry does not fit the answer, so the search goes on with the next one.
5519
LD A,(DE) 1A
Load Register A with the entry's flags byte at Register Pair DE.
551A
BIT 0,A CB 47
Test bit 0 of Register A, set for the commands that may print (DD, DM, DFS, DTS, DMDB).
551C
If the Z FLAG is set (no printing for this command), JUMP to 65B9H to display ILLEGAL PRINTER REQUEST and go back to the menu.
551F
LD B,02H 06 02
Load Register B with 02H, bit 1 of the command flags: print the pages or sectors as well.
5521
LD A,(HL) 7E
Load Register A with the answer character at Register Pair HL, the one after the name or after ,P.
5522
CP 0DH FE 0D
Compare Register A with 0DH, the carriage return that ends the answer.
5524
If the NZ FLAG is set (more text), JUMP to 5500H to try the next entry.
5526
EX DE,HL EB
Exchange Register Pair DE and Register Pair HL: Register Pair HL now points at the entry's flags byte.
5527
LD A,(HL) 7E
Load Register A with the flags byte at Register Pair HL.
5528
AND 7FH E6 7F
AND Register A with 7FH to drop bit 7, which only marks the end of the name.
552A
OR B B0
OR Register A with Register B (02H for ,P, else 00H) to set bit 1 when the output is to be printed as well.
552B
LD (5491H),A 32 91 54
Store Register A at 5491H, the command flags: bit 0 ,P allowed, bit 1 ,P given, bit 3 DMDB, bit 4 DTS, bit 5 DM, bit 6 DFS.
552E
INC HL 23
Increment Register Pair HL to the second flags byte.
552F
LD A,(HL) 7E
Load Register A with the second flags byte at Register Pair HL.
5530
LD (5492H),A 32 92 54
Store Register A at 5492H, the second command flags: bit 7 VDS, bit 6 ZDS, bit 5 CDS, bit 4 CDD, bit 3 RRT.
5533
BIT 3,A CB 5F
Test bit 3 of Register A, set only for RRT, the raw track read.
5535
If the Z FLAG is set (not RRT), JUMP to 553FH.
5537
LD A,(436AH) 3A 6A 43
Load Register A with the system flags at 436AH.
553A
BIT 5,A CB 6F
Test bit 5 of Register A, the 436AH bit that SUPERZAP takes to mean it runs under DOS-CALL.
553C
If the NZ FLAG is set, JUMP to 65BEH to display FUNCTION ILLEGAL UNDER DOS-CALL and go back to the menu.
553F
INC HL 23
Increment Register Pair HL to the handler address in the entry.
5540
LD A,(HL) 7E
Load Register A with the low byte of the handler address at Register Pair HL.
5541
INC HL 23
Increment Register Pair HL to the high byte of the handler address in the command table entry.
5542
LD H,(HL) 66
Load Register H with the high byte of the handler address at Register Pair HL.
5543
LD L,A 6F
Copy Register A (the low byte) into Register L: Register Pair HL = the handler (5584H DD, 564FH DM, 55CAH DFS and DMDB, 5545H DTS, 5BA6H VDS, 5B9EH ZDS, 5B4DH CDS, 59E0H CDD, 5E49H DPWE, 5EA0H DNTH, 5EDFH RRT, 581BH EXIT).
5544
JP (HL) E9
JUMP to the handler at Register Pair HL. The word 5440H pushed at 54EDH is still on the stack (not for an empty answer).

5545H - DTS: Display a Track's Sector

Asks DRIVE, TRACK AND SECTOR #'S? (J restarts here). An empty answer reads the sector the variables already name. 5554H is the K re-entry, which keeps the drive and asks TRACK AND SECTOR #'S?; 5563H asks only the sector. Each answer is checked by 670FH (drive), 6732H (track) and 6751H (sector); a bad one asks the same question again. The relative sector within the drive is track x sectors per track + sector.

5545
LD HL,6D3BH 21 3B 6D
Load Register Pair HL with 6D3BH, the question DRIVE, TRACK AND SECTOR #'S?.
5548
GOSUB to 634EH to display the question and read the answer into 5440H; Register Pair HL returns 5440H and the Z FLAG is set for an empty answer.
554B
If the Z FLAG is set (only ENTER), JUMP to 55A0H to read the sector already named by 54A2H.
554D
GOSUB to 670FH to take the drive number from the answer at Register Pair HL: it is checked, stored at 5406H and 5499H, and the drive's sizes are read. The CARRY FLAG means it was not valid; Register Pair HL returns after the comma.
5550
If the CARRY FLAG is set (bad drive), LOOP BACK to 5545H to ask again.
5552
JUMP to 555AH to take the track number from the same answer (the Z FLAG is clear, since a further parameter followed).
5554
LD HL,6D44H 21 44 6D
Load Register Pair HL with 6D44H, the question TRACK AND SECTOR #'S? (the K command of DTS, the drive is kept).
5557
GOSUB to 634EH to display the question and read the answer into 5440H; the Z FLAG is set for an empty answer.
555A
If the Z FLAG is set (empty answer), JUMP to 55A0H to read the sector named by 54A2H.
555C
GOSUB to 6732H to take the track number at Register Pair HL: it must be below the drive's track count at 430DH and is stored at 549EH. The CARRY FLAG means it was not valid.
555F
If the CARRY FLAG is set (bad track), LOOP BACK to 5554H to ask again.
5561
JUMP to 5569H to take the sector number from the same answer.
5563
LD HL,6D4BH 21 4B 6D
Load Register Pair HL with 6D4BH, the question RELATIVE-SECTOR-WITHIN-TRACK #?, asked again after a bad sector number.
5566
GOSUB to 634EH to display the question and read the answer; the Z FLAG is set for an empty answer.
5569
If the Z FLAG is set (empty answer), JUMP to 5570H to use the sector number already at 54A0H.
556B
GOSUB to 6751H to take the sector number at Register Pair HL (the last parameter): it must be below the sectors per track at 549BH and is stored at 54A0H. The CARRY FLAG means it was not valid.
556E
If the CARRY FLAG is set (bad sector), LOOP BACK to 5563H to ask for the sector again.
5570
LD A,(549EH) 3A 9E 54
Load Register A with the track number at 549EH.
5573
LD L,A 6F
Copy Register A (the track) into Register L, the multiplicand.
5574
LD A,(549BH) 3A 9B 54
Load Register A with the sectors per track at 549BH.
5577
GOSUB to 687BH to clear Register H and multiply: Register Pair HL = track x sectors per track, the relative sector of the track's first sector.
557A
LD A,(54A0H) 3A A0 54
Load Register A with the sector within the track at 54A0H.
557D
LD E,A 5F
Copy Register A (the sector within the track) into Register E.
557E
LD D,00H 16 00
Load Register D with 00H, so Register Pair DE = the sector within the track.
5580
ADD HL,DE 19
Add Register Pair DE to Register Pair HL: Register Pair HL = the relative sector within the drive.
5581
EX DE,HL EB
Exchange Register Pair DE and Register Pair HL: Register Pair DE = the relative sector.
5582
JUMP to 55A7H to set the FCB and read that sector.

5584H - DD: Display a Disk Sector

Asks DRIVE AND RELATIVE-SECTOR-WITHIN-DRIVE #'S? (also the empty menu answer and J). 5593H is the K re-entry, which keeps the drive. 55A0H reads the drive's sizes again; 55A7H sets the FCB's EOF to the drive's sector count, 55ADH the sector number. With ,P the sectors are printed through the VDS loop (5BB8H); otherwise the sector is read into 5300H and the display mode starts at 56BAH. 55ADH is also where R, + and - of the display mode come back for a disk sector.

5584
LD HL,6D50H 21 50 6D
Load Register Pair HL with 6D50H, the question DRIVE AND RELATIVE-SECTOR-WITHIN-DRIVE #'S?.
5587
GOSUB to 634EH to display the question and read the answer into 5440H; the Z FLAG is set for an empty answer.
558A
If the Z FLAG is set (empty answer), JUMP to 55A0H to read the sector named by 54A2H.
558C
GOSUB to 670FH to take and check the drive number at Register Pair HL (stored at 5406H and 5499H); the CARRY FLAG means it was not valid.
558F
If the CARRY FLAG is set (bad drive), LOOP BACK to 5584H to ask again.
5591
JUMP to 5599H to take the relative sector from the same answer.
5593
LD HL,6D58H 21 58 6D
Load Register Pair HL with 6D58H, the question RELATIVE-SECTOR-WITHIN-DRIVE #? (the K command, the drive is kept).
5596
GOSUB to 634EH to display the question and read the answer; the Z FLAG is set for an empty answer.
5599
If the Z FLAG is set (empty answer), JUMP to 55A0H to use the sector at 54A2H.
559B
GOSUB to 679EH to take the relative sector at Register Pair HL (the last parameter) and store it at 54A2H; the CARRY FLAG means it was not valid.
559E
If the CARRY FLAG is set, LOOP BACK to 5593H to ask for the sector again.
55A0
GOSUB to 67B5H to check the diskette in the drive at 5406H and read its sizes again: 549BH sectors per track, 549CH granules per lump, 54A8H sectors on the drive.
55A3
LD DE,(54A2H) ED 5B A2 54
Load Register Pair DE with the relative sector at 54A2H.
55A7
LD HL,(54A8H) 2A A8 54
Load Register Pair HL with the number of sectors on the drive at 54A8H.
55AA
LD (540CH),HL 22 0C 54
Store Register Pair HL at 540CH, the FCB's EOF: reading at or past the drive's last sector gives an error.
55AD
LD (54A2H),DE ED 53 A2 54
Store Register Pair DE (the relative sector) at 54A2H, the sector being shown. Also the entry from 564CH (DFS) and 5771H (the R, + and - keys).
55B1
LD HL,(54A2H) 2A A2 54
Load Register Pair HL with the relative sector at 54A2H.
55B4
LD (540AH),HL 22 0A 54
Store Register Pair HL at 540AH, the FCB's NEXT: the sector to be read (a sector of the drive, or of the file for DFS).
55B7
LD A,(5491H) 3A 91 54
Load Register A with the command flags at 5491H.
55BA
BIT 1,A CB 4F
Test bit 1 of Register A, set when ,P was given.
55BC
If the NZ FLAG is set (,P), JUMP to 5BB8H to ask SECTOR COUNT? and read and print that many sectors through the VDS loop.
55BF
GOSUB to 6457H to read the sector at NEXT into the buffer at 5300H; an error is reported there (the status at 5494H tells the display what happened).
55C2
JUMP to 56BAH to show the buffer at 5300H and enter the display mode.

55C5H - DFS and DMDB: Open the File

55C5H is the error exit of the open: SYS0 4409H displays the DOS error (bits 7 and 6 set, so it returns) and the filespec is asked again. 55CAH asks FILESPEC? (also J for DFS and DMDB); an empty answer goes back to the menu. The file is opened with SYS0 4424H, buffer 5300H, record length 256. The FCB's bit 6 of byte 1 is set, and the file's drive becomes the current drive. DMDB goes on at 55F7H, DFS asks for the sector within the file at 5641H.

55C5
OR C0H F6 C0
OR Register A (the DOS error code from 4424H) with C0H: bit 7 makes SYS0 4409H return after displaying the message, bit 6 is set along with it.
55C7
GOSUB to SYS0 4409H to display the error message for the code in Register A.
55CA
LD HL,6D5DH 21 5D 6D
Load Register Pair HL with 6D5DH, the question FILESPEC?.
55CD
LD DE,5400H 11 00 54
Load Register Pair DE with 5400H, the FCB: the answer is read straight into it.
55D0
LD B,1FH 06 1F
Load Register B with 1FH, the longest answer (31 characters).
55D2
GOSUB to 633CH to display the question and read up to Register B characters into the FCB at Register Pair DE; the Z FLAG is set for an empty answer.
55D5
If the Z FLAG is set (no filespec), JUMP to 54C5H, the menu.
55D8
LD DE,5400H 11 00 54
Load Register Pair DE with 5400H, the FCB that holds the filespec.
55DB
LD HL,5300H 21 00 53
Load Register Pair HL with 5300H, the sector buffer for the file.
55DE
LD B,00H 06 00
Load Register B with 00H, the record length (00H means 256).
55E0
GOSUB to SYS0 4424H to open the existing file named in the FCB at Register Pair DE with the buffer at Register Pair HL. The NZ FLAG means an error, with its code in Register A.
55E3
If the NZ FLAG is set (the open failed), LOOP BACK to 55C5H to display the error and ask again.
55E5
LD HL,5401H 21 01 54
Load Register Pair HL with 5401H, byte 1 of the FCB.
55E8
SET 6,(HL) CB F6
Set bit 6 of the FCB byte at Register Pair HL (5401H): the file's EOF may only move forward.
55EA
LD A,(5406H) 3A 06 54
Load Register A with the FCB's drive number at 5406H, the drive the file was found on.
55ED
LD (5499H),A 32 99 54
Store Register A (the file's drive) at 5499H, the drive of the current function.
55F0
LD A,(5491H) 3A 91 54
Load Register A with the command flags at 5491H.
55F3
BIT 3,A CB 5F
Test bit 3 of Register A (the command flags from 5491H), set for DMDB and clear for DFS.
55F5
If the Z FLAG is set (DFS), JUMP to 5641H to ask for the sector within the file.

55F7H - DMDB: The Dump's Base Address

A memory dump file made by DUMP starts with the address the dump was taken from, followed by the memory bytes. The file's first sector is read, its first two bytes become the base address at 54B2H and are shown as xxxxH = DUMP'S BASE MEMORY ADDRESS. 5623H then asks DUMP MAIN MEMORY ADDRESS? (also the K command); the address is cut to its page. With ,P the pages are printed from 5668H, otherwise 617BH reads the page from the file into 5300H and the display mode starts.

55F7
LD HL,5300H 21 00 53
Load Register Pair HL with 5300H, the sector buffer.
55FA
LD (5403H),HL 22 03 54
Store Register Pair HL (5300H) at 5403H, the FCB's buffer address.
55FD
LD HL,0000H 21 00 00
Load Register Pair HL with 0000H, the file's first sector.
5600
LD (540AH),HL 22 0A 54
Store Register Pair HL (0000H) at 540AH, the FCB's NEXT.
5603
GOSUB to 6457H to read the file's first sector into 5300H.
5606
LD HL,(5300H) 2A 00 53
Load Register Pair HL with the first two bytes of the file at 5300H, the address the dump was taken from.
5609
LD (54B2H),HL 22 B2 54
Store Register Pair HL at 54B2H, the dump's base address.
560C
EX DE,HL EB
Exchange Register Pair DE and Register Pair HL: Register Pair DE = the base address, to be written in hexadecimal.
560D
LD HL,5487H 21 87 54
Load Register Pair HL with 5487H, the number text buffer.
5610
PUSH HL E5
Save Register Pair HL (5487H) on the stack, to output the text from there.
5611
GOSUB to 61EAH to write Register Pair DE (the base address) as four hexadecimal digits at Register Pair HL (5487H-548AH); Register Pair HL returns 548BH.
5614
LD (HL),48H 36 48
Store 48H (H) at Register Pair HL (548BH) after the digits.
5616
INC HL 23
Increment Register Pair HL past the H (the value is not used, as Register Pair HL is restored next).
5617
POP HL E1
Restore Register Pair HL (5487H) from the stack.
5618
LD B,05H 06 05
Load Register B with 05H, the four digits and the H.
561A
GOSUB to 62BAH to output Register B characters from Register Pair HL: the base address, such as 5200H.
561D
LD HL,6D2DH 21 2D 6D
Load Register Pair HL with 6D2DH, the text = DUMP'S BASE MEMORY ADDRESS.
5620
GOSUB to 6245H to display it with a carriage return.
5623
LD HL,6D7BH 21 7B 6D
Load Register Pair HL with 6D7BH, the question DUMP MAIN MEMORY ADDRESS? (also the K command of DMDB).
5626
GOSUB to 634EH to display the question and read the answer into 5440H; Register Pair HL returns 5440H.
5629
GOSUB to 6770H to take the address at Register Pair HL (the only parameter) into Register Pair DE; the CARRY FLAG means it was not valid (BAD/ILLEGAL MAIN MEMORY ADDRESS).
562C
If the CARRY FLAG is set, LOOP BACK to 5623H to ask again.
562E
LD E,00H 1E 00
Load Register E with 00H: Register Pair DE = the start of the address's page.
5630
LD (54B4H),DE ED 53 B4 54
Store Register Pair DE (the page address) at 54B4H, the memory page to show.
5634
LD A,(5491H) 3A 91 54
Load Register A with the command flags at 5491H.
5637
BIT 1,A CB 4F
Test bit 1 of Register A (the command flags from 5491H), set when DMDB,P was typed.
5639
If the NZ FLAG is set (,P), JUMP to 5668H to ask BYTE COUNT? and print the pages.
563B
GOSUB to 617BH to read the 256 bytes of the dump that belong to the page at 54B4H into 5300H (also the entry from 5792H for R, + and -).
563E
JUMP to 56BAH to show the buffer at 5300H and enter the display mode.

5641H - DFS: The Sector Within the File

Asks RELATIVE-SECTOR-WITHIN-FILE #? (also the K command of DFS). The answer is stored at 54A2H and 55ADH reads that sector of the file (NEXT counts file sectors, because the open cleared the FCB's whole-diskette bit).

5641
LD HL,6D68H 21 68 6D
Load Register Pair HL with 6D68H, the question RELATIVE-SECTOR-WITHIN-FILE #?.
5644
GOSUB to 634EH to display the question and read the answer into 5440H; Register Pair HL returns 5440H.
5647
GOSUB to 679EH to take the sector number at Register Pair HL into 54A2H (and Register Pair DE); the CARRY FLAG means it was not valid.
564A
If the CARRY FLAG is set, LOOP BACK to 5641H to ask again.
564C
JUMP to 55ADH to read that sector of the file and show it, Register Pair DE holding the sector number.

564FH - DM: Display Main Memory

Asks MAIN MEMORY ADDRESS? (also the K command of DM). The address is cut to the start of its page and stored at 54B4H. Without ,P the display mode shows that memory page directly (56BDH); with ,P BYTE COUNT? is asked and the pages are printed.

564F
LD HL,6D36H 21 36 6D
Load Register Pair HL with 6D36H, the question MAIN MEMORY ADDRESS?.
5652
GOSUB to 634EH to display the question and read the answer into 5440H; Register Pair HL returns 5440H.
5655
GOSUB to 6770H to take the address at Register Pair HL into Register Pair DE; the CARRY FLAG means it was not valid.
5658
If the CARRY FLAG is set, LOOP BACK to 564FH to ask again.
565A
LD E,00H 1E 00
Load Register E with 00H: Register Pair DE = the start of the address's 256-byte page.
565C
LD (54B4H),DE ED 53 B4 54
Store Register Pair DE (the page address) at 54B4H, the memory page to show.
5660
LD A,(5491H) 3A 91 54
Load Register A with the command flags at 5491H.
5663
BIT 1,A CB 4F
Test bit 1 of Register A (the command flags from 5491H), set when DM,P was typed.
5665
If the Z FLAG is set (no ,P), JUMP to 56BDH to show the memory page at Register Pair DE in the display mode.

5668H - DM,P and DMDB,P: Print Pages

Asks BYTE COUNT? and prints that many bytes, one display page of 16 lines of 16 bytes at a time: each page is shown and then copied line by line to the printer by 613AH. A last part page prints only the lines it needs. Then FUNCTION COMPLETED. For DMDB each page is read from the file first.

5668
GOSUB to 66E1H to ask BYTE COUNT? until a count from 1 to 65535 is given; it is stored at 54ACH.
566B
LD C,10H 0E 10
Load Register C with 10H, the 16 lines of a full page to print.
566D
LD HL,(54ACH) 2A AC 54
Load Register Pair HL with the bytes still to print at 54ACH.
5670
LD DE,0100H 11 00 01
Load Register Pair DE with 0100H, the 256 bytes of one page.
5673
OR A B7
OR Register A with itself to clear the CARRY FLAG before the subtraction.
5674
SBC HL,DE ED 52
Subtract Register Pair DE (256) from Register Pair HL (the bytes left): the CARRY FLAG is set if less than a full page is left.
5676
If the NO CARRY FLAG is set, JUMP to 568FH to store the remaining count and print a full page.
5678
OR A B7
OR Register A with itself to clear the CARRY FLAG again.
5679
ADC HL,DE ED 5A
Add Register Pair DE (256) back to Register Pair HL: Register Pair HL = the bytes left (below 256); the Z FLAG is set if none are left.
567B
If the Z FLAG is set (nothing left), JUMP to 65C6H to display FUNCTION COMPLETED and go back to the menu.
567E
LD A,L 7D
Load Register A with Register L, the bytes left (1-255).
567F
RRCA 0F
Rotate Register A right (four RRCAs divide by 16).
5680
RRCA 0F
Rotate Register A (the bytes left) right, the second of the four rotations that divide by 16.
5681
RRCA 0F
Rotate Register A (the bytes left) right, the third of the four rotations that divide by 16.
5682
RRCA 0F
Rotate Register A right, the fourth: the high four bits of the count are now the low four.
5683
AND 0FH E6 0F
AND Register A with 0FH: Register A = the full 16-byte lines in the count.
5685
LD C,A 4F
Copy Register A (the full lines) into Register C, the lines to print.
5686
LD A,L 7D
Load Register A with Register L, the bytes left.
5687
AND 0FH E6 0F
AND Register A with 0FH, the bytes of a last part line.
5689
If the Z FLAG is set (no part line), JUMP to 568CH.
568B
INC C 0C
Increment Register C to print the part line too.
568C
LD HL,0000H 21 00 00
Load Register Pair HL with 0000H: nothing will be left after this page.
568F
LD (54ACH),HL 22 AC 54
Store Register Pair HL at 54ACH, the bytes still to print after this page.
5692
GOSUB to 5200H to point 5495H at the memory page at 54B4H (not for DMDB); Register A returns the command flags at 5491H.
5695
BIT 3,A CB 5F
Test bit 3 of Register A (the command flags returned by 5200H), set for DMDB.
5697
If the NZ FLAG is set (DMDB), JUMP to 56A2H to read the page from the file first.
5699
GOSUB to 613AH to show the page and print Register C lines of it (H stops the printing, P pauses it).
569C
LD HL,54B5H 21 B5 54
Load Register Pair HL with 54B5H, the page number of the address at 54B4H.
569F
INC (HL) 34
Increment the page number at Register Pair HL: the next 256 bytes.
56A0
LOOP BACK to 566BH to work out the lines of the next page from the count at 54ACH.
56A2
PUSH BC C5
Save Register Pair BC (Register C, the lines to print) on the stack.
56A3
GOSUB to 617BH to read the dump's bytes for the page at 54B4H into 5300H.
56A6
POP BC C1
Restore Register Pair BC (Register C, the lines to print) from the stack.
56A7
JUMP back to 5699H to show and print the page.

56A9H - Sector Out of Range from the Display Keys

Reached when - is pressed at relative sector 0 (576EH) or a dump read runs past the end of its file (61BCH): SOURCE SECTOR OUT OF RANGE is displayed, ENTER is awaited and the K command is run, which asks for the position again. 56AEH is also used by SCOPY (5800H) to show FUNCTION COMPLETED and run R.

56A9
LD HL,6E20H 21 20 6E
Load Register Pair HL with 6E20H, the message SOURCE SECTOR OUT OF RANGE.
56AC
LD A,4BH 3E 4B
Load Register A with 4BH (K), the display mode command to run afterwards: ask for the position again.
56AE
PUSH AF F5
Save Register Pair AF (Register A, the command to run) on the stack.
56AF
GOSUB to 6245H to display the message at Register Pair HL and a carriage return.
56B2
LD HL,6DD5H 21 D5 6D
Load Register Pair HL with 6DD5H, the text PRESS 'ENTER' TO CONTINUE.
56B5
GOSUB to 6345H to display it and wait until an empty line (ENTER alone) is typed.
56B8
JUMP to 571AH, where Register A (K or R) is taken back from the stack and run as a display mode command.

56BAH - Display Mode: Show the Page and Read a Key

56BAH points the display at the sector buffer 5300H, 56BDH at the address in Register Pair DE (a DM memory page). 56C1H is the display mode loop, entered after every command: the stack is reset, the 256 bytes and the position are shown (5FB2H). After a search match the matched byte is marked with a blinking thin cursor until a key is pressed; otherwise a key is awaited. Keys of 20H and above are shown down column 6. M (MOD, not for DMDB), X (menu), E (EXIT), S (SCOPY), F (find), L (load module find, DFS only) are handled here; ; is taken as + and = as -, then 5716H clears the screen and 571BH handles J, K, R, + and -. Any other key shows the page again.

56BA
LD DE,5300H 11 00 53
Load Register Pair DE with 5300H, the sector buffer that holds the sector or dump page.
56BD
LD (5495H),DE ED 53 95 54
Store Register Pair DE at 5495H, the address of the 256 bytes to show (5300H, or the memory page for DM).
56C1
LD SP,5300H 31 00 53
Load the Stack Pointer with 5300H: the display mode loop starts with an empty stack, whatever command came back here.
56C4
GOSUB to 5FB2H to start the key echo at 3C06H and show the 16 lines of the page at 5495H with the drive, sector and status at the left.
56C7
LD HL,5493H 21 93 54
Load Register Pair HL with 5493H, the state flags.
56CA
BIT 4,(HL) CB 66
Test bit 4 of the state flags at Register Pair HL, set by a search that found a match.
56CC
If the Z FLAG is set (no match to mark), JUMP to 56DBH to wait for a key.
56CE
RES 4,(HL) CB A6
Reset bit 4 of the state flags at Register Pair HL: the match is marked only once.
56D0
LD A,(54AEH) 3A AE 54
Load Register A with 54AEH, the byte offset of the match within the page.
56D3
LD C,A 4F
Copy Register A (the offset) into Register C for the cursor routine.
56D4
LD A,95H 3E 95
Load Register A with 95H, the thin vertical graphic character used as the match cursor.
56D6
GOSUB to 5DBCH to blink the cursor character in Register A on the byte at offset Register C until a key is pressed; Register A returns the key.
56D9
JUMP to 56DEH to show and handle the key in Register A that ended the cursor blinking.
56DB
GOSUB to 620BH to wait for a key with ROM 0049H (upper case); Register A returns it.
56DE
GOSUB to 5DFAH to show the key in Register A down column 6 if it is 20H or above (from 4000H on the key becomes 00H).
56E1
LD HL,5491H 21 91 54
Load Register Pair HL with 5491H, the command flags, which the key tests below read.
56E4
CP 4DH FE 4D
Compare Register A (the key) with 4DH (M), the first letter of the MODxx command.
56E6
If the NZ FLAG is set (not M), JUMP to 56EDH.
56E8
BIT 3,(HL) CB 5E
Test bit 3 of the command flags at Register Pair HL (DMDB): a memory dump page cannot be changed.
56EA
If the Z FLAG is set (not DMDB), JUMP to 5C5AH for MODxx, the modify mode.
56ED
CP 58H FE 58
Compare Register A (the key) with 58H (X), the command that goes back to the menu.
56EF
If the Z FLAG is set (X), JUMP to 54C5H: end the function and show the menu.
56F2
CP 45H FE 45
Compare Register A (the key) with 45H (E), the first letter of the EXIT command.
56F4
If the Z FLAG is set (E), JUMP to 5814H, where XIT must follow to end SUPERZAP.
56F7
CP 53H FE 53
Compare Register A (the key) with 53H (S), the first letter of the SCOPY command.
56F9
If the Z FLAG is set (S), JUMP to 5795H for SCOPY.
56FC
CP 46H FE 46
Compare Register A (the key) with 46H (F), the search command of the display mode.
56FE
If the Z FLAG is set (F), JUMP to 582CH, the search.
5701
CP 4CH FE 4C
Compare Register A (the key) with 4CH (L), the load module search command (DFS only).
5703
If the NZ FLAG is set (not L), JUMP to 570AH.
5705
BIT 6,(HL) CB 76
Test bit 6 of the command flags at Register Pair HL (DFS, a file is open).
5707
If the NZ FLAG is set (DFS), JUMP to 5821H for the load module search; in the other modes L does nothing.
570A
CP 3BH FE 3B
Compare Register A (the key) with 3BH (;), the key that gives + when shifted.
570C
If the NZ FLAG is set (not ;), JUMP to 5710H.
570E
LD A,2BH 3E 2B
Load Register A with 2BH (+): ; works as + without the shift key.
5710
CP 3DH FE 3D
Compare Register A (the key) with 3DH (=), the shifted minus key.
5712
If the NZ FLAG is set (not =), JUMP to 5716H.
5714
LD A,2DH 3E 2D
Load Register A with 2DH (-): the key = (shifted minus) works as - without the shift.
5716
PUSH AF F5
Save Register Pair AF (Register A, the key) on the stack (also the entry from 5939H and 5D31H with R).
5717
GOSUB to 62A7H to clear the screen (1CH home, 1FH clear to the end of the frame).
571A
POP AF F1
Restore Register Pair AF (Register A, the key) from the stack (also the entry from 56B8H).

571BH - Display Mode: J, K, R, + and -

J restarts the function with all its questions (not DM, where J only shows the page again). K restarts keeping the first answer: DM asks the address, DFS the file sector, DMDB the dump address, DTS the track and sector, DD the relative sector. For a disk sector R reads the same sector again, + the next and - the previous one (- at sector 0 gives SOURCE SECTOR OUT OF RANGE); for DM and DMDB they change the page number at 54B5H. Any other key shows the page again.

571B
LD HL,5491H 21 91 54
Load Register Pair HL with 5491H, the command flags (also the entry from 59DDH with K after NO MATCH).
571E
CP 4AH FE 4A
Compare Register A (the key) with 4AH (J), the command that restarts the function.
5720
If the NZ FLAG is set (not J), JUMP to 5734H.
5722
BIT 4,(HL) CB 66
Test bit 4 of the command flags at Register Pair HL (DTS).
5724
If the NZ FLAG is set (DTS), JUMP to 5545H to ask DRIVE, TRACK AND SECTOR #'S? again.
5727
BIT 5,(HL) CB 6E
Test bit 5 of the command flags at Register Pair HL (DM).
5729
If the NZ FLAG is set (DM), JUMP to 56C1H: J only shows the memory page again.
572B
LD A,(HL) 7E
Load Register A with the command flags at Register Pair HL.
572C
AND 48H E6 48
AND Register A with 48H, bits 6 (DFS) and 3 (DMDB): the functions that start with a filespec.
572E
If the NZ FLAG is set (DFS or DMDB), JUMP to 55CAH to ask FILESPEC? again.
5731
JUMP to 5584H to start DD again with DRIVE AND RELATIVE-SECTOR-WITHIN-DRIVE #'S?.
5734
CP 4BH FE 4B
Compare Register A (the key) with 4BH (K), restart keeping the first answer.
5736
If the NZ FLAG is set (not K), JUMP to 574FH.
5738
BIT 5,(HL) CB 6E
Test bit 5 of the command flags at Register Pair HL (DM).
573A
If the NZ FLAG is set (DM), JUMP to 564FH to ask MAIN MEMORY ADDRESS? again.
573D
BIT 6,(HL) CB 76
Test bit 6 of the command flags at Register Pair HL (DFS).
573F
If the NZ FLAG is set (DFS), JUMP to 5641H to ask RELATIVE-SECTOR-WITHIN-FILE #? for the same file.
5742
BIT 3,(HL) CB 5E
Test bit 3 of the command flags at Register Pair HL (DMDB).
5744
If the NZ FLAG is set (DMDB), JUMP to 5623H to ask DUMP MAIN MEMORY ADDRESS? for the same file.
5747
BIT 4,(HL) CB 66
Test bit 4 of the command flags at Register Pair HL (DTS).
5749
If the NZ FLAG is set (DTS), JUMP to 5554H to ask TRACK AND SECTOR #'S? on the same drive.
574C
JUMP to 5593H to ask RELATIVE-SECTOR-WITHIN-DRIVE #? on the same drive (DD).
574F
BIT 5,(HL) CB 6E
Test bit 5 of the command flags at Register Pair HL (DM).
5751
If the NZ FLAG is set (DM), JUMP to 5774H, where the keys change the memory page.
5753
BIT 3,(HL) CB 5E
Test bit 3 of the command flags at Register Pair HL (DMDB).
5755
If the NZ FLAG is set (DMDB), JUMP to 5774H as well.
5757
LD DE,(54A2H) ED 5B A2 54
Load Register Pair DE with the relative sector being shown, at 54A2H.
575B
CP 52H FE 52
Compare Register A (the key) with 52H (R), read the same sector again.
575D
If the Z FLAG is set (R), JUMP to 5771H to read the same sector again.
575F
INC DE 13
Increment Register Pair DE to the next sector, for +.
5760
CP 2BH FE 2B
Compare Register A (the key) with 2BH (+), the next sector (Register Pair DE already holds it).
5762
If the Z FLAG is set (+), JUMP to 5771H to read the next sector.
5764
CP 2DH FE 2D
Compare Register A (the key) with 2DH (-), the previous sector.
5766
If the NZ FLAG is set (any other key), JUMP to 56C1H to show the page again.
5769
DEC DE 1B
Decrement Register Pair DE (back to the sector shown).
576A
DEC DE 1B
Decrement Register Pair DE to the previous sector.
576B
LD A,D 7A
Load Register A with Register D, the high byte of the new sector number.
576C
AND E A3
AND Register A with Register E: FFH only when Register Pair DE is FFFFH.
576D
INC A 3C
Increment Register A: the Z FLAG is set when Register Pair DE is FFFFH, that is - was pressed at sector 0.
576E
If the Z FLAG is set, JUMP to 56A9H to display SOURCE SECTOR OUT OF RANGE and run K.
5771
JUMP to 55ADH to store Register Pair DE at 54A2H, read that sector and show it.
5774
LD DE,(54B4H) ED 5B B4 54
Load Register Pair DE with the page address at 54B4H (Register D = the page number).
5778
CP 52H FE 52
Compare Register A (the key) with 52H (R), show the same memory page again.
577A
If the Z FLAG is set (R), JUMP to 5789H to show the same page again.
577C
INC D 14
Increment Register D, the page number, for +.
577D
CP 2BH FE 2B
Compare Register A (the key) with 2BH (+), the next memory page (Register D already holds it).
577F
If the Z FLAG is set (+), JUMP to 5789H to store the next page address in Register Pair DE.
5782
CP 2DH FE 2D
Compare Register A (the key) with 2DH (-), the previous memory page.
5784
If the NZ FLAG is set (any other key), JUMP to 56C1H to show the page again.
5787
DEC D 15
Decrement Register D (back to the page shown).
5788
DEC D 15
Decrement Register D to the previous page (from 00H it wraps to FFH).
5789
LD (54B4H),DE ED 53 B4 54
Store Register Pair DE (the new page address) at 54B4H.
578D
BIT 3,(HL) CB 5E
Test bit 3 of the command flags at Register Pair HL (5491H, DMDB).
578F
If the Z FLAG is set (DM), JUMP to 56BDH to show the memory page at Register Pair DE.
5792
JUMP to 563BH to read the dump's bytes of the new page into 5300H and show them (DMDB).

5795H - SCOPY: Copy the Shown Sector to Another

DD and DTS only, typed as S then COPY. The source location is shown with IS TO BE COPIED TO and the destination drive and sector are asked (an empty or bad answer goes back to the menu). The destination is read into 4200H only to find its status, which is reported (SECTOR NOT READABLE, SECTOR READ PROTECTED, SECTOR NOT READ PROTECTED); then SHALL IT BE READ PROTECTED??? decides how the buffer at 5300H is written there. Afterwards FUNCTION COMPLETED and R, which shows the destination sector.

5795
LD A,(HL) 7E
Load Register A with the command flags at Register Pair HL (5491H).
5796
AND 68H E6 68
AND Register A with 68H, bits 6 (DFS), 5 (DM) and 3 (DMDB): SCOPY works only for DD and DTS.
5798
If the NZ FLAG is set (another mode), JUMP to 56C1H to show the page again.
579B
GOSUB to 5803H, which reads keys and compares them with the text after the CALL (COPY); any other key shows the page again, and after the text it returns to 57A3H.
579E-57A2
DEFM "COPY", 00H 43 4F 50 59 00
The rest of the command SCOPY, compared key by key by 5803H; the 00H ends it and 5803H continues at 57A3H.
57A3
GOSUB to 62A7H to clear the screen (1CH home, 1FH clear to the end of the frame).
57A6
GOSUB to 65D0H to display the location of the sector shown: DRIVE, DRS, TRACK and SECTOR, in decimal and hexadecimal.
57A9
LD HL,6DB7H 21 B7 6D
Load Register Pair HL with 6DB7H, the text IS TO BE COPIED TO and a carriage return.
57AC
GOSUB to 678FH to display it and ask DRIVE AND RELATIVE-SECTOR-WITHIN-DRIVE #'S?: the drive goes to 5406H and 5499H, the sector to 54A2H. The CARRY FLAG means an empty or bad answer.
57AF
If the CARRY FLAG is set, JUMP to 6582H to show PRESS 'ENTER' TO RETURN TO MENU and go back to the menu.
57B2
LD HL,4200H 21 00 42
Load Register Pair HL with 4200H, a second buffer for the destination's old contents.
57B5
LD (5403H),HL 22 03 54
Store Register Pair HL (4200H) at 5403H, the FCB's buffer address, so that 5300H keeps the source sector.
57B8
LD HL,(54A2H) 2A A2 54
Load Register Pair HL with the destination sector at 54A2H.
57BB
LD (540AH),HL 22 0A 54
Store Register Pair HL at 540AH, the FCB's NEXT.
57BE
PUSH HL E5
Save Register Pair HL (the destination sector) on the stack.
57BF
GOSUB to 644CH to read the destination into 4200H with bit 6 of 5493H set, so an error is reported without the retry question. The NZ FLAG means it could not be read; 5494H is set to P (read protected) or a space.
57C2
LD HL,5300H 21 00 53
Load Register Pair HL with 5300H, the buffer holding the source sector.
57C5
LD (5403H),HL 22 03 54
Store Register Pair HL (5300H) at 5403H, the FCB's buffer address, for the write.
57C8
POP HL E1
Restore Register Pair HL (the destination sector) from the stack.
57C9
LD (540AH),HL 22 0A 54
Store Register Pair HL at 540AH, the FCB's NEXT, again.
57CC
LD HL,6EABH 21 AB 6E
Load Register Pair HL with 6EABH, the message SECTOR NOT READABLE (the loads do not change the flags of the read).
57CF
If the NZ FLAG is set (the read failed), JUMP to 57DEH to report SECTOR NOT READABLE.
57D1
LD HL,6EB8H 21 B8 6E
Load Register Pair HL with 6EB8H, the message SECTOR READ PROTECTED.
57D4
LD A,(5494H) 3A 94 54
Load Register A with the status at 5494H, set by the read.
57D7
CP 50H FE 50
Compare Register A with 50H (P), the read protected status.
57D9
If the Z FLAG is set (read protected), JUMP to 57DEH to report it.
57DB
LD HL,6EB3H 21 B3 6E
Load Register Pair HL with 6EB3H, the message SECTOR NOT READ PROTECTED.
57DE
PUSH HL E5
Save Register Pair HL (the status message) on the stack.
57DF
LD HL,6D0EH 21 0E 6D
Load Register Pair HL with 6D0EH, the word DESTINATION and a space.
57E2
GOSUB to 6255H to display it without a carriage return.
57E5
POP HL E1
Restore Register Pair HL (the status message) from the stack.
57E6
GOSUB to 6245H to display the status message and a carriage return.
57E9
LD HL,6EBCH 21 BC 6E
Load Register Pair HL with 6EBCH, the question SHALL IT BE READ PROTECTED??? (Y OR N).
57EC
GOSUB to 6231H to ask until a single Y or N is typed: the Z FLAG for N, the NZ FLAG for Y.
57EF
LD A,20H 3E 20
Load Register A with 20H (space), the status for a normal write.
57F1
If the Z FLAG is set (N), JUMP to 57F5H with Register A = 20H, a normal write.
57F3
LD A,50H 3E 50
Load Register A with 50H (P): write the sector read protected.
57F5
LD (5494H),A 32 94 54
Store Register A at 5494H, the status the write uses: P writes with the directory mark.
57F8
GOSUB to 6474H to write the buffer at 5300H to the destination sector at NEXT, read protected if 5494H is P.
57FB
LD HL,6C2DH 21 2D 6C
Load Register Pair HL with 6C2DH, the message FUNCTION COMPLETED.
57FE
LD A,52H 3E 52
Load Register A with 52H (R): read and show the sector at 54A2H, now the destination, afterwards.
5800
JUMP to 56AEH to display the message, wait for ENTER and run R.

5803H - Display Mode: Match the Rest of a Command

Called with the text to match right after the CALL (COPY, XIT, OD, each ended by 00H). Each key (shown down column 6) must equal the next character; a wrong key shows the page again (56C1H resets the stack). After the 00H the routine continues at the instruction after the text.

5803
GOSUB to 5DF7H to wait for a key and show it down column 6; Register A returns the key in upper case.
5806
POP HL E1
Restore Register Pair HL from the stack: the address of the next character of the text to match (the CALL's return address).
5807
CP (HL) BE
Compare Register A (the key) with the text character at Register Pair HL.
5808
INC HL 23
Increment Register Pair HL to the next text character.
5809
If the NZ FLAG is set (wrong key), JUMP to 56C1H to drop the command and show the page again.
580C
PUSH HL E5
Save Register Pair HL (the next text character) on the stack as the return address.
580D
LD A,(HL) 7E
Load Register A with the next text character at Register Pair HL.
580E
OR A B7
OR Register A with itself to set the Z FLAG if it is the 00H that ends the text.
580F
If the NZ FLAG is set (more characters), LOOP BACK to 5803H for the next key.
5811
POP HL E1
Restore Register Pair HL (the address of the 00H) from the stack.
5812
INC HL 23
Increment Register Pair HL past the 00H, to the instruction after the text.
5813
JP (HL) E9
JUMP to Register Pair HL, the code after the text.

5814H - EXIT

E in the display mode must be followed by XIT. 581BH is also the handler of the menu's EXIT: the screen is cleared and SUPERZAP leaves through 402DH to DOS READY.

5814
GOSUB to 5803H to read keys that must be XIT (the text after the CALL); any other key shows the page again.
5817-581A
DEFM "XIT", 00H 58 49 54 00
The rest of the display mode command EXIT, compared key by key by 5803H; after the 00H the code at 581BH runs.
581B
GOSUB to 62A7H to clear the screen (1CH home, 1FH clear to the end of the frame).
581E
JUMP to 402DH, the DOS entry that returns to DOS READY: SUPERZAP ends here.

5821H - Search: F and L

The display mode search for one to four bytes. L (DFS only) must be followed by a comma; F followed by ENTER goes on from the last match with the same bytes. After F or L: a comma starts at the beginning of the drive, file, memory or dump, two hexadecimal digits xx start at byte xx of the page shown; then a comma and up to four bytes aa,bb,cc,dd in hexadecimal, or ENTER to use the bytes of the last search. Each key is shown down column 6 and any wrong key shows the page again. The position is a 24-bit value in Register C (high), Register H and Register L (low): a byte position within the drive or file, or a memory address. For DMDB it is a position in the dump file, 2 more than the address minus the base.

5821
LD B,A 47
Load Register B with Register A (4CH, L): the search kind, a load module search.
5822
GOSUB to 5E37H to read the next key: the Z FLAG for ENTER, the NZ FLAG with the NO CARRY FLAG for a comma, the CARRY FLAG for any other key.
5825
If the CARRY FLAG is set (neither comma nor ENTER), JUMP to 5829H to show the page again.
5827
If the NZ FLAG is set (a comma), JUMP to 5834H to set up the search.
5829
JUMP to 56C1H to show the page again: L needs a comma.
582C
LD B,00H 06 00
Load Register B with 00H: the search kind, F (all bytes are compared).
582E
GOSUB to 5E37H to read the next key: the Z FLAG for ENTER, the NZ FLAG for a comma, the CARRY FLAG for another key (the first digit of xx).
5831
If the Z FLAG is set (F and ENTER), JUMP to 58BEH to continue from the last position with the last bytes.
5834
PUSH AF F5
Save Register Pair AF (the key and its flags) on the stack.
5835
LD A,B 78
Load Register A with Register B, the search kind (4CH or 00H).
5836
LD (54BEH),A 32 BE 54
Store Register A (4CH for L, 00H for F) at 54BEH, the search kind.
5839
XOR A AF
Set Register A to 00H (XOR A with itself), to clear the load block count and Register C.
583A
LD (54C0H),A 32 C0 54
Store Register A (00H) at 54C0H: no load block bytes are pending for an L search.
583D
LD C,A 4F
Copy Register A (00H) into Register C, the high byte of the position.
583E
LD A,(HL) 7E
Load Register A with the command flags at Register Pair HL (5491H).
583F
AND 28H E6 28
AND Register A with 28H, bits 5 (DM) and 3 (DMDB): the modes whose pages are memory pages.
5841
LD B,A 47
Copy Register A into Register B: Register B is not 00H for DM and DMDB (bit 3 tells DMDB).
5842
LD HL,(54B4H) 2A B4 54
Load Register Pair HL with the page address at 54B4H (DM and DMDB).
5845
LD (54C3H),HL 22 C3 54
Store Register Pair HL at 54C3H, the page address the search shows when it stops.
5848
If the NZ FLAG is set (DM or DMDB), JUMP to 5851H: the position is the page address in Register Pair HL.
584A
LD L,C 69
Copy Register C (00H) into Register L: the byte within the sector.
584B
LD DE,(54A2H) ED 5B A2 54
Load Register Pair DE with the relative sector shown, at 54A2H.
584F
LD H,E 63
Copy Register E, the sector number's low byte, into Register H.
5850
LD C,D 4A
Copy Register D, the sector number's high byte, into Register C: the position is the first byte of the sector shown.
5851
POP AF F1
Restore Register Pair AF (the key and its flags) from the stack.
5852
If the CARRY FLAG is set (a digit), JUMP to 586AH to read the offset xx.
5854
LD E,00H 1E 00
Load Register E with 00H, the start offset: a comma means start at the very beginning.
5856
GOSUB to 520DH to set Register C, Register H and Register L to 00H (position 0) and 54C3H to 0000H.
5859
BIT 3,B CB 58
Test bit 3 of Register B (the memory mode bits from 5491H): set for DMDB.
585B
If the Z FLAG is set (not DMDB), JUMP to 5860H.
585D
GOSUB to 5214H to set 54C3H to the dump's base page (Register L stays 00H).
5860
GOSUB to 5E37H to read the key after the comma: the Z FLAG for ENTER, the CARRY FLAG for the first digit of the bytes.
5863
If the CARRY FLAG is set (a digit), JUMP to 5872H.
5865
If the Z FLAG is set (ENTER: the last bytes), JUMP to 5872H.
5867
JUMP to 56C1H to drop the command and show the page again (a second comma, or a bad key from 58A8H and 58B0H).
586A
GOSUB to 5E2EH to read the second digit of xx and the key after it: Register E = the offset, the CARRY FLAG for a bad key, the Z FLAG for ENTER, the NZ FLAG for a comma.
586D
If the CARRY FLAG is set, JUMP to 5867H to show the page again.
586F
If the NZ FLAG is set (a comma), GOSUB to 5E37H to read the next key: ENTER (Z) for the last bytes, a digit (CARRY) for new ones.
5872
PUSH AF F5
Save Register Pair AF (the last key and its flags) on the stack.
5873
LD A,E 7B
Load Register A with Register E, the start offset within the page (00H after a comma).
5874
LD (54C2H),A 32 C2 54
Store Register A at 54C2H, the offset of the search position within its page.
5877
ADD A,L 85
Add Register L (the low byte of the position) to Register A.
5878
LD L,A 6F
Copy Register A into Register L: the position now points at byte xx of the page.
5879
BIT 3,B CB 58
Test bit 3 of Register B (the memory mode bits from 5491H): set for DMDB, a dump file position.
587B
If the Z FLAG is set (not DMDB), JUMP to 5896H to store the position.
587D
LD DE,(54B2H) ED 5B B2 54
Load Register Pair DE with the dump's base address at 54B2H.
5881
OR A B7
OR Register A with itself to clear the CARRY FLAG before the subtraction.
5882
SBC HL,DE ED 52
Subtract Register Pair DE (the base) from Register Pair HL (the address): Register Pair HL = the address's distance from the start of the dump.
5884
If the NO CARRY FLAG is set (the address is in the dump), JUMP to 588FH.
5886
LD A,L 7D
Load Register A with Register L, the low byte of the negative distance.
5887
LD HL,54C2H 21 C2 54
Load Register Pair HL with 54C2H, the start offset.
588A
SUB (HL) 96
Subtract the start offset at Register Pair HL from Register A.
588B
LD (HL),A 77
Store Register A back at Register Pair HL (54C2H).
588C
LD HL,0000H 21 00 00
Load Register Pair HL with 0000H: the search starts at the first byte of the dump.
588F
LD DE,0002H 11 02 00
Load Register Pair DE with 0002H, the two address bytes at the start of a dump file.
5892
ADD HL,DE 19
Add Register Pair DE (2) to Register Pair HL: the position within the file.
5893
If the NO CARRY FLAG is set (the position fits 16 bits), JUMP to 5896H to store it.
5895
INC C 0C
Increment Register C, the high byte of the position, for a carry out of the 16 bits.
5896
LD (54B6H),HL 22 B6 54
Store Register Pair HL at 54B6H, the low and middle bytes of the search position.
5899
LD A,C 79
Load Register A with Register C, the high byte of the position.
589A
LD (54B8H),A 32 B8 54
Store Register A at 54B8H, the high byte of the search position.
589D
POP AF F1
Restore Register Pair AF (the last key and its flags) from the stack.
589E
If the Z FLAG is set (ENTER: keep the last bytes), JUMP to 58BEH to search.
58A0
LD B,04H 06 04
Load Register B with 04H, the most search bytes.
58A2
LD HL,54B9H 21 B9 54
Load Register Pair HL with 54B9H, the search string.
58A5
GOSUB to 5E2EH to read the second digit of the byte (Register A holds the first) and the key after it: Register E = the byte, the Z FLAG for ENTER, the CARRY FLAG for a bad key.
58A8
If the CARRY FLAG is set, JUMP to 5867H to show the page again.
58AB
LD (HL),E 73
Store Register E (the byte) at Register Pair HL, in the search string.
58AC
INC HL 23
Increment Register Pair HL to the next place in the string (the flags of the read are kept).
58AD
If the Z FLAG is set (ENTER after the byte), JUMP to 58B8H: the string is complete.
58AF
DEC B 05
Decrement Register B, the places left in the string.
58B0
If the Z FLAG is set (a fifth byte), JUMP to 5867H to show the page again.
58B3
GOSUB to 5E33H to read the next byte (two digits) and the key after it into Register E.
58B6
LOOP BACK to 58A8H to store the byte in Register E unless the key after it was bad.
58B8
LD A,05H 3E 05
Load Register A with 05H, one more than the four places of the search string.
58BA
SUB B 90
Subtract Register B (4 down to 1) from Register A: Register A = the number of bytes in the string (1 to 4).
58BB
LD (54BDH),A 32 BD 54
Store Register A at 54BDH, the length of the search string.
58BE
PUSH HL E5
Save Register Pair HL on the stack, to match the POP of the compare loop.

58BFH - Search: The Compare Loop

Each pass starts one byte further on: the byte at the search position is read (593CH) and the position moved on; for a disk the sector and offset of that byte are kept at 54A2H and 54C2H, for memory the page at 54C3H. If it equals the first search byte, the following bytes are read and compared. Holding the up-arrow key stops the search and shows the page reached. A match sets bit 4 of 5493H, so the display marks the byte at 54AEH; then R shows the page.

58BF
POP HL E1
Restore Register Pair HL from the stack, the word saved at 58BEH or 58E4H (it is not used).
58C0
LD HL,(54C3H) 2A C3 54
Load Register Pair HL with the page address of the search at 54C3H.
58C3
LD (54B4H),HL 22 B4 54
Store Register Pair HL at 54B4H, the memory page shown when the search stops or finds a match.
58C6
LD A,(38C0H) 3A C0 38
Load Register A with the keyboard rows 6 and 7 at 38C0H.
58C9
AND 08H E6 08
AND Register A with 08H, the up-arrow key's bit.
58CB
If the NZ FLAG is set (up-arrow held), JUMP to 5937H to stop and show the page reached.
58CD
LD A,(54C0H) 3A C0 54
Load Register A with 54C0H, the load block bytes left at the search position (L search).
58D0
LD (54BFH),A 32 BF 54
Store Register A at 54BFH, the working count of load block bytes.
58D3
LD A,(54B6H) 3A B6 54
Load Register A with the low byte of the search position at 54B6H.
58D6
LD C,A 4F
Copy Register A into Register C, the low byte of the position for 593CH.
58D7
LD HL,(54B7H) 2A B7 54
Load Register Pair HL with the middle and high bytes of the position at 54B7H.
58DA
GOSUB to 593CH to read the byte at the position (Register C, Register L and Register H) into Register B and move the position on by one.
58DD
LD A,C 79
Load Register A with Register C, the new low byte of the position.
58DE
LD (54B6H),A 32 B6 54
Store Register A at 54B6H: the next pass starts one byte further on.
58E1
LD (54B7H),HL 22 B7 54
Store Register Pair HL at 54B7H, the new middle and high bytes of the position.
58E4
PUSH HL E5
Save Register Pair HL (the new position) on the stack while the following bytes are compared.
58E5
LD A,(54BFH) 3A BF 54
Load Register A with the working count at 54BFH.
58E8
LD (54C0H),A 32 C0 54
Store Register A at 54C0H, the count at the new search position.
58EB
LD A,(5491H) 3A 91 54
Load Register A with the command flags at 5491H.
58EE
AND 28H E6 28
AND Register A with 28H, bits 5 (DM) and 3 (DMDB).
58F0
PUSH AF F5
Save Register Pair AF (the NZ FLAG for a memory search) on the stack.
58F1
If the NZ FLAG is set (DM or DMDB), JUMP to 5902H.
58F3
LD D,H 54
Copy Register H (the position's high byte) into Register D, for the sector number.
58F4
LD E,L 5D
Copy Register L into Register E: Register Pair DE = the sector number of the new position.
58F5
LD A,C 79
Load Register A with Register C, the offset of the new position within its sector.
58F6
OR A B7
OR Register A with itself: the Z FLAG is set when the new position is the first byte of a sector.
58F7
If the NZ FLAG is set (not the first byte of a sector), JUMP to 58FAH with Register Pair DE unchanged.
58F9
DEC DE 1B
Decrement Register Pair DE: the byte read was the last of the previous sector.
58FA
DEC A 3D
Decrement Register A to the offset of the byte read (00H wraps to FFH).
58FB
LD (54C2H),A 32 C2 54
Store Register A at 54C2H, the offset of the byte read within its sector.
58FE
LD (54A2H),DE ED 53 A2 54
Store Register Pair DE at 54A2H, the sector holding the byte read: the one shown if the search stops or matches here.
5902
LD HL,54C2H 21 C2 54
Load Register Pair HL with 54C2H, the offset of the byte read.
5905
LD A,(HL) 7E
Load Register A with the offset at Register Pair HL.
5906
LD (54AEH),A 32 AE 54
Store Register A at 54AEH, the byte offset the match cursor marks.
5909
POP AF F1
Restore Register Pair AF (the NZ FLAG for a memory search) from the stack.
590A
If the Z FLAG is set (a disk search), JUMP to 5919H.
590C
INC (HL) 34
Increment the offset at Register Pair HL (54C2H) to the next byte of the memory page.
590D
If the NZ FLAG is set (still in the page), JUMP to 5919H.
590F
LD HL,(54C3H) 2A C3 54
Load Register Pair HL with the page address at 54C3H.
5912
LD DE,0100H 11 00 01
Load Register Pair DE with 0100H, one memory page of 256 bytes, to step 54C3H.
5915
ADD HL,DE 19
Add Register Pair DE to Register Pair HL: the next page.
5916
LD (54C3H),HL 22 C3 54
Store Register Pair HL at 54C3H, the page address of the search.
5919
LD HL,54B9H 21 B9 54
Load Register Pair HL with 54B9H, the search string.
591C
LD A,(54BDH) 3A BD 54
Load Register A with the length of the string at 54BDH.
591F
LD D,A 57
Copy Register A into Register D, the bytes to compare.
5920
LD A,(HL) 7E
Load Register A with the search byte at Register Pair HL.
5921
CP B B8
Compare Register A with Register B, the byte read.
5922
INC HL 23
Increment Register Pair HL to the next search byte.
5923
If the NZ FLAG is set (different), LOOP BACK to 58BFH to try the next position.
5925
DEC D 15
Decrement Register D, the bytes still to compare.
5926
If the Z FLAG is set (all matched), JUMP to 5931H.
5928
EX (SP),HL E3
Exchange Register Pair HL with the word on the stack (Stack Pointer): Register Pair HL = the read position, the stack holds the search string pointer.
5929
PUSH DE D5
Save Register Pair DE (Register D, the count) on the stack.
592A
GOSUB to 593CH to read the next byte at the position (Register C and Register Pair HL) into Register B.
592D
POP DE D1
Restore Register Pair DE (Register D, the count) from the stack.
592E
EX (SP),HL E3
Exchange Register Pair HL with the word on the stack (Stack Pointer): Register Pair HL = the search string pointer again.
592F
LOOP BACK to 5920H to compare the byte in Register B with the next search byte.
5931
POP HL E1
Restore Register Pair HL from the stack, dropping the read position.
5932
LD HL,5493H 21 93 54
Load Register Pair HL with 5493H, the state flags.
5935
SET 4,(HL) CB E6
Set bit 4 of the state flags at Register Pair HL: the display marks the matched byte (54AEH).
5937
LD A,52H 3E 52
Load Register A with 52H (R), the command that shows the page found or reached.
5939
JUMP to 5716H to clear the screen and run R: the sector at 54A2H is read, or the page at 54B4H shown.

593CH - Search: Read the Byte at the Position

Returns the byte at the position (Register C low, Register L, Register H) in Register B and moves the position on by one. DM reads memory: Register L is the address high byte and Register H must stay 00H (past FFFFH the search ends). The others read the file or drive with 5990H; an L search drops the load record headers, so only the bytes of load blocks are returned: 54BFH counts the bytes left in the current block.

593C
LD A,(5491H) 3A 91 54
Load Register A with the command flags at 5491H.
593F
AND 20H E6 20
AND Register A (the command flags from 5491H) with 20H, bit 5: DM reads memory.
5941
If the Z FLAG is set (not DM), JUMP to 5951H to read the file or drive.
5943
LD A,H 7C
Load Register A with Register H, the byte above the 16-bit address.
5944
OR A B7
OR Register A with itself: not 00H means the search went past FFFFH.
5945
If the NZ FLAG is set, JUMP to 59B4H: NO MATCH.
5947
PUSH DE D5
Save Register Pair DE on the stack, as Register Pair DE is used for the memory address.
5948
LD D,L 55
Copy Register L, the address high byte, into Register D.
5949
LD E,C 59
Copy Register C, the address low byte, into Register E: Register Pair DE = the memory address.
594A
LD A,(DE) 1A
Load Register A with the memory byte at Register Pair DE.
594B
POP DE D1
Restore Register Pair DE from the stack (also the return from 5990H).
594C
LD B,A 47
Copy Register A (the byte read) into Register B, where the search compares it.
594D
INC C 0C
Increment Register C, the low byte of the position.
594E
RET NZ C0
If the NZ FLAG is set (no carry into the next page or sector), RETURN.
594F
INC HL 23
Increment Register Pair HL, the middle and high bytes of the position.
5950
RET C9
RETURN to the caller with the byte in Register B.
5951
GOSUB to 5990H to read the byte at the position from the drive or file into Register B and move the position on.
5954
LD A,(54BEH) 3A BE 54
Load Register A with the search kind at 54BEH.
5957
OR A B7
OR Register A (the search kind from 54BEH) with itself: 00H means F, all bytes count.
5958
RET Z C8
If the Z FLAG is set (F), RETURN with the byte in Register B.
5959
LD A,(5491H) 3A 91 54
Load Register A with the command flags at 5491H.
595C
BIT 6,A CB 77
Test bit 6 of Register A (DFS): L works only on a file.
595E
If the Z FLAG is set, JUMP to 56C1H to show the page again.
5961
LD A,(54BFH) 3A BF 54
Load Register A with the load block bytes left at 54BFH.
5964
OR A B7
OR Register A with itself: 00H means the byte read starts a new record.
5965
If the Z FLAG is set, JUMP to 596CH to read the record header.
5967
DEC A 3D
Decrement Register A, the load block bytes left.
5968
LD (54BFH),A 32 BF 54
Store Register A (the load block bytes left) at 54BFH.
596B
RET C9
RETURN with the load block byte in Register B.
596C
LD D,B 50
Copy Register B, the record type byte, into Register D.
596D
GOSUB to 5990H to read the record's length byte into Register B.
5970
LD A,D 7A
Load Register A with Register D, the record type.
5971
CP 20H FE 20
Compare Register A with 20H: a load module has no record type of 20H or above.
5973
If the NO CARRY FLAG is set, JUMP to 6576H to report DOS error 01H through 4409H and go back to the menu.
5976
DEC A 3D
Decrement Register A: the Z FLAG for type 01H, a load block.
5977
If the Z FLAG is set (record type 01H, a load block), JUMP to 5982H.
5979
DEC A 3D
Decrement Register A: the Z FLAG for type 02H, the transfer record, which ends the module.
597A
If the Z FLAG is set, JUMP to 59B4H: NO MATCH.
597C
LD D,B 50
Copy Register B (the record length) into Register D, the bytes to skip.
597D
GOSUB to 5989H to read and drop Register D bytes, the whole record.
5980
LOOP BACK to 5951H to read the next record type.
5982
LD D,03H 16 03
Load Register D with 03H: the two address bytes and the first data byte are read next.
5984
LD A,B 78
Load Register A with Register B, the block length (the address bytes and the data).
5985
SUB D 92
Subtract Register D (3) from Register A: the data bytes left after the first one.
5986
LD (54BFH),A 32 BF 54
Store Register A at 54BFH, the load block bytes left.
5989
GOSUB to 5990H to read the next byte into Register B.
598C
DEC D 15
Decrement Register D, the bytes still to read.
598D
If the NZ FLAG is set (Register D not yet 0), LOOP BACK to 5989H to read another byte.
598F
RET C9
RETURN with the last byte read (the block's first data byte) in Register B.

5990H - Search: Read a Byte of the Drive or File

Positions the FCB at the byte Register C of sector Register Pair HL with SYS0 444EH and reads it with ROM 0013H. Error 06H (the sector is read protected) still leaves the data in the buffer, so the byte is taken from there. Error 1CH or 1DH (the end) gives NO MATCH; any other error is displayed and the menu shown.

5990
PUSH DE D5
Save Register Pair DE on the stack, as Register Pair DE is needed for the FCB address.
5991
LD DE,5400H 11 00 54
Load Register Pair DE with 5400H, the FCB of the open file or drive.
5994
GOSUB to SYS0 444EH to position the FCB at Register Pair DE to byte Register C of sector Register Pair HL; the NZ FLAG means an error with its code in Register A.
5997
If the Z FLAG is set, GOSUB to ROM 0013H to read the byte at the FCB's position into Register A.
599A
If the Z FLAG is set (read), JUMP to 594BH to restore Register Pair DE, return the byte in Register B and move the position on.
599C
CP 06H FE 06
Compare Register A (the error code) with 06H, the code for a read protected sector.
599E
If the NZ FLAG is set (another error), JUMP to 59ABH.
59A0
LD B,00H 06 00
Load Register B with 00H: Register Pair BC = the byte's offset in the sector.
59A2
PUSH HL E5
Save Register Pair HL (the sector number) on the stack.
59A3
LD HL,(5403H) 2A 03 54
Load Register Pair HL with the FCB's buffer address at 5403H.
59A6
ADD HL,BC 09
Add Register Pair BC (the offset) to Register Pair HL: the byte in the buffer.
59A7
LD A,(HL) 7E
Load Register A with the byte at Register Pair HL.
59A8
POP HL E1
Restore Register Pair HL (the sector number) from the stack.
59A9
JUMP to 594BH to return the byte in Register B.
59AB
CP 1CH FE 1C
Compare Register A (the error code) with 1CH, the end of the file.
59AD
If the Z FLAG is set, JUMP to 59B4H: NO MATCH.
59AF
CP 1DH FE 1D
Compare Register A with 1DH, past the end of the file.
59B1
If the NZ FLAG is set (another error), JUMP to 6578H to display it through 4409H and go back to the menu.

59B4H - Search: No Match

The search reached the end. The search position goes back to the start (the first byte; for DMDB byte 2 of the file and page address 54B2H, the address of the base address variable), NO MATCH is shown after clearing the screen and K is run, which asks for the position again.

59B4
XOR A AF
Set Register A to 00H (XOR A with itself), to clear the search variables.
59B5
LD (54B8H),A 32 B8 54
Store Register A (00H) at 54B8H, the high byte of the search position.
59B8
LD H,A 67
Copy Register A (00H) into Register H, the middle byte of the search position.
59B9
LD L,A 6F
Copy Register A (00H) into Register L: Register Pair HL = 0000H.
59BA
LD D,A 57
Copy Register A (00H) into Register D, the high byte of the page address.
59BB
LD E,A 5F
Copy Register A (00H) into Register E: Register Pair DE = 0000H, the page address.
59BC
LD (54BFH),A 32 BF 54
Store Register A (00H) at 54BFH, the load block bytes left.
59BF
LD (54C2H),A 32 C2 54
Store Register A (00H) at 54C2H, the offset of the search position.
59C2
LD A,(5491H) 3A 91 54
Load Register A with the command flags at 5491H.
59C5
AND 08H E6 08
AND Register A (the command flags from 5491H) with 08H, bit 3: set for DMDB.
59C7
If the Z FLAG is set (not DMDB), JUMP to 59CEH.
59C9
LD DE,54B2H 11 B2 54
Load Register Pair DE with 54B2H, the address of the base address variable itself (not the base address stored there).
59CC
LD L,02H 2E 02
Load Register L with 02H: the position is file byte 2, the first byte of the dump.
59CE
LD (54C3H),DE ED 53 C3 54
Store Register Pair DE (0000H, or 54B2H for DMDB) at 54C3H, the page address of the search.
59D2
LD (54B6H),HL 22 B6 54
Store Register Pair HL at 54B6H, the low and middle bytes of the search position.
59D5
LD HL,6EDBH 21 DB 6E
Load Register Pair HL with 6EDBH, the message that clears the screen and shows NO MATCH.
59D8
GOSUB to 6245H to display it with a carriage return.
59DB
LD A,4BH 3E 4B
Load Register A with 4BH (K): ask for the position again.
59DD
JUMP to 571BH to run the display mode command K (ask for the position again).

59E0H - CDD: Copy Disk Data

Copies any string of bytes from one place on a diskette to another. After the heading COPY DISK DATA (after seven asterisks) and SURE YOU WANT TO DO THIS??? the source drive, relative sector and byte offset are asked, then the destination's, then BYTE COUNT?. The source values move to 549AH (drive), 54A4H (sector), 54AFH (offset) and 54AAH (drive size); the destination stays in 5499H, 54A2H, 54AEH and 54A8H. 6111H decides whether the copy must run backwards because the ranges overlap. Source sectors are read into 4200H, destination sectors into 5300H; each destination sector is written back when it is full, keeping its read protection status.

59E0
LD HL,6D28H 21 28 6D
Load Register Pair HL with 6D28H, the heading of seven asterisks and COPY DISK DATA.
59E3
GOSUB to 6224H to display it and ask SURE YOU WANT TO DO THIS??? (Y OR N); N goes back to the menu.
59E6
LD HL,6D0BH 21 0B 6D
Load Register Pair HL with 6D0BH, the word SOURCE and a space.
59E9
GOSUB to 678FH to display it and ask DRIVE AND RELATIVE-SECTOR-WITHIN-DRIVE #'S?: drive to 5406H and 5499H, sector to 54A2H, sizes to 549BH and 54A8H. The CARRY FLAG means an empty or bad answer.
59EC
If the CARRY FLAG is set, LOOP BACK to 59E6H to ask again.
59EE
GOSUB to 66EFH to ask BYTE OFFSET WITHIN SECTOR? until a value below 256 is given; it is stored at 54AEH.
59F1
LD A,(5499H) 3A 99 54
Load Register A with the source drive at 5499H.
59F4
LD (549AH),A 32 9A 54
Store Register A (the source drive) at 549AH, where the copy reads the source from.
59F7
LD HL,(54A2H) 2A A2 54
Load Register Pair HL with the source sector at 54A2H.
59FA
LD (54A4H),HL 22 A4 54
Store Register Pair HL at 54A4H, the source sector.
59FD
LD A,(54AEH) 3A AE 54
Load Register A with the source offset at 54AEH.
5A00
LD (54AFH),A 32 AF 54
Store Register A at 54AFH, the source offset.
5A03
LD HL,(54A8H) 2A A8 54
Load Register Pair HL with the source drive's sector count at 54A8H.
5A06
LD (54AAH),HL 22 AA 54
Store Register Pair HL at 54AAH, the source drive's sector count.
5A09
LD HL,6D0EH 21 0E 6D
Load Register Pair HL with 6D0EH, the word DESTINATION and a space.
5A0C
GOSUB to 678FH to display it and ask the destination drive and relative sector (to 5499H, 54A2H, 54A8H); the CARRY FLAG means an empty or bad answer.
5A0F
If the CARRY FLAG is set, LOOP BACK to 5A09H to ask again.
5A11
GOSUB to 66EFH to ask the destination's BYTE OFFSET WITHIN SECTOR?, stored at 54AEH.
5A14
GOSUB to 66E1H to ask BYTE COUNT? until a count from 1 to 65535 is given; it is stored at 54ACH.
5A17
LD A,(54ADH) 3A AD 54
Load Register A with the high byte of the count at 54ADH.
5A1A
LD E,A 5F
Copy Register A (the count's high byte) into Register E: the whole 256-byte blocks.
5A1B
LD D,00H 16 00
Load Register D with 00H: Register Pair DE = the count divided by 256.
5A1D
LD A,(54AFH) 3A AF 54
Load Register A with the source offset at 54AFH.
5A20
LD B,A 47
Copy Register A into Register B, the source offset for 6111H.
5A21
LD A,(54AEH) 3A AE 54
Load Register A with the destination offset at 54AEH.
5A24
LD C,A 4F
Copy Register A into Register C, the destination offset for 6111H.
5A25
INC DE 13
Increment Register Pair DE: the number of sectors the copy spans, as 6111H counts them.
5A26
PUSH BC C5
Save Register Pair BC (the two offsets) on the stack.
5A27
GOSUB to 6111H to set bit 7 of 5493H if the destination range starts inside the source range on the same drive, so that the copy must run backwards.
5A2A
POP BC C1
Restore Register Pair BC (Register B the source offset, Register C the destination offset) from the stack.
5A2B
LD HL,(54ACH) 2A AC 54
Load Register Pair HL with the byte count at 54ACH.
5A2E
PUSH HL E5
Save Register Pair HL (the byte count) on the stack: the copy loop counts it down there.
5A2F
LD E,C 59
Copy Register C (the destination offset) into Register E.
5A30
LD C,B 48
Copy Register B (the source offset) into Register C.
5A31
LD B,00H 06 00
Load Register B with 00H: Register Pair BC = the source offset.
5A33
LD D,B 50
Copy Register B (00H) into Register D: Register Pair DE = the destination offset.
5A34
LD HL,5493H 21 93 54
Load Register Pair HL with 5493H, the state flags.
5A37
BIT 7,(HL) CB 7E
Test bit 7 of the state flags at Register Pair HL (copy backwards).
5A39
If the Z FLAG is set (forwards), JUMP to 5A57H.
5A3B
POP HL E1
Restore Register Pair HL (the byte count) from the stack.
5A3C
PUSH HL E5
Save Register Pair HL (the byte count) on the stack again.
5A3D
ADD HL,DE 19
Add Register Pair DE (the destination offset) to Register Pair HL.
5A3E
DEC HL 2B
Decrement Register Pair HL: Register Pair HL = the position of the last destination byte, counted from the start of the first destination sector.
5A3F
LD A,L 7D
Load Register A with Register L, the offset of the last destination byte within its sector.
5A40
LD E,H 5C
Copy Register H, the sectors from the first destination sector to the last, into Register E (Register D is 00H).
5A41
LD HL,(54A2H) 2A A2 54
Load Register Pair HL with the destination sector at 54A2H.
5A44
ADD HL,DE 19
Add Register Pair DE to Register Pair HL: the last destination sector.
5A45
LD (54A2H),HL 22 A2 54
Store Register Pair HL at 54A2H: the copy starts with the last destination sector.
5A48
LD E,A 5F
Copy Register A (the last byte's offset) into Register E: Register Pair DE = the destination offset to start from.
5A49
POP HL E1
Restore Register Pair HL (the byte count) from the stack.
5A4A
PUSH HL E5
Save Register Pair HL (the byte count) on the stack again.
5A4B
ADD HL,BC 09
Add Register Pair BC (the source offset) to Register Pair HL.
5A4C
DEC HL 2B
Decrement Register Pair HL: the position of the last source byte from the start of the first source sector.
5A4D
LD A,L 7D
Load Register A with Register L, the offset of the last source byte within its sector.
5A4E
LD C,H 4C
Copy Register H, the sectors to the last source sector, into Register C (Register B is 00H).
5A4F
LD HL,(54A4H) 2A A4 54
Load Register Pair HL with the source sector at 54A4H.
5A52
ADD HL,BC 09
Add Register Pair BC to Register Pair HL: the last source sector.
5A53
LD (54A4H),HL 22 A4 54
Store Register Pair HL at 54A4H: the copy starts with the last source sector.
5A56
LD C,A 4F
Copy Register A (the last byte's offset) into Register C: Register Pair BC = the source offset to start from.
5A57
LD A,E 7B
Load Register A with Register E, the destination offset.
5A58
LD HL,5300H 21 00 53
Load Register Pair HL with 5300H, the destination sector buffer.
5A5B
ADD HL,DE 19
Add Register Pair DE (the destination offset) to Register Pair HL: the first destination byte in the buffer.
5A5C
EX DE,HL EB
Exchange Register Pair DE and Register Pair HL: Register Pair DE = the destination byte address.
5A5D
LD HL,4200H 21 00 42
Load Register Pair HL with 4200H, the source sector buffer.
5A60
ADD HL,BC 09
Add Register Pair BC (the source offset) to Register Pair HL: the first source byte in the buffer.
5A61
LD B,C 41
Copy Register C (the source offset) into Register B, the source position counter.
5A62
LD C,A 4F
Copy Register A (the destination offset) into Register C, the destination position counter.
5A63
GOSUB to 5AACH to read the source sector at 54A4H into 4200H and step 54A4H to the next one.
5A66
GOSUB to 5AF2H to read the destination sector at 54A2H into 5300H and keep its status for the write.
5A69
LD A,(5493H) 3A 93 54
Load Register A with the state flags at 5493H.
5A6C
BIT 7,A CB 7F
Test bit 7 of Register A (the state flags from 5493H), set when the copy runs backwards.
5A6E
If the Z FLAG is set (forwards), JUMP to 5A72H.
5A70
INC B 04
Increment Register B: backwards the counters run one above the offsets, so they reach 00H after byte 0.
5A71
INC C 0C
Increment Register C, the destination counter, the same way.

Copy Loop
Register Pair HL = the source byte (4200H-42FFH), Register Pair DE = the destination byte (5300H-53FFH), Register B and Register C their position counters; the byte count is on the stack.

5A72
LD A,(HL) 7E
Load Register A with the source byte at Register Pair HL.
5A73
LD (DE),A 12
Store Register A at Register Pair DE, the destination byte.
5A74
EX (SP),HL E3
Exchange Register Pair HL with the byte count on the stack (Stack Pointer).
5A75
DEC HL 2B
Decrement Register Pair HL, the bytes still to copy.
5A76
LD A,H 7C
Load Register A with Register H, the high byte of the bytes still to copy.
5A77
OR L B5
OR Register A with Register L: the Z FLAG is set when the count reaches 0.
5A78
If the NZ FLAG is set (more bytes), JUMP to 5A80H.
5A7A
GOSUB to 5AD2H to write the last destination sector from 5300H.
5A7D
JUMP to 65C6H to display FUNCTION COMPLETED and go back to the menu.
5A80
EX (SP),HL E3
Exchange Register Pair HL with the word on the stack (Stack Pointer): the count goes back, Register Pair HL = the source byte address.
5A81
LD A,(5493H) 3A 93 54
Load Register A with the state flags at 5493H.
5A84
BIT 7,A CB 7F
Test bit 7 of Register A (the state flags from 5493H), set when the copy runs backwards.
5A86
If the NZ FLAG is set (backwards), JUMP to 5A9AH to step the pointers down.
5A88
INC HL 23
Increment Register Pair HL to the next source byte.
5A89
INC DE 13
Increment Register Pair DE to the next destination byte.
5A8A
INC B 04
Increment Register B, the source counter: 00H means the source sector is used up.
5A8B
If the NZ FLAG is set (still in the sector), JUMP to 5A91H.
5A8D
DEC H 25
Decrement Register H: Register Pair HL goes back from 4300H to 4200H.
5A8E
GOSUB to 5AACH to read the next source sector into 4200H.
5A91
INC C 0C
Increment Register C, the destination counter.
5A92
If the NZ FLAG is set (still in the sector), JUMP to 5A98H.
5A94
DEC D 15
Decrement Register D: Register Pair DE goes back from 5400H to 5300H.
5A95
GOSUB to 5AEFH to write the full destination sector and read the next one into 5300H.
5A98
LOOP BACK to 5A72H to copy the next byte from Register Pair HL to Register Pair DE.
5A9A
DEC HL 2B
Decrement Register Pair HL to the previous source byte.
5A9B
DEC DE 1B
Decrement Register Pair DE to the previous destination byte.
5A9C
DEC B 05
Decrement Register B, the source counter: 00H means byte 0 of the source sector is done.
5A9D
If the NZ FLAG is set (still in the sector), JUMP to 5AA3H.
5A9F
INC H 24
Increment Register H: Register Pair HL goes from 41FFH to 42FFH, the last byte of the buffer.
5AA0
GOSUB to 5AACH to read the previous source sector into 4200H.
5AA3
DEC C 0D
Decrement Register C, the destination counter.
5AA4
If the NZ FLAG is set (still in the sector), JUMP to 5AAAH.
5AA6
INC D 14
Increment Register D: Register Pair DE goes from 52FFH to 53FFH.
5AA7
GOSUB to 5AEFH to write the finished destination sector and read the previous one.
5AAA
LOOP BACK to 5A72H to copy the next byte from Register Pair HL to Register Pair DE.

5AACH - CDD: Source and Destination Sectors

5AACH reads the source sector at 54A4H on drive 549AH into 4200H (checked against 54AAH) and steps 54A4H on (back for a backward copy). 5AD2H writes 5300H to the destination sector at 54A2H with the status its read found, and steps 54A2H. 5AEFH writes and then reads the next destination sector with 5AF2H, which checks it against 54A8H and keeps its status in the operand at 5AD6H, because source reads change 5494H in the meantime. All keep Register Pair HL, Register Pair DE and Register Pair BC.

5AAC
PUSH HL E5
Save Register Pair HL (the copy loop's source pointer) on the stack.
5AAD
PUSH DE D5
Save Register Pair DE (the copy loop's destination pointer) on the stack.
5AAE
PUSH BC C5
Save Register Pair BC (the copy loop's two counters) on the stack.
5AAF
LD HL,(54A4H) 2A A4 54
Load Register Pair HL with the source sector at 54A4H.
5AB2
LD DE,(54AAH) ED 5B AA 54
Load Register Pair DE with the source drive's sector count at 54AAH, the limit.
5AB6
LD BC,4200H 01 00 42
Load Register Pair BC with 4200H, the source buffer.
5AB9
LD A,(549AH) 3A 9A 54
Load Register A with the source drive at 549AH.
5ABC
PUSH HL E5
Save Register Pair HL (the source sector) on the stack.
5ABD
GOSUB to 5B16H to set the FCB (sector Register Pair HL, buffer Register Pair BC, drive Register A), check the sector against Register Pair DE (SOURCE SECTOR OUT OF RANGE) and read it.
5AC0
POP HL E1
Restore Register Pair HL (the source sector) from the stack.
5AC1
INC HL 23
Increment Register Pair HL to the next source sector.
5AC2
LD A,(5493H) 3A 93 54
Load Register A with the state flags at 5493H.
5AC5
BIT 7,A CB 7F
Test bit 7 of Register A (the state flags from 5493H), set when the copy runs backwards.
5AC7
If the Z FLAG is set (forwards), JUMP to 5ACBH.
5AC9
DEC HL 2B
Decrement Register Pair HL (the source sector plus 1) once.
5ACA
DEC HL 2B
Decrement Register Pair HL: the previous source sector.
5ACB
LD (54A4H),HL 22 A4 54
Store Register Pair HL at 54A4H, the next source sector to read.
5ACE
POP BC C1
Restore Register Pair BC from the stack (also the end of 5AD2H and 5AF2H).
5ACF
POP DE D1
Restore Register Pair DE (the copy loop's destination pointer) from the stack.
5AD0
POP HL E1
Restore Register Pair HL (the copy loop's source pointer) from the stack.
5AD1
RET C9
RETURN to the copy loop with its registers as they were.
5AD2
PUSH HL E5
Save Register Pair HL (the copy loop's source pointer) on the stack.
5AD3
PUSH DE D5
Save Register Pair DE (the copy loop's destination pointer) on the stack.
5AD4
PUSH BC C5
Save Register Pair BC (the copy loop's two counters) on the stack.
5AD5
LD A,00H 3E 00
Load Register A with the destination sector's status, the operand at 5AD6H that 5B11H fills in (00H in the file).
5AD7
LD (5494H),A 32 94 54
Store Register A at 5494H: the write keeps the destination's read protection (P), writes normally (space), or refuses a sector that was not read (E).
5ADA
GOSUB to 5B29H to write 5300H to the destination sector at 54A2H on drive 5499H (DESTINATION SECTOR OUT OF RANGE past 54A8H).
5ADD
LD HL,(54A2H) 2A A2 54
Load Register Pair HL with the destination sector at 54A2H.
5AE0
INC HL 23
Increment Register Pair HL to the next destination sector.
5AE1
LD A,(5493H) 3A 93 54
Load Register A with the state flags at 5493H.
5AE4
BIT 7,A CB 7F
Test bit 7 of Register A (the state flags from 5493H), set when the copy runs backwards.
5AE6
If the Z FLAG is set (forwards), JUMP to 5AEAH.
5AE8
DEC HL 2B
Decrement Register Pair HL (the destination sector plus 1) once.
5AE9
DEC HL 2B
Decrement Register Pair HL: the previous destination sector.
5AEA
LD (54A2H),HL 22 A2 54
Store Register Pair HL at 54A2H, the next destination sector.
5AED
JUMP to 5ACEH to restore the registers and return.
5AEF
GOSUB to 5AD2H to write the finished destination sector, then go on into 5AF2H to read the next one.
5AF2
PUSH HL E5
Save Register Pair HL (the copy loop's source pointer) on the stack.
5AF3
PUSH DE D5
Save Register Pair DE (the copy loop's destination pointer) on the stack.
5AF4
PUSH BC C5
Save Register Pair BC (the copy loop's two counters) on the stack.
5AF5
LD HL,(54A2H) 2A A2 54
Load Register Pair HL with the destination sector at 54A2H.
5AF8
LD DE,(54A8H) ED 5B A8 54
Load Register Pair DE with the destination drive's sector count at 54A8H.
5AFC
LD BC,5300H 01 00 53
Load Register Pair BC with 5300H, the destination buffer.
5AFF
LD A,(5499H) 3A 99 54
Load Register A with the destination drive at 5499H.
5B02
GOSUB to 5B42H to set the FCB's NEXT (Register Pair HL), buffer (Register Pair BC) and drive (Register A).
5B05
OR A B7
OR Register A with itself to clear the CARRY FLAG before the subtraction.
5B06
SBC HL,DE ED 52
Subtract Register Pair DE (the sector count) from Register Pair HL (the sector): the NO CARRY FLAG means the sector is past the end of the drive.
5B08
If the NO CARRY FLAG is set, GOSUB to 6593H to display DESTINATION SECTOR OUT OF RANGE and go back to the menu.
5B0B
GOSUB to 6457H to read the destination sector into 5300H, setting its status at 5494H.
5B0E
LD A,(5494H) 3A 94 54
Load Register A with the status at 5494H (P, space or E).
5B11
LD (5AD6H),A 32 D6 5A
Store Register A at 5AD6H, the operand of the LD A,nn at 5AD5H, for the write of this sector.
5B14
JUMP to 5ACEH to restore the registers and return.

5B16H - Read and Write a Sector With a Range Check

5B16H sets the FCB from Register Pair HL (sector), Register Pair BC (buffer) and Register A (drive), checks the sector against Register Pair DE (SOURCE SECTOR OUT OF RANGE; not done for DFS and DMDB, where the DOS checks the file) and reads it with 6457H. 5B29H writes the buffer at 5300H to the sector at 54A2H on drive 5499H after checking it against 54A8H (DESTINATION SECTOR OUT OF RANGE). 5B42H only sets the FCB.

5B16
GOSUB to 5B42H to store Register Pair HL at NEXT, Register Pair BC as the buffer and Register A as the drive in the FCB.
5B19
LD A,(5491H) 3A 91 54
Load Register A with the command flags at 5491H.
5B1C
AND 48H E6 48
AND Register A with 48H, bits 6 (DFS) and 3 (DMDB): the sector is a file sector.
5B1E
If the NZ FLAG is set (a file), JUMP to 5B26H to read without the check.
5B20
OR A B7
OR Register A with itself to clear the CARRY FLAG before the subtraction.
5B21
SBC HL,DE ED 52
Subtract Register Pair DE (the limit) from Register Pair HL (the sector): the NO CARRY FLAG means it is past the end.
5B23
If the NO CARRY FLAG is set, GOSUB to 658EH to display SOURCE SECTOR OUT OF RANGE and go back to the menu.
5B26
JUMP to 6457H to read the sector; its RETURN goes back to the caller with the Z FLAG for a sector read (or read protected) and the NZ FLAG for a skipped one.
5B29
LD HL,(54A2H) 2A A2 54
Load Register Pair HL with the destination sector at 54A2H.
5B2C
LD DE,(54A8H) ED 5B A8 54
Load Register Pair DE with the destination drive's sector count at 54A8H.
5B30
LD BC,5300H 01 00 53
Load Register Pair BC with 5300H, the buffer to write.
5B33
LD A,(5499H) 3A 99 54
Load Register A with the destination drive at 5499H.
5B36
GOSUB to 5B42H to set the FCB's NEXT, buffer and drive.
5B39
OR A B7
OR Register A with itself to clear the CARRY FLAG before the subtraction.
5B3A
SBC HL,DE ED 52
Subtract Register Pair DE (the sector count) from Register Pair HL (the sector).
5B3C
If the NO CARRY FLAG is set (past the end), GOSUB to 6593H to display DESTINATION SECTOR OUT OF RANGE and go back to the menu.
5B3F
JUMP to 6474H to write the buffer, read protected if 5494H is P; its RETURN goes back to the caller.
5B42
LD (540AH),HL 22 0A 54
Store Register Pair HL at 540AH, the FCB's NEXT: the sector to read or write.
5B45
LD (5403H),BC ED 43 03 54
Store Register Pair BC at 5403H, the FCB's buffer address.
5B49
LD (5406H),A 32 06 54
Store Register A (the drive) at 5406H, the FCB's drive number.
5B4C
RET C9
RETURN to the caller with the FCB set for the read or write.

5B4DH - CDS, ZDS and VDS

CDS asks COPY DISK SECTORS??? (after seven asterisks) and SURE?, the source drive and sector (moved to 549AH, 54A4H, 54AAH), the destination (5499H, 54A2H, 54A8H) and SECTOR COUNT?; an overlapping copy on one drive runs from the last sector down. ZDS (5B9EH) asks ZERO DISK SECTORS??? (after seven asterisks) and SURE?, VDS (5BA6H) PAUSE WHEN SECTOR READ PROTECTED??? (Y sets bit 5 of 5493H); both then ask the drive and sector and SECTOR COUNT? (5BB3H). 5BB8H is also the ,P path of DD, DTS and DFS.

5B4D
LD HL,6D21H 21 21 6D
Load Register Pair HL with 6D21H, the heading of seven asterisks and COPY DISK SECTORS???.
5B50
GOSUB to 6224H to display it and ask SURE YOU WANT TO DO THIS??? (Y OR N); N goes back to the menu.
5B53
LD HL,6D0BH 21 0B 6D
Load Register Pair HL with 6D0BH, the word SOURCE and a space.
5B56
GOSUB to 678FH to display it and ask the drive and relative sector (to 5406H, 5499H, 54A2H; the drive size to 54A8H). The CARRY FLAG means an empty or bad answer.
5B59
If the CARRY FLAG is set, LOOP BACK to 5B53H to ask again.
5B5B
LD A,(5406H) 3A 06 54
Load Register A with the source drive at 5406H.
5B5E
LD (549AH),A 32 9A 54
Store Register A (the source drive) at 549AH, where the copy reads the source from.
5B61
LD HL,(54A2H) 2A A2 54
Load Register Pair HL with the source sector at 54A2H.
5B64
LD (54A4H),HL 22 A4 54
Store Register Pair HL at 54A4H, the source sector.
5B67
LD HL,(54A8H) 2A A8 54
Load Register Pair HL with the source drive's sector count at 54A8H.
5B6A
LD (54AAH),HL 22 AA 54
Store Register Pair HL at 54AAH, the source limit.
5B6D
LD HL,6D0EH 21 0E 6D
Load Register Pair HL with 6D0EH, the word DESTINATION and a space.
5B70
GOSUB to 678FH to display it and ask the destination drive and sector (to 5499H, 54A2H, 54A8H).
5B73
If the CARRY FLAG is set, LOOP BACK to 5B6DH to ask again.
5B75
GOSUB to 66DCH to ask SECTOR COUNT? until a count from 1 to 65535 is given; it is stored at 54ACH.
5B78
LD BC,0000H 01 00 00
Load Register Pair BC with 0000H: whole sectors, both offsets 0 for 6111H.
5B7B
LD DE,(54ACH) ED 5B AC 54
Load Register Pair DE with the sector count at 54ACH.
5B7F
GOSUB to 6111H to set bit 7 of 5493H when the destination range starts inside the source range on the same drive.
5B82
LD A,(5493H) 3A 93 54
Load Register A with the state flags at 5493H.
5B85
BIT 7,A CB 7F
Test bit 7 of Register A (the state flags from 5493H), set when the copy must run backwards.
5B87
If the Z FLAG is set (forwards), JUMP to 5BBBH to start the loop.
5B89
LD DE,(54ACH) ED 5B AC 54
Load Register Pair DE with the sector count at 54ACH.
5B8D
DEC DE 1B
Decrement Register Pair DE: the distance from the first sector to the last.
5B8E
LD HL,(54A2H) 2A A2 54
Load Register Pair HL with the destination sector at 54A2H.
5B91
ADD HL,DE 19
Add Register Pair DE to Register Pair HL: the last destination sector.
5B92
LD (54A2H),HL 22 A2 54
Store Register Pair HL (the last destination sector) at 54A2H.
5B95
LD HL,(54A4H) 2A A4 54
Load Register Pair HL with the source sector at 54A4H.
5B98
ADD HL,DE 19
Add Register Pair DE to Register Pair HL: the last source sector.
5B99
LD (54A4H),HL 22 A4 54
Store Register Pair HL (the last source sector) at 54A4H.
5B9C
JUMP to 5BBBH to copy from the last sectors down.
5B9E
LD HL,6D1AH 21 1A 6D
Load Register Pair HL with 6D1AH, the heading of seven asterisks and ZERO DISK SECTORS???.
5BA1
GOSUB to 6224H to display it and ask SURE YOU WANT TO DO THIS??? (Y OR N); N goes back to the menu.
5BA4
JUMP to 5BB3H to ask the drive and the first relative sector to zero.
5BA6
LD HL,6D81H 21 81 6D
Load Register Pair HL with 6D81H, the question PAUSE WHEN SECTOR READ PROTECTED??? (Y OR N).
5BA9
GOSUB to 6231H to ask until a single Y or N is typed: the Z FLAG for N.
5BAC
If the Z FLAG is set (N, no pause), JUMP to 5BB3H to ask the drive and sector.
5BAE
LD HL,5493H 21 93 54
Load Register Pair HL with 5493H, the state flags.
5BB1
SET 5,(HL) CB EE
Set bit 5 of the state flags at Register Pair HL: pause at every read protected sector.
5BB3
GOSUB to 6792H to ask DRIVE AND RELATIVE-SECTOR-WITHIN-DRIVE #'S? (to 5406H, 5499H, 54A2H, 54A8H); the CARRY FLAG means an empty or bad answer.
5BB6
If the CARRY FLAG is set, LOOP BACK to 5BB3H to ask again.
5BB8
GOSUB to 66DCH to ask SECTOR COUNT?, stored at 54ACH (also the ,P entry from 55BCH).

5BBBH - The Sector Loop of VDS, ZDS, CDS and ,P

For each sector: read it (CDS reads the source; the others the sector at 54A2H). A skipped error sector goes on to the next one. With ,P the sector is shown and printed. VDS stops when the up-arrow key is held and pauses at a read protected sector if asked. ZDS zeroes the buffer and writes it back, CDS writes the buffer to the destination; both keep the status the read found, so read protection is kept (ZDS) or copied (CDS). Then both sector numbers move on (or back) and the count at 54ACH is counted down; at 0 FUNCTION COMPLETED.

5BBB
LD A,(5492H) 3A 92 54
Load Register A with the second command flags at 5492H.
5BBE
BIT 5,A CB 6F
Test bit 5 of Register A (CDS): the read is then from the source variables.
5BC0
LD A,(5499H) 3A 99 54
Load Register A with the drive at 5499H (the loads do not change the flags of the test).
5BC3
LD HL,(54A2H) 2A A2 54
Load Register Pair HL with the relative sector at 54A2H.
5BC6
LD DE,(54A8H) ED 5B A8 54
Load Register Pair DE with the drive's sector count at 54A8H.
5BCA
If the Z FLAG is set (not CDS), JUMP to 5BD6H.
5BCC
LD A,(549AH) 3A 9A 54
Load Register A with the source drive at 549AH.
5BCF
LD HL,(54A4H) 2A A4 54
Load Register Pair HL with the source sector at 54A4H.
5BD2
LD DE,(54AAH) ED 5B AA 54
Load Register Pair DE with the source drive's sector count at 54AAH.
5BD6
LD BC,5300H 01 00 53
Load Register Pair BC with 5300H, the buffer.
5BD9
GOSUB to 5B16H to set the FCB, check the sector against Register Pair DE and read it into 5300H; the NZ FLAG means the operator chose to skip an error sector.
5BDC
If the NZ FLAG is set (skipped), JUMP to 5C30H to go on with the next sector.
5BDE
LD A,(5491H) 3A 91 54
Load Register A with the command flags at 5491H.
5BE1
BIT 1,A CB 4F
Test bit 1 of Register A (the command flags from 5491H), set for ,P.
5BE3
If the Z FLAG is set (no ,P), JUMP to 5BECH for VDS, ZDS and CDS.
5BE5
LD C,10H 0E 10
Load Register C with 10H, all 16 lines of the sector.
5BE7
GOSUB to 613AH to show the sector and print its 16 lines (H stops the printing).
5BEA
JUMP to 5C30H to step to the next sector and count it.
5BEC
LD A,(5492H) 3A 92 54
Load Register A with the second command flags at 5492H.
5BEF
BIT 7,A CB 7F
Test bit 7 of Register A (the second command flags from 5492H), set for VDS.
5BF1
If the Z FLAG is set (ZDS or CDS), JUMP to 5C1AH.
5BF3
LD A,(3840H) 3A 40 38
Load Register A with keyboard row 6 at 3840H.
5BF6
AND 08H E6 08
AND Register A (keyboard row 6) with 08H, the up-arrow key's bit.
5BF8
If the NZ FLAG is set (up-arrow held), JUMP to 65C6H to display FUNCTION COMPLETED and go back to the menu.
5BFB
LD A,(5494H) 3A 94 54
Load Register A with the sector's status at 5494H.
5BFE
CP 50H FE 50
Compare Register A with 50H (P, read protected).
5C00
If the NZ FLAG is set (not read protected), JUMP to 5C30H.
5C02
LD A,(5493H) 3A 93 54
Load Register A with the state flags at 5493H.
5C05
BIT 5,A CB 6F
Test bit 5 of Register A, the pause asked for at 5BA6H.
5C07
If the Z FLAG is set (no pause), JUMP to 5C30H.
5C09
GOSUB to 65D0H to display the sector's location: DRIVE, DRS, TRACK and SECTOR.
5C0C
LD HL,6EB8H 21 B8 6E
Load Register Pair HL with 6EB8H, the message SECTOR READ PROTECTED.
5C0F
GOSUB to 6245H to display it with a carriage return.
5C12
LD HL,6DD5H 21 D5 6D
Load Register Pair HL with 6DD5H, the text PRESS 'ENTER' TO CONTINUE.
5C15
GOSUB to 6345H to display it and wait for ENTER.
5C18
JUMP to 5C30H to step to the next sector and count it.
5C1A
BIT 5,A CB 6F
Test bit 5 of Register A (the second command flags, CDS).
5C1C
If the NZ FLAG is set (CDS), JUMP to 5C2DH to write the buffer to the destination.
5C1E
BIT 6,A CB 77
Test bit 6 of Register A (the second command flags from 5492H), set for ZDS.
5C20
If the Z FLAG is set (none of the commands that come here), GOSUB to 65AFH to display SUPERZAP INTERNAL PROGRAMMING ERROR and go back to the menu.
5C23
LD HL,5300H 21 00 53
Load Register Pair HL with 5300H, the buffer to zero.
5C26
LD A,00H 3E 00
Load Register A with 00H, the value every byte of the buffer gets.
5C28
LD B,A 47
Copy Register A (00H) into Register B: 256 bytes for the DJNZ.
5C29
LD (HL),A 77
Store Register A (00H) at Register Pair HL, the next byte of the buffer at 5300H.
5C2A
INC HL 23
Increment Register Pair HL to the next byte of the buffer at 5300H.
5C2B
Decrement Register B and LOOP BACK to 5C29H until all 256 bytes of 5300H are zero.
5C2D
GOSUB to 5B29H to write 5300H to the sector at 54A2H on drive 5499H, with the status the read left at 5494H.
5C30
LD HL,(54A2H) 2A A2 54
Load Register Pair HL with the sector at 54A2H.
5C33
LD DE,(54A4H) ED 5B A4 54
Load Register Pair DE with the source sector at 54A4H.
5C37
INC HL 23
Increment Register Pair HL to the next sector.
5C38
INC DE 13
Increment Register Pair DE to the next source sector.
5C39
LD A,(5493H) 3A 93 54
Load Register A with the state flags at 5493H.
5C3C
BIT 7,A CB 7F
Test bit 7 of Register A (the state flags from 5493H), set when the copy runs backwards.
5C3E
If the Z FLAG is set (forwards), JUMP to 5C44H to store the next sector numbers.
5C40
DEC HL 2B
Decrement Register Pair HL (the sector plus 1) once.
5C41
DEC HL 2B
Decrement Register Pair HL: the previous sector.
5C42
DEC DE 1B
Decrement Register Pair DE (the source sector plus 1) once.
5C43
DEC DE 1B
Decrement Register Pair DE: the previous source sector.
5C44
LD (54A2H),HL 22 A2 54
Store Register Pair HL (the next sector) at 54A2H.
5C47
LD (54A4H),DE ED 53 A4 54
Store Register Pair DE (the next source sector) at 54A4H.
5C4B
LD HL,(54ACH) 2A AC 54
Load Register Pair HL with the sectors left at 54ACH.
5C4E
DEC HL 2B
Decrement Register Pair HL, the sectors left: one sector is done.
5C4F
LD (54ACH),HL 22 AC 54
Store Register Pair HL (the sectors left) at 54ACH.
5C52
LD A,H 7C
Load Register A with Register H, the high byte of the sectors left.
5C53
OR L B5
OR Register A with Register L: the Z FLAG is set when no sectors are left.
5C54
If the NZ FLAG is set, JUMP to 5BBBH for the next sector.
5C57
JUMP to 65C6H to display FUNCTION COMPLETED and go back to the menu.

5C5AH - MODxx: The Modify Mode

M in the display mode (not DMDB) must be followed by OD and two hexadecimal digits xx, the byte where the cursor starts. Register L is the cursor's byte offset in the page and bit 0 of Register B the digit (0 the high digit, 1 the low one); bit 1 of Register B is set when the cursor has run past the last byte, and a hexadecimal digit typed then is refused. After every key the page is shown again with a blinking block on the digit. Hexadecimal digits change the byte at once (in memory for DM, in the buffer for a sector); space and right arrow move one digit on, left arrow one back, shift right and shift left two bytes, down arrow and up arrow 16 bytes (one line), all inside the page. ENTER ends (5D01H), Q cancels a sector change (5D34H), ZTxx and RTxx,jk fill a range (5D45H); anything else gives INVALID MODIFICATION MODE CHAR.

5C5A
GOSUB to 5803H to read keys that must be OD (the text after the CALL); any other key shows the page again.
5C5D-5C5F
DEFM "OD", 00H 4F 44 00
The rest of the display mode command MOD, compared key by key by 5803H; after the 00H the code at 5C60H runs.
5C60
GOSUB to 5E19H to read two hexadecimal digits (each shown down column 6) into Register Pair DE; the CARRY FLAG means a key that is not a digit.
5C63
If the CARRY FLAG is set, JUMP to 56C1H to show the page again.
5C66
EX DE,HL EB
Exchange Register Pair DE and Register Pair HL: Register L = xx, the cursor's byte offset.
5C67
LD B,00H 06 00
Load Register B with 00H: the cursor is on the byte's high digit (also the entry from 5DA3H after a fill).

Modify Loop
Register L = the cursor's byte, Register B bit 0 = its digit, bit 1 = past the end.

5C69
LD (5497H),HL 22 97 54
Store Register Pair HL at 5497H, the cursor position (no instruction reads it back).
5C6C
PUSH HL E5
Save Register Pair HL (the cursor) on the stack.
5C6D
LD C,L 4D
Copy Register L (the cursor's byte offset) into Register C for the cursor routine.
5C6E
GOSUB to 5FB2H to show the page again with the bytes as they now are; Register Pair BC is kept.
5C71
LD A,BFH 3E BF
Load Register A with BFH, the full block graphic character used as the modify cursor.
5C73
GOSUB to 5DBCH to blink it on the digit given by Register C and bit 0 of Register B until a key is pressed; Register A returns the key.
5C76
POP HL E1
Restore Register Pair HL (the cursor) from the stack.
5C77
LD C,A 4F
Copy Register A (the key) into Register C, kept while the key is tested for a digit.
5C78
GOSUB to 686DH to turn the key in Register A into its value: the CARRY FLAG and Register A = 0-15 for a hexadecimal digit.
5C7B
If the NO CARRY FLAG is set (not a digit), JUMP to 5CAEH for the other keys.
5C7D
BIT 1,B CB 48
Test bit 1 of Register B, set when the cursor ran past the last byte.
5C7F
RES 1,B CB 88
Reset bit 1 of Register B (the RES does not change the flags of the test).
5C81
If the NZ FLAG is set (past the end), JUMP to 5DA6H for INVALID MODIFICATION MODE CHAR.
5C84
LD E,F0H 1E F0
Load Register E with F0H, the mask that keeps the high digit when the low one is replaced.
5C86
BIT 0,B CB 40
Test bit 0 of Register B: set when the cursor is on the byte's low digit.
5C88
If the NZ FLAG is set, JUMP to 5C90H with the value in the low four bits of Register A.
5C8A
LD E,0FH 1E 0F
Load Register E with 0FH, the mask that keeps the low digit.
5C8C
RLCA 07
Rotate Register A left (four RLCAs move the value to the high four bits).
5C8D
RLCA 07
Rotate Register A (the digit) left, the second of the four rotations to the high half.
5C8E
RLCA 07
Rotate Register A (the digit) left, the third of the four rotations to the high half.
5C8F
RLCA 07
Rotate Register A left, the fourth: the new high digit.
5C90
LD C,A 4F
Copy Register A (the new digit in place) into Register C.
5C91
PUSH HL E5
Save Register Pair HL (the cursor) on the stack.
5C92
PUSH DE D5
Save Register Pair DE (Register E, the mask) on the stack.
5C93
LD DE,(5495H) ED 5B 95 54
Load Register Pair DE with the page address at 5495H (5300H for a sector, the memory page for DM).
5C97
ADD HL,DE 19
Add Register Pair DE to Register Pair HL: Register Pair HL = the byte under the cursor.
5C98
POP DE D1
Restore Register Pair DE (Register E, the mask) from the stack.
5C99
LD A,(HL) 7E
Load Register A with the byte at Register Pair HL.
5C9A
AND E A3
AND Register A with Register E, keeping the other digit.
5C9B
OR C B1
OR Register A with Register C, the new digit.
5C9C
LD (HL),A 77
Store Register A at Register Pair HL: the byte is changed.
5C9D
POP HL E1
Restore Register Pair HL (the cursor) from the stack.
5C9E
BIT 0,B CB 40
Test bit 0 of Register B (the low digit was changed).
5CA0
If the Z FLAG is set (the high digit), JUMP to 5CA7H to move to the low digit.
5CA2
INC L 2C
Increment Register L, the cursor, to the next byte after the low digit was changed.
5CA3
If the NZ FLAG is set (still in the page), JUMP to 5CA7H.
5CA5
SET 1,B CB C8
Set bit 1 of Register B: the cursor ran past byte FFH and has wrapped to byte 00H.
5CA7
LD A,B 78
Load Register A with Register B, the cursor's digit flags.
5CA8
XOR 01H EE 01
XOR Register A with 01H to change to the other digit.
5CAA
LD B,A 47
Copy Register A (the flags with bit 0 changed) into Register B: the cursor is on the other digit.
5CAB
JUMP to 5C69H to show the page with the cursor at its new place.
5CAE
RES 1,B CB 88
Reset bit 1 of Register B: a key that is not a digit cancels the past-the-end state.
5CB0
LD A,C 79
Load Register A with Register C, the key, again (686DH changed Register A).
5CB1
CP 0DH FE 0D
Compare Register A (the key) with 0DH (ENTER), which ends the modify mode.
5CB3
If the Z FLAG is set, JUMP to 5D01H to end the modify mode.
5CB6
CP 20H FE 20
Compare Register A (the key) with 20H (space), which moves the cursor one digit on.
5CB8
If the Z FLAG is set, JUMP to 5CBEH to move one digit on.
5CBA
CP 09H FE 09
Compare Register A (the key) with 09H (right arrow), which moves one digit on as well.
5CBC
If the NZ FLAG is set (not right arrow), JUMP to 5CC7H to test the other keys.
5CBE
BIT 0,B CB 40
Test bit 0 of Register B: set when the cursor is on the byte's low digit.
5CC0
If the Z FLAG is set (high digit), JUMP to 5CA7H to move to the low digit of the same byte.
5CC2
INC L 2C
Increment Register L, the cursor, to the next byte (from the low digit).
5CC3
If the NZ FLAG is set (still in the page), JUMP to 5CA7H to go to its high digit.
5CC5
JUMP to 5CE1H to stay on the low digit of byte FFH.
5CC7
CP 08H FE 08
Compare Register A (the key) with 08H (left arrow), one digit back.
5CC9
If the NZ FLAG is set (not left arrow), JUMP to 5CD6H to test the shift arrows.
5CCB
BIT 0,B CB 40
Test bit 0 of Register B: set when the cursor is on the byte's low digit.
5CCD
If the NZ FLAG is set (low digit), JUMP to 5CA7H to go to the high digit of the same byte.
5CCF
INC L 2C
Increment Register L (the cursor), so that the DEC below tests it for 00H.
5CD0
DEC L 2D
Decrement Register L: the Z FLAG is set when the cursor is on byte 00H.
5CD1
If the Z FLAG is set (the first digit of the page), JUMP to 5CABH: the cursor stays.
5CD3
DEC L 2D
Decrement Register L, the cursor, to the previous byte of the page.
5CD4
JUMP to 5CA7H to change Register B to the low digit of that byte.
5CD6
LD E,02H 1E 02
Load Register E with 02H, the step of the shift arrows (two bytes).
5CD8
CP 19H FE 19
Compare Register A with 19H (shift right arrow).
5CDA
If the NZ FLAG is set (not shift right arrow), JUMP to 5CE7H.
5CDC
LD A,L 7D
Load Register A with Register L, the cursor's byte (also the down arrow, with 10H).
5CDD
ADD A,E 83
Add Register E (the step, 2 or 16 bytes) to Register A, the cursor's byte.
5CDE
LD L,A 6F
Copy Register A into Register L, the new byte.
5CDF
If the NO CARRY FLAG is set (still in the page), JUMP to 5CABH.
5CE1
LD B,01H 06 01
Load Register B with 01H: the cursor goes to the low digit of the last byte.
5CE3
LD L,FFH 2E FF
Load Register L with FFH: the last byte of the page.
5CE5
JUMP to 5CABH to show the cursor on the last digit of the page.
5CE7
CP 18H FE 18
Compare Register A with 18H (shift left arrow).
5CE9
If the Z FLAG is set, JUMP to 5CF7H to move back two bytes.
5CEB
LD E,10H 1E 10
Load Register E with 10H, the step of the up and down arrows (one line of 16 bytes).
5CED
CP 0AH FE 0A
Compare Register A (the key) with 0AH (down arrow), 16 bytes on.
5CEF
If the Z FLAG is set, JUMP to 5CDCH to move 16 bytes on.
5CF1
LD C,L 4D
Copy Register L (the cursor) into Register C, kept for the fill commands at 5D45H.
5CF2
CP 5BH FE 5B
Compare Register A (the key) with 5BH (up arrow), 16 bytes back.
5CF4
If the NZ FLAG is set, JUMP to 5D34H for Q, Z and R.
5CF7
LD A,L 7D
Load Register A with Register L, the cursor's byte.
5CF8
SUB E 93
Subtract Register E (the step) from Register A.
5CF9
LD L,A 6F
Copy Register A into Register L, the new byte.
5CFA
If the NO CARRY FLAG is set (still in the page), JUMP to 5CABH.
5CFC
LD B,00H 06 00
Load Register B with 00H: the cursor goes to the high digit of the first byte.
5CFE
LD L,B 68
Copy Register B (00H) into Register L: the first byte of the page.
5CFF
JUMP to 5CABH to show the cursor on the first digit of the page.

5D01H - Modify Mode: ENTER and Q

For DM, ENTER only ends the modify mode (the memory is already changed): MODIFICATION COMPLETED. For a sector the screen asks REPLY 'Y' IF OK TO WRITE MODIFIED SECTOR TO DISK: Y writes the buffer to the sector at 54A2H, keeping its read protection, and shows MODIFICATION COMPLETED; any other key goes back to the modify mode. Q (sectors only) shows MODIFICATION CANCELLED; after ENTER, R reads the sector again, which drops the changes.

5D01
LD A,(5491H) 3A 91 54
Load Register A with the command flags at 5491H.
5D04
BIT 5,A CB 6F
Test bit 5 of Register A (the command flags from 5491H), set for DM.
5D06
If the NZ FLAG is set (memory), JUMP to 5D23H: MODIFICATION COMPLETED.
5D08
PUSH HL E5
Save Register Pair HL (the cursor) on the stack.
5D09
PUSH BC C5
Save Register Pair BC (Register B, the digit) on the stack.
5D0A
LD HL,6DA2H 21 A2 6D
Load Register Pair HL with 6DA2H, the screen clear and REPLY 'Y' IF OK TO WRITE MODIFIED SECTOR TO DISK.
5D0D
GOSUB to 6245H to display it with a carriage return.
5D10
GOSUB to 620BH to wait for a key; Register A returns it in upper case.
5D13
POP BC C1
Restore Register Pair BC (Register B, the cursor's digit) from the stack.
5D14
POP HL E1
Restore Register Pair HL (the cursor) from the stack.
5D15
CP 59H FE 59
Compare Register A (the key) with 59H (Y), the answer that writes the sector.
5D17
If the NZ FLAG is set (not Y), JUMP to 5C69H to go on modifying.
5D1A
LD HL,(54A2H) 2A A2 54
Load Register Pair HL with the sector shown, at 54A2H.
5D1D
LD (540AH),HL 22 0A 54
Store Register Pair HL at 540AH, the FCB's NEXT.
5D20
GOSUB to 6474H to write the buffer at 5300H to that sector, read protected if 5494H is P.
5D23
LD HL,6DC4H 21 C4 6D
Load Register Pair HL with 6DC4H, the screen clear and MODIFICATION COMPLETED.
5D26
GOSUB to 6245H to display the message at Register Pair HL with a carriage return (also from 5D43H with MODIFICATION CANCELLED).
5D29
LD HL,6DD5H 21 D5 6D
Load Register Pair HL with 6DD5H, the text PRESS 'ENTER' TO CONTINUE.
5D2C
GOSUB to 6345H to display it and wait for ENTER.
5D2F
LD A,52H 3E 52
Load Register A with 52H (R), the display mode command to run next.
5D31
JUMP to 5716H to clear the screen and run R: the sector is read again (for DM the page is shown).
5D34
CP 51H FE 51
Compare Register A (the key) with 51H (Q), the command that cancels a sector change.
5D36
If the NZ FLAG is set (not Q), JUMP to 5D45H to test for Z and R.
5D38
LD A,(5491H) 3A 91 54
Load Register A with the command flags at 5491H.
5D3B
BIT 5,A CB 6F
Test bit 5 of Register A (DM): memory changes cannot be cancelled.
5D3D
If the NZ FLAG is set (DM), JUMP to 5DA6H for INVALID MODIFICATION MODE CHAR.
5D40
LD HL,6DC8H 21 C8 6D
Load Register Pair HL with 6DC8H, the screen clear and MODIFICATION CANCELLED.
5D43
JUMP to 5D26H to display it, wait for ENTER and read the sector again.

5D45H - Modify Mode: ZTxx and RTxx,jk

Z or R, then T, two digits xx (the last byte of the range) and for R a comma and two digits jk (the new value), then ENTER; the keys are shown down column 6. Every byte from the cursor to byte xx becomes 00H (ZT) or jk (RT); when the cursor is on a low digit, the first byte keeps its high digit. The fill value is put into the operand at 5D9CH. The cursor ends on the high digit of the byte after xx. A wrong key, or xx before the cursor, gives INVALID MODIFICATION MODE CHAR.

5D45
LD C,00H 0E 00
Load Register C with 00H, the kind: 00H for ZT.
5D47
CP 5AH FE 5A
Compare Register A (the key) with 5AH (Z), the first letter of ZTxx.
5D49
If the Z FLAG is set (Z), JUMP to 5D51H with Register C = 00H.
5D4B
INC C 0C
Increment Register C to 01H, the kind for RT.
5D4C
CP 52H FE 52
Compare Register A (the key) with 52H (R), the first letter of RTxx,jk.
5D4E
If the NZ FLAG is set (any other key), JUMP to 5DA6H for INVALID MODIFICATION MODE CHAR.
5D51
PUSH HL E5
Save Register Pair HL (the cursor) on the stack.
5D52
PUSH BC C5
Save Register Pair BC (Register B the digit, Register C the kind) on the stack.
5D53
GOSUB to 5DFDH to show the key (Z or R) down column 6.
5D56
GOSUB to 5DF7H to wait for the next key and show it.
5D59
CP 54H FE 54
Compare Register A (the key after Z or R) with 54H (T).
5D5B
If the NZ FLAG is set, JUMP to 5DAAH for INVALID MODIFICATION MODE CHAR.
5D5E
GOSUB to 5E33H to read two digits (xx) into Register E and the key after them: the CARRY FLAG for a bad key, the Z FLAG for ENTER.
5D61
If the CARRY FLAG is set (not two digits), JUMP to 5DAAH for INVALID MODIFICATION MODE CHAR.
5D63
PUSH DE D5
Save Register Pair DE (Register E, the last byte xx) on the stack.
5D64
LD E,00H 1E 00
Load Register E with 00H, the fill value of ZT.
5D66
DEC C 0D
Decrement Register C, the kind: the Z FLAG for RT.
5D67
If the NZ FLAG is set (ZT), JUMP to 5D72H with the fill value 00H in Register E.
5D69
CP 2CH FE 2C
Compare Register A (the key after xx) with 2CH (a comma).
5D6B
If the NZ FLAG is set, JUMP to 5DA9H for INVALID MODIFICATION MODE CHAR (dropping the saved word).
5D6D
GOSUB to 5E33H to read the two digits jk into Register E and the key after them.
5D70
If the CARRY FLAG is set (not two digits), JUMP to 5DA9H for INVALID MODIFICATION MODE CHAR.
5D72
CP 0DH FE 0D
Compare Register A (the last key) with 0DH (ENTER).
5D74
If the NZ FLAG is set (not ENTER), JUMP to 5DAAH for INVALID MODIFICATION MODE CHAR.
5D76
LD A,E 7B
Load Register A with Register E, the fill value (00H or jk).
5D77
LD (5D9CH),A 32 9C 5D
Store Register A at 5D9CH, the operand of the LD A,nn at 5D9BH.
5D7A
POP DE D1
Restore Register Pair DE (Register E, the last byte xx) from the stack.
5D7B
POP BC C1
Restore Register Pair BC (Register B, the digit) from the stack.
5D7C
POP HL E1
Restore Register Pair HL (Register L, the cursor) from the stack.
5D7D
LD A,E 7B
Load Register A with Register E, the last byte xx.
5D7E
SUB L 95
Subtract Register L (the cursor) from Register A.
5D7F
LD C,A 4F
Copy Register A into Register C: the bytes in the range less one.
5D80
If the CARRY FLAG is set (xx before the cursor), JUMP to 5DA6H for INVALID MODIFICATION MODE CHAR.
5D83
INC C 0C
Increment Register C: the number of bytes to fill (00H means all 256).
5D84
EX DE,HL EB
Exchange Register Pair DE and Register Pair HL: Register Pair DE = the cursor.
5D85
LD HL,(5495H) 2A 95 54
Load Register Pair HL with the page address at 5495H.
5D88
ADD HL,DE 19
Add Register Pair DE (the cursor) to Register Pair HL: the first byte to fill.
5D89
BIT 0,B CB 40
Test bit 0 of Register B (the cursor on the low digit).
5D8B
If the Z FLAG is set (high digit), JUMP to 5D9AH.
5D8D
LD A,(HL) 7E
Load Register A with the first byte at Register Pair HL.
5D8E
AND F0H E6 F0
AND Register A with F0H, keeping its high digit.
5D90
LD (HL),A 77
Store Register A (the high digit only) at Register Pair HL, the first byte of the range.
5D91
LD A,(5D9CH) 3A 9C 5D
Load Register A with the fill value at 5D9CH.
5D94
AND 0FH E6 0F
AND Register A (the fill value) with 0FH, keeping its low digit.
5D96
OR (HL) B6
OR Register A with the byte at Register Pair HL: the old high digit and the new low one.
5D97
EX DE,HL EB
Exchange Register Pair DE and Register Pair HL: Register Pair DE = the byte's address, Register L = the cursor.
5D98
JUMP to 5D9DH to store Register A at Register Pair DE.
5D9A
EX DE,HL EB
Exchange Register Pair DE and Register Pair HL: Register Pair DE = the first byte's address, Register L = the cursor.
5D9B
LD A,00H 3E 00
Load Register A with the fill value, the operand at 5D9CH (00H in the file, set at 5D77H).
5D9D
LD (DE),A 12
Store Register A at Register Pair DE, a byte of the range.
5D9E
INC DE 13
Increment Register Pair DE to the next byte of the range.
5D9F
INC L 2C
Increment Register L, the cursor, along with Register Pair DE.
5DA0
DEC C 0D
Decrement Register C, the bytes of the range still to fill.
5DA1
If the NZ FLAG is set, LOOP BACK to 5D9BH to fill the next byte.
5DA3
JUMP to 5C67H: the cursor stays on the high digit of the byte after the range.
5DA6
PUSH HL E5
Save Register Pair HL (the cursor) on the stack (the entry for a bad key).
5DA7
PUSH BC C5
Save Register Pair BC (Register B, the digit) on the stack.
5DA8
PUSH AF F5
Save Register Pair AF on the stack, so that the POP AF below leaves the stack as 5DAAH needs it.
5DA9
POP AF F1
Restore Register Pair AF from the stack: from 5D6BH and 5D70H this drops the saved last byte xx.
5DAA
LD HL,6DDBH 21 DB 6D
Load Register Pair HL with 6DDBH, the screen clear and INVALID MODIFICATION MODE CHAR. REPLY with an asterisk TO CONTINUE.
5DAD
GOSUB to 6255H to display the message at Register Pair HL.
5DB0
GOSUB to 620BH to wait for a key; Register A returns it.
5DB3
CP 2AH FE 2A
Compare Register A with 2AH, the asterisk key.
5DB5
If the NZ FLAG is set (another key), LOOP BACK to 5DB0H.
5DB7
POP BC C1
Restore Register Pair BC (Register B, the digit) from the stack.
5DB8
POP HL E1
Restore Register Pair HL (the cursor) from the stack.
5DB9
JUMP to 5C69H to go on modifying with the cursor where it was.

5DBCH - Blink a Cursor and Wait for a Key

Register A is the cursor character (95H for a match, BFH for the modify mode), Register C the byte offset in the page, bit 0 of Register B the digit. The digit's place on the display is 3C08H + row x 64 + group x 5 + byte x 2 + digit, where the row is the offset's high four bits, the group (two bytes each) bits 3-1 and the byte in the group bit 0. The cursor character and the digit take turns, each for up to 256 keyboard scans, until a key is pressed; the digit is put back and the key returned in Register A.

5DBC
LD (5DE1H),A 32 E1 5D
Store Register A (the cursor character) at 5DE1H, the operand of the LD (HL),nn at 5DE0H.
5DBF
LD H,00H 26 00
Load Register H with 00H, the high byte of the row calculation.
5DC1
LD D,H 54
Copy Register H (00H) into Register D, the high byte of the column.
5DC2
LD E,H 5C
Copy Register H (00H) into Register E, which takes the byte within the group.
5DC3
LD A,C 79
Load Register A with Register C, the byte offset.
5DC4
RRA 1F
Rotate Register A right through the CARRY FLAG: bit 0 (the byte within its two-byte group) goes to the CARRY FLAG.
5DC5
RL E CB 13
Rotate Register E left through the CARRY FLAG: Register E = that bit (0 or 1).
5DC7
AND 07H E6 07
AND Register A with 07H: the group number 0-7 within the line (offset bits 3-1).
5DC9
LD L,A 6F
Copy Register A (the group number) into Register L, kept for the sum.
5DCA
ADD A,A 87
Add Register A (the group) to itself: group x 2.
5DCB
ADD A,E 83
Add Register E (the byte within the group) to Register A: group x 2 + byte.
5DCC
ADD A,A 87
Add Register A to itself: group x 4 + byte x 2.
5DCD
ADD A,L 85
Add Register L (the group) to Register A: group x 5 + byte x 2, the column of the byte's high digit after column 8.
5DCE
LD E,A 5F
Copy Register A into Register E: Register Pair DE = the column.
5DCF
BIT 0,B CB 40
Test bit 0 of Register B: set when the cursor is on the low digit.
5DD1
If the Z FLAG is set (high digit), JUMP to 5DD4H with Register E unchanged.
5DD3
INC E 1C
Increment Register E: one column further for the low digit.
5DD4
LD A,C 79
Load Register A with Register C, the byte offset.
5DD5
AND F0H E6 F0
AND Register A (the byte offset) with F0H: the line number x 16.
5DD7
LD L,A 6F
Copy Register A into Register L: Register Pair HL = line x 16.
5DD8
ADD HL,HL 29
Add Register Pair HL to itself: line x 32 (Register H was 00H).
5DD9
ADD HL,HL 29
Add Register Pair HL to itself: line x 64, the start of the display row.
5DDA
ADD HL,DE 19
Add Register Pair DE (the column) to Register Pair HL.
5DDB
LD DE,3C08H 11 08 3C
Load Register Pair DE with 3C08H, column 8 of the first display row, where the hexadecimal bytes start.
5DDE
ADD HL,DE 19
Add Register Pair DE to Register Pair HL: Register Pair HL = the digit on the display.
5DDF
LD C,(HL) 4E
Load Register C with the character at Register Pair HL, the digit, to put back.
5DE0
LD (HL),00H 36 00
Store the cursor character (the operand at 5DE1H) at Register Pair HL.
5DE2
GOSUB to 5DECH to scan the keyboard up to 256 times: the NZ FLAG and Register A = the key if one is pressed.
5DE5
LD (HL),C 71
Store Register C (the digit) back at Register Pair HL.
5DE6
If the Z FLAG is set (no key yet), GOSUB to 5DECH to scan again with the digit showing.
5DE9
If the Z FLAG is set (still no key), LOOP BACK to 5DE0H to show the cursor again.
5DEB
RET C9
RETURN with the key in Register A and the NZ FLAG.
5DEC
LD D,00H 16 00
Load Register D with 00H: up to 256 keyboard scans.
5DEE
GOSUB to 6205H to scan the keyboard with ROM 002BH (upper case); Register A = 00H if no key is pressed.
5DF1
OR A B7
OR Register A with itself: the NZ FLAG for a key.
5DF2
RET NZ C0
If the NZ FLAG is set, RETURN with the key in Register A.
5DF3
DEC D 15
Decrement Register D, the keyboard scans left.
5DF4
If the NZ FLAG is set, LOOP BACK to 5DEEH to scan again.
5DF6
RET C9
RETURN with the Z FLAG and Register A = 00H: no key was pressed.

5DF7H - Keys of the Display Mode Commands

5DF7H waits for a key and shows it; 5DFAH shows the key in Register A if it is 20H or above; 5DFDH shows it in any case. The echo goes down column 6 of the display (54B0H, from 3C06H); when it would go below the last row the key becomes 00H, which no command accepts. 5E19H reads two hexadecimal digits into Register Pair DE (5E1CH with the first key already in Register A) and returns the CARRY FLAG for a key that is not a digit. 5E2EH and 5E33H read a byte the same way and then the key after it; 5E37H reads that key: the Z FLAG for ENTER, the NZ FLAG for a comma, the CARRY FLAG for anything else. Register Pair HL and Register Pair BC are kept.

5DF7
GOSUB to 620BH to wait for a key with ROM 0049H; Register A returns it in upper case.
5DFA
CP 20H FE 20
Compare Register A (the key) with 20H, the lowest code that is shown.
5DFC
RET C D8
If the CARRY FLAG is set (a control key such as ENTER or an arrow), RETURN without showing it.
5DFD
PUSH HL E5
Save Register Pair HL on the stack, as it is used for the echo position.
5DFE
PUSH DE D5
Save Register Pair DE on the stack, as it is used for 4000H and 0040H.
5DFF
LD HL,(54B0H) 2A B0 54
Load Register Pair HL with the echo position at 54B0H.
5E02
LD DE,4000H 11 00 40
Load Register Pair DE with 4000H, the first address after the display memory.
5E05
OR A B7
OR Register A with itself to clear the CARRY FLAG before the subtraction (Register A is kept).
5E06
SBC HL,DE ED 52
Subtract Register Pair DE (4000H) from Register Pair HL: the CARRY FLAG is set while the echo position is inside the display.
5E08
If the CARRY FLAG is set, JUMP to 5E0DH to show the key.
5E0A
XOR A AF
Set Register A to 00H (XOR A with itself): below the last row the key is lost.
5E0B
JUMP to 5E16H to restore Register Pair DE and Register Pair HL and return.
5E0D
ADD HL,DE 19
Add Register Pair DE (4000H) back to Register Pair HL: the echo position.
5E0E
LD (HL),A 77
Store Register A (the key) at Register Pair HL on the display.
5E0F
LD DE,0040H 11 40 00
Load Register Pair DE with 0040H, one display row.
5E12
ADD HL,DE 19
Add Register Pair DE to Register Pair HL: the same column one row down.
5E13
LD (54B0H),HL 22 B0 54
Store Register Pair HL at 54B0H, the next echo position.
5E16
POP DE D1
Restore Register Pair DE (the caller's value) from the stack.
5E17
POP HL E1
Restore Register Pair HL (the caller's value) from the stack.
5E18
RET C9
RETURN with the key (or 00H past the last row) in Register A.
5E19
GOSUB to 5DF7H to wait for the first key and show it.
5E1C
PUSH HL E5
Save Register Pair HL (the caller's value) on the stack.
5E1D
PUSH BC C5
Save Register Pair BC (the caller's value) on the stack.
5E1E
LD DE,0000H 11 00 00
Load Register Pair DE with 0000H, the value being built.
5E21
GOSUB to 685AH to add the hexadecimal digit in Register A to Register Pair DE (DE x 16 + digit); the CARRY FLAG means it is not a digit.
5E24
If the CARRY FLAG is set, JUMP to 5E46H to return with it.
5E26
GOSUB to 5DF7H to wait for the second key and show it.
5E29
GOSUB to 685AH to add it to Register Pair DE; the CARRY FLAG means it is not a digit.
5E2C
JUMP to 5E46H to return with the value in Register Pair DE (Register E for a byte).
5E2E
GOSUB to 5E1CH to finish the byte whose first key is in Register A.
5E31
JUMP to 5E36H to read the key after the byte unless a digit was wrong.
5E33
GOSUB to 5E19H to read both digits of a byte into Register E.
5E36
RET C D8
If the CARRY FLAG is set (not a digit), RETURN with it.
5E37
PUSH HL E5
Save Register Pair HL (the caller's value) on the stack.
5E38
PUSH BC C5
Save Register Pair BC (the caller's value) on the stack.
5E39
GOSUB to 5DF7H to wait for the next key and show it.
5E3C
CP 0DH FE 0D
Compare Register A (the key) with 0DH (ENTER), which ends the command.
5E3E
If the Z FLAG is set, JUMP to 5E46H to return the Z FLAG.
5E40
CP 2CH FE 2C
Compare Register A (the key) with 2CH (a comma), which separates the bytes.
5E42
SCF 37
Set the CARRY FLAG, for a key that is neither (SCF does not change the Z FLAG).
5E43
If the NZ FLAG is set (not a comma), JUMP to 5E46H to return with the CARRY FLAG.
5E45
OR A B7
OR Register A with itself: the comma gives the NZ FLAG and clears the CARRY FLAG.
5E46
POP BC C1
Restore Register Pair BC (the caller's value) from the stack.
5E47
POP HL E1
Restore Register Pair HL (the caller's value) from the stack.
5E48
RET C9
RETURN with the key in Register A and its flags.

5E49H - DPWE: Display Password Encode

Asks PASSWORD?, pads the answer to 8 characters with spaces and encodes it the way the DOS stores a password code in a directory entry (the same steps as SYS2's encoding routine): Register Pair DE starts at FFFFH and every character, from the last to the first, is mixed into it. The code is shown as four hexadecimal digits, low byte first, as it is in the directory entry, and then FUNCTION COMPLETED.

5E49
LD HL,6EE6H 21 E6 6E
Load Register Pair HL with 6EE6H, the question PASSWORD?.
5E4C
GOSUB to 634EH to display it and read the answer into 5440H; Register Pair HL returns 5440H and Register B the characters typed.
5E4F
LD C,B 48
Copy Register B (the characters typed) into Register C.
5E50
LD B,00H 06 00
Load Register B with 00H: Register Pair BC = the length.
5E52
ADD HL,BC 09
Add Register Pair BC to Register Pair HL: the place of the carriage return after the password.
5E53
LD B,08H 06 08
Load Register B with 08H, the spaces to add after the password.
5E55
LD (HL),20H 36 20
Store 20H (space) at Register Pair HL, after the password in the buffer.
5E57
INC HL 23
Increment Register Pair HL to the next byte of the line buffer.
5E58
Decrement Register B and LOOP BACK to 5E55H: the password is followed by 8 spaces, so 5440H-5447H hold it padded to 8 characters.
5E5A
LD HL,5447H 21 47 54
Load Register Pair HL with 5447H, the eighth character: the encoding goes from the last character to the first.
5E5D
PUSH DE D5
Save Register Pair DE on the stack (it is not taken back: 54C5H resets the stack).
5E5E
PUSH BC C5
Save Register Pair BC on the stack (not taken back either).
5E5F
LD DE,FFFFH 11 FF FF
Load Register Pair DE with FFFFH, the starting value of the code.
5E62
LD B,08H 06 08
Load Register B with 08H, the characters to encode.

Encoding Loop
Register Pair DE = the code so far, Register Pair HL = the character.

5E64
PUSH BC C5
Save Register Pair BC (Register B, the count) on the stack.
5E65
LD A,E 7B
Load Register A with Register E, the low byte of the code.
5E66
AND 07H E6 07
AND Register A (the code's low byte) with 07H, its low three bits.
5E68
LD C,A 4F
Copy Register A (the low three bits) into Register C.
5E69
LD A,E 7B
Load Register A with Register E, the code's low byte, again.
5E6A
RLCA 07
Rotate Register A left (three RLCAs): the first.
5E6B
RLCA 07
Rotate Register A (the code's low byte) left, the second of three.
5E6C
RLCA 07
Rotate Register A left, the third: Register E rotated left by three bits.
5E6D
XOR C A9
XOR Register A with Register C (the low three bits of Register E).
5E6E
RLCA 07
Rotate Register A (the mixed value) left once more.
5E6F
LD C,A 4F
Copy Register A into Register C, the mixed value.
5E70
AND F0H E6 F0
AND Register A (the mixed value) with F0H, its high four bits.
5E72
LD B,A 47
Copy Register A (the high four bits) into Register B.
5E73
LD A,C 79
Load Register A with Register C, the mixed value.
5E74
RLCA 07
Rotate Register A (the mixed value) left by one bit, into the five-bit part.
5E75
AND 1FH E6 1F
AND Register A (the rotated value) with 1FH, its low five bits.
5E77
XOR B A8
XOR Register A with Register B (the high four bits).
5E78
XOR D AA
XOR Register A with Register D, the high byte of the code.
5E79
LD E,A 5F
Copy Register A into Register E, the new low byte of the code.
5E7A
LD A,C 79
Load Register A with Register C, the mixed value.
5E7B
AND 0FH E6 0F
AND Register A (the mixed value) with 0FH, its low four bits.
5E7D
LD B,A 47
Copy Register A (the low four bits) into Register B.
5E7E
LD A,C 79
Load Register A with Register C, the mixed value, again.
5E7F
RLCA 07
Rotate Register A left (four RLCAs swap the halves): the first.
5E80
RLCA 07
Rotate Register A (the mixed value) left, the second of four.
5E81
RLCA 07
Rotate Register A (the mixed value) left, the third of four.
5E82
RLCA 07
Rotate Register A (the mixed value) left, the fourth: its halves are swapped.
5E83
XOR B A8
XOR Register A with Register B (the low four bits).
5E84
POP BC C1
Restore Register Pair BC (Register B, the count) from the stack.
5E85
XOR (HL) AE
XOR Register A with the character at Register Pair HL.
5E86
LD D,A 57
Copy Register A into Register D, the new high byte of the code.
5E87
LD (HL),20H 36 20
Store 20H (space) at Register Pair HL: the character is blanked after use.
5E89
DEC HL 2B
Decrement Register Pair HL to the character before.
5E8A
Decrement Register B and LOOP BACK to 5E64H until all 8 characters are encoded.
5E8C
INC HL 23
Increment Register Pair HL to 5440H, where the result is written.
5E8D
LD B,04H 06 04
Load Register B with 04H, the digits to show.
5E8F
LD A,E 7B
Load Register A with Register E, the low byte of the code (first, as in the directory entry).
5E90
GOSUB to 6674H to write Register A as two hexadecimal digits at Register Pair HL.
5E93
LD A,D 7A
Load Register A with Register D, the high byte of the code.
5E94
GOSUB to 6674H to write Register A as two hexadecimal digits at Register Pair HL (also the DNTH result from 5EDDH).
5E97
LD HL,5440H 21 40 54
Load Register Pair HL with 5440H, the digits.
5E9A
GOSUB to 62BAH to output Register B characters from Register Pair HL.
5E9D
JUMP to 65C3H to output a carriage return, display FUNCTION COMPLETED and go back to the menu.

5EA0H - DNTH: Display Name/Type Hash Code

Asks FILE NAME? (up to 8 characters) and FILE TYPE? (up to 3), both padded with spaces, at 5440H-5447H and 5448H-544AH. The 11 characters are XORed together with a left rotation after each; a result of 00H becomes 01H. This is the byte the directory's hash index sector holds for the file. It is written over 5440H (the address the dispatcher left on the stack) and shown as two hexadecimal digits, then FUNCTION COMPLETED.

5EA0
LD B,08H 06 08
Load Register B with 08H, the longest file name.
5EA2
LD HL,6D60H 21 60 6D
Load Register Pair HL with 6D60H, the question FILE NAME?.
5EA5
GOSUB to 6339H to display it and read up to Register B characters into 5440H; Register Pair HL returns 5440H and Register B the characters typed.
5EA8
LD C,B 48
Copy Register B (the name's length) into Register C.
5EA9
LD B,00H 06 00
Load Register B with 00H: Register Pair BC = the length.
5EAB
ADD HL,BC 09
Add Register Pair BC to Register Pair HL: the place after the name.
5EAC
LD A,09H 3E 09
Load Register A with 09H, the name's 8 places plus the space at 5448H.
5EAE
SUB C 91
Subtract Register C (the length) from Register A: the spaces to 5448H inclusive.
5EAF
LD B,A 47
Copy Register A into Register B, the spaces to store.
5EB0
LD (HL),20H 36 20
Store 20H (space) at Register Pair HL, after the file name in the buffer.
5EB2
INC HL 23
Increment Register Pair HL to the next byte of the line buffer.
5EB3
Decrement Register B and LOOP BACK to 5EB0H: the name is padded with spaces to 8 characters.
5EB5
EX DE,HL EB
Exchange Register Pair DE and Register Pair HL: Register Pair DE = 5449H.
5EB6
LD HL,6D64H 21 64 6D
Load Register Pair HL with 6D64H, the question FILE TYPE?.
5EB9
LD B,03H 06 03
Load Register B with 03H, the longest file type (name extension).
5EBB
DEC DE 1B
Decrement Register Pair DE to 5448H, where the type goes.
5EBC
GOSUB to 633CH to display the question and read up to 3 characters into 5448H; Register Pair HL returns 5448H and Register B the characters typed.
5EBF
LD C,B 48
Copy Register B (the type's length) into Register C.
5EC0
LD B,00H 06 00
Load Register B with 00H: Register Pair BC = the length.
5EC2
ADD HL,BC 09
Add Register Pair BC to Register Pair HL: the place after the type.
5EC3
LD A,04H 3E 04
Load Register A with 04H, the type's 3 places plus the space at 544BH.
5EC5
SUB C 91
Subtract Register C (the length) from Register A: the spaces to 544BH inclusive.
5EC6
LD B,A 47
Copy Register A (the spaces to add) into Register B.
5EC7
LD (HL),20H 36 20
Store 20H (space) at Register Pair HL, after the file type.
5EC9
INC HL 23
Increment Register Pair HL to the next byte of the line buffer.
5ECA
Decrement Register B and LOOP BACK to 5EC7H: the type is padded to 3 characters.
5ECC
LD HL,5440H 21 40 54
Load Register Pair HL with 5440H, the name and type.
5ECF
LD B,0BH 06 0B
Load Register B with 0BH, the 11 characters of name and type.
5ED1
XOR A AF
Set Register A to 00H (XOR A with itself), the hash.
5ED2
XOR (HL) AE
XOR Register A with the character at Register Pair HL.
5ED3
INC HL 23
Increment Register Pair HL to the next character.
5ED4
RLCA 07
Rotate Register A (the hash so far) left after each character.
5ED5
Decrement Register B and LOOP BACK to 5ED2H for all 11 characters.
5ED7
If the NZ FLAG is set (the hash is not 00H), JUMP to 5EDAH.
5ED9
INC A 3C
Increment Register A: a hash of 00H becomes 01H.
5EDA
POP HL E1
Restore Register Pair HL from the stack: 5440H, the word the command search pushed at 54EDH.
5EDB
LD B,02H 06 02
Load Register B with 02H, the digits to show.
5EDD
JUMP to 5E94H to write Register A as two digits at 5440H, output them and end.

5EDFH - RRT: Read Raw Track

Not in the menu. Asks the drive and relative sector, reads that sector so that the head is on its track, and then reads the whole track with the controller's READ TRACK command (E4H) into memory from 7000H, interrupts off. The result is shown as MAIN MEMORY RANGE 7000H- xxxxH (the last byte stored). Read errors 03H-07H of the sector read are ignored; a controller status with any of bits 7-3 set is reported as DOS error (bit number + 1). Refused under DOS-CALL (550BH).

5EDF
GOSUB to 6792H to ask DRIVE AND RELATIVE-SECTOR-WITHIN-DRIVE #'S? (to 5406H, 5499H, 54A2H, 54A8H); the CARRY FLAG means an empty or bad answer.
5EE2
If the CARRY FLAG is set, LOOP BACK to 5EDFH.
5EE4
LD HL,5493H 21 93 54
Load Register Pair HL with 5493H, the state flags.
5EE7
SET 6,(HL) CB F6
Set bit 6 of the state flags at Register Pair HL: an error is reported without the retry question.
5EE9
LD HL,(54A8H) 2A A8 54
Load Register Pair HL with the drive's sector count at 54A8H.
5EEC
LD (540CH),HL 22 0C 54
Store Register Pair HL at 540CH, the FCB's EOF.
5EEF
LD HL,(54A2H) 2A A2 54
Load Register Pair HL with the relative sector at 54A2H.
5EF2
LD (540AH),HL 22 0A 54
Store Register Pair HL at 540AH, the FCB's NEXT.
5EF5
LD DE,5400H 11 00 54
Load Register Pair DE with 5400H, the FCB set for the drive and sector.
5EF8
GOSUB to SYS0 4436H to read the sector into 5300H: this selects the drive and moves the head to the track. The NZ FLAG means an error with its code in Register A.
5EFB
If the Z FLAG is set (the sector was read), JUMP to 5F05H.
5EFD
CP 03H FE 03
Compare Register A (the error code) with 03H.
5EFF
If the CARRY FLAG is set (01H or 02H), JUMP to 5F63H to report it.
5F01
CP 08H FE 08
Compare Register A (the error code) with 08H.
5F03
If the NO CARRY FLAG is set (08H or above), JUMP to 5F63H; 03H-07H are errors of the data, the head is on the track.
5F05
LD A,(4309H) 3A 09 43
Load Register A with the select latch value at 4309H that the read used (bit 3 = the second side).
5F08
PUSH AF F5
Save Register Pair AF (the select latch value) on the stack.
5F09
DI F3
Disable interrupts: the track is read with the processor polling the controller.
5F0A
GOSUB to 67B5H to check the drive (SYS0 445EH) and read its sizes again, which can change 4309H.
5F0D
POP AF F1
Restore Register Pair AF (the select latch value) from the stack.
5F0E
LD (4309H),A 32 09 43
Store Register A at 4309H: the side of the sector read is selected again.
5F11
GOSUB to 5FA2H to write 4309H to the drive select latch at 37E1H.
5F14
GOSUB to 5FA9H to wait a moment and read the controller status at 37ECH.
5F17
LD HL,37ECH 21 EC 37
Load Register Pair HL with 37ECH, the controller's command and status register.
5F1A
LD (HL),E4H 36 E4
Store E4H at Register Pair HL: the READ TRACK command (with the head settling delay).
5F1C
LD DE,37EFH 11 EF 37
Load Register Pair DE with 37EFH, the controller's data register.
5F1F
LD BC,7000H 01 00 70
Load Register Pair BC with 7000H, where the track is stored.
5F22
GOSUB to 5FA9H to give the controller time to take the command.
5F25
NOP 00
No operation: one more moment for the controller after the command.
5F26
LD A,01H 3E 01
Load Register A with 01H, the status with only the busy bit set.
5F28
CP (HL) BE
Compare Register A with the status at Register Pair HL.
5F29
If the Z FLAG is set (busy, no data yet), LOOP BACK to 5F28H.

Track Byte Loop
Register Pair HL = 37ECH (status), Register Pair DE = 37EFH (data), Register Pair BC = the store address.

5F2B
LD A,(DE) 1A
Load Register A with the data byte at Register Pair DE (37EFH).
5F2C
LD (BC),A 02
Store Register A (the track byte) at Register Pair BC, from 7000H up.
5F2D
INC BC 03
Increment Register Pair BC to the next store address.
5F2E
BIT 1,(HL) CB 4E
Test bit 1 of the status at Register Pair HL, the data request.
5F30
If the NZ FLAG is set (a byte is ready), LOOP BACK to 5F2BH.
5F32
BIT 1,(HL) CB 4E
Test bit 1 of the status at Register Pair HL again.
5F34
If the NZ FLAG is set (a byte is ready), LOOP BACK to 5F2BH.
5F36
BIT 1,(HL) CB 4E
Test bit 1 of the status at Register Pair HL a third time.
5F38
If the NZ FLAG is set (a byte is ready), LOOP BACK to 5F2BH.
5F3A
BIT 0,(HL) CB 46
Test bit 0 of the status at Register Pair HL, the busy bit.
5F3C
If the Z FLAG is set (the command has ended), JUMP to 5F46H.
5F3E
BIT 1,(HL) CB 4E
Test bit 1 of the status at Register Pair HL, the data request.
5F40
If the NZ FLAG is set (a byte is ready), LOOP BACK to 5F2BH.
5F42
BIT 7,(HL) CB 7E
Test bit 7 of the status at Register Pair HL, not ready.
5F44
If the Z FLAG is set (ready), LOOP BACK to 5F2EH to keep polling.
5F46
LD A,(4311H) 3A 11 43
Load Register A with the drive's disk I/O flags at 4311H.
5F49
RLCA 07
Rotate Register A left: bit 7 goes to the CARRY FLAG.
5F4A
If the NO CARRY FLAG is set (bit 7 of 4311H clear), JUMP to 5F50H.
5F4C
DEC DE 1B
Decrement Register Pair DE to 37EEH, the controller's sector register.
5F4D
LD A,80H 3E 80
Load Register A with 80H, the value for the sector register.
5F4F
LD (DE),A 12
Store Register A (80H) at Register Pair DE, the sector register, for a drive with bit 7 of 4311H set.
5F50
LD A,(HL) 7E
Load Register A with the final status at Register Pair HL.
5F51
LD (HL),D0H 36 D0
Store D0H at Register Pair HL: the FORCE INTERRUPT command ends anything still running.
5F53
EI FB
Enable interrupts again: the track has been read.
5F54
LD (5F7CH),BC ED 43 7C 5F
Store Register Pair BC (the address after the last byte) at 5F7CH, the operand of the LD DE,nn at 5F7BH.
5F58
AND F8H E6 F8
AND Register A with F8H: status bits 7-3 (not ready, write protect or record type, record not found, CRC error, lost data).
5F5A
LD C,A 4F
Copy Register A (the status bits 7-3) into Register C.
5F5B
If the Z FLAG is set (no error), JUMP to 5F69H to show the range.
5F5D
XOR A AF
Set Register A to 00H (XOR A with itself), the error number.
5F5E
INC A 3C
Increment Register A, the error number, once for each bit passed.
5F5F
RRC C CB 09
Rotate Register C right: its low bit goes to the CARRY FLAG.
5F61
If the NO CARRY FLAG is set, LOOP BACK to 5F5EH: Register A ends as the number of the lowest error bit plus 1 (04H-08H).
5F63
GOSUB to 64BCH with the NZ FLAG and Register A = the error code: the location and the error are displayed (code 06H returns without a message).
5F66
JUMP to 6582H to show PRESS 'ENTER' TO RETURN TO MENU and go back to the menu.
5F69
LD HL,6EFBH 21 FB 6E
Load Register Pair HL with 6EFBH, the text MAIN MEMORY RANGE and two spaces.
5F6C
GOSUB to 6255H to display the message at Register Pair HL (MAIN MEMORY RANGE).
5F6F
LD DE,7000H 11 00 70
Load Register Pair DE with 7000H, the first byte of the track.
5F72
GOSUB to 665BH to output Register Pair DE as four hexadecimal digits, H and two spaces.
5F75
LD HL,6EA7H 21 A7 6E
Load Register Pair HL with 6EA7H, the text - and two spaces.
5F78
GOSUB to 6255H to display the message at Register Pair HL (the minus sign).
5F7B
LD DE,0000H 11 00 00
Load Register Pair DE with the address after the last byte, the operand at 5F7CH (0000H in the file, set at 5F54H).
5F7E
DEC DE 1B
Decrement Register Pair DE: the last byte stored.
5F7F
GOSUB to 665BH to output Register Pair DE as four hexadecimal digits and H.
5F82
JUMP to 65C3H to output a carriage return, display FUNCTION COMPLETED and go back to the menu.

5F85H - Controller Helpers

5F85H-5FA1H is a wait loop no instruction calls: it reads the controller status until it is not busy (returning Register A = 00H), sending FORCE INTERRUPT when the drive is not ready and selecting the drive again otherwise. 5FA2H writes the select latch value at 4309H to 37E1H. 5FA9H waits a short moment (A counts 6 down) and returns the controller status at 37ECH in Register A.

5F85
GOSUB to 5FA9H to wait a moment and load Register A with the controller status at 37ECH.
5F88
RRCA 0F
Rotate Register A right: bit 0, busy, goes to the CARRY FLAG.
5F89
If the CARRY FLAG is set (busy), JUMP to 5F8DH.
5F8B
XOR A AF
Set Register A to 00H (XOR A with itself): the controller is not busy.
5F8C
RET C9
RETURN with Register A = 00H: the controller is not busy.
5F8D
RLCA 07
Rotate Register A (the status) left, putting bit 0 back in place.
5F8E
RLCA 07
Rotate Register A left: bit 7, not ready, goes to the CARRY FLAG.
5F8F
If the CARRY FLAG is set (not ready), JUMP to 5F96H.
5F91
GOSUB to 5FA2H to write 4309H to the drive select latch 37E1H again.
5F94
LOOP BACK to 5F85H to read the controller status again.
5F96
LD A,D0H 3E D0
Load Register A with D0H, the FORCE INTERRUPT command.
5F98
LD (37ECH),A 32 EC 37
Store Register A at 37ECH, the controller's command register.
5F9B
LOOP BACK to 5F85H to read the controller status again.
5F9D
LD A,(37ECH) 3A EC 37
Load Register A with the controller status at 37ECH.
5FA0
RLCA 07
Rotate Register A left: bit 7, not ready, goes to the CARRY FLAG.
5FA1
RET C D8
If the CARRY FLAG is set (not ready), RETURN; otherwise go on into 5FA2H.
5FA2
LD A,(4309H) 3A 09 43
Load Register A with the select latch value at 4309H (drive bit, and bit 3 for the second side).
5FA5
LD (37E1H),A 32 E1 37
Store Register A at 37E1H, the drive select latch.
5FA8
RET C9
RETURN to the caller with the drive selected.
5FA9
LD A,06H 3E 06
Load Register A with 06H, the count of the short delay loop.
5FAB
DEC A 3D
Decrement Register A, the delay count, once per pass of the loop.
5FAC
If the NZ FLAG is set, LOOP BACK to 5FABH until the delay count is 0.
5FAE
LD A,(37ECH) 3A EC 37
Load Register A with the controller status at 37ECH.
5FB1
RET C9
RETURN with the controller status from 37ECH in Register A.

5FB2H - Show the Page

5FB2H also starts the key echo at 3C06H; 5FB8H (used by the printing at 613AH) only shows. The screen is cleared and the 256 bytes at 5495H are written straight into the display memory as 16 rows of 16 bytes: columns 4-5 the offset within the page (columns 2-5 the address for DM and DMDB), column 6 the echo column, columns 8-47 the bytes in eight groups of two, columns 48-63 the bytes as characters (21H-5FH, or 21H-7FH with option AI; others as a period). At the left of rows 0-2 DRV and the drive in decimal and hexadecimal are shown; for a disk sector DRS (relative sector within the drive) at row 4, TRK at row 8 and TRS (sector within the track) at row 12; for DFS the drive sector DRS (found through the file's extents) and FRS (the file sector) at row 12. DM shows nothing there, DMDB only MD. The status character at 5494H is shown at row 15, column 1. Register Pair BC is kept.

5FB2
LD HL,3C06H 21 06 3C
Load Register Pair HL with 3C06H, row 0, column 6 of the display.
5FB5
LD (54B0H),HL 22 B0 54
Store Register Pair HL at 54B0H, the echo position: the keys of the next command are shown down column 6.
5FB8
GOSUB to 62A7H to clear the screen (1CH home, 1FH clear to the end of the frame).
5FBB
LD HL,3C00H 21 00 3C
Load Register Pair HL with 3C00H, the first row of the display memory.
5FBE
LD DE,(5495H) ED 5B 95 54
Load Register Pair DE with the page address at 5495H.
5FC2
LD A,10H 3E 10
Load Register A with 10H, the 16 display rows of 16 bytes each.
5FC4
PUSH BC C5
Save Register Pair BC (the caller's value, such as the cursor offset in Register C) on the stack.

Row Loop
Register Pair HL = the start of a display row, Register Pair DE = the page byte, the row count in the alternate Register A.

5FC5
EX AF,AF' 08
Exchange Register Pair AF with the alternate Register Pair AF: the row count is kept there.
5FC6
INC L 2C
Increment Register L (four INCs move to column 4).
5FC7
INC L 2C
Increment Register L (the display position), the second of four.
5FC8
INC L 2C
Increment Register L (the display position), the third of four.
5FC9
INC L 2C
Increment Register L (the display position), the fourth: column 4 of the row.
5FCA
LD A,(5495H) 3A 95 54
Load Register A with the low byte of the page address at 5495H.
5FCD
NEG ED 44
Negate Register A (the page address low byte), to subtract it from Register E.
5FCF
ADD A,E 83
Add Register E: Register A = the row's offset within the page (00H, 10H ... F0H).
5FD0
LD C,A 4F
Copy Register A (the row's offset within the page) into Register C.
5FD1
LD A,(5491H) 3A 91 54
Load Register A with the command flags at 5491H.
5FD4
AND 28H E6 28
AND Register A with 28H, bits 5 (DM) and 3 (DMDB).
5FD6
If the Z FLAG is set (a sector), JUMP to 5FE0H.
5FD8
DEC L 2D
Decrement Register L (the display position) once, towards column 2.
5FD9
DEC L 2D
Decrement Register L (the display position) again: column 2, for the page number.
5FDA
LD A,(54B5H) 3A B5 54
Load Register A with the page number at 54B5H, the address high byte.
5FDD
GOSUB to 61EFH to write Register A as two hexadecimal digits at Register Pair HL.
5FE0
LD A,C 79
Load Register A with Register C, the row's offset.
5FE1
GOSUB to 61EFH to write it as two hexadecimal digits: columns 4-5.
5FE4
LD C,08H 0E 08
Load Register C with 08H, the eight groups of two bytes.
5FE6
INC L 2C
Increment Register L (the display position) past column 6, the echo column.
5FE7
INC L 2C
Increment Register L (the display position) to column 8, where the bytes start.
5FE8
PUSH HL E5
Save Register Pair HL (column 8) on the stack.
5FE9
LD A,L 7D
Load Register A with Register L, the low byte of the display position (column 8).
5FEA
ADD A,28H C6 28
Add 28H (40 columns) to Register A, the place of the characters after the 40 columns of bytes.
5FEC
LD L,A 6F
Copy Register A into Register L: Register Pair HL = column 48 of the row, where the characters go.
5FED
EX (SP),HL E3
Exchange Register Pair HL with the word on the stack (Stack Pointer): the character position is kept there, Register Pair HL = column 8.
5FEE
LD B,02H 06 02
Load Register B with 02H, the bytes of a group.
5FF0
LD A,(DE) 1A
Load Register A with the page byte at Register Pair DE.
5FF1
GOSUB to 61EFH to write it as two hexadecimal digits at Register Pair HL.
5FF4
PUSH BC C5
Save Register Pair BC (the counters) on the stack.
5FF5
LD C,3FH 0E 3F
Load Register C with 3FH, the range of codes shown as characters from 21H (21H-5FH).
5FF7
LD A,(436CH) 3A 6C 43
Load Register A with the system option byte at 436CH.
5FFA
BIT 4,A CB 67
Test bit 4 of Register A (option AI, lower case display).
5FFC
If the Z FLAG is set (option AI off), JUMP to 6000H with Register C = 3FH.
5FFE
LD C,5FH 0E 5F
Load Register C with 5FH: codes 21H-7FH are shown.
6000
LD A,(DE) 1A
Load Register A with the page byte at Register Pair DE.
6001
SUB 21H D6 21
Subtract 21H from Register A (the page byte): codes 21H and up become 00H and up.
6003
CP C B9
Compare Register A with Register C: the CARRY FLAG for a code that can be shown.
6004
POP BC C1
Restore Register Pair BC (the counters) from the stack.
6005
LD A,(DE) 1A
Load Register A with the page byte at Register Pair DE.
6006
INC DE 13
Increment Register Pair DE to the next page byte.
6007
If the CARRY FLAG is set (it can be shown), JUMP to 600BH.
6009
LD A,2EH 3E 2E
Load Register A with 2EH, the period shown for the other codes.
600B
EX (SP),HL E3
Exchange Register Pair HL with the word on the stack (Stack Pointer): Register Pair HL = the character position.
600C
LD (HL),A 77
Store Register A at Register Pair HL, the character column.
600D
INC HL 23
Increment Register Pair HL to the next character position.
600E
EX (SP),HL E3
Exchange Register Pair HL with the word on the stack (Stack Pointer) again: Register Pair HL = the digit position.
600F
Decrement Register B and LOOP BACK to 5FF0H for the second byte of the group.
6011
INC HL 23
Increment Register Pair HL: a space after the group.
6012
DEC C 0D
Decrement Register C, the groups of two bytes left in the row.
6013
If the NZ FLAG is set, LOOP BACK to 5FEEH for the next group.
6015
POP HL E1
Restore Register Pair HL from the stack: the character position, now the start of the next row.
6016
EX AF,AF' 08
Exchange Register Pair AF with the alternate Register Pair AF: Register A = the row count.
6017
DEC A 3D
Decrement Register A, the display rows still to show on the page.
6018
If the NZ FLAG is set, LOOP BACK to 5FC5H for the next row.
601A
LD A,(5491H) 3A 91 54
Load Register A with the command flags at 5491H.
601D
BIT 5,A CB 6F
Test bit 5 of Register A (the command flags from 5491H), set for DM.
601F
If the NZ FLAG is set, JUMP to 60EAH: nothing more is shown for memory.
6022
BIT 3,A CB 5F
Test bit 3 of Register A (the command flags from 5491H), set for DMDB.
6024
If the Z FLAG is set (a sector), JUMP to 6032H to show the drive and sector labels.
6026
LD HL,3C00H 21 00 3C
Load Register Pair HL with 3C00H, the top left of the display.
6029
LD DE,444DH 11 4D 44
Load Register Pair DE with 444DH, the characters M (Register E) and D (Register D).
602C
LD (HL),E 73
Store Register E (M) at Register Pair HL, the top left of the display.
602D
INC HL 23
Increment Register Pair HL to the next display position.
602E
LD (HL),D 72
Store Register D (D) at Register Pair HL: MD marks a memory dump page.
602F
JUMP to 60EAH to restore Register Pair BC and return.
6032
LD BC,68FEH 01 FE 68
Load Register Pair BC with 68FEH, the label DRV.
6035
LD DE,3C00H 11 00 3C
Load Register Pair DE with 3C00H, row 0, column 0.
6038
LD A,(5406H) 3A 06 54
Load Register A with the drive number at 5406H, the FCB's drive.
603B
LD L,A 6F
Copy Register A (the drive number) into Register L, the number to show.
603C
LD H,00H 26 00
Load Register H with 00H: Register Pair HL = the drive.
603E
GOSUB to 60ECH to write DRV at Register Pair DE and the drive in decimal and hexadecimal on the two rows below.
6041
LD HL,(54A2H) 2A A2 54
Load Register Pair HL with the relative sector at 54A2H.
6044
PUSH HL E5
Save Register Pair HL (the relative sector) on the stack.
6045
LD A,(5491H) 3A 91 54
Load Register A with the command flags at 5491H.
6048
BIT 6,A CB 77
Test bit 6 of Register A (the command flags from 5491H), set for DFS.
604A
If the Z FLAG is set (a disk sector), JUMP to 60ACH to show it as DRS.
604C
LD A,(549DH) 3A 9D 54
Load Register A with the sectors per granule at 549DH (5).
604F
GOSUB to 6896H to divide Register Pair HL (the file sector) by Register A: Register Pair HL = the granule within the file, Register A = the sector within the granule.
6052
PUSH AF F5
Save Register Pair AF (the sector within the granule) on the stack.
6053
EX DE,HL EB
Exchange Register Pair DE and Register Pair HL: Register Pair DE = the granule within the file.
6054
LD BC,0000H 01 00 00
Load Register Pair BC with 0000H, the granules of the extents passed so far.
6057
LD A,08H 3E 08
Load Register A with 08H, the eight extent elements of the FCB.
6059
LD HL,540EH 21 0E 54
Load Register Pair HL with 540EH, the FCB's first extent element.

Extent Loop
Register Pair HL = the element, Register Pair DE = the granule wanted, Register Pair BC = the granules before the element, the element count in the alternate Register A.

605C
EX AF,AF' 08
Exchange Register Pair AF with the alternate Register Pair AF: the count is kept there.
605D
LD A,(HL) 7E
Load Register A with the element's first byte at Register Pair HL, the lump number.
605E
CP FEH FE FE
Compare Register A with FEH: FEH and FFH end the list.
6060
If the NO CARRY FLAG is set, JUMP to 6089H: the sector is not in the FCB's extents.
6063
INC HL 23
Increment Register Pair HL to the element's second byte.
6064
LD A,(HL) 7E
Load Register A with the byte at Register Pair HL, the element's second byte: bits 7-5 the first granule in the lump, bits 4-0 the granules less one.
6065
EX DE,HL EB
Exchange Register Pair DE and Register Pair HL: Register Pair HL = the granule wanted.
6066
OR A B7
OR Register A with itself to clear the CARRY FLAG before the subtraction.
6067
SBC HL,BC ED 42
Subtract Register Pair BC from Register Pair HL: the granule's place within this element.
6069
If the CARRY FLAG is set (before this element), JUMP to 6089H: not found.
606B
INC H 24
Increment Register H, so that the DEC below tests it for 00H.
606C
DEC H 25
Decrement Register H: the Z FLAG is set when Register H is 00H.
606D
If the NZ FLAG is set (256 or more on), JUMP to 6074H.
606F
AND 1FH E6 1F
AND Register A with 1FH: the element's granules less one.
6071
CP L BD
Compare Register A with Register L, the place within the element.
6072
If the NO CARRY FLAG is set (the granule is in this element), JUMP to 608DH.
6074
ADD HL,BC 09
Add Register Pair BC back to Register Pair HL: the granule wanted.
6075
INC A 3C
Increment Register A: the element's granules (when Register H was not 00H the whole byte is used, bits 7-5 included).
6076
ADD A,C 81
Add Register C (the low byte of the granules so far) to Register A.
6077
LD C,A 4F
Copy Register A into Register C: Register Pair BC = the granules up to the next element.
6078
If the NO CARRY FLAG is set, JUMP to 607BH with Register B unchanged.
607A
INC B 04
Increment Register B, the high byte of the granules so far, for the carry.
607B
EX DE,HL EB
Exchange Register Pair DE and Register Pair HL: Register Pair HL = the element's second byte, Register Pair DE = the granule wanted.
607C
INC HL 23
Increment Register Pair HL to the next element.
607D
EX AF,AF' 08
Exchange Register Pair AF with the alternate Register Pair AF: Register A = the element count.
607E
CP 05H FE 05
Compare Register A with 05H: after the fourth element.
6080
If the NZ FLAG is set (not after the fourth element), JUMP to 6086H.
6082
LD C,(HL) 4E
Load Register C with the low byte at Register Pair HL (FCB byte +22), the granules before the second group of elements.
6083
INC HL 23
Increment Register Pair HL to FCB byte +23, the high byte of the granule count.
6084
LD B,(HL) 46
Load Register B with the high byte at Register Pair HL (FCB byte +23).
6085
INC HL 23
Increment Register Pair HL to the fifth element (FCB byte +24).
6086
DEC A 3D
Decrement Register A, the extent elements left to look at.
6087
If the NZ FLAG is set, LOOP BACK to 605CH for the next extent element.
6089
POP AF F1
Restore Register Pair AF (the sector within the granule) from the stack, unused.
608A
JUMP to 60B5H to show only FRS, the sector within the file.
608D
LD A,(DE) 1A
Load Register A with the element's second byte at Register Pair DE.
608E
AND E0H E6 E0
AND Register A with E0H, the first granule in the lump (bits 7-5).
6090
DEC DE 1B
Decrement Register Pair DE to the element's first byte, the lump number.
6091
RLCA 07
Rotate Register A left (three RLCAs move bits 7-5 to bits 2-0): the first.
6092
RLCA 07
Rotate Register A (the first granule bits) left, the second of three.
6093
RLCA 07
Rotate Register A left, the third: the first granule in the lump.
6094
ADD A,L 85
Add Register L (the place within the element) to Register A.
6095
LD L,A 6F
Copy Register A into Register L: Register Pair HL = the granule within the lump region.
6096
PUSH HL E5
Save Register Pair HL (the granule within the lump region) on the stack.
6097
LD A,(DE) 1A
Load Register A with the lump number at Register Pair DE.
6098
LD L,A 6F
Copy Register A into Register L (Register H is 00H).
6099
LD A,(549CH) 3A 9C 54
Load Register A with the granules per lump at 549CH.
609C
GOSUB to 687DH to multiply: Register Pair HL = lump x granules per lump.
609F
POP DE D1
Restore Register Pair DE (the granule within the lump) from the stack.
60A0
ADD HL,DE 19
Add Register Pair DE to Register Pair HL: the granule within the drive.
60A1
LD A,(549DH) 3A 9D 54
Load Register A with the sectors per granule at 549DH.
60A4
GOSUB to 687DH to multiply: Register Pair HL = the granule's first sector within the drive.
60A7
POP AF F1
Restore Register Pair AF (the sector within the granule) from the stack.
60A8
LD E,A 5F
Copy Register A (the sector within the granule) into Register E.
60A9
LD D,00H 16 00
Load Register D with 00H: Register Pair DE = the sector within the granule.
60AB
ADD HL,DE 19
Add Register Pair DE to Register Pair HL: Register Pair HL = the relative sector within the drive.
60AC
LD DE,3D00H 11 00 3D
Load Register Pair DE with 3D00H, row 4, column 0.
60AF
LD BC,6907H 01 07 69
Load Register Pair BC with 6907H, the label DRS.
60B2
GOSUB to 60ECH to write DRS and the relative sector within the drive.
60B5
LD BC,690AH 01 0A 69
Load Register Pair BC with 690AH, the label FRS (used if the sector is a file sector).
60B8
POP HL E1
Restore Register Pair HL (the relative sector at 54A2H) from the stack.
60B9
LD A,(5491H) 3A 91 54
Load Register A with the command flags at 5491H.
60BC
BIT 6,A CB 77
Test bit 6 of Register A (the command flags from 5491H), set for DFS.
60BE
If the NZ FLAG is set, JUMP to 60DEH to write FRS.
60C0
LD A,(549BH) 3A 9B 54
Load Register A with the sectors per track at 549BH.
60C3
GOSUB to 6896H to divide Register Pair HL by Register A: Register L = the track, Register A = the sector within it.
60C6
PUSH AF F5
Save Register Pair AF (the sector within the track) on the stack.
60C7
LD (54A0H),A 32 A0 54
Store Register A at 54A0H, the sector within the track.
60CA
LD A,L 7D
Load Register A with Register L, the track number from the division.
60CB
LD (549EH),A 32 9E 54
Store Register A (the track) at 549EH, the track variable.
60CE
LD BC,6901H 01 01 69
Load Register Pair BC with 6901H, the label TRK.
60D1
LD DE,3E00H 11 00 3E
Load Register Pair DE with 3E00H, row 8, column 0.
60D4
GOSUB to 60ECH to write TRK and the track number.
60D7
POP AF F1
Restore Register Pair AF (the sector within the track) from the stack.
60D8
LD L,A 6F
Copy Register A (the sector within the track) into Register L.
60D9
LD H,00H 26 00
Load Register H with 00H: Register Pair HL = the sector within the track.
60DB
LD BC,6904H 01 04 69
Load Register Pair BC with 6904H, the label TRS.
60DE
LD DE,3F00H 11 00 3F
Load Register Pair DE with 3F00H, row 12, column 0.
60E1
GOSUB to 60ECH to write the label at Register Pair BC (TRS or FRS) and the number in Register Pair HL.
60E4
LD A,(5494H) 3A 94 54
Load Register A with the sector status at 5494H (E, P or space).
60E7
LD (3FC1H),A 32 C1 3F
Store Register A (the status character) at 3FC1H, row 15, column 1 of the display.
60EA
POP BC C1
Restore Register Pair BC (the caller's value) from the stack.
60EB
RET C9
RETURN to the caller with the page on the display.

60ECH - Show a Label and a Number

Writes the three characters at Register Pair BC at the display address Register Pair DE, Register Pair HL in decimal (without leading zeros) one row below, and in hexadecimal with H two rows below.

60EC
PUSH HL E5
Save Register Pair HL (the number) on the stack.
60ED
LD HL,0080H 21 80 00
Load Register Pair HL with 0080H, two display rows.
60F0
ADD HL,DE 19
Add Register Pair DE to Register Pair HL: the place for the hexadecimal number.
60F1
EX (SP),HL E3
Exchange Register Pair HL with the word on the stack (Stack Pointer): that place is kept, Register Pair HL = the number.
60F2
PUSH HL E5
Save Register Pair HL (the number) on the stack.
60F3
PUSH HL E5
Save Register Pair HL (the number) on the stack again.
60F4
LD HL,0040H 21 40 00
Load Register Pair HL with 0040H, one display row.
60F7
ADD HL,DE 19
Add Register Pair DE to Register Pair HL: the place for the decimal number.
60F8
EX (SP),HL E3
Exchange Register Pair HL with the word on the stack (Stack Pointer): that place is kept, Register Pair HL = the number.
60F9
PUSH HL E5
Save Register Pair HL (the number) on the stack.
60FA
LD H,B 60
Copy Register B (the label address high byte) into Register H.
60FB
LD L,C 69
Copy Register C into Register L: Register Pair HL = the label.
60FC
LD BC,0003H 01 03 00
Load Register Pair BC with 0003H, the three characters.
60FF
LDIR ED B0
Copy Register Pair BC (3) bytes from Register Pair HL (the label) to Register Pair DE (the display).
6101
POP DE D1
Restore Register Pair DE (the number) from the stack.
6102
GOSUB to 68AFH to write Register Pair DE in decimal at 5487H; Register Pair HL returns the first digit that is not a leading zero, Register B the digits from there.
6105
POP DE D1
Restore Register Pair DE (the place one row down) from the stack.
6106
GOSUB to 668AH to copy Register B bytes from Register Pair HL (the digits) to Register Pair DE.
6109
POP DE D1
Restore Register Pair DE (the number) from the stack.
610A
POP HL E1
Restore Register Pair HL (the place two rows down) from the stack.
610B
GOSUB to 6665H to write Register Pair DE in hexadecimal at Register Pair HL without leading zeros.
610E
LD (HL),48H 36 48
Store 48H (H) at Register Pair HL after the digits.
6110
RET C9
RETURN to the caller with the label and both numbers on the display.

6111H - Copy Direction

Called by CDS and CDD with Register Pair DE = the number of sectors the copy spans, Register B = the source offset and Register C = the destination offset. On the same drive (5499H = 549AH) bit 7 of 5493H is set, so the copy runs backwards, when the destination starts after the source and no later than the source's end, or in the same sector at a higher offset.

6111
LD HL,549AH 21 9A 54
Load Register Pair HL with 549AH, the source drive.
6114
LD A,(5499H) 3A 99 54
Load Register A with the destination drive at 5499H.
6117
CP (HL) BE
Compare Register A with the source drive at Register Pair HL.
6118
RET NZ C0
If the NZ FLAG is set (different drives), RETURN: the copy runs forwards.
6119
PUSH DE D5
Save Register Pair DE (the sector span) on the stack.
611A
LD HL,(54A4H) 2A A4 54
Load Register Pair HL with the source sector at 54A4H.
611D
LD DE,(54A2H) ED 5B A2 54
Load Register Pair DE with the destination sector at 54A2H.
6121
OR A B7
OR Register A with itself to clear the CARRY FLAG before the subtraction.
6122
SBC HL,DE ED 52
Subtract Register Pair DE (the destination) from Register Pair HL (the source).
6124
If the CARRY FLAG is set (the destination comes after the source), JUMP to 612DH.
6126
POP HL E1
Restore Register Pair HL (the span) from the stack, which leaves the flags alone.
6127
RET NZ C0
If the NZ FLAG is set (the destination comes first), RETURN: forwards is safe.
6128
LD A,B 78
Load Register A with Register B, the source offset (same sector).
6129
CP C B9
Compare Register A with Register C, the destination offset.
612A
RET NC D0
If the NO CARRY FLAG is set (the destination offset is not higher), RETURN: forwards.
612B
JUMP to 6134H to set the flag for a backward copy.
612D
ADD HL,DE 19
Add Register Pair DE back to Register Pair HL: the source sector.
612E
POP BC C1
Restore Register Pair BC (the span) from the stack.
612F
ADD HL,BC 09
Add Register Pair BC to Register Pair HL: the sector after the source range.
6130
OR A B7
OR Register A with itself to clear the CARRY FLAG before the subtraction.
6131
SBC HL,DE ED 52
Subtract Register Pair DE (the destination) from Register Pair HL.
6133
RET C D8
If the CARRY FLAG is set (the destination lies after the source range), RETURN: forwards.
6134
LD HL,5493H 21 93 54
Load Register Pair HL with 5493H, the state flags.
6137
SET 7,(HL) CB FE
Set bit 7 of the state flags at Register Pair HL: copy backwards.
6139
RET C9
RETURN to the caller with bit 7 of 5493H set: the copy runs backwards.

613AH - Print the Page

Shows the page (5FB8H) and sends the first Register C rows of the display to the printer, 64 characters each (codes below 20H as 40H-5FH). After each row the keyboard is checked: H ends with FUNCTION TERMINATED BY OPERATOR, P waits for ENTER. Two carriage returns end the page and the output goes back to the display.

613A
PUSH BC C5
Save Register Pair BC (Register C, the rows to print) on the stack.
613B
GOSUB to 5FB8H to clear the screen and show the page.
613E
GOSUB to 6379H to send the output to the printer from now on.
6141
POP BC C1
Restore Register Pair BC (Register C, the rows) from the stack.
6142
LD HL,3C00H 21 00 3C
Load Register Pair HL with 3C00H, the first display row.
6145
LD B,40H 06 40
Load Register B with 40H, the 64 characters of a row.
6147
LD A,(HL) 7E
Load Register A with the display character at Register Pair HL.
6148
CP 20H FE 20
Compare Register A (the display character) with 20H.
614A
INC HL 23
Increment Register Pair HL to the next character.
614B
If the NO CARRY FLAG is set (20H or above), JUMP to 614FH.
614D
ADD A,40H C6 40
Add 40H to Register A: codes 00H-1FH print as the letters 40H-5FH.
614F
GOSUB to 62C8H to output Register A to the printer.
6152
Decrement Register B and LOOP BACK to 6147H for the whole row.
6154
GOSUB to 6248H to output a carriage return to the printer after the row.
6157
GOSUB to 6205H to scan the keyboard; Register A = the key or 00H.
615A
CP 48H FE 48
Compare Register A (the key) with 48H (H), which ends the printing.
615C
If the NZ FLAG is set (not H), JUMP to 6164H.
615E
GOSUB to 6374H to send the output to the display again.
6161
JUMP to 65B4H to display FUNCTION TERMINATED BY OPERATOR and go back to the menu.
6164
CP 50H FE 50
Compare Register A (the key) with 50H (P), which pauses the printing.
6166
If the NZ FLAG is set (not P), JUMP to 616FH.
6168
GOSUB to 620BH to wait for a key; Register A returns it.
616B
CP 0DH FE 0D
Compare Register A (the key) with 0DH (ENTER), which ends the pause.
616D
If the NZ FLAG is set, LOOP BACK to 6168H: the printing pauses until ENTER.
616F
DEC C 0D
Decrement Register C, the rows left to print.
6170
If the NZ FLAG is set, LOOP BACK to 6145H for the next row.
6172
GOSUB to 6248H to output a carriage return to the printer after the page.
6175
GOSUB to 6248H to output a second carriage return to the printer.
6178
JUMP to 6374H to send the output to the display again and return.

617BH - DMDB: Read a Page From the Dump

The page at 54B4H is found in the file (61BFH): file byte = address - base + 2. Bytes of the page below the dump's base are filled with FFH (the page shown then starts at the base's page). The bytes are read one at a time with ROM 0013H through the FCB into 5300H; at the end of the file the rest is filled with FFH and PARTIAL BLOCK DUE TO EOF is shown. A page that starts after the end gives SOURCE SECTOR OUT OF RANGE; other errors are displayed and the menu shown.

617B
LD HL,(54B4H) 2A B4 54
Load Register Pair HL with the page address at 54B4H.
617E
GOSUB to 61BFH to set the FCB to the file byte of that address; Register B returns 01H, or the base's low byte + 1 when the page starts below the base.
6181
LD HL,4200H 21 00 42
Load Register Pair HL with 4200H, the FCB's own buffer for the file reads.
6184
LD (5403H),HL 22 03 54
Store Register Pair HL at 5403H, the FCB's buffer address.
6187
LD HL,5300H 21 00 53
Load Register Pair HL with 5300H, where the page is built.
618A
LD C,00H 0E 00
Load Register C with 00H, the bytes to read (00H means 256).
618C
LD DE,5400H 11 00 54
Load Register Pair DE with 5400H, the FCB of the open dump file.
618F
JUMP to 6195H to start the count of bytes below the base in Register B.
6191
LD (HL),FFH 36 FF
Store FFH at Register Pair HL: a byte below the dump's base.
6193
DEC C 0D
Decrement Register C: one byte fewer to read.
6194
INC HL 23
Increment Register Pair HL to the next byte of the page buffer.
6195
Decrement Register B and LOOP BACK to 6191H while bytes below the base are left.
6197
LD B,C 41
Copy Register C (the bytes to read) into Register B.
6198
GOSUB to ROM 0013H to read the next byte of the file through the FCB at Register Pair DE into Register A; the NZ FLAG means an error.
619B
If the NZ FLAG is set (an error), JUMP to 61A2H with its code in Register A.
619D
LD (HL),A 77
Store Register A (the dump byte) at Register Pair HL in the page buffer.
619E
INC HL 23
Increment Register Pair HL to the next byte of the page buffer.
619F
Decrement Register B and LOOP BACK to 6198H for the rest of the page.
61A1
RET C9
RETURN with the 256 bytes of the page in 5300H.
61A2
CP 1CH FE 1C
Compare Register A (the error code) with 1CH, the end of the file.
61A4
If the NZ FLAG is set (not 1CH), JUMP to 61B7H.
61A6
LD (HL),FFH 36 FF
Store FFH at Register Pair HL: past the end of the dump.
61A8
INC HL 23
Increment Register Pair HL to the next byte of the page buffer.
61A9
Decrement Register B and LOOP BACK to 61A6H for the rest of the page.
61AB
LD HL,6ECBH 21 CB 6E
Load Register Pair HL with 6ECBH, the message PARTIAL BLOCK DUE TO EOF.
61AE
GOSUB to 6245H to display it with a carriage return.
61B1
LD HL,6DD5H 21 D5 6D
Load Register Pair HL with 6DD5H, the text PRESS 'ENTER' TO CONTINUE.
61B4
JUMP to 6345H to display it, wait for ENTER and return.
61B7
CP 1DH FE 1D
Compare Register A with 1DH, past the end of the file.
61B9
If the NZ FLAG is set (another error), JUMP to 6578H to display it through 4409H and go back to the menu.
61BC
JUMP to 56A9H to display SOURCE SECTOR OUT OF RANGE and run K.
61BF
LD DE,(54B2H) ED 5B B2 54
Load Register Pair DE with the dump's base address at 54B2H.
61C3
OR A B7
OR Register A with itself to clear the CARRY FLAG before the subtraction.
61C4
SBC HL,DE ED 52
Subtract Register Pair DE (the base) from Register Pair HL (the page address).
61C6
LD BC,0100H 01 00 01
Load Register Pair BC with 0100H: Register B = 01H (no bytes to fill), Register C = 00H.
61C9
If the NO CARRY FLAG is set (the page starts in the dump), JUMP to 61D4H.
61CB
LD H,C 61
Copy Register C (00H) into Register H, the high byte of the file position.
61CC
LD L,C 69
Copy Register C (00H) into Register L: Register Pair HL = 0000H, the dump's first byte.
61CD
LD B,E 43
Copy Register E (the base's low byte) into Register B, the bytes of the page below the base.
61CE
LD E,C 59
Copy Register C (00H) into Register E: Register Pair DE = the base's page.
61CF
LD (54B4H),DE ED 53 B4 54
Store Register Pair DE at 54B4H: the page shown is the base's page.
61D3
INC B 04
Increment Register B for the DJNZ count at 6195H.
61D4
LD DE,0002H 11 02 00
Load Register Pair DE with 0002H, the two address bytes at the start of the file.
61D7
ADD HL,DE 19
Add Register Pair DE to Register Pair HL: the file byte of the page's first byte.
61D8
If the NO CARRY FLAG is set, JUMP to 61DBH with Register C unchanged.
61DA
INC C 0C
Increment Register C: the 17th bit of the file byte position.
61DB
LD A,L 7D
Load Register A with Register L, the byte within the sector.
61DC
LD L,H 6C
Copy Register H (the middle byte of the file position) into Register L.
61DD
LD H,C 61
Copy Register C into Register H: Register Pair HL = the file sector.
61DE
LD (540AH),HL 22 0A 54
Store Register Pair HL at 540AH, the FCB's NEXT sector.
61E1
LD (5405H),A 32 05 54
Store Register A at 5405H, the FCB's byte within the sector.
61E4
LD HL,5401H 21 01 54
Load Register Pair HL with 5401H, FCB byte 1.
61E7
SET 5,(HL) CB EE
Set bit 5 of the FCB byte at Register Pair HL: the buffer does not hold that sector, so the next byte read reads it.
61E9
RET C9
RETURN to the caller with the FCB set at the page's first byte.

61EAH - Hexadecimal Digits and Keyboard

61EAH writes Register Pair DE as four hexadecimal digits at Register Pair HL, 61EFH writes Register A as two; Register Pair HL ends after them. 6205H scans the keyboard with ROM 002BH (Register A = 00H if no key), 620BH waits for a key with ROM 0049H; both keep Register Pair DE and turn a lower case letter into upper case (6210H).

61EA
LD A,D 7A
Load Register A with Register D, the high byte.
61EB
GOSUB to 61EFH to write Register A (the high byte) as two hexadecimal digits.
61EE
LD A,E 7B
Load Register A with Register E, the low byte, and go on into 61EFH.
61EF
PUSH AF F5
Save Register Pair AF (the byte) on the stack.
61F0
RRCA 0F
Rotate Register A right (four RRCAs bring the high digit down): the first.
61F1
RRCA 0F
Rotate Register A (the byte) right, the second of four rotations.
61F2
RRCA 0F
Rotate Register A (the byte) right, the third of four rotations.
61F3
RRCA 0F
Rotate Register A (the byte) right, the fourth: the high digit is now the low four bits.
61F4
GOSUB to 61F8H to write the high digit at Register Pair HL.
61F7
POP AF F1
Restore Register Pair AF (the byte) from the stack and go on with the low digit.
61F8
AND 0FH E6 0F
AND Register A with 0FH, keeping one hexadecimal digit (0-15).
61FA
CP 0AH FE 0A
Compare Register A (the digit) with 0AH, the first value written as a letter.
61FC
If the CARRY FLAG is set (0-9), JUMP to 6200H.
61FE
ADD A,07H C6 07
Add 07H to Register A, so that 10-15 become A-F.
6200
ADD A,30H C6 30
Add 30H to Register A: the ASCII character of the digit (0-9 or A-F).
6202
LD (HL),A 77
Store Register A (the digit character) at Register Pair HL.
6203
INC HL 23
Increment Register Pair HL to the place of the next digit.
6204
RET C9
RETURN to the caller with Register Pair HL after the digit.
6205
PUSH DE D5
Save Register Pair DE on the stack, as the ROM keyboard scan changes it.
6206
GOSUB to ROM 002BH to scan the keyboard: Register A = the key, or 00H.
6209
JUMP to 620FH to restore Register Pair DE and make the key upper case.
620B
PUSH DE D5
Save Register Pair DE on the stack, as the ROM key wait changes it.
620C
GOSUB to ROM 0049H to wait for a key; Register A returns it.
620F
POP DE D1
Restore Register Pair DE (the caller's value) from the stack.
6210
CP 61H FE 61
Compare Register A with 61H, the lower case a (also used by the line reader at 635DH).
6212
RET C D8
If the CARRY FLAG is set (below a), RETURN with Register A unchanged.
6213
CP 7BH FE 7B
Compare Register A with 7BH, the code after z.
6215
RET NC D0
If the NO CARRY FLAG is set (above z), RETURN unchanged.
6216
SUB 20H D6 20
Subtract 20H from Register A: the upper case letter.
6218
RET C9
RETURN with the key in upper case in Register A.

6219H - Messages and Questions

6219H (called by no instruction) clears the screen and shows a message with three carriage returns. 6224H shows the message at Register Pair HL and asks SURE YOU WANT TO DO THIS??? (Y OR N); N goes back to the menu. 6231H asks the question at Register Pair HL until exactly one character, Y or N, is typed: Z for N, NZ for Y. 6242H switches to the display first; 6245H shows a message and a carriage return; 6248H outputs one carriage return, 624AH Register B of them. 6252H (called by no instruction) switches to the display and goes into 6255H.

6219
GOSUB to 62A7H to clear the screen (1CH home, 1FH clear to the end of the frame).
621C
GOSUB to 6245H to display the message at Register Pair HL with a carriage return.
621F
LD B,03H 06 03
Load Register B with 03H, the carriage returns to add.
6221
JUMP to 624AH to output Register B carriage returns.
6224
GOSUB to 6245H to display the heading at Register Pair HL with a carriage return.
6227
LD HL,6D11H 21 11 6D
Load Register Pair HL with 6D11H, the question SURE YOU WANT TO DO THIS??? (Y OR N).
622A
GOSUB to 6231H to ask it until Y or N is typed: the Z FLAG for N.
622D
If the Z FLAG is set (N), JUMP to 54C5H, the menu.
6230
RET C9
RETURN to the function, which goes on after the Y answer.
6231
PUSH HL E5
Save Register Pair HL (the question) on the stack.
6232
GOSUB to 634EH to display the question and read the answer into 5440H; Register B returns the characters typed, Register A the first one.
6235
POP HL E1
Restore Register Pair HL (the question) from the stack.
6236
DEC B 05
Decrement Register B, the characters typed: 00H means exactly one.
6237
If the NZ FLAG is set (not exactly one), LOOP BACK to 6231H to ask again.
6239
CP 4EH FE 4E
Compare Register A (the answer) with 4EH (N).
623B
RET Z C8
If the Z FLAG is set (N), RETURN with the Z FLAG.
623C
CP 59H FE 59
Compare Register A (the answer) with 59H (Y).
623E
If the NZ FLAG is set (another letter), LOOP BACK to 6231H.
6240
OR A B7
OR Register A with itself: the NZ FLAG for Y.
6241
RET C9
RETURN with the NZ FLAG, which tells the caller the answer was Y.
6242
GOSUB to 6374H to send the output to the display.
6245
GOSUB to 6255H to display the message at Register Pair HL.
6248
LD B,01H 06 01
Load Register B with 01H, one carriage return.
624A
LD A,0DH 3E 0D
Load Register A with 0DH, the carriage return.
624C
GOSUB to 62C8H to output Register A (the carriage return).
624F
Decrement Register B and LOOP BACK to 624AH for Register B carriage returns.
6251
RET C9
RETURN to the caller after Register B carriage returns.
6252
GOSUB to 6374H to send the output to the display, then go on into 6255H (no instruction calls 6252H).

6255H - Display a Message

Messages are byte strings ended by 03H. Bytes below 60H are output as they are, except 08H, which means that the next word gets no space before it. Bytes 60H-96H are words from the list after 696BH (word number = byte - 5FH), bytes 97H-DDH words from the list after 6A23H (byte - 96H); each word ends with a byte that has bit 7 set. A word gets a space before it when it follows another word, unless its first byte is 08H. Register Pair HL returns at the 03H; Register Pair BC is kept.

6255
PUSH BC C5
Save Register Pair BC on the stack, as Register B and Register C are used here.
6256
LD C,00H 0E 00
Load Register C with 00H: bit 0 clear, no word has been output yet, so no space.
6258
JUMP to 6264H to read the first byte of the message at Register Pair HL.
625A
CP 03H FE 03
Compare Register A (a byte below 60H) with 03H, the end of the message.
625C
If the NZ FLAG is set, JUMP to 6260H to output it.
625E
POP BC C1
Restore Register Pair BC (the caller's value) from the stack.
625F
RET C9
RETURN with Register Pair HL at the 03H that ended the message.
6260
GOSUB to 629FH to output the byte in Register A (08H only clears bit 0 of Register C).
6263
INC HL 23
Increment Register Pair HL to the next message byte.
6264
LD A,(HL) 7E
Load Register A with the message byte at Register Pair HL.
6265
CP 60H FE 60
Compare Register A (the message byte) with 60H, the first word code.
6267
If the CARRY FLAG is set (below 60H), JUMP to 625AH.
6269
SUB 5FH D6 5F
Subtract 5FH from Register A: the word number in the first list (1 for 60H).
626B
LD B,A 47
Copy Register A into Register B, the word count.
626C
PUSH HL E5
Save Register Pair HL (the message position) on the stack.
626D
LD HL,696BH 21 6B 69
Load Register Pair HL with 696BH, the byte that ends the command table, just before the first word list.
6270
SUB 38H D6 38
Subtract 38H from Register A: the CARRY FLAG is set for bytes below 97H.
6272
If the CARRY FLAG is set, JUMP to 6279H with the first list.
6274
LD B,A 47
Copy Register A (byte - 97H) into Register B.
6275
LD HL,6A23H 21 23 6A
Load Register Pair HL with 6A23H, the 80H before the second word list.
6278
INC B 04
Increment Register B: the word number in the second list (1 for 97H).
6279
BIT 7,(HL) CB 7E
Test bit 7 of the byte at Register Pair HL, the end of a word.
627B
INC HL 23
Increment Register Pair HL to the next byte of the word list.
627C
If the Z FLAG is set (not the end), LOOP BACK to 6279H.
627E
LD A,(HL) 7E
Load Register A with the byte at Register Pair HL, the first byte of the next word.
627F
OR A B7
OR Register A with itself: 00H ends the list.
6280
If the Z FLAG is set (no such word), JUMP to 629CH to output nothing.
6282
Decrement Register B and LOOP BACK to 6279H until Register Pair HL is at the word wanted.
6284
INC HL 23
Increment Register Pair HL past the first byte.
6285
CP 08H FE 08
Compare Register A (the first byte) with 08H.
6287
If the Z FLAG is set (08H: no space before this word), JUMP to 628FH with Register Pair HL past it.
6289
DEC HL 2B
Decrement Register Pair HL back to the first byte.
628A
BIT 0,C CB 41
Test bit 0 of Register C, set after a word: a space goes before the next one.
628C
If the NZ FLAG is set, GOSUB to 62C6H to output a space before the word.
628F
SET 0,C CB C1
Set bit 0 of Register C: a word has been output.
6291
LD A,(HL) 7E
Load Register A with the word's byte at Register Pair HL.
6292
AND 7FH E6 7F
AND Register A with 7FH, without the end bit.
6294
GOSUB to 629FH to output it (08H only clears bit 0 of Register C).
6297
BIT 7,(HL) CB 7E
Test bit 7 of the byte at Register Pair HL, the last byte of the word.
6299
INC HL 23
Increment Register Pair HL to the next byte of the word.
629A
If the Z FLAG is set (more bytes), LOOP BACK to 6291H.
629C
POP HL E1
Restore Register Pair HL (the message position) from the stack.
629D
JUMP to 6263H to go on with the next message byte.
629F
CP 08H FE 08
Compare Register A (the byte to output) with 08H, the no space code.
62A1
If the NZ FLAG is set, JUMP to 62C8H to output the character and return.
62A4
RES 0,C CB 81
Reset bit 0 of Register C: the next word gets no space before it.
62A6
RET C9
RETURN to the caller with bit 0 of Register C clear.

62A7H - Output Characters

62A7H clears the screen (1CH home, 1FH clear to the end of the frame). 62AEH and 62B2H (called by no instruction) output 0EH and 0FH, the cursor on and off codes. 62B6H outputs 1CH. 62BAH outputs Register B characters from Register Pair HL; 62C2H (called by no instruction) one character from Register Pair HL; 62C6H a space. 62C8H outputs Register A to the display or the printer and keeps the column count at 5483H: a printable character uses a column and a full line is ended; 08H gives one back; 1CH-1FH start the line again; 0AH-0DH end the line (an empty line gets a space first), count the printed lines and, if BREAK is held, wait until ENTER. All registers are kept.

62A7
GOSUB to 62B6H to output 1CH, the cursor to the top left.
62AA
LD A,1FH 3E 1F
Load Register A with 1FH, clear to the end of the frame.
62AC
JUMP to 62C8H to output Register A (1FH) and return.
62AE
LD A,0EH 3E 0E
Load Register A with 0EH, the code that turns the cursor on.
62B0
JUMP to 62C8H to output Register A (0EH) and return.
62B2
LD A,0FH 3E 0F
Load Register A with 0FH, the code that turns the cursor off.
62B4
JUMP to 62C8H to output Register A (0FH) and return.
62B6
LD A,1CH 3E 1C
Load Register A with 1CH, the code that moves the cursor to the top left.
62B8
JUMP to 62C8H to output Register A (1CH) and return.
62BA
LD A,(HL) 7E
Load Register A with the character at Register Pair HL.
62BB
INC HL 23
Increment Register Pair HL to the next character to output.
62BC
GOSUB to 62C8H to output Register A to the display or the printer.
62BF
Decrement Register B and LOOP BACK to 62BAH for Register B characters.
62C1
RET C9
RETURN to the caller after Register B characters.
62C2
LD A,(HL) 7E
Load Register A with the character at Register Pair HL.
62C3
INC HL 23
Increment Register Pair HL to the next character.
62C4
JUMP to 62C8H to output Register A and return.
62C6
LD A,20H 3E 20
Load Register A with 20H, a space, and go on into 62C8H to output it.
62C8
PUSH HL E5
Save Register Pair HL (the caller's value) on the stack.
62C9
PUSH DE D5
Save Register Pair DE (the caller's value) on the stack.
62CA
PUSH BC C5
Save Register Pair BC (the caller's value) on the stack.
62CB
PUSH AF F5
Save Register Pair AF (the character) on the stack.
62CC
LD HL,5483H 21 83 54
Load Register Pair HL with 5483H, the columns left on the line.
62CF
CP 0EH FE 0E
Compare Register A (the character) with 0EH, the first code above 0DH.
62D1
If the NO CARRY FLAG is set (0EH or above), JUMP to 62D7H.
62D3
CP 0AH FE 0A
Compare Register A (the character) with 0AH, the first line end code.
62D5
If the NO CARRY FLAG is set (0AH-0DH), JUMP to 62FDH to end the line.
62D7
GOSUB to 63E8H to send Register A to the display or the printer.
62DA
CP 20H FE 20
Compare Register A (the character just sent) with 20H, the first printable code.
62DC
If the NO CARRY FLAG is set (printable), JUMP to 62FAH to count the column.
62DE
CP 08H FE 08
Compare Register A (the character) with 08H (backspace).
62E0
If the NZ FLAG is set (not backspace), JUMP to 62EEH.
62E2
LD A,(5484H) 3A 84 54
Load Register A with the line width at 5484H.
62E5
DEC A 3D
Decrement Register A: the line width minus 1.
62E6
CP (HL) BE
Compare Register A with the columns left at Register Pair HL.
62E7
INC (HL) 34
Increment the columns left at Register Pair HL: one column back.
62E8
If the NO CARRY FLAG is set (the line was not empty), JUMP to 6322H.
62EA
LD (HL),01H 36 01
Store 01H at Register Pair HL: a backspace at the line's start counts as the end of the line before.
62EC
JUMP to 6322H to restore the registers and return.
62EE
SUB 1CH D6 1C
Subtract 1CH from Register A (the control code): 1CH-1FH become 00H-03H.
62F0
CP 1DH FE 1D
Compare Register A with 1DH: the CARRY FLAG for 1CH-1FH.
62F2
If the NO CARRY FLAG is set (another control code), JUMP to 6322H.
62F4
LD A,(5484H) 3A 84 54
Load Register A with the line width at 5484H.
62F7
LD (HL),A 77
Store Register A at Register Pair HL: a new line starts (home or clear).
62F8
JUMP to 6322H to restore the registers and return.
62FA
DEC (HL) 35
Decrement the columns left at Register Pair HL.
62FB
If the NZ FLAG is set, JUMP to 6322H to return.
62FD
LD A,(5484H) 3A 84 54
Load Register A with the line width at 5484H (a full line, or 0AH-0DH).
6300
CP (HL) BE
Compare Register A with the columns left at Register Pair HL: the Z FLAG for an empty line.
6301
LD A,20H 3E 20
Load Register A with 20H, a space for an empty line.
6303
If the Z FLAG is set (empty line), GOSUB to 63E8H to output the space.
6306
LD A,0DH 3E 0D
Load Register A with 0DH, the carriage return.
6308
GOSUB to 63E8H to send the carriage return in Register A.
630B
GOSUB to 63B5H to count the printed line and start the next.
630E
LD A,(3840H) 3A 40 38
Load Register A with keyboard row 6 at 3840H.
6311
AND 04H E6 04
AND Register A (keyboard row 6) with 04H, the BREAK key.
6313
If the Z FLAG is set (not held), JUMP to 6322H.
6315
LD BC,0000H 01 00 00
Load Register Pair BC with 0000H, the longest delay.
6318
GOSUB to ROM 0060H to wait for the time in Register Pair BC.
631B
LD A,(3840H) 3A 40 38
Load Register A with keyboard row 6 at 3840H.
631E
AND 01H E6 01
AND Register A (keyboard row 6) with 01H, the ENTER key.
6320
If the Z FLAG is set (not pressed), LOOP BACK to 631BH.
6322
POP AF F1
Restore Register Pair AF (the character) from the stack.
6323
POP BC C1
Restore Register Pair BC (the caller's value) from the stack.
6324
POP DE D1
Restore Register Pair DE (the caller's value) from the stack.
6325
POP HL E1
Restore Register Pair HL (the caller's value) from the stack.
6326
RET C9
RETURN with all registers as they were on entry.

6327H - Tab and Line Input

6327H (called by no instruction) outputs spaces up to column Register B of the line. 6339H asks a question and reads up to Register B characters into 5440H, 633CH into Register Pair DE. 6345H shows a message and waits until ENTER alone is typed. 634EH shows a question and reads up to 64 characters into 5440H. The lines are read with ROM 0040H and turned into upper case; they return Register Pair HL = the line, Register B = the characters typed, Register A = the first character and the Z FLAG for an empty line.

6327
LD A,(5484H) 3A 84 54
Load Register A with the line width at 5484H.
632A
SUB B 90
Subtract Register B (the column wanted) from Register A.
632B
LD B,A 47
Copy Register A into Register B: the columns that must be left.
632C
LD A,(5483H) 3A 83 54
Load Register A with the columns left at 5483H.
632F
SUB B 90
Subtract Register B from Register A: the spaces needed.
6330
RET C D8
If the CARRY FLAG is set (past the column), RETURN.
6331
RET Z C8
If the Z FLAG is set (at the column), RETURN.
6332
LD B,A 47
Copy Register A (the spaces needed) into Register B.
6333
GOSUB to 62C6H to output a space and count the column.
6336
Decrement Register B and LOOP BACK to 6333H for the spaces left.
6338
RET C9
RETURN to the caller with the line at the column wanted.
6339
LD DE,5440H 11 40 54
Load Register Pair DE with 5440H, the line buffer.
633C
PUSH BC C5
Save Register Pair BC (Register B, the longest answer) on the stack.
633D
PUSH DE D5
Save Register Pair DE (the buffer) on the stack.
633E
GOSUB to 6255H to display the question at Register Pair HL.
6341
POP HL E1
Restore Register Pair HL (the buffer) from the stack.
6342
POP BC C1
Restore Register Pair BC (Register B, the longest answer) from the stack.
6343
JUMP to 6356H to read the line into Register Pair HL.
6345
GOSUB to 6255H to display the message at Register Pair HL.
6348
GOSUB to 6351H to read a line into 5440H; the Z FLAG for an empty line.
634B
If the NZ FLAG is set (something was typed), LOOP BACK to 6348H.
634D
RET C9
RETURN when ENTER alone was pressed (the Z FLAG).
634E
GOSUB to 6255H to display the question at Register Pair HL.
6351
LD HL,5440H 21 40 54
Load Register Pair HL with 5440H, the line buffer.
6354
LD B,40H 06 40
Load Register B with 40H, the 64 characters the buffer at 5440H holds.
6356
GOSUB to ROM 0040H to read a line of up to Register B characters into Register Pair HL; Register B returns the characters typed.
6359
PUSH HL E5
Save Register Pair HL (the line) on the stack.
635A
PUSH BC C5
Save Register Pair BC (Register B, the length) on the stack.
635B
INC B 04
Increment Register B, to include the carriage return.
635C
LD A,(HL) 7E
Load Register A with the character at Register Pair HL.
635D
GOSUB to 6210H to turn Register A into upper case.
6360
LD (HL),A 77
Store Register A (the character in upper case) back at Register Pair HL.
6361
INC HL 23
Increment Register Pair HL to the next character of the line.
6362
Decrement Register B and LOOP BACK to 635CH for the rest of the line.
6364
POP BC C1
Restore Register Pair BC (Register B, the length) from the stack.
6365
POP HL E1
Restore Register Pair HL (the line) from the stack.
6366
LD A,(HL) 7E
Load Register A with the first character at Register Pair HL.
6367
CP 0DH FE 0D
Compare Register A with 0DH: the Z FLAG for an empty line.
6369
RET C9
RETURN with the line at Register Pair HL and the Z FLAG for an empty line.

636AH - Output Device Selection

6374H sends the output to the display, 6379H to the printer. Both first end a line that is not empty, put the JR displacement at 63ECH (22H skips the printer code, 00H runs it) and take the line width from 5485H (64) or 5486H (132). 636AH (called by no instruction) also clears the echo flag 5480H; 639FH and 63A8H (called by no instruction) set and clear its bit 6; 63AFH returns the Z FLAG at the top of a printed page. Register A is kept.

636A
PUSH AF F5
Save Register Pair AF (the caller's value) on the stack.
636B
GOSUB to 6374H to send the output to the display.
636E
XOR A AF
Set Register A to 00H (XOR A with itself), the value for 5480H.
636F
LD (5480H),A 32 80 54
Store Register A (00H) at 5480H: printed output is not echoed on the display.
6372
POP AF F1
Restore Register Pair AF (the caller's value) from the stack.
6373
RET C9
RETURN to the caller with the output on the display.
6374
PUSH AF F5
Save Register Pair AF (the caller's value) on the stack.
6375
LD A,22H 3E 22
Load Register A with 22H, the displacement that jumps over the printer code.
6377
JUMP to 637CH with Register A = 22H, the display.
6379
PUSH AF F5
Save Register Pair AF (the caller's value) on the stack.
637A
LD A,00H 3E 00
Load Register A with 00H, the displacement that runs the printer code.
637C
PUSH AF F5
Save Register Pair AF (the displacement) on the stack.
637D
PUSH HL E5
Save Register Pair HL (the caller's value) on the stack.
637E
LD HL,5483H 21 83 54
Load Register Pair HL with 5483H, the columns left on the line.
6381
LD A,(5484H) 3A 84 54
Load Register A with the line width at 5484H.
6384
CP (HL) BE
Compare Register A with the columns left at Register Pair HL: the NZ FLAG when the line is not empty.
6385
If the NZ FLAG is set, GOSUB to 6248H to end it with a carriage return.
6388
POP HL E1
Restore Register Pair HL (the caller's value) from the stack.
6389
POP AF F1
Restore Register Pair AF (the displacement) from the stack.
638A
CP 22H FE 22
Compare Register A with 22H: the Z FLAG for the display.
638C
LD (63ECH),A 32 EC 63
Store Register A at 63ECH, the displacement of the JR at 63EBH.
638F
LD A,(5485H) 3A 85 54
Load Register A with the display width at 5485H.
6392
If the Z FLAG is set (the display), JUMP to 6397H with its width.
6394
LD A,(5486H) 3A 86 54
Load Register A with the printer width at 5486H.
6397
LD (5484H),A 32 84 54
Store Register A (the line width) at 5484H, the current line width.
639A
LD (5483H),A 32 83 54
Store Register A at 5483H, the columns left: a new line.
639D
POP AF F1
Restore Register Pair AF (the caller's value) from the stack.
639E
RET C9
RETURN to the caller with the output device selected.
639F
LD A,(5480H) 3A 80 54
Load Register A with the echo flag at 5480H (63A2H sets its bit 6).
63A2
SET 6,A CB F7
Set bit 6 of Register A: printed output is also shown.
63A4
LD (5480H),A 32 80 54
Store Register A (the new echo flag) at 5480H.
63A7
RET C9
RETURN to the caller with the echo flag changed.
63A8
LD A,(5480H) 3A 80 54
Load Register A with the echo flag at 5480H (63ABH clears its bit 6).
63AB
RES 6,A CB B7
Reset bit 6 of Register A: printed output is not shown.
63AD
JUMP to 63A4H to store Register A (the echo flag) at 5480H.
63AF
LD A,(5482H) 3A 82 54
Load Register A with the printed lines left at 5482H.
63B2
CP 3CH FE 3C
Compare Register A with 3CH (60): the Z FLAG at the top of a page.
63B4
RET C9
RETURN to the caller with the Z FLAG at the top of a page.

63B5H - After a Carriage Return

On the printer the lines left on the page at 5482H are counted down; at 0 six more carriage returns are printed if 5481H is not 00H, and the count starts again at 60. Then the columns left are set to the line width. 63DDH (called by no instruction) prints carriage returns until the top of a page, at most Register C of them.

63B5
LD A,(63ECH) 3A EC 63
Load Register A with the displacement at 63ECH.
63B8
CP 22H FE 22
Compare Register A (the displacement) with 22H, the display.
63BA
If the Z FLAG is set (the display), JUMP to 63D6H.
63BC
LD A,(5482H) 3A 82 54
Load Register A with the lines left at 5482H.
63BF
DEC A 3D
Decrement Register A, the printed lines left on the page.
63C0
If the NZ FLAG is set, JUMP to 63D3H to store it.
63C2
LD A,(5481H) 3A 81 54
Load Register A with the page skip flag at 5481H.
63C5
OR A B7
OR Register A (the page skip flag) with itself.
63C6
If the Z FLAG is set (no skip), JUMP to 63D1H.
63C8
LD B,06H 06 06
Load Register B with 06H, the lines to skip at the end of a page.
63CA
LD A,0DH 3E 0D
Load Register A with 0DH, the carriage return.
63CC
GOSUB to 63E8H to send the carriage return in Register A to the printer.
63CF
Decrement Register B and LOOP BACK to 63CCH for the lines left to skip.
63D1
LD A,3CH 3E 3C
Load Register A with 3CH, the 60 lines of a page.
63D3
LD (5482H),A 32 82 54
Store Register A (the printed lines left) at 5482H for the next line.
63D6
LD A,(5484H) 3A 84 54
Load Register A with the line width at 5484H.
63D9
LD (5483H),A 32 83 54
Store Register A at 5483H, the columns left: a new line.
63DC
RET C9
RETURN to the caller with a new line started.
63DD
GOSUB to 63AFH to test for the top of a page.
63E0
RET Z C8
If the Z FLAG is set (top of a page), RETURN.
63E1
GOSUB to 6248H to output a carriage return to the printer.
63E4
DEC C 0D
Decrement Register C, the most lines to output.
63E5
If the NZ FLAG is set (Register C not 0), LOOP BACK to 63DDH.
63E7
RET C9
RETURN to the caller with Register C counted down.

63E8H - Send a Character

6427H saves Register Pair HL, Register Pair DE, Register Pair BC, Index Register IX and Index Register IY and goes on at 63EBH. The JR there has the displacement set by 638CH: 22H goes to the display code at 640FH, 00H runs the printer code at 63EDH first. The printer gets codes 0AH-0DH and 20H and above through ROM 003BH; codes above option AX (4370H) become a period, other control codes are dropped. Printed output also goes to the display when bit 6 of 5480H is set. The display code (ROM 0033H) leaves out the carriage return after a line of exactly 64 characters, because the display has already moved to the next line.

63E8
GOSUB to 6427H to save the registers; it continues at 63EBH.
63EB
JUMP to 640FH, the display code: the displacement byte at 63ECH is 22H, or 00H to go on into the printer code at 63EDH.
63ED
PUSH AF F5
Save Register Pair AF (the character) on the stack.
63EE
LD HL,4370H 21 70 43
Load Register Pair HL with 4370H, option AX, the highest code the printer may get.
63F1
CP (HL) BE
Compare Register A with the limit at Register Pair HL.
63F2
If the CARRY FLAG is set (below), JUMP to 63F8H.
63F4
If the Z FLAG is set (equal to the limit), JUMP to 63F8H.
63F6
LD A,2EH 3E 2E
Load Register A with 2EH, a period, for a code above the limit.
63F8
CP 20H FE 20
Compare Register A (the character) with 20H, the first printable code.
63FA
If the NO CARRY FLAG is set (printable), JUMP to 6404H to print it.
63FC
CP 0EH FE 0E
Compare Register A (the character) with 0EH, the first code not printed.
63FE
If the NO CARRY FLAG is set (0EH-1FH), JUMP to 6407H: not printed.
6400
CP 0AH FE 0A
Compare Register A (the character) with 0AH, the first line end code.
6402
If the CARRY FLAG is set (00H-09H), JUMP to 6407H: not printed.
6404
GOSUB to ROM 003BH to send Register A to the printer.
6407
POP AF F1
Restore Register Pair AF (the character) from the stack.
6408
LD HL,5480H 21 80 54
Load Register Pair HL with 5480H, the echo flag.
640B
BIT 6,(HL) CB 76
Test bit 6 of the echo flag at Register Pair HL.
640D
If the Z FLAG is set (no echo), JUMP to 6444H to restore the registers and return.
640F
CP 0DH FE 0D
Compare Register A with 0DH, the carriage return.
6411
If the NZ FLAG is set, JUMP to 6422H to display it.
6413
LD HL,5483H 21 83 54
Load Register Pair HL with 5483H, the columns left.
6416
LD A,(5484H) 3A 84 54
Load Register A with the line width at 5484H.
6419
SUB (HL) 96
Subtract the columns left at Register Pair HL: Register A = the characters on the line.
641A
If the Z FLAG is set (an empty line), JUMP to 6420H.
641C
AND 3FH E6 3F
AND Register A with 3FH: 00H for exactly 64 (or 128) characters.
641E
If the Z FLAG is set, JUMP to 6444H: the display has already moved to the next line.
6420
LD A,0DH 3E 0D
Load Register A with 0DH, the carriage return.
6422
GOSUB to ROM 0033H to display Register A at the cursor.
6425
JUMP to 6444H to restore the registers and return.
6427
EX (SP),HL E3
Exchange Register Pair HL with the word on the stack (Stack Pointer): Register Pair HL = the return address 63EBH.
6428
LD (6434H),HL 22 34 64
Store Register Pair HL at 6434H, the operand of the JP at 6433H.
642B
POP HL E1
Restore Register Pair HL (the caller's value) from the stack.
642C
PUSH HL E5
Save Register Pair HL (the caller's value) on the stack.
642D
PUSH DE D5
Save Register Pair DE (the caller's value) on the stack.
642E
PUSH BC C5
Save Register Pair BC (the caller's value) on the stack.
642F
PUSH IX DD E5
Save Index Register IX (the caller's value) on the stack.
6431
PUSH IY FD E5
Save Index Register IY (the caller's value) on the stack.
6433
JUMP to the address in the operand at 6434H (0000H in the file, the return address stored at 6428H).
6436
PUSH HL E5
Save Register Pair HL on the stack (6436H-6443H is called by no instruction: the reverse of 6427H).
6437
LD (6442H),HL 22 42 64
Store Register Pair HL at 6442H, the operand of the JP at 6441H.
643A
POP IY FD E1
Restore Index Register IY from the stack (the word just pushed).
643C
POP IX DD E1
Restore Index Register IX (the value saved by 6427H) from the stack.
643E
POP BC C1
Restore Register Pair BC (the value saved by 6427H) from the stack.
643F
POP DE D1
Restore Register Pair DE (the value saved by 6427H) from the stack.
6440
POP HL E1
Restore Register Pair HL (the value saved by 6427H) from the stack.
6441
JUMP to the address in the operand at 6442H (0000H in the file).
6444
POP IY FD E1
Restore Index Register IY (the value saved by 6427H) from the stack.
6446
POP IX DD E1
Restore Index Register IX (the value saved by 6427H) from the stack.
6448
POP BC C1
Restore Register Pair BC (the value saved by 6427H) from the stack.
6449
POP DE D1
Restore Register Pair DE (the value saved by 6427H) from the stack.
644A
POP HL E1
Restore Register Pair HL (the value saved by 6427H) from the stack.
644B
RET C9
RETURN to the caller of 63E8H with all registers kept.

644CH - Read and Write a Sector

644CH reads with bit 6 of 5493H set (no retry question). 6457H reads the sector at the FCB's NEXT with SYS0 4436H; 6474H writes it with SYS0 443CH (write with verify), setting FCB bit 0 for a read protected write when 5494H is P and refusing a sector that was not read (E). 6497H prepares both: bit 7 of 5491H = write, FCB byte 1 bit 7 cleared, the byte within the sector 00H, and the sector number copied to 54A6H; it puts the return address in the JP at 64B9H, so a retry (64B3H) runs the DOS call again. A read sets 5494H to P (error 06H) or a space. The registers are kept; Z = done, NZ = skipped.

644C
LD HL,5493H 21 93 54
Load Register Pair HL with 5493H, the state flags.
644F
SET 6,(HL) CB F6
Set bit 6 of the state flags at Register Pair HL: an error does not ask R, S or X.
6451
GOSUB to 6457H to read the sector at the FCB's NEXT.
6454
RES 6,(HL) CB B6
Reset bit 6 of the state flags at Register Pair HL (the flags of the read are kept).
6456
RET C9
RETURN with the Z FLAG for a sector read and the NZ FLAG for an error.
6457
XOR A AF
Set Register A to 00H (XOR A with itself): bit 7 of 5491H clear, a read.
6458
GOSUB to 6497H to prepare the FCB; it continues at 645BH with Register Pair DE = 5400H.
645B
GOSUB to SYS0 4436H to read the sector at the FCB's NEXT into its buffer; the NZ FLAG means an error with its code in Register A.
645E
GOSUB to 64BCH to handle an error: the CARRY FLAG for retry, the NZ FLAG for skip, the Z FLAG with Register A = 00H or 06H otherwise.
6461
If the CARRY FLAG is set (R), JUMP to 64B3H to read again.
6463
If the NZ FLAG is set (S), JUMP to 6471H to return with it.
6465
CP 06H FE 06
Compare Register A with 06H, the read protected sector.
6467
LD A,50H 3E 50
Load Register A with 50H (P), the status of a read protected sector.
6469
If the Z FLAG is set (read protected), JUMP to 646DH.
646B
LD A,20H 3E 20
Load Register A with 20H (space), a normal sector.
646D
LD (5494H),A 32 94 54
Store Register A at 5494H, the sector status.
6470
CP A BF
Compare Register A with itself: the Z FLAG, the sector was read.
6471
POP DE D1
Restore Register Pair DE (the caller's value, saved by 6497H) from the stack.
6472
POP HL E1
Restore Register Pair HL (the caller's value, saved by 6497H) from the stack.
6473
RET C9
RETURN to the caller of 6457H or 6474H with the result in the flags.
6474
LD A,80H 3E 80
Load Register A with 80H: bit 7 of 5491H set, a write.
6476
GOSUB to 6497H to prepare the FCB; it continues at 6479H with Register Pair DE = 5400H.
6479
LD A,(5494H) 3A 94 54
Load Register A with the sector status at 5494H.
647C
CP 20H FE 20
Compare Register A with 20H (a normal sector).
647E
If the Z FLAG is set, JUMP to 6489H to write it.
6480
CP 50H FE 50
Compare Register A (the sector status) with 50H (P), read protected.
6482
If the NZ FLAG is set (E), JUMP to 65AAH to display SECTOR NOT PREVIOUSLY SUCCESSFULLY READ and go back to the menu.
6485
EX DE,HL EB
Exchange Register Pair DE and Register Pair HL: Register Pair HL = 5400H, the FCB.
6486
SET 0,(HL) CB C6
Set bit 0 of FCB byte 0 at Register Pair HL: write with the directory mark (read protected).
6488
EX DE,HL EB
Exchange Register Pair DE and Register Pair HL back.
6489
GOSUB to SYS0 443CH to write the buffer to the sector at NEXT and verify it; the NZ FLAG means an error.
648C
EX DE,HL EB
Exchange Register Pair DE and Register Pair HL: Register Pair HL = 5400H.
648D
RES 0,(HL) CB 86
Reset bit 0 of FCB byte 0 at Register Pair HL.
648F
EX DE,HL EB
Exchange Register Pair DE and Register Pair HL back.
6490
GOSUB to 64BCH to handle an error of the write.
6493
If the CARRY FLAG is set (R), JUMP to 64B3H to write again.
6495
JUMP to 6471H to restore the registers and return.

6497H - Prepare the FCB for a Read or Write

Called by 6457H and 6474H with Register A = 00H (read) or 80H (write). The return address goes into the JP at 64B9H and the caller's Register Pair HL and Register Pair DE stay on the stack for 6471H. Returns (through that JP) with Register Pair DE = 5400H and Register Pair HL = the sector at NEXT.

6497
EX (SP),HL E3
Exchange Register Pair HL with the word on the stack (Stack Pointer): Register Pair HL = the return address (645BH or 6479H), the caller's Register Pair HL stays on the stack.
6498
PUSH DE D5
Save Register Pair DE (the caller's value) on the stack, for 6471H to restore.
6499
LD (64BAH),HL 22 BA 64
Store Register Pair HL (the return address) at 64BAH, the operand of the JP at 64B9H.
649C
LD E,A 5F
Copy Register A (00H read, 80H write) into Register E.
649D
LD HL,5491H 21 91 54
Load Register Pair HL with 5491H, the command flags.
64A0
LD A,(HL) 7E
Load Register A with the command flags at Register Pair HL.
64A1
AND 7FH E6 7F
AND Register A (the command flags) with 7FH, dropping the old bit 7.
64A3
OR E B3
OR Register A with Register E: bit 7 set for a write.
64A4
LD (HL),A 77
Store Register A at Register Pair HL (5491H); the error report reads bit 7.
64A5
LD HL,5401H 21 01 54
Load Register Pair HL with 5401H, FCB byte 1.
64A8
RES 7,(HL) CB BE
Reset bit 7 of the FCB byte at Register Pair HL: sector mode, not record mode.
64AA
DEC HL 2B
Decrement Register Pair HL to 5400H, the FCB.
64AB
EX DE,HL EB
Exchange Register Pair DE and Register Pair HL: Register Pair DE = 5400H.
64AC
LD HL,(540AH) 2A 0A 54
Load Register Pair HL with the sector number at 540AH, the FCB's NEXT.
64AF
XOR A AF
Set Register A to 00H (XOR A with itself), the byte within the sector.
64B0
LD (5405H),A 32 05 54
Store Register A (00H) at 5405H, the byte within the sector.
64B3
LD (540AH),HL 22 0A 54
Store Register Pair HL at 540AH, the FCB's NEXT (also the retry entry from 6461H and 6493H).
64B6
LD (54A6H),HL 22 A6 54
Store Register Pair HL at 54A6H, the sector the error report shows.
64B9
JUMP to the return address in the operand at 64BAH (0000H in the file, set at 6499H): the read or write is done there.

64BCH - Disk Errors

Entered with the flags of a DOS call. Z (no error) returns Register A = 00H. Error 06H (read protected) returns the Z FLAG. Otherwise the screen is cleared, the location shown (65D0H), and SOURCE SECTOR READ ERROR, DESTINATION SECTOR WRITE ERROR or DESTINATION SECTOR VERIFY ERROR (a write with a code below 09H, which comes from the verify read); then the error's text from the table at 6BEDH, or for DFS and DMDB the DOS message (4409H), or SYSTEM ERROR CODE n. VDS, ZDS and CDS ask R (retry, CARRY FLAG), S (skip, NZ FLAG) or X (end); CDD and RRT go back to the menu; a display function shows BUFFER MAY CONTAIN SOME OR ALL OF SECTOR DATA and the display mode. With bit 6 of 5493H the routine returns NZ. A read error sets 5494H to E.

64BC
If the NZ FLAG is set (an error), JUMP to 64C0H.
64BE
XOR A AF
Set Register A to 00H (XOR A with itself), with the Z FLAG.
64BF
RET C9
RETURN with Register A = 00H and the Z FLAG: there was no error.
64C0
If the Z FLAG is set, JUMP to 64C5H (from 5F63H the NZ FLAG is always set).
64C2
CP 06H FE 06
Compare Register A (the error code) with 06H, the read protected sector.
64C4
RET Z C8
If the Z FLAG is set, RETURN: the data was read, the sector carries the directory mark.
64C5
PUSH HL E5
Save Register Pair HL (the caller's value) on the stack.
64C6
PUSH DE D5
Save Register Pair DE (the caller's value) on the stack.
64C7
PUSH BC C5
Save Register Pair BC (the caller's value) on the stack.
64C8
PUSH AF F5
Save Register Pair AF (Register A, the error code) on the stack.
64C9
GOSUB to 62A7H to clear the screen for the error report.
64CC
GOSUB to 65D0H to display the location of the sector: DRIVE, DRS or FRS, TRACK and SECTOR.
64CF
LD A,(5491H) 3A 91 54
Load Register A with the command flags at 5491H.
64D2
BIT 7,A CB 7F
Test bit 7 of Register A (the operation was a write).
64D4
If the Z FLAG is set (a read), JUMP to 64E7H.
64D6
LD DE,6E30H 11 30 6E
Load Register Pair DE with 6E30H, the message SECTOR WRITE ERROR.
64D9
LD HL,6D0EH 21 0E 6D
Load Register Pair HL with 6D0EH, the word DESTINATION.
64DC
POP AF F1
Restore Register Pair AF (Register A, the error code) from the stack.
64DD
CP 09H FE 09
Compare Register A (the error code) with 09H.
64DF
PUSH AF F5
Save Register Pair AF (the error code) on the stack again for 64F9H.
64E0
If the NO CARRY FLAG is set (09H or above), JUMP to 64F2H.
64E2
LD DE,6E34H 11 34 6E
Load Register Pair DE with 6E34H, the message SECTOR VERIFY ERROR (a code below 09H comes from the read that verifies the write).
64E5
JUMP to 64F2H to display DESTINATION and the verify message.
64E7
LD A,45H 3E 45
Load Register A with 45H (E), the status of a sector not read.
64E9
LD (5494H),A 32 94 54
Store Register A at 5494H: the sector was not read successfully.
64EC
LD DE,6E2CH 11 2C 6E
Load Register Pair DE with 6E2CH, the message SECTOR READ ERROR.
64EF
LD HL,6D0BH 21 0B 6D
Load Register Pair HL with 6D0BH, the word SOURCE.
64F2
GOSUB to 6255H to display the word at Register Pair HL (SOURCE or DESTINATION).
64F5
EX DE,HL EB
Exchange Register Pair DE and Register Pair HL: Register Pair HL = the error message.
64F6
GOSUB to 6245H to display it with a carriage return.
64F9
POP BC C1
Restore Register Pair BC from the stack: Register B = the error code.
64FA
LD HL,6BEDH 21 ED 6B
Load Register Pair HL with 6BEDH, the error table.

Error Table Search
Each group is one or more codes, 00H, the message ended by 03H; a 00H in place of the first code ends the table.

64FD
LD A,(HL) 7E
Load Register A with the code at Register Pair HL.
64FE
CP B B8
Compare Register A with Register B, the error code.
64FF
INC HL 23
Increment Register Pair HL to the next byte of the error table.
6500
If the Z FLAG is set (the code is in this group), JUMP to 652EH.
6502
LD A,(HL) 7E
Load Register A with the next byte at Register Pair HL.
6503
OR A B7
OR Register A with itself: 00H ends the group's codes.
6504
If the NZ FLAG is set (another code), LOOP BACK to 64FDH.
6506
LD A,(HL) 7E
Load Register A with the byte at Register Pair HL.
6507
CP 03H FE 03
Compare Register A with 03H, the end of the group's message.
6509
INC HL 23
Increment Register Pair HL to the next byte of the group's message.
650A
If the NZ FLAG is set (not 03H yet), LOOP BACK to 6506H.
650C
LD A,(HL) 7E
Load Register A with the first byte of the next group at Register Pair HL.
650D
OR A B7
OR Register A with itself: 00H ends the table.
650E
If the NZ FLAG is set (another group), LOOP BACK to 64FDH.
6510
LD A,(5491H) 3A 91 54
Load Register A with the command flags at 5491H.
6513
AND 48H E6 48
AND Register A with 48H, bits 6 (DFS) and 3 (DMDB).
6515
If the Z FLAG is set (not a file), JUMP to 651FH.
6517
LD A,B 78
Load Register A with Register B, the error code.
6518
OR C0H F6 C0
OR Register A with C0H, so that SYS0 4409H displays the message and returns.
651A
GOSUB to SYS0 4409H to display the DOS message for the code.
651D
JUMP to 6536H to end the line and decide what happens next.
651F
LD HL,6E38H 21 38 6E
Load Register Pair HL with 6E38H, the text SYSTEM ERROR CODE.
6522
GOSUB to 6255H to display the text at Register Pair HL (SYSTEM ERROR CODE).
6525
LD E,B 58
Copy Register B (the error code) into Register E.
6526
GOSUB to 68A7H to write Register E in decimal at 5487H (Register D = 00H); Register Pair HL returns the first digit, Register B the digits.
6529
GOSUB to 62BAH to output Register B characters from Register Pair HL.
652C
JUMP to 6536H to end the line and decide what happens next.
652E
LD A,(HL) 7E
Load Register A with the byte at Register Pair HL (the group's other codes).
652F
OR A B7
OR Register A (the table byte) with itself: 00H ends the codes.
6530
INC HL 23
Increment Register Pair HL to the next byte of the group.
6531
If the NZ FLAG is set, LOOP BACK to 652EH until the 00H before the message.
6533
GOSUB to 6255H to display the error's text at Register Pair HL.
6536
GOSUB to 6248H to output a carriage return after the error text.
6539
LD A,(5492H) 3A 92 54
Load Register A with the second command flags at 5492H.
653C
OR A B7
OR Register A with itself: 00H for the display functions.
653D
If the NZ FLAG is set (VDS, ZDS, CDS, CDD or RRT), JUMP to 6553H.
653F
LD A,(5493H) 3A 93 54
Load Register A with the state flags at 5493H.
6542
BIT 6,A CB 77
Test bit 6 of Register A (the state flags from 5493H): no question is asked.
6544
If the NZ FLAG is set, JUMP to 656FH to return with the NZ FLAG.
6546
BIT 1,A CB 4F
Test bit 1 of Register A, which no instruction in SUPERZAP sets.
6548
If the NZ FLAG is set, JUMP to 6558H to ask R, S or X.
654A
LD HL,6D90H 21 90 6D
Load Register Pair HL with 6D90H, BUFFER MAY CONTAIN SOME OR ALL OF SECTOR DATA and PRESS 'ENTER' TO DISPLAY BUFFER CONTENTS.
654D
GOSUB to 6345H to display it and wait for ENTER.
6550
JUMP to 56C1H to show the buffer in the display mode.
6553
AND E0H E6 E0
AND Register A with E0H, bits 7 (VDS), 6 (ZDS) and 5 (CDS).
6555
If the Z FLAG is set (CDD or RRT), JUMP to 6582H to go back to the menu.
6558
LD HL,6E71H 21 71 6E
Load Register Pair HL with 6E71H, REPLY 'R' FOR RETRY, 'S' FOR SKIP ERROR SECTOR, OR 'X' TO TERMINATE FUNCTION.
655B
GOSUB to 634EH to display it and read the answer; Register B returns the characters typed, Register A the first.
655E
Decrement Register B and LOOP BACK to 6558H unless exactly one character was typed.
6560
CP 58H FE 58
Compare Register A (the answer) with 58H (X), terminate the function.
6562
If the Z FLAG is set, JUMP to 65B4H to display FUNCTION TERMINATED BY OPERATOR.
6565
CP 52H FE 52
Compare Register A (the answer) with 52H (R), retry the operation.
6567
SCF 37
Set the CARRY FLAG, the retry answer (SCF leaves the Z FLAG alone).
6568
If the Z FLAG is set (R), JUMP to 656FH to return with it.
656A
CP 53H FE 53
Compare Register A (the answer) with 53H (S), skip the sector.
656C
If the NZ FLAG is set (another letter), LOOP BACK to 6558H.
656E
OR A B7
OR Register A with itself: the NZ FLAG and no CARRY FLAG, skip.
656F
POP BC C1
Restore Register Pair BC (the caller's value) from the stack.
6570
POP DE D1
Restore Register Pair DE (the caller's value) from the stack.
6571
POP HL E1
Restore Register Pair HL (the caller's value) from the stack.
6572
RET C9
RETURN with the answer in the flags: CARRY retry, NZ skip.

6573H - Ending a Function

6573H (called by no instruction) shows the message at Register Pair DE as below. 6576H and 6578H display a DOS error (Register A, 01H at 6576H) through SYS0 4409H. 657FH switches to the display and shows the message at Register Pair HL; 6582H shows PRESS 'ENTER' TO RETURN TO MENU and goes back to the menu after ENTER. The entries from 658EH load their message and go there; 6598H, 65A0H and 65A5H (parameter errors) return the CARRY FLAG instead.

6573
EX DE,HL EB
Exchange Register Pair DE and Register Pair HL: Register Pair HL = the message.
6574
JUMP to 657FH to display it and go back to the menu.
6576
LD A,01H 3E 01
Load Register A with 01H, the DOS error code SUPERZAP reports when an L search meets a record type of 20H or above (5973H).
6578
OR C0H F6 C0
OR Register A with C0H, so that SYS0 4409H displays the message and returns.
657A
GOSUB to SYS0 4409H to display the DOS message for the code in Register A.
657D
JUMP to 6582H to wait for ENTER and go back to the menu.
657F
GOSUB to 6242H to send the output to the display and show the message at Register Pair HL with a carriage return.
6582
GOSUB to 6374H to send the output to the display.
6585
LD HL,6D89H 21 89 6D
Load Register Pair HL with 6D89H, PRESS 'ENTER' TO RETURN TO MENU.
6588
GOSUB to 6345H to display it and wait for ENTER.
658B
JUMP to 54C5H, the menu: the function has ended.
658E
LD HL,6E20H 21 20 6E
Load Register Pair HL with 6E20H, SOURCE SECTOR OUT OF RANGE.
6591
JUMP to 657FH to display the message at Register Pair HL and end.
6593
LD HL,6E26H 21 26 6E
Load Register Pair HL with 6E26H, DESTINATION SECTOR OUT OF RANGE.
6596
JUMP to 657FH to display the message at Register Pair HL and end.
6598
LD HL,6E0AH 21 0A 6E
Load Register Pair HL with 6E0AH, TOO FEW PARAMETERS.
659B
GOSUB to 6245H to display the message at Register Pair HL with a carriage return.
659E
SCF 37
Set the CARRY FLAG: the parameter was not valid.
659F
RET C9
RETURN to the caller of the parameter routine.
65A0
LD HL,6E0FH 21 0F 6E
Load Register Pair HL with 6E0FH, TOO MANY PARAMETERS.
65A3
JUMP to 659BH to display the message at Register Pair HL and return the CARRY FLAG.
65A5
LD HL,6E14H 21 14 6E
Load Register Pair HL with 6E14H, MISSING IMBEDDED PARAMETER (a comma with nothing before it).
65A8
JUMP to 659BH to display the message at Register Pair HL and return the CARRY FLAG.
65AA
LD HL,6E3DH 21 3D 6E
Load Register Pair HL with 6E3DH, SECTOR NOT PREVIOUSLY SUCCESSFULLY READ.
65AD
JUMP to 657FH to display the message at Register Pair HL and end.
65AF
LD HL,6E59H 21 59 6E
Load Register Pair HL with 6E59H, SUPERZAP INTERNAL PROGRAMMING ERROR.
65B2
JUMP to 657FH to display the message at Register Pair HL and end.
65B4
LD HL,6E85H 21 85 6E
Load Register Pair HL with 6E85H, FUNCTION TERMINATED BY OPERATOR.
65B7
JUMP to 657FH to display the message at Register Pair HL and end.
65B9
LD HL,6DE7H 21 E7 6D
Load Register Pair HL with 6DE7H, ILLEGAL PRINTER REQUEST.
65BC
JUMP to 657FH to display the message at Register Pair HL and end.
65BE
LD HL,6EE9H 21 E9 6E
Load Register Pair HL with 6EE9H, FUNCTION ILLEGAL UNDER DOS-CALL.
65C1
JUMP to 657FH to display the message at Register Pair HL and end.
65C3
GOSUB to 6248H to output a carriage return before FUNCTION COMPLETED.
65C6
LD HL,6C2DH 21 2D 6C
Load Register Pair HL with 6C2DH, FUNCTION COMPLETED.
65C9
JUMP to 657FH to display the message at Register Pair HL and end.
65CB
ADD A,L 85
Add Register L to Register A (65CBH-65CFH is called by no instruction: Register Pair HL plus Register A).
65CC
LD L,A 6F
Copy Register A (the low byte of the sum) into Register L.
65CD
RET NC D0
If the NO CARRY FLAG is set, RETURN with the sum in Register Pair HL.
65CE
INC H 24
Increment Register H for the carry out of Register L.
65CF
RET C9
RETURN with the sum of Register Pair HL and Register A in Register Pair HL.

65D0H - Show the Location of a Sector

Displays DRIVE d, dH and then, for a file (DFS, DMDB), FRS n, nH; otherwise DRS n, nH TRACK t, tH SECTOR s, sH, from the sector at 54A6H and the sectors per track at 549BH. 660DH shows the label at Register Pair HL and the number in Register Pair DE in decimal and hexadecimal (with a 0 before a hexadecimal number that starts with a letter). 6649H outputs Register A as two hexadecimal digits; 665BH outputs Register Pair DE as four with H and two spaces.

65D0
LD A,(5406H) 3A 06 54
Load Register A with the drive number at 5406H, the FCB's drive.
65D3
LD HL,6E8DH 21 8D 6E
Load Register Pair HL with 6E8DH, the label DRIVE.
65D6
GOSUB to 660AH to show it with the drive number.
65D9
LD HL,6E9BH 21 9B 6E
Load Register Pair HL with 6E9BH, the label FRS.
65DC
LD DE,(54A6H) ED 5B A6 54
Load Register Pair DE with the sector at 54A6H.
65E0
LD A,(5491H) 3A 91 54
Load Register A with the command flags at 5491H.
65E3
AND 48H E6 48
AND Register A with 48H, bits 6 (DFS) and 3 (DMDB).
65E5
If the NZ FLAG is set (a file), JUMP to 6604H to show FRS.
65E7
LD HL,6E96H 21 96 6E
Load Register Pair HL with 6E96H, the label DRS.
65EA
PUSH DE D5
Save Register Pair DE (the sector) on the stack.
65EB
GOSUB to 660DH to show DRS and the relative sector.
65EE
POP HL E1
Restore Register Pair HL (the sector) from the stack.
65EF
LD A,(549BH) 3A 9B 54
Load Register A with the sectors per track at 549BH.
65F2
GOSUB to 6896H to divide Register Pair HL by Register A: Register Pair HL = the track, Register A = the sector in it.
65F5
EX DE,HL EB
Exchange Register Pair DE and Register Pair HL: Register Pair DE = the track.
65F6
PUSH AF F5
Save Register Pair AF (the sector in the track) on the stack.
65F7
LD HL,6E90H 21 90 6E
Load Register Pair HL with 6E90H, the label TRACK.
65FA
GOSUB to 660DH to show the label TRACK with the track in Register Pair DE.
65FD
POP AF F1
Restore Register Pair AF (the sector in the track) from the stack.
65FE
LD E,A 5F
Copy Register A (the sector within the track) into Register E.
65FF
LD D,00H 16 00
Load Register D with 00H: Register Pair DE = the sector in the track.
6601
LD HL,6E93H 21 93 6E
Load Register Pair HL with 6E93H, the label SECTOR.
6604
GOSUB to 660DH to show the label at Register Pair HL and Register Pair DE.
6607
JUMP to 6248H to output a carriage return and return.
660A
LD E,A 5F
Copy Register A (the number) into Register E.
660B
LD D,00H 16 00
Load Register D with 00H: Register Pair DE = Register A.
660D
PUSH DE D5
Save Register Pair DE (the number) on the stack.
660E
GOSUB to 6255H to display the label at Register Pair HL.
6611
GOSUB to 68AFH to write Register Pair DE in decimal at 5487H; Register Pair HL returns the first digit, Register B the digits.
6614
GOSUB to 62BAH to output Register B digits from Register Pair HL.
6617
LD HL,6EA0H 21 A0 6E
Load Register Pair HL with 6EA0H, a comma and a space.
661A
GOSUB to 6255H to display the comma and space at Register Pair HL.
661D
LD HL,5487H 21 87 54
Load Register Pair HL with 5487H, the number buffer.
6620
LD B,04H 06 04
Load Register B with 04H, the four bytes of the buffer to clear.
6622
PUSH HL E5
Save Register Pair HL (5487H) on the stack for the digit output.
6623
LD (HL),00H 36 00
Store 00H at Register Pair HL, in the number buffer.
6625
INC HL 23
Increment Register Pair HL to the next byte of the number buffer.
6626
Decrement Register B and LOOP BACK to 6623H: 5487H-548AH cleared.
6628
POP HL E1
Restore Register Pair HL (5487H) from the stack.
6629
POP DE D1
Restore Register Pair DE (the number) from the stack.
662A
PUSH HL E5
Save Register Pair HL (5487H) on the stack for the output below.
662B
GOSUB to 6665H to write Register Pair DE in hexadecimal without leading zeros at Register Pair HL.
662E
POP HL E1
Restore Register Pair HL (5487H) from the stack.
662F
LD B,04H 06 04
Load Register B with 04H, the most hexadecimal digits.
6631
LD A,(HL) 7E
Load Register A with the first digit at Register Pair HL.
6632
CP 3AH FE 3A
Compare Register A with 3AH: the NO CARRY FLAG for a letter A-F.
6634
If the CARRY FLAG is set (a digit 0-9), JUMP to 663BH.
6636
LD A,30H 3E 30
Load Register A with 30H, the digit 0 to put before a letter.
6638
GOSUB to 62C8H to output a 0 before a number that starts with a letter.
663B
LD A,(HL) 7E
Load Register A with the digit at Register Pair HL.
663C
OR A B7
OR Register A with itself: 00H after the last digit.
663D
INC HL 23
Increment Register Pair HL to the next digit in the buffer.
663E
If the NZ FLAG is set, GOSUB to 62C8H to output the digit.
6641
Decrement Register B and LOOP BACK to 663BH for the next digit.
6643
LD HL,6EA3H 21 A3 6E
Load Register Pair HL with 6EA3H, the letter H and two spaces.
6646
JUMP to 6255H to display the H and spaces at Register Pair HL and return.
6649
PUSH HL E5
Save Register Pair HL (the caller's value) on the stack.
664A
PUSH BC C5
Save Register Pair BC (the caller's value) on the stack.
664B
LD HL,5487H 21 87 54
Load Register Pair HL with 5487H, the number buffer.
664E
GOSUB to 6674H to write Register A as two hexadecimal digits at Register Pair HL.
6651
DEC HL 2B
Decrement Register Pair HL (after the two digits) once.
6652
DEC HL 2B
Decrement Register Pair HL back to 5487H, the first digit.
6653
LD B,02H 06 02
Load Register B with 02H, the two digits to output.
6655
GOSUB to 62BAH to output the two digits from Register Pair HL.
6658
POP BC C1
Restore Register Pair BC (the caller's value) from the stack.
6659
POP HL E1
Restore Register Pair HL (the caller's value) from the stack.
665A
RET C9
RETURN to the caller with the byte output as two hexadecimal digits.
665B
LD A,D 7A
Load Register A with Register D, the high byte.
665C
GOSUB to 6649H to output Register A (the high byte) as two digits.
665F
LD A,E 7B
Load Register A with Register E, the low byte.
6660
GOSUB to 6649H to output Register A (the low byte) as two digits.
6663
JUMP to 6643H to output H and two spaces after the four digits.

6665H - Hexadecimal Without Leading Zeros

6665H writes Register Pair DE at Register Pair HL: four digits when Register D is not 00H, two when Register E is 10H or more, otherwise one. 6670H writes Register A with one or two digits, 6674H always two, 667DH one. Register Pair HL ends after the digits.

6665
LD A,D 7A
Load Register A with Register D, the high byte.
6666
OR A B7
OR Register A (the high byte) with itself: the Z FLAG for 00H.
6667
If the Z FLAG is set (00H), JUMP to 666FH to write only Register E.
6669
GOSUB to 6670H to write Register D with one or two digits.
666C
LD A,E 7B
Load Register A with Register E, the low byte.
666D
JUMP to 6674H to write Register A (the low byte) as two digits.
666F
LD A,E 7B
Load Register A with Register E, the low byte.
6670
CP 10H FE 10
Compare Register A (the byte) with 10H: below 10H it is one digit.
6672
If the CARRY FLAG is set (one digit), JUMP to 667DH.
6674
PUSH AF F5
Save Register Pair AF (the byte) on the stack.
6675
RRCA 0F
Rotate Register A right (four RRCAs bring the high digit down): the first.
6676
RRCA 0F
Rotate Register A (the byte) right, the second of four rotations.
6677
RRCA 0F
Rotate Register A (the byte) right, the third of four rotations.
6678
RRCA 0F
Rotate Register A (the byte) right, the fourth: the high digit is now low.
6679
GOSUB to 667DH to write the high digit at Register Pair HL.
667C
POP AF F1
Restore Register Pair AF (the byte) from the stack.
667D
AND 0FH E6 0F
AND Register A with 0FH, keeping one hexadecimal digit (0-15).
667F
CP 0AH FE 0A
Compare Register A (the digit) with 0AH, the first value written as a letter.
6681
If the CARRY FLAG is set (0-9), JUMP to 6685H.
6683
ADD A,07H C6 07
Add 07H to Register A, so that 10-15 become A-F.
6685
ADD A,30H C6 30
Add 30H to Register A: the ASCII character of the digit (0-9 or A-F).
6687
LD (HL),A 77
Store Register A (the digit character) at Register Pair HL.
6688
INC HL 23
Increment Register Pair HL to the place of the next digit.
6689
RET C9
RETURN to the caller with Register Pair HL after the digit.

668AH - Copy, Compare and Character Tests

668AH copies Register B bytes from Register Pair HL to Register Pair DE. 6691H-66D4H, called by no instruction, are compares of register pairs (6691H HL with DE, 6697H HL with BC and then DE with HL, 66A2H DE with BC and then BC with HL, 66ADH BC with DE), a compare of Register B bytes at Register Pair DE and Register Pair HL (66B3H) and letter tests (66BBH, 66C3H, 66CBH). 66D5H returns the CARRY FLAG when Register A is a decimal digit (it is also the end of 66C3H and 66CBH).

668A
LD A,(HL) 7E
Load Register A with the byte at Register Pair HL.
668B
LD (DE),A 12
Store Register A (the byte) at Register Pair DE, the destination.
668C
INC DE 13
Increment Register Pair DE to the next destination byte.
668D
INC HL 23
Increment Register Pair HL to the next source byte.
668E
Decrement Register B and LOOP BACK to 668AH for Register B bytes.
6690
RET C9
RETURN to the caller after Register B bytes were copied.
6691
LD A,H 7C
Load Register A with Register H (6691H-6696H compare Register Pair HL with Register Pair DE).
6692
CP D BA
Compare Register A (Register H) with Register D, the high bytes.
6693
RET NZ C0
If the NZ FLAG is set, RETURN with the result of the high bytes.
6694
LD A,L 7D
Load Register A with Register L, the low byte of Register Pair HL.
6695
CP E BB
Compare Register A (Register L) with Register E, the low bytes.
6696
RET C9
RETURN with the flags of the compare of the two register pairs.
6697
LD A,H 7C
Load Register A with Register H (6697H-66A1H compare Register Pair HL with Register Pair BC, then Register Pair DE with Register Pair HL).
6698
CP B B8
Compare Register A (Register H) with Register B, the high bytes.
6699
RET NZ C0
If the NZ FLAG is set (the high bytes differ), RETURN.
669A
CP L BD
Compare Register A (Register H) with Register L.
669B
RET C D8
If the CARRY FLAG is set (Register H below Register L), RETURN.
669C
LD A,D 7A
Load Register A with Register D, the high byte of Register Pair DE.
669D
CP H BC
Compare Register A (Register D) with Register H.
669E
RET NZ C0
If the NZ FLAG is set (the high bytes differ), RETURN.
669F
LD A,E 7B
Load Register A with Register E, the low byte of Register Pair DE.
66A0
CP L BD
Compare Register A (Register E) with Register L.
66A1
RET C9
RETURN with the flags of the compare of the two register pairs.
66A2
LD A,D 7A
Load Register A with Register D (66A2H-66ACH compare Register Pair DE with Register Pair BC, then Register Pair BC with Register Pair HL).
66A3
CP B B8
Compare Register A (Register D) with Register B, the high bytes.
66A4
RET NZ C0
If the NZ FLAG is set (the high bytes differ), RETURN.
66A5
CP E BB
Compare Register A (Register D) with Register E.
66A6
RET C D8
If the CARRY FLAG is set (Register D below Register E), RETURN.
66A7
LD A,B 78
Load Register A with Register B, the high byte of Register Pair BC.
66A8
CP H BC
Compare Register A (Register B) with Register H.
66A9
RET NZ C0
If the NZ FLAG is set (the high bytes differ), RETURN.
66AA
LD A,C 79
Load Register A with Register C, the low byte of Register Pair BC.
66AB
CP L BD
Compare Register A (Register C) with Register L.
66AC
RET C9
RETURN with the flags of the compare of the two register pairs.
66AD
LD A,B 78
Load Register A with Register B (66ADH-66B2H compare Register Pair BC with Register Pair DE).
66AE
CP D BA
Compare Register A (Register B) with Register D, the high bytes.
66AF
RET NZ C0
If the NZ FLAG is set (the high bytes differ), RETURN.
66B0
LD A,C 79
Load Register A with Register C, the low byte of Register Pair BC.
66B1
CP E BB
Compare Register A (Register C) with Register E, the low bytes.
66B2
RET C9
RETURN with the flags of the compare of the two register pairs.
66B3
LD A,(DE) 1A
Load Register A with the byte at Register Pair DE (66B3H-66BAH compare Register B bytes).
66B4
CP (HL) BE
Compare Register A with the byte at Register Pair HL.
66B5
INC DE 13
Increment Register Pair DE to the next byte of the first string.
66B6
INC HL 23
Increment Register Pair HL to the next byte of the second string.
66B7
RET NZ C0
If the NZ FLAG is set (the bytes differ), RETURN with the NZ FLAG.
66B8
Decrement Register B and LOOP BACK to 66B3H for the next pair of bytes.
66BA
RET C9
RETURN with the Z FLAG: all Register B bytes are equal.
66BB
LD A,(HL) 7E
Load Register A with the character at Register Pair HL (66BBH-66C2H: the CARRY FLAG for a letter A-Z).
66BC
CP 41H FE 41
Compare Register A (the character) with 41H (A).
66BE
CCF 3F
Complement the CARRY FLAG: the CARRY FLAG is set for A and above.
66BF
RET NC D0
If the NO CARRY FLAG is set (below A), RETURN.
66C0
CP 5BH FE 5B
Compare Register A with 5BH, the code after Z: the CARRY FLAG for A-Z.
66C2
RET C9
RETURN with the CARRY FLAG set when Register A is a letter A-Z.
66C3
LD A,(HL) 7E
Load Register A with the character at Register Pair HL (66C3H-66CAH: a letter A-Z, or a digit through 66D5H).
66C4
CP 41H FE 41
Compare Register A (the character) with 41H (A).
66C6
If the CARRY FLAG is set (below A), JUMP to 66D5H to test for a digit.
66C8
CP 5BH FE 5B
Compare Register A with 5BH: the CARRY FLAG for A-Z.
66CA
RET C9
RETURN with the CARRY FLAG set when Register A is a letter A-Z.
66CB
CP 47H FE 47
Compare Register A with 47H, the code after F (66CBH-66D3H: a hexadecimal digit).
66CD
RET NC D0
If the NO CARRY FLAG is set, RETURN: not a hexadecimal digit.
66CE
CP 41H FE 41
Compare Register A (the character) with 41H (A).
66D0
CCF 3F
Complement the CARRY FLAG: the CARRY FLAG is set for A-F.
66D1
RET C D8
If the CARRY FLAG is set (A-F), RETURN with it.
66D2
JUMP to 66D5H to test Register A for a decimal digit.
66D4
LD A,(HL) 7E
Load Register A with the character at Register Pair HL (an entry no instruction calls).
66D5
CP 3AH FE 3A
Compare Register A with 3AH, the code after 9.
66D7
RET NC D0
If the NO CARRY FLAG is set, RETURN: not a digit.
66D8
CP 30H FE 30
Compare Register A (the character) with 30H (0).
66DA
CCF 3F
Complement the CARRY FLAG: the CARRY FLAG for 0-9.
66DB
RET C9
RETURN with the CARRY FLAG for a decimal digit 0-9.

66DCH - The Count and Offset Questions

66DCH asks SECTOR COUNT?, 66E1H BYTE COUNT?, both until 677BH accepts a count from 1 to 65535 (stored at 54ACH). 66EFH asks BYTE OFFSET WITHIN SECTOR? until 66FBH accepts a value below 256 (stored at 54AEH). An X as the answer goes back to the menu (681BH).

66DC
LD HL,6D6DH 21 6D 6D
Load Register Pair HL with 6D6DH, the question SECTOR COUNT?.
66DF
JUMP to 66E4H to ask the question at Register Pair HL.
66E1
LD HL,6D71H 21 71 6D
Load Register Pair HL with 6D71H, the question BYTE COUNT?.
66E4
PUSH HL E5
Save Register Pair HL (the question) on the stack.
66E5
GOSUB to 634EH to display the question and read the answer into 5440H; Register Pair HL returns 5440H.
66E8
GOSUB to 677BH to take the count at Register Pair HL; the CARRY FLAG means it was not valid.
66EB
POP HL E1
Restore Register Pair HL (the question) from the stack.
66EC
If the CARRY FLAG is set, LOOP BACK to 66E4H to ask again.
66EE
RET C9
RETURN with the valid count stored at 54ACH for the function.
66EF
LD HL,6D75H 21 75 6D
Load Register Pair HL with 6D75H, the question BYTE OFFSET WITHIN SECTOR?.
66F2
GOSUB to 634EH to display the question and read the answer; Register Pair HL returns 5440H.
66F5
GOSUB to 66FBH to take the offset at Register Pair HL; the CARRY FLAG means it was not valid.
66F8
If the CARRY FLAG is set, LOOP BACK to 66EFH.
66FA
RET C9
RETURN with the valid offset stored at 54AEH.
66FB
GOSUB to 67E5H to take the last parameter at Register Pair HL into Register Pair DE.
66FE
PUSH HL E5
Save Register Pair HL (after the parameter) on the stack.
66FF
PUSH AF F5
Save Register Pair AF (the flags of the parameter) on the stack.
6700
If the CARRY FLAG is set (not valid), JUMP to 670AH.
6702
LD A,E 7B
Load Register A with Register E, the offset's low byte.
6703
LD (54AEH),A 32 AE 54
Store Register A (the offset low byte) at 54AEH, the byte offset.
6706
LD A,D 7A
Load Register A with Register D, the high byte.
6707
OR A B7
OR Register A with itself: 00H for a value below 256.
6708
If the Z FLAG is set, JUMP to 6725H to return the flags of the parameter.
670A
LD HL,6E04H 21 04 6E
Load Register Pair HL with 6E04H, BAD/ILLEGAL OFFSET WITHIN SECTOR VALUE.
670D
JUMP to 672BH to display it and return the CARRY FLAG.

670FH - Parameters: Drive, Track, Sector, Address, Count

Each takes one parameter from the answer at Register Pair HL (67EDH), checks it, stores it and returns the NO CARRY FLAG with the Z FLAG for the last parameter or the NZ FLAG when more follow; a bad value displays its BAD/ILLEGAL message and returns the CARRY FLAG. 670FH: the drive, stored at 5406H and 5499H, then 67B5H checks the diskette. 6732H: the track, below 430DH, to 549EH. 6751H: the sector, below 549BH, to 54A0H. 6770H: a memory address in Register Pair DE. 677BH: a count from 1 up, to 54ACH. 678FH shows a message and asks DRIVE AND RELATIVE-SECTOR-WITHIN-DRIVE #'S? (6792H only asks); 679EH takes the relative sector to 54A2H.

670F
GOSUB to 67EDH to take a parameter at Register Pair HL into Register Pair DE.
6712
PUSH HL E5
Save Register Pair HL (after the parameter) on the stack.
6713
PUSH AF F5
Save Register Pair AF (its flags) on the stack.
6714
If the CARRY FLAG is set (not valid), JUMP to 6728H.
6716
LD A,D 7A
Load Register A with Register D, the high byte.
6717
OR A B7
OR Register A (the high byte) with itself: 00H for a drive below 256.
6718
If the NZ FLAG is set (256 or more), JUMP to 6728H.
671A
LD A,E 7B
Load Register A with Register E, the drive number.
671B
LD (5406H),A 32 06 54
Store Register A (the drive) at 5406H, the FCB's drive.
671E
LD A,E 7B
Load Register A with Register E, the drive number, again.
671F
LD (5499H),A 32 99 54
Store Register A at 5499H, the drive of the function.
6722
GOSUB to 67B5H to check the diskette in the drive and read its sizes.
6725
POP AF F1
Restore Register Pair AF (the parameter's flags) from the stack.
6726
POP HL E1
Restore Register Pair HL (after the parameter) from the stack.
6727
RET C9
RETURN with the flags of the parameter (Z last, NZ more follow).
6728
LD HL,6DEBH 21 EB 6D
Load Register Pair HL with 6DEBH, BAD/ILLEGAL DRIVE #.
672B
GOSUB to 6245H to display the message with a carriage return.
672E
POP AF F1
Restore Register Pair AF (the parameter's flags) from the stack.
672F
POP HL E1
Restore Register Pair HL (after the parameter) from the stack.
6730
SCF 37
Set the CARRY FLAG: the parameter was not valid.
6731
RET C9
RETURN with the CARRY FLAG to the question routine, which asks again.
6732
GOSUB to 67EDH to take a parameter at Register Pair HL into Register Pair DE.
6735
PUSH HL E5
Save Register Pair HL (after the parameter) on the stack.
6736
PUSH AF F5
Save Register Pair AF (its flags) on the stack.
6737
If the CARRY FLAG is set (not a number), JUMP to 674CH.
6739
LD A,D 7A
Load Register A with Register D, the high byte.
673A
OR A B7
OR Register A (the high byte) with itself: 00H for a track below 256.
673B
If the NZ FLAG is set (too big), JUMP to 674CH.
673D
GOSUB to 67B5H to check the drive and read its sizes (430DH tracks).
6740
LD HL,430DH 21 0D 43
Load Register Pair HL with 430DH, the drive's number of tracks.
6743
LD A,E 7B
Load Register A with Register E, the track number.
6744
CP (HL) BE
Compare Register A with the tracks at Register Pair HL.
6745
If the NO CARRY FLAG is set (too high), JUMP to 674CH.
6747
LD (549EH),A 32 9E 54
Store Register A (the track) at 549EH, the track variable.
674A
JUMP to 6725H to restore the registers and return.
674C
LD HL,6DEFH 21 EF 6D
Load Register Pair HL with 6DEFH, BAD/ILLEGAL TRACK #.
674F
JUMP to 672BH to display BAD/ILLEGAL TRACK # and return the CARRY FLAG.
6751
GOSUB to 67E5H to take the last parameter at Register Pair HL into Register Pair DE.
6754
PUSH HL E5
Save Register Pair HL (after the parameter) on the stack.
6755
PUSH AF F5
Save Register Pair AF (its flags) on the stack.
6756
If the CARRY FLAG is set (not a number), JUMP to 676BH.
6758
LD A,D 7A
Load Register A with Register D, the high byte.
6759
OR A B7
OR Register A (the high byte) with itself: 00H for a sector below 256.
675A
If the NZ FLAG is set (too big), JUMP to 676BH.
675C
GOSUB to 67B5H to check the drive and read its sizes (549BH).
675F
LD HL,549BH 21 9B 54
Load Register Pair HL with 549BH, the sectors per track.
6762
LD A,E 7B
Load Register A with Register E, the sector number.
6763
CP (HL) BE
Compare Register A with the sectors per track at Register Pair HL.
6764
If the NO CARRY FLAG is set (too high), JUMP to 676BH.
6766
LD (54A0H),A 32 A0 54
Store Register A at 54A0H, the sector within the track.
6769
JUMP to 6725H to restore the registers and return.
676B
LD HL,6DF3H 21 F3 6D
Load Register Pair HL with 6DF3H, BAD/ILLEGAL SECTOR #.
676E
JUMP to 672BH to display BAD/ILLEGAL SECTOR # and return the CARRY FLAG.
6770
GOSUB to 67E5H to take the last parameter at Register Pair HL into Register Pair DE.
6773
RET NC D0
If the NO CARRY FLAG is set, RETURN with the address in Register Pair DE.
6774
PUSH HL E5
Save Register Pair HL (after the parameter) on the stack.
6775
PUSH AF F5
Save Register Pair AF (the parameter's flags) on the stack.
6776
LD HL,6DFFH 21 FF 6D
Load Register Pair HL with 6DFFH, BAD/ILLEGAL MAIN MEMORY ADDRESS.
6779
JUMP to 672BH to display BAD/ILLEGAL MAIN MEMORY ADDRESS and return the CARRY FLAG.
677B
GOSUB to 67E5H to take the last parameter at Register Pair HL into Register Pair DE.
677E
PUSH HL E5
Save Register Pair HL (after the parameter) on the stack.
677F
PUSH AF F5
Save Register Pair AF (the parameter's flags) on the stack.
6780
If the CARRY FLAG is set (not a number), JUMP to 678AH.
6782
LD (54ACH),DE ED 53 AC 54
Store Register Pair DE (the count) at 54ACH, the count variable.
6786
LD A,D 7A
Load Register A with Register D, the count's high byte.
6787
OR E B3
OR Register A with Register E: the Z FLAG for a count of 0.
6788
If the NZ FLAG is set, JUMP to 6725H to return.
678A
LD HL,6DFCH 21 FC 6D
Load Register Pair HL with 6DFCH, BAD/ILLEGAL COUNT.
678D
JUMP to 672BH to display BAD/ILLEGAL COUNT and return the CARRY FLAG.
678F
GOSUB to 6255H to display the message at Register Pair HL (SOURCE, DESTINATION or IS TO BE COPIED TO).
6792
LD HL,6D50H 21 50 6D
Load Register Pair HL with 6D50H, DRIVE AND RELATIVE-SECTOR-WITHIN-DRIVE #'S?.
6795
GOSUB to 634EH to display it and read the answer; the Z FLAG for an empty answer.
6798
SCF 37
Set the CARRY FLAG, returned if the answer is empty.
6799
RET Z C8
If the Z FLAG is set (empty), RETURN with the CARRY FLAG.
679A
GOSUB to 670FH to take the drive number from the answer at Register Pair HL.
679D
RET C D8
If the CARRY FLAG is set (bad drive), RETURN with it.
679E
GOSUB to 67E5H to take the last parameter at Register Pair HL into Register Pair DE (the relative sector).
67A1
PUSH HL E5
Save Register Pair HL (after the parameter) on the stack.
67A2
PUSH AF F5
Save Register Pair AF (the parameter's flags) on the stack.
67A3
If the CARRY FLAG is set (not a number), JUMP to 67AFH.
67A5
LD (54A2H),DE ED 53 A2 54
Store Register Pair DE at 54A2H, the relative sector.
67A9
GOSUB to 67B5H to check the drive and read its sizes.
67AC
JUMP to 6725H to restore the registers and return.
67AF
LD HL,6DF7H 21 F7 6D
Load Register Pair HL with 6DF7H, BAD/ILLEGAL RELATIVE SECTOR #.
67B2
JUMP to 672BH to display BAD/ILLEGAL RELATIVE SECTOR # and return the CARRY FLAG.

67B5H - Check the Drive and Read Its Sizes

Checks the drive at 5406H with SYS0 445EH (an error is displayed through 4409H and the menu shown) and copies the drive's sizes: 549BH sectors per track (430EH), 549CH granules per lump (430FH), 54A8H = tracks (430DH) x sectors per track. All registers are kept.

67B5
PUSH AF F5
Save Register Pair AF (the caller's value) on the stack.
67B6
PUSH HL E5
Save Register Pair HL (the caller's value) on the stack.
67B7
PUSH DE D5
Save Register Pair DE (the caller's value) on the stack.
67B8
PUSH BC C5
Save Register Pair BC (the caller's value) on the stack.
67B9
LD A,(5406H) 3A 06 54
Load Register A with the drive number at 5406H, the FCB's drive.
67BC
LD DE,5400H 11 00 54
Load Register Pair DE with 5400H, the FCB, for SYS0 445EH.
67BF
GOSUB to SYS0 445EH to test the diskette in drive Register A; the NZ FLAG means an error with its code in Register A.
67C2
If the NZ FLAG is set, JUMP to 6578H to display it and go back to the menu.
67C5
LD A,(430EH) 3A 0E 43
Load Register A with the sectors per track at 430EH.
67C8
LD (549BH),A 32 9B 54
Store Register A (the sectors per track) at 549BH.
67CB
LD A,(430FH) 3A 0F 43
Load Register A with the granules per lump at 430FH.
67CE
LD (549CH),A 32 9C 54
Store Register A (the granules per lump) at 549CH.
67D1
LD A,(430DH) 3A 0D 43
Load Register A with the number of tracks at 430DH.
67D4
LD L,A 6F
Copy Register A (the number of tracks) into Register L.
67D5
LD H,00H 26 00
Load Register H with 00H: Register Pair HL = the tracks.
67D7
LD A,(549BH) 3A 9B 54
Load Register A with the sectors per track at 549BH.
67DA
GOSUB to 687DH to multiply: Register Pair HL = tracks x sectors per track.
67DD
LD (54A8H),HL 22 A8 54
Store Register Pair HL at 54A8H, the sectors on the drive.
67E0
POP BC C1
Restore Register Pair BC (the caller's value) from the stack.
67E1
POP DE D1
Restore Register Pair DE (the caller's value) from the stack.
67E2
POP HL E1
Restore Register Pair HL (the caller's value) from the stack.
67E3
POP AF F1
Restore Register Pair AF (the caller's value) from the stack.
67E4
RET C9
RETURN to the caller with the drive's sizes stored.

67E5H - Take a Number From the Answer

67E5H takes the last parameter (TOO MANY PARAMETERS if more follow). 67EDH takes one: ENTER gives TOO FEW PARAMETERS, a comma MISSING IMBEDDED PARAMETER (both with the CARRY FLAG). A number is decimal, or hexadecimal when it ends in H (a digit A-H after the decimal digits starts the hexadecimal reading). It must be followed by ENTER (Z FLAG) or a comma (NZ FLAG, Register Pair HL after it); X goes back to the menu; anything else returns the CARRY FLAG. The value is in Register Pair DE.

67E5
GOSUB to 67EDH to take one parameter from the answer at Register Pair HL.
67E8
RET C D8
If the CARRY FLAG is set (not valid), RETURN with it.
67E9
If the NZ FLAG is set (more follow), JUMP to 65A0H to display TOO MANY PARAMETERS and return the CARRY FLAG.
67EC
RET C9
RETURN with the Z FLAG and the value in Register Pair DE.
67ED
LD A,(HL) 7E
Load Register A with the character at Register Pair HL.
67EE
CP 0DH FE 0D
Compare Register A (the character) with 0DH (ENTER): no parameter left.
67F0
If the Z FLAG is set, JUMP to 6598H to display TOO FEW PARAMETERS and return the CARRY FLAG.
67F3
CP 2CH FE 2C
Compare Register A (the character) with 2CH (a comma): an empty parameter.
67F5
If the Z FLAG is set, JUMP to 65A5H to display MISSING IMBEDDED PARAMETER and return the CARRY FLAG.
67F8
PUSH HL E5
Save Register Pair HL (the start of the number) on the stack.
67F9
GOSUB to 6822H to read decimal digits into Register Pair DE; Register Pair HL returns at the first other character.
67FC
POP BC C1
Restore Register Pair BC (the start of the number) from the stack.
67FD
LD A,(HL) 7E
Load Register A with the character at Register Pair HL.
67FE
SUB 41H D6 41
Subtract 41H (A) from Register A, the character after the decimal digits.
6800
CP 08H FE 08
Compare Register A with 08H: the CARRY FLAG for A-H.
6802
If the NO CARRY FLAG is set, JUMP to 680FH: a decimal number.
6804
LD H,B 60
Copy Register B (the start of the number, high byte) into Register H.
6805
LD L,C 69
Copy Register C into Register L: Register Pair HL = the start again.
6806
GOSUB to 684FH to read hexadecimal digits into Register Pair DE.
6809
LD A,(HL) 7E
Load Register A with the character at Register Pair HL.
680A
CP 48H FE 48
Compare Register A (the character after the digits) with 48H (H).
680C
INC HL 23
Increment Register Pair HL past the character (INC keeps the flags).
680D
If the NZ FLAG is set (no H), JUMP to 6820H to return the CARRY FLAG.
680F
LD A,(HL) 7E
Load Register A with the character at Register Pair HL.
6810
CP 0DH FE 0D
Compare Register A (the character after the number) with 0DH (ENTER).
6812
RET Z C8
If the Z FLAG is set, RETURN: the last parameter.
6813
CP 2CH FE 2C
Compare Register A (the character after the number) with 2CH (a comma).
6815
If the NZ FLAG is set (not a comma), JUMP to 681BH.
6818
INC HL 23
Increment Register Pair HL past the comma, to the next parameter.
6819
OR A B7
OR Register A with itself: the NZ FLAG and no CARRY FLAG, more follow.
681A
RET C9
RETURN with the NZ FLAG: more parameters follow.
681B
CP 58H FE 58
Compare Register A (the character) with 58H (X), which ends the function.
681D
If the Z FLAG is set, JUMP to 54C5H, the menu.
6820
SCF 37
Set the CARRY FLAG: the parameter was not valid.
6821
RET C9
RETURN with the CARRY FLAG and Register Pair HL at the bad character.
6822
LD DE,0000H 11 00 00
Load Register Pair DE with 0000H, the decimal value being built.
6825
GOSUB to 682CH to add the next decimal digit; the CARRY FLAG at the end or on overflow.
6828
RET C D8
If the CARRY FLAG is set (no more digits), RETURN with Register Pair HL there.
6829
INC HL 23
Increment Register Pair HL to the next character.
682A
LOOP BACK to 6825H for the next decimal digit.
682C
LD A,(HL) 7E
Load Register A with the character at Register Pair HL.
682D
GOSUB to 66D5H: the CARRY FLAG for a decimal digit.
6830
CCF 3F
Complement the CARRY FLAG: now set when Register A is not a digit.
6831
RET C D8
If the CARRY FLAG is set (not a digit), RETURN.
6832
SUB 30H D6 30
Subtract 30H from Register A: the digit's value.
6834
PUSH HL E5
Save Register Pair HL (the character position) on the stack.
6835
LD H,D 62
Copy Register D (the value's high byte) into Register H.
6836
LD L,E 6B
Copy Register E into Register L: Register Pair HL = the value.
6837
EX AF,AF' 08
Exchange Register Pair AF with the alternate Register Pair AF: the digit is kept there.
6838
LD A,1FH 3E 1F
Load Register A with 1FH, the largest high byte that can be multiplied by 10.
683A
CP D BA
Compare Register A with Register D: the CARRY FLAG when the value is 2000H or more.
683B
If the CARRY FLAG is set (too big), JUMP to 684DH.
683D
EX AF,AF' 08
Exchange Register Pair AF with the alternate Register Pair AF: Register A = the digit.
683E
ADD HL,HL 29
Add Register Pair HL (the value) to itself: value x 2.
683F
ADD HL,HL 29
Add Register Pair HL to itself: value x 4 (Register Pair DE holds value x 1).
6840
ADD HL,DE 19
Add Register Pair DE (the value) to Register Pair HL (value x 4): value x 5.
6841
ADD HL,HL 29
Add Register Pair HL to itself: value x 10 (x 16 from 686BH).
6842
If the CARRY FLAG is set (overflow), JUMP to 684DH.
6844
LD E,A 5F
Copy Register A (the digit's value) into Register E, to add it.
6845
LD D,00H 16 00
Load Register D with 00H: Register Pair DE = the digit.
6847
ADD HL,DE 19
Add Register Pair DE (the digit) to Register Pair HL.
6848
If the CARRY FLAG is set (overflow), JUMP to 684DH.
684A
EX DE,HL EB
Exchange Register Pair DE and Register Pair HL: Register Pair DE = the new value.
684B
LD A,D 7A
Load Register A with Register D, the new value's high byte.
684C
OR E B3
OR Register A with Register E, clearing the CARRY FLAG.
684D
POP HL E1
Restore Register Pair HL (the character position) from the stack.
684E
RET C9
RETURN to the caller with the flags set by the digit routine.
684F
LD DE,0000H 11 00 00
Load Register Pair DE with 0000H, the hexadecimal value being built.
6852
GOSUB to 6859H to add the next hexadecimal digit.
6855
RET C D8
If the CARRY FLAG is set (no more digits), RETURN with Register Pair HL there.
6856
INC HL 23
Increment Register Pair HL to the next character.
6857
LOOP BACK to 6852H for the next hexadecimal digit.
6859
LD A,(HL) 7E
Load Register A with the character at Register Pair HL.
685A
GOSUB to 686DH: the CARRY FLAG and its value in Register A for a hexadecimal digit (also the entry from 5E21H with the key in Register A).
685D
CCF 3F
Complement the CARRY FLAG: now set when Register A is not a digit.
685E
RET C D8
If the CARRY FLAG is set (not a digit), RETURN.
685F
PUSH HL E5
Save Register Pair HL (the character position) on the stack.
6860
EX DE,HL EB
Exchange Register Pair DE and Register Pair HL: Register Pair HL = the value.
6861
EX AF,AF' 08
Exchange Register Pair AF with the alternate Register Pair AF: the digit is kept there.
6862
LD A,H 7C
Load Register A with Register H, the value's high byte.
6863
ADD A,F0H C6 F0
Add F0H to Register A: the CARRY FLAG when the value is 1000H or more.
6865
If the CARRY FLAG is set (too big), JUMP to 684DH.
6867
EX AF,AF' 08
Exchange Register Pair AF with the alternate Register Pair AF: Register A = the digit.
6868
ADD HL,HL 29
Add Register Pair HL (the value) to itself: value x 2.
6869
ADD HL,HL 29
Add Register Pair HL to itself: value x 4 on the way to x 16.
686A
ADD HL,HL 29
Add Register Pair HL to itself: value x 8 on the way to x 16.
686B
JUMP to 6841H to double Register Pair HL once more (x 16) and add the digit.
686D
SUB 30H D6 30
Subtract 30H from Register A (the character): the digits 0-9 become 0-9.
686F
CP 0AH FE 0A
Compare Register A with 0AH: the CARRY FLAG for 0-9.
6871
RET C D8
If the CARRY FLAG is set (0-9), RETURN with it.
6872
SUB 11H D6 11
Subtract 11H from Register A: the letter A becomes 0.
6874
CP 06H FE 06
Compare Register A with 06H: the CARRY FLAG for A-F.
6876
RET NC D0
If the NO CARRY FLAG is set (not A-F), RETURN.
6877
ADD A,0AH C6 0A
Add 0AH to Register A: the letters A-F become the values 10-15.
6879
SCF 37
Set the CARRY FLAG: Register A holds a hexadecimal digit.
687A
RET C9
RETURN with the digit's value in Register A and the CARRY FLAG.

687BH - Multiply and Divide

687BH multiplies Register L by Register A, 687DH Register Pair HL by Register A; the product is in Register Pair HL, Register Pair DE and Register Pair BC are kept. 6896H divides Register Pair HL by Register A: the quotient in Register Pair HL, the remainder in Register A.

687B
LD H,00H 26 00
Load Register H with 00H: Register Pair HL = Register L.
687D
PUSH DE D5
Save Register Pair DE (the caller's value) on the stack.
687E
PUSH BC C5
Save Register Pair BC (the caller's value) on the stack.
687F
EX DE,HL EB
Exchange Register Pair DE and Register Pair HL: Register Pair DE = the multiplicand.
6880
LD C,80H 0E 80
Load Register C with 80H, a marker bit that ends the loop after eight steps.
6882
LD HL,0000H 21 00 00
Load Register Pair HL with 0000H, the product's high part.
6885
RRCA 0F
Rotate Register A right: the next multiplier bit goes to the CARRY FLAG.
6886
If the NO CARRY FLAG is set (bit clear), JUMP to 6889H.
6888
ADD HL,DE 19
Add Register Pair DE (the multiplicand) to Register Pair HL.
6889
SRL H CB 3C
Shift Register H (the product's high part) right.
688B
RR L CB 1D
Rotate Register L right: the bit leaves into the CARRY FLAG.
688D
RR C CB 19
Rotate Register C right: it takes the bit; the marker leaves at the eighth step.
688F
If the NO CARRY FLAG is set, LOOP BACK to 6885H.
6891
LD H,L 65
Copy Register L (the product's high byte) into Register H.
6892
LD L,C 69
Copy Register C into Register L: Register Pair HL = the product.
6893
POP BC C1
Restore Register Pair BC (the caller's value) from the stack.
6894
POP DE D1
Restore Register Pair DE (the caller's value) from the stack.
6895
RET C9
RETURN with the product in Register Pair HL; Register Pair DE and Register Pair BC kept.
6896
LD C,A 4F
Copy Register A (the divisor) into Register C.
6897
LD B,10H 06 10
Load Register B with 10H, the 16 bits of the dividend.
6899
XOR A AF
Set Register A to 00H (XOR A with itself), the remainder.
689A
ADD HL,HL 29
Add Register Pair HL to itself: the next dividend bit goes to the CARRY FLAG.
689B
RLA 17
Rotate Register A left through the CARRY FLAG: the bit enters the remainder.
689C
If the CARRY FLAG is set (the remainder passed 255), JUMP to 68A1H.
689E
CP C B9
Compare Register A with Register C (the divisor).
689F
If the CARRY FLAG is set (smaller), JUMP to 68A3H.
68A1
SUB C 91
Subtract Register C (the divisor) from Register A, the remainder.
68A2
INC L 2C
Increment Register L: the quotient gets a bit of 1 in its lowest place.
68A3
Decrement Register B and LOOP BACK to 689AH for the next bit.
68A5
RET C9
RETURN with the quotient in Register Pair HL, the remainder in Register A.

68A6H - Decimal Numbers

68AFH writes Register Pair DE as five decimal digits at 5487H-548BH (68D1H), replaces leading zeros by spaces and returns Register Pair HL = the first digit shown, Register B = the digits from there, Register Pair DE = the caller's Register Pair HL. 68A6H takes Register A and 68A7H Register E as the number; 68ABH (called by no instruction) the word at Register Pair HL; 68C5H (called by no instruction) outputs the five digits; 68D0H (called by no instruction) takes the number in Register Pair HL.

68A6
LD E,A 5F
Copy Register A into Register E (an entry no instruction calls).
68A7
LD D,00H 16 00
Load Register D with 00H: Register Pair DE = Register E.
68A9
JUMP to 68AFH to write Register Pair DE in decimal.
68AB
LD E,(HL) 5E
Load Register E with the low byte at Register Pair HL.
68AC
INC HL 23
Increment Register Pair HL to the high byte of the word.
68AD
LD D,(HL) 56
Load Register D with the high byte at Register Pair HL.
68AE
INC HL 23
Increment Register Pair HL past the word, the caller's next item.
68AF
PUSH HL E5
Save Register Pair HL (the caller's value) on the stack.
68B0
GOSUB to 68D1H to write Register Pair DE as five digits at 5487H.
68B3
LD B,04H 06 04
Load Register B with 04H, the digits that may be leading zeros.
68B5
LD HL,5487H 21 87 54
Load Register Pair HL with 5487H, the first digit.
68B8
LD A,30H 3E 30
Load Register A with 30H, the digit 0 to compare with.
68BA
CP (HL) BE
Compare Register A with the digit at Register Pair HL.
68BB
If the NZ FLAG is set (a digit not 0), JUMP to 68C2H.
68BD
LD (HL),20H 36 20
Store 20H (space) at Register Pair HL in place of the leading zero.
68BF
INC HL 23
Increment Register Pair HL to the next digit.
68C0
Decrement Register B and LOOP BACK to 68BAH for the next leading digit.
68C2
INC B 04
Increment Register B: the digits from Register Pair HL to the end.
68C3
POP DE D1
Restore Register Pair DE (the caller's Register Pair HL) from the stack.
68C4
RET C9
RETURN with Register Pair HL at the first digit and Register B the digits.
68C5
GOSUB to 68D1H to write the five digits (68C5H-68CFH is called by no instruction).
68C8
LD B,05H 06 05
Load Register B with 05H, the five digits of the number.
68CA
LD HL,5487H 21 87 54
Load Register Pair HL with 5487H, the first of the five digits.
68CD
JUMP to 62BAH to output the five digits and return.
68D0
EX DE,HL EB
Exchange Register Pair DE and Register Pair HL: the number into Register Pair DE.
68D1
LD BC,5487H 01 87 54
Load Register Pair BC with 5487H, where the digits go.
68D4
LD HL,68F6H 21 F6 68
Load Register Pair HL with 68F6H, the table of negative powers of ten.
68D7
LD A,04H 3E 04
Load Register A with 04H, the four table entries.
68D9
EX AF,AF' 08
Exchange Register Pair AF with the alternate Register Pair AF: the count is kept there.
68DA
PUSH BC C5
Save Register Pair BC (the digit position) on the stack.
68DB
LD C,(HL) 4E
Load Register C with the low byte at Register Pair HL.
68DC
INC HL 23
Increment Register Pair HL to the high byte of the table entry.
68DD
LD B,(HL) 46
Load Register B with the high byte at Register Pair HL: Register Pair BC = minus the power of ten.
68DE
INC HL 23
Increment Register Pair HL to the next entry.
68DF
EX DE,HL EB
Exchange Register Pair DE and Register Pair HL: Register Pair HL = the number, Register Pair DE = the table position.
68E0
LD A,2FH 3E 2F
Load Register A with 2FH, one below the digit 0.
68E2
INC A 3C
Increment Register A, the digit (from 30H, the digit 0).
68E3
ADD HL,BC 09
Add Register Pair BC to Register Pair HL: subtract the power of ten.
68E4
If the CARRY FLAG is set (not below zero), LOOP BACK to 68E2H.
68E7
SBC HL,BC ED 42
Subtract Register Pair BC from Register Pair HL: add the power back.
68E9
EX DE,HL EB
Exchange Register Pair DE and Register Pair HL: Register Pair DE = the rest of the number.
68EA
POP BC C1
Restore Register Pair BC (the digit position) from the stack.
68EB
LD (BC),A 02
Store Register A (the digit) at Register Pair BC.
68EC
INC BC 03
Increment Register Pair BC to the place of the next digit.
68ED
EX AF,AF' 08
Exchange Register Pair AF with the alternate Register Pair AF: Register A = the count.
68EE
DEC A 3D
Decrement Register A, the table entries left.
68EF
If the NZ FLAG is set, LOOP BACK to 68D9H for the next power of ten.
68F1
LD A,E 7B
Load Register A with Register E, the units left of the number.
68F2
ADD A,30H C6 30
Add 30H to Register A: the ASCII character of the units digit.
68F4
LD (BC),A 02
Store Register A at Register Pair BC, the fifth digit.
68F5
RET C9
RETURN to the caller with the five digits at 5487H-548BH.

68F6H - Powers of Ten and Display Labels

Data. 68F6H holds minus 10000, 1000, 100 and 10 for the decimal conversion at 68D1H. 68FEH-690CH are the three-letter labels the display shows at the left (60ECH).

68F6-68F7
DEFW 0D8F0H F0 D8
Minus 10000 (D8F0H), subtracted repeatedly by 68E3H to find one decimal digit of the number.
68F8-68F9
DEFW 0FC18H 18 FC
Minus 1000 (FC18H), subtracted repeatedly by 68E3H to find one decimal digit of the number.
68FA-68FB
DEFW 0FF9CH 9C FF
Minus 100 (FF9CH), subtracted repeatedly by 68E3H to find one decimal digit of the number.
68FC-68FD
DEFW 0FFF6H F6 FF
Minus 10 (FFF6H), subtracted repeatedly by 68E3H to find one decimal digit of the number.
68FE-6900
DEFM "DRV" 44 52 56
The label DRV, shown at the left of the page above the drive number, rows 0-2 (6032H).
6901-6903
DEFM "TRK" 54 52 4B
The label TRK, shown at the left of the page above the track, row 8 (60CEH).
6904-6906
DEFM "TRS" 54 52 53
The label TRS, shown at the left of the page above the sector within the track, row 12 (60DBH).
6907-6909
DEFM "DRS" 44 52 53
The label DRS, shown at the left of the page above the relative sector within the drive, row 4 (60AFH).
690A-690C
DEFM "FRS" 46 52 53
The label FRS, shown at the left of the page above the relative sector within the file, row 12 (60B5H).

690DH - Command Table

Data, searched by 54EDH. Each entry is the command name, the flags byte (bit 7 set, which ends the name; the rest goes to 5491H), the second flags byte (to 5492H) and the handler address. A 00H in place of a name ends the table.

690D-6912
DEFM "DD" / DEFB 81H, 00H / DEFW 5584H 44 44 81 00 84 55
Command DD, display a disk sector: flags 01H (bit 0: ,P allowed), second flags 00H, handler 5584H.
6913-6918
DEFM "DM" / DEFB 0A1H, 00H / DEFW 564FH 44 4D A1 00 4F 56
Command DM, display main memory: flags 21H (bit 0: ,P allowed), second flags 00H, handler 564FH.
6919-691F
DEFM "DFS" / DEFB 0C1H, 00H / DEFW 55CAH 44 46 53 C1 00 CA 55
Command DFS, display a file's sector: flags 41H (bit 0: ,P allowed), second flags 00H, handler 55CAH.
6920-6926
DEFM "DTS" / DEFB 91H, 00H / DEFW 5545H 44 54 53 91 00 45 55
Command DTS, display a track's sector: flags 11H (bit 0: ,P allowed), second flags 00H, handler 5545H.
6927-692E
DEFM "DMDB" / DEFB 89H, 00H / DEFW 55CAH 44 4D 44 42 89 00 CA 55
Command DMDB, display a memory dump block: flags 09H (bit 0: ,P allowed), second flags 00H, handler 55CAH.
692F-6935
DEFM "VDS" / DEFB 80H, 80H / DEFW 5BA6H 56 44 53 80 80 A6 5B
Command VDS, verify disk sectors: flags 00H (no ,P), second flags 80H, handler 5BA6H.
6936-693C
DEFM "ZDS" / DEFB 80H, 40H / DEFW 5B9EH 5A 44 53 80 40 9E 5B
Command ZDS, zero disk sectors: flags 00H (no ,P), second flags 40H, handler 5B9EH.
693D-6943
DEFM "CDS" / DEFB 80H, 20H / DEFW 5B4DH 43 44 53 80 20 4D 5B
Command CDS, copy disk sectors: flags 00H (no ,P), second flags 20H, handler 5B4DH.
6944-694A
DEFM "CDD" / DEFB 80H, 10H / DEFW 59E0H 43 44 44 80 10 E0 59
Command CDD, copy disk data: flags 00H (no ,P), second flags 10H, handler 59E0H.
694B-6952
DEFM "DPWE" / DEFB 80H, 00H / DEFW 5E49H 44 50 57 45 80 00 49 5E
Command DPWE, display a password encode: flags 00H (no ,P), second flags 00H, handler 5E49H.
6953-695A
DEFM "DNTH" / DEFB 80H, 00H / DEFW 5EA0H 44 4E 54 48 80 00 A0 5E
Command DNTH, display a name and type hash code: flags 00H (no ,P), second flags 00H, handler 5EA0H.
695B-6961
DEFM "RRT" / DEFB 80H, 08H / DEFW 5EDFH 52 52 54 80 08 DF 5E
Command RRT, read a raw track into memory from 7000H (not in the menu): flags 00H (no ,P), second flags 08H, handler 5EDFH.
6962-6969
DEFM "EXIT" / DEFB 80H, 00H / DEFW 581BH 45 58 49 54 80 00 1B 58
Command EXIT, end SUPERZAP: flags 00H (no ,P), second flags 00H, handler 581BH.
696A
DEFB 00H 00
The 00H in place of a command name that ends the command table: an answer that matched nothing goes back to the menu (5509H).

696BH - Word List 1

Data, read by the message routine 6255H. 696BH is a byte with bit 7 set that the search for word 1 passes over; then each word ends with a byte with bit 7 set, and a 00H ends the list. Message bytes 60H-96H stand for these words in order.

696B
DEFB 80H 80
The byte with bit 7 set before the first word: 6279H passes one such end for word 1, two for word 2, and so on. It is also the byte after the command table.
696C-696E
DEFM " -", 0A0H 20 2D A0
Word 60H of word list 1, the text a message byte 60H stands for: a space, a minus sign and a space.
696F-6971
DEFM "'", 2AH, 0A7H 27 2A A7
Word 61H of word list 1, the text a message byte 61H stands for: an asterisk in single quotes.
6972-6974
DEFM "'R", 0A7H 27 52 A7
Word 62H of word list 1, the text a message byte 62H stands for: R in single quotes.
6975-6977
DEFM "'S", 0A7H 27 53 A7
Word 63H of word list 1, the text a message byte 63H stands for: S in single quotes.
6978-697A
DEFM "'X", 0A7H 27 58 A7
Word 64H of word list 1, the text a message byte 64H stands for: X in single quotes.
697B-697D
DEFM "'Y", 0A7H 27 59 A7
Word 65H of word list 1, the text a message byte 65H stands for: Y in single quotes.
697E-6986
DEFM "(Y OR N)", 0A0H 28 59 20 4F 52 20 4E 29 A0
Word 66H of word list 1, the text a message byte 66H stands for: (Y OR N) and a space.
6987-698B
DEFM 08H, "???", 0A0H 08 3F 3F 3F A0
Word 67H of word list 1, the text a message byte 67H stands for: three question marks and a space, with 08H first so no space comes before it.
698C-6992
DEFM 2AH x 6, 0AAH 2A 2A 2A 2A 2A 2A AA
Word 68H of word list 1, the text a message byte 68H stands for: seven asterisks.
6993-6999
DEFM "'ENTER", 0A7H 27 45 4E 54 45 52 A7
Word 69H of word list 1, the text a message byte 69H stands for: ENTER in single quotes.
699A-699C
DEFM 08H, ".", 0A0H 08 2E A0
Word 6AH of word list 1, the text a message byte 6AH stands for: a period and a space, with 08H first.
699D-699F
DEFM 08H, "'", 0D3H 08 27 D3
Word 6BH of word list 1, the text a message byte 6BH stands for: an apostrophe and S, with 08H first (the possessive).
69A0-69A5
DEFM 08H, "' -", 0A0H 08 27 20 20 2D A0
Word 6CH of word list 1, the text a message byte 6CH stands for: a quote, two spaces, a minus sign and a space, with 08H first.
69A6
DEFM 0A0H A0
Word 6DH of word list 1, the text a message byte 6DH stands for: one space.
69A7-69A9
DEFM 08H, "?", 0A0H 08 3F A0
Word 6EH of word list 1, the text a message byte 6EH stands for: a question mark and a space, with 08H first.
69AA-69AD
DEFM 08H, "? ", 0A0H 08 3F 20 A0
Word 6FH of word list 1, the text a message byte 6FH stands for: a question mark and two spaces, with 08H first.
69AE-69AF
DEFM "(", 88H 28 88
Word 70H of word list 1, the text a message byte 70H stands for: an opening parenthesis, with 08H last so the next word follows it directly.
69B0-69B1
DEFM 08H, 0A9H 08 A9
Word 71H of word list 1, the text a message byte 71H stands for: a closing parenthesis, with 08H first.
69B2-69B4
DEFM 1CH, 1FH, 88H 1C 1F 88
Word 72H of word list 1, the text a message byte 72H stands for: the codes 1CH and 1FH (home, clear to the end of the frame) and 08H last: the message starts on a cleared screen.
69B5-69B8
DEFM 08H, "(S", 0A9H 08 28 53 A9
Word 73H of word list 1, the text a message byte 73H stands for: (S), with 08H first.
69B9-69BB
DEFM 08H, "/", 88H 08 2F 88
Word 74H of word list 1, the text a message byte 74H stands for: a slash, with 08H first and last, so it joins two words.
69BC
DEFM 0A3H A3
Word 75H of word list 1, the text a message byte 75H stands for: the number sign.
69BD-69BE
DEFM "A", 0D4H 41 D4
Word 76H of word list 1, the text a message byte 76H stands for: AT.
69BF-69C0
DEFM "B", 0C5H 42 C5
Word 77H of word list 1, the text a message byte 77H stands for: BE.
69C1-69C2
DEFM "D", 0CFH 44 CF
Word 78H of word list 1, the text a message byte 78H stands for: DO.
69C3-69C4
DEFM "I", 0C6H 49 C6
Word 79H of word list 1, the text a message byte 79H stands for: IF.
69C5-69C6
DEFM "I", 0D3H 49 D3
Word 7AH of word list 1, the text a message byte 7AH stands for: IS.
69C7-69C8
DEFM "O", 0C6H 4F C6
Word 7BH of word list 1, the text a message byte 7BH stands for: OF.
69C9-69CA
DEFM "O", 0CBH 4F CB
Word 7CH of word list 1, the text a message byte 7CH stands for: OK.
69CB-69CC
DEFM "O", 0D2H 4F D2
Word 7DH of word list 1, the text a message byte 7DH stands for: OR.
69CD-69CE
DEFM "T", 0CFH 54 CF
Word 7EH of word list 1, the text a message byte 7EH stands for: TO.
69CF-69D1
DEFM "AL", 0CCH 41 4C CC
Word 7FH of word list 1, the text a message byte 7FH stands for: ALL.
69D2-69D4
DEFM "AN", 0C4H 41 4E C4
Word 80H of word list 1, the text a message byte 80H stands for: AND.
69D5-69D7
DEFM "BA", 0C4H 42 41 C4
Word 81H of word list 1, the text a message byte 81H stands for: BAD.
69D8-69DA
DEFM "EN", 0C4H 45 4E C4
Word 82H of word list 1, the text a message byte 82H stands for: END.
69DB-69DD
DEFM "EO", 0C6H 45 4F C6
Word 83H of word list 1, the text a message byte 83H stands for: EOF.
69DE-69E0
DEFM "FE", 0D7H 46 45 D7
Word 84H of word list 1, the text a message byte 84H stands for: FEW.
69E1-69E3
DEFM "FO", 0D2H 46 4F D2
Word 85H of word list 1, the text a message byte 85H stands for: FOR.
69E4-69E6
DEFM "MA", 0D9H 4D 41 D9
Word 86H of word list 1, the text a message byte 86H stands for: MAY.
69E7-69E9
DEFM "NO", 0D4H 4E 4F D4
Word 87H of word list 1, the text a message byte 87H stands for: NOT.
69EA-69EC
DEFM "OU", 0D4H 4F 55 D4
Word 88H of word list 1, the text a message byte 88H stands for: OUT.
69ED-69EF
DEFM "TH", 0C5H 54 48 C5
Word 89H of word list 1, the text a message byte 89H stands for: THE.
69F0-69F2
DEFM "TO", 0CFH 54 4F CF
Word 8AH of word list 1, the text a message byte 8AH stands for: TOO.
69F3-69F5
DEFM "YO", 0D5H 59 4F D5
Word 8BH of word list 1, the text a message byte 8BH stands for: YOU.
69F6-69F9
DEFM "BAS", 0C5H 42 41 53 C5
Word 8CH of word list 1, the text a message byte 8CH stands for: BASE.
69FA-69FD
DEFM "BYT", 0C5H 42 59 54 C5
Word 8DH of word list 1, the text a message byte 8DH stands for: BYTE.
69FE-6A01
DEFM "CHA", 0D2H 43 48 41 D2
Word 8EH of word list 1, the text a message byte 8EH stands for: CHAR.
6A02-6A05
DEFM "COD", 0C5H 43 4F 44 C5
Word 8FH of word list 1, the text a message byte 8FH stands for: CODE.
6A06-6A09
DEFM "COP", 0D9H 43 4F 50 D9
Word 90H of word list 1, the text a message byte 90H stands for: COPY.
6A0A-6A0D
DEFM "DAT", 0C1H 44 41 54 C1
Word 91H of word list 1, the text a message byte 91H stands for: DATA.
6A0E-6A11
DEFM "DIS", 0CBH 44 49 53 CB
Word 92H of word list 1, the text a message byte 92H stands for: DISK.
6A12-6A15
DEFM "DUM", 0D0H 44 55 4D D0
Word 93H of word list 1, the text a message byte 93H stands for: DUMP.
6A16-6A19
DEFM "EXI", 0D4H 45 58 49 D4
Word 94H of word list 1, the text a message byte 94H stands for: EXIT.
6A1A-6A1D
DEFM "FIL", 0C5H 46 49 4C C5
Word 95H of word list 1, the text a message byte 95H stands for: FILE.
6A1E-6A21
DEFM "LOS", 0D4H 4C 4F 53 D4
Word 96H of word list 1, the text a message byte 96H stands for: LOST.
6A22
DEFB 00H 00
The 00H that ends word list 1; a word number past the end outputs nothing (6280H).

6A23H - Word List 2

Data, read by the message routine 6255H. 6A23H is a byte with bit 7 set that the search for word 1 passes over; then each word ends with a byte with bit 7 set, and a 00H ends the list. Message bytes 97H-DDH stand for these words in order.

6A23
DEFB 80H 80
The byte with bit 7 set before the first word: 6279H passes one such end for word 1, two for word 2, and so on.
6A24-6A27
DEFM "MAI", 0CEH 4D 41 49 CE
Word 97H of word list 2, the text a message byte 97H stands for: MAIN.
6A28-6A2B
DEFM "MAN", 0D9H 4D 41 4E D9
Word 98H of word list 2, the text a message byte 98H stands for: MANY.
6A2C-6A2F
DEFM "MEN", 0D5H 4D 45 4E D5
Word 99H of word list 2, the text a message byte 99H stands for: MENU.
6A30-6A33
DEFM "MOD", 0C5H 4D 4F 44 C5
Word 9AH of word list 2, the text a message byte 9AH stands for: MODE.
6A34-6A37
DEFM "NAM", 0C5H 4E 41 4D C5
Word 9BH of word list 2, the text a message byte 9BH stands for: NAME.
6A38-6A3B
DEFM "REA", 0C4H 52 45 41 C4
Word 9CH of word list 2, the text a message byte 9CH stands for: READ.
6A3C-6A3F
DEFM "SEE", 0CBH 53 45 45 CB
Word 9DH of word list 2, the text a message byte 9DH stands for: SEEK.
6A40-6A43
DEFM "SKI", 0D0H 53 4B 49 D0
Word 9EH of word list 2, the text a message byte 9EH stands for: SKIP.
6A44-6A47
DEFM "SOM", 0C5H 53 4F 4D C5
Word 9FH of word list 2, the text a message byte 9FH stands for: SOME.
6A48-6A4B
DEFM "SUR", 0C5H 53 55 52 C5
Word A0H of word list 2, the text a message byte A0H stands for: SURE.
6A4C-6A4F
DEFM "THI", 0D3H 54 48 49 D3
Word A1H of word list 2, the text a message byte A1H stands for: THIS.
6A50-6A53
DEFM "TYP", 0C5H 54 59 50 C5
Word A2H of word list 2, the text a message byte A2H stands for: TYPE.
6A54-6A57
DEFM "WAN", 0D4H 57 41 4E D4
Word A3H of word list 2, the text a message byte A3H stands for: WANT.
6A58-6A5B
DEFM "WHE", 0CEH 57 48 45 CE
Word A4H of word list 2, the text a message byte A4H stands for: WHEN.
6A5C-6A5F
DEFM "ZER", 0CFH 5A 45 52 CF
Word A5H of word list 2, the text a message byte A5H stands for: ZERO.
6A60-6A64
DEFM "BLOC", 0CBH 42 4C 4F 43 CB
Word A6H of word list 2, the text a message byte A6H stands for: BLOCK.
6A65-6A69
DEFM "COUN", 0D4H 43 4F 55 4E D4
Word A7H of word list 2, the text a message byte A7H stands for: COUNT.
6A6A-6A6E
DEFM "DRIV", 0C5H 44 52 49 56 C5
Word A8H of word list 2, the text a message byte A8H stands for: DRIVE.
6A6F-6A73
DEFM "ERRO", 0D2H 45 52 52 4F D2
Word A9H of word list 2, the text a message byte A9H stands for: ERROR.
6A74-6A78
DEFM "EXTR", 0C1H 45 58 54 52 C1
Word AAH of word list 2, the text a message byte AAH stands for: EXTRA.
6A79-6A7D
DEFM "FAUL", 0D4H 46 41 55 4C D4
Word ABH of word list 2, the text a message byte ABH stands for: FAULT.
6A7E-6A82
DEFM "FOUN", 0C4H 46 4F 55 4E C4
Word ACH of word list 2, the text a message byte ACH stands for: FOUND.
6A83-6A87
DEFM "INPU", 0D4H 49 4E 50 55 D4
Word ADH of word list 2, the text a message byte ADH stands for: INPUT.
6A88-6A8C
DEFM "PAUS", 0C5H 50 41 55 53 C5
Word AEH of word list 2, the text a message byte AEH stands for: PAUSE.
6A8D-6A91
DEFM "PRES", 0D3H 50 52 45 53 D3
Word AFH of word list 2, the text a message byte AFH stands for: PRESS.
6A92-6A96
DEFM "RANG", 0C5H 52 41 4E 47 C5
Word B0H of word list 2, the text a message byte B0H stands for: RANGE.
6A97-6A9B
DEFM "REPL", 0D9H 52 45 50 4C D9
Word B1H of word list 2, the text a message byte B1H stands for: REPLY.
6A9C-6AA0
DEFM "RETR", 0D9H 52 45 54 52 D9
Word B2H of word list 2, the text a message byte B2H stands for: RETRY.
6AA1-6AA5
DEFM "TRAC", 0CBH 54 52 41 43 CB
Word B3H of word list 2, the text a message byte B3H stands for: TRACK.
6AA6-6AAA
DEFM "VALU", 0C5H 56 41 4C 55 C5
Word B4H of word list 2, the text a message byte B4H stands for: VALUE.
6AAB-6AAF
DEFM "WRIT", 0C5H 57 52 49 54 C5
Word B5H of word list 2, the text a message byte B5H stands for: WRITE.
6AB0-6AB5
DEFM "BEYON", 0C4H 42 45 59 4F 4E C4
Word B6H of word list 2, the text a message byte B6H stands for: BEYOND.
6AB6-6ABB
DEFM "BUFFE", 0D2H 42 55 46 46 45 D2
Word B7H of word list 2, the text a message byte B7H stands for: BUFFER.
6ABC-6AC1
DEFM "DEVIC", 0C5H 44 45 56 49 43 C5
Word B8H of word list 2, the text a message byte B8H stands for: DEVICE.
6AC2-6AC7
DEFM "MEMOR", 0D9H 4D 45 4D 4F 52 D9
Word B9H of word list 2, the text a message byte B9H stands for: MEMORY.
6AC8-6ACD
DEFM "OFFSE", 0D4H 4F 46 46 53 45 D4
Word BAH of word list 2, the text a message byte BAH stands for: OFFSET.
6ACE-6AD3
DEFM "PARIT", 0D9H 50 41 52 49 54 D9
Word BBH of word list 2, the text a message byte BBH stands for: PARITY.
6AD4-6AD9
DEFM "RECOR", 0C4H 52 45 43 4F 52 C4
Word BCH of word list 2, the text a message byte BCH stands for: RECORD.
6ADA-6ADF
DEFM "RETUR", 0CEH 52 45 54 55 52 CE
Word BDH of word list 2, the text a message byte BDH stands for: RETURN.
6AE0-6AE5
DEFM "SECTO", 0D2H 53 45 43 54 4F D2
Word BEH of word list 2, the text a message byte BEH stands for: SECTOR.
6AE6-6AEB
DEFM "SOURC", 0C5H 53 4F 55 52 43 C5
Word BFH of word list 2, the text a message byte BFH stands for: SOURCE.
6AEC-6AF1
DEFM "SYSTE", 0CDH 53 59 53 54 45 CD
Word C0H of word list 2, the text a message byte C0H stands for: SYSTEM.
6AF2-6AF7
DEFM "VERIF", 0D9H 56 45 52 49 46 D9
Word C1H of word list 2, the text a message byte C1H stands for: VERIFY.
6AF8-6AFD
DEFM "WITHI", 0CEH 57 49 54 48 49 CE
Word C2H of word list 2, the text a message byte C2H stands for: WITHIN.
6AFE-6B04
DEFM "ADDRES", 0D3H 41 44 44 52 45 53 D3
Word C3H of word list 2, the text a message byte C3H stands for: ADDRESS.
6B05-6B0B
DEFM "CONTAI", 0CEH 43 4F 4E 54 41 49 CE
Word C4H of word list 2, the text a message byte C4H stands for: CONTAIN.
6B0C-6B12
DEFM "DISPLA", 0D9H 44 49 53 50 4C 41 D9
Word C5H of word list 2, the text a message byte C5H stands for: DISPLAY.
6B13-6B19
DEFM "ILLEGA", 0CCH 49 4C 4C 45 47 41 CC
Word C6H of word list 2, the text a message byte C6H stands for: ILLEGAL.
6B1A-6B20
DEFM "INVALI", 0C4H 49 4E 56 41 4C 49 C4
Word C7H of word list 2, the text a message byte C7H stands for: INVALID.
6B21-6B27
DEFM "MISSIN", 0C7H 4D 49 53 53 49 4E C7
Word C8H of word list 2, the text a message byte C8H stands for: MISSING.
6B28-6B2E
DEFM "NUMERI", 0C3H 4E 55 4D 45 52 49 C3
Word C9H of word list 2, the text a message byte C9H stands for: NUMERIC.
6B2F-6B35
DEFM "PRINTE", 0D2H 50 52 49 4E 54 45 D2
Word CAH of word list 2, the text a message byte CAH stands for: PRINTER.
6B36-6B3C
DEFM "REQUES", 0D4H 52 45 51 55 45 53 D4
Word CBH of word list 2, the text a message byte CBH stands for: REQUEST.
6B3D-6B44
DEFM "CONTENT", 0D3H 43 4F 4E 54 45 4E 54 D3
Word CCH of word list 2, the text a message byte CCH stands for: CONTENTS.
6B45-6B4C
DEFM "CONTINU", 0C5H 43 4F 4E 54 49 4E 55 C5
Word CDH of word list 2, the text a message byte CDH stands for: CONTINUE.
6B4D-6B54
DEFM "DISKETT", 0C5H 44 49 53 4B 45 54 54 C5
Word CEH of word list 2, the text a message byte CEH stands for: DISKETTE.
6B55-6B5C
DEFM "FILESPE", 0C3H 46 49 4C 45 53 50 45 C3
Word CFH of word list 2, the text a message byte CFH stands for: FILESPEC.
6B5D-6B64
DEFM "FUNCTIO", 0CEH 46 55 4E 43 54 49 4F CE
Word D0H of word list 2, the text a message byte D0H stands for: FUNCTION.
6B65-6B6C
DEFM "OPERATO", 0D2H 4F 50 45 52 41 54 4F D2
Word D1H of word list 2, the text a message byte D1H stands for: OPERATOR.
6B6D-6B74
DEFM "PASSWOR", 0C4H 50 41 53 53 57 4F 52 C4
Word D2H of word list 2, the text a message byte D2H stands for: PASSWORD.
6B75-6B7C
DEFM "RELATIV", 0C5H 52 45 4C 41 54 49 56 C5
Word D3H of word list 2, the text a message byte D3H stands for: RELATIVE.
6B7D-6B84
DEFM "SUPERZA", 0D0H 53 55 50 45 52 5A 41 D0
Word D4H of word list 2, the text a message byte D4H stands for: SUPERZAP.
6B85-6B8D
DEFM "AVAILABL", 0C5H 41 56 41 49 4C 41 42 4C C5
Word D5H of word list 2, the text a message byte D5H stands for: AVAILABLE.
6B8E-6B96
DEFM "COMPLETE", 0C4H 43 4F 4D 50 4C 45 54 45 C4
Word D6H of word list 2, the text a message byte D6H stands for: COMPLETED.
6B97-6B9F
DEFM "PARAMETE", 0D2H 50 41 52 41 4D 45 54 45 D2
Word D7H of word list 2, the text a message byte D7H stands for: PARAMETER.
6BA0-6BA8
DEFM "PROTECTE", 0C4H 50 52 4F 54 45 43 54 45 C4
Word D8H of word list 2, the text a message byte D8H stands for: PROTECTED.
6BA9-6BB1
DEFM "TERMINAT", 0C5H 54 45 52 4D 49 4E 41 54 C5
Word D9H of word list 2, the text a message byte D9H stands for: TERMINATE.
6BB2-6BBC
DEFM "BAD/ILLEGA", 0CCH 42 41 44 2F 49 4C 4C 45 47 41 CC
Word DAH of word list 2, the text a message byte DAH stands for: BAD/ILLEGAL.
6BBD-6BC7
DEFM "DESTINATIO", 0CEH 44 45 53 54 49 4E 41 54 49 4F CE
Word DBH of word list 2, the text a message byte DBH stands for: DESTINATION.
6BC8-6BD3
DEFM "MODIFICATIO", 0CEH 4D 4F 44 49 46 49 43 41 54 49 4F CE
Word DCH of word list 2, the text a message byte DCH stands for: MODIFICATION.
6BD4-6BEB
DEFM "RELATIVE-SECTOR-WITHIN-", 88H 52 45 4C 41 54 49 56 45 2D 53 45 43 54 4F 52 2D 57 49 54 48 49 4E 2D 88
Word DDH of word list 2, the text a message byte DDH stands for: RELATIVE-SECTOR-WITHIN- with 08H last, so the next word follows the hyphen directly.
6BEC
DEFB 00H 00
The 00H that ends word list 2; a word number past the end outputs nothing (6280H).

6BEDH - Disk Error Table

Data, searched by 64FAH. Each group is the error codes it covers, 00H, and the message (ended by 03H); a 00H in place of the first code ends the table. Codes not in the table are reported by the DOS (DFS, DMDB) or as SYSTEM ERROR CODE n.

6BED-6BF2
DEFB 02H, 0AH / DEFB 00H / DEFM 9DH, 0A9H, 03H 02 0A 00 9D A9 03
Error 02H and 0AH: the text SEEK ERROR, shown under the location and the SECTOR READ, WRITE or VERIFY ERROR line.
6BF3-6BF8
DEFB 03H, 0BH / DEFB 00H / DEFM 96H, 91H, 03H 03 0B 00 96 91 03
Error 03H and 0BH: the text LOST DATA, shown under the location and the SECTOR READ, WRITE or VERIFY ERROR line.
6BF9-6BFE
DEFB 04H, 0CH / DEFB 00H / DEFM 0BBH, 0A9H, 03H 04 0C 00 BB A9 03
Error 04H and 0CH: the text PARITY ERROR, shown under the location and the SECTOR READ, WRITE or VERIFY ERROR line.
6BFF-6C06
DEFB 05H, 0DH / DEFB 00H / DEFM 91H, 0BCH, 87H, 0ACH, 03H 05 0D 00 91 BC 87 AC 03
Error 05H and 0DH: the text DATA RECORD NOT FOUND, shown under the location and the SECTOR READ, WRITE or VERIFY ERROR line.
6C07-6C0D
DEFB 08H, 10H / DEFB 00H / DEFM 0B8H, 87H, 0D5H, 03H 08 10 00 B8 87 D5 03
Error 08H and 10H: the text DEVICE NOT AVAILABLE, shown under the location and the SECTOR READ, WRITE or VERIFY ERROR line.
6C0E-6C13
DEFB 0EH / DEFB 00H / DEFM 0A8H, 0B5H, 0ABH, 03H 0E 00 A8 B5 AB 03
Error 0EH: the text DRIVE WRITE FAULT, shown under the location and the SECTOR READ, WRITE or VERIFY ERROR line.
6C14-6C19
DEFB 0FH / DEFB 00H / DEFM 0B5H, 0D8H, 0CEH, 03H 0F 00 B5 D8 CE 03
Error 0FH: the text WRITE PROTECTED DISKETTE, shown under the location and the SECTOR READ, WRITE or VERIFY ERROR line.
6C1A-6C25
DEFB 1CH, 1DH / DEFB 00H / DEFM 76H, 74H, 0B6H, 82H, 7BH, 0CEH, 74H, 95H, 03H 1C 1D 00 76 74 B6 82 7B CE 74 95 03
Error 1CH and 1DH: the text AT/ BEYOND END OF DISKETTE/ FILE, shown under the location and the SECTOR READ, WRITE or VERIFY ERROR line.
6C26-6C2B
DEFB 20H / DEFB 00H / DEFM 0C6H, 0A8H, 75H, 03H 20 00 C6 A8 75 03
Error 20H: the text ILLEGAL DRIVE #, shown under the location and the SECTOR READ, WRITE or VERIFY ERROR line.
6C2C
DEFB 00H 00
The 00H in place of a first code that ends the error table (650DH); a code not found goes on at 6510H.

6C2DH - Messages

Data, displayed by 6255H: bytes below 60H as they are (08H: no space before the next word), 60H-DDH words from the two lists, 03H the end. Each row gives the text as it is displayed and the instructions that use it.

6C2D-6C2F
DEFM 0D0H, 0D6H, 03H D0 D6 03
The message routine 6255H displays: FUNCTION COMPLETED. Used at 57FBH, 65C6H.
6C30-6D0A
DEFM 72H, "APPARAT", 6BH, 0D4H, "/80", 6AH, 0ADH, " ONE", 7BH, 89H, " FOLLOWING", 0D0H, "S:", 0DH, "'DD", 6CH, 7DH, " NULL", 60H, 0C5H, 92H, 0BEH, 0DH, "'DM", 6CH, 0C5H, 97H, 0B9H, 0DH, "'DFS", 6CH, 0C5H, 95H, 6BH, 0BEH, 0DH, "'DTS", 6CH, 0C5H, 0B3H, 6BH, 0BEH, 0DH, "'DMDB", 6CH, 0C5H, 0B9H, 93H, 0A6H, 0DH, "'VDS", 6CH, 0C1H, 92H, 0BEH, "S", 0DH, "'ZDS", 6CH, 0A5H, 92H, 0BEH, "S", 0DH, "'CDS", 6CH, 90H, 92H, 0BEH, "S", 0DH, "'CDD", 6CH, 90H, 92H, 91H, 0DH, "'DPWE", 6CH, 0C5H, 0D2H, " EN", 08H, 8FH, 0DH, "'DNTH", 6CH, 0C5H, 9BH, 74H, 0A2H, " HASH", 8FH, 0DH, "'", 08H, 94H, 6CH, 82H, 0D4H, ",", 94H, 7EH, " DOS", 0DH, 08H, 0CAH, " OUTPUT", 6AH, " APPEND ,P", 7EH, " DD, DM, DFS, DTS", 7DH, " DMDB", 0DH, 03H 72 41 50 50 41 52 41 54 6B D4 2F 38 30 6A AD 20 4F 4E 45 7B 89 20 46 4F 4C 4C 4F 57 49 4E 47 D0 53 3A 0D 27 44 44 6C 7D 20 4E 55 4C 4C 60 C5 92 BE 0D 27 44 4D 6C C5 97 B9 0D 27 44 46 53 6C C5 95 6B BE 0D 27 44 54 53 6C C5 B3 6B BE 0D 27 44 4D 44 42 6C C5 B9 93 A6 0D 27 56 44 53 6C C1 92 BE 53 0D 27 5A 44 53 6C A5 92 BE 53 0D 27 43 44 53 6C 90 92 BE 53 0D 27 43 44 44 6C 90 92 91 0D 27 44 50 57 45 6C C5 D2 20 45 4E 08 8F 0D 27 44 4E 54 48 6C C5 9B 74 A2 20 48 41 53 48 8F 0D 27 08 94 6C 82 D4 2C 94 7E 20 44 4F 53 0D 08 CA 20 4F 55 54 50 55 54 6A 20 41 50 50 45 4E 44 20 2C 50 7E 20 44 44 2C 20 44 4D 2C 20 44 46 53 2C 20 44 54 53 7D 20 44 4D 44 42 0D 03
The message routine 6255H displays: (screen cleared) APPARAT'S SUPERZAP/80. INPUT ONE OF THE FOLLOWING FUNCTIONS: (carriage return) 'DD' - OR NULL - DISPLAY DISK SECTOR (carriage return) 'DM' - DISPLAY MAIN MEMORY (carriage return) 'DFS' - DISPLAY FILE'S SECTOR (carriage return) 'DTS' - DISPLAY TRACK'S SECTOR (carriage return) 'DMDB' - DISPLAY MEMORY DUMP BLOCK (carriage return) 'VDS' - VERIFY DISK SECTORS (carriage return) 'ZDS' - ZERO DISK SECTORS (carriage return) 'CDS' - COPY DISK SECTORS (carriage return) 'CDD' - COPY DISK DATA (carriage return) 'DPWE' - DISPLAY PASSWORD ENCODE (carriage return) 'DNTH' - DISPLAY NAME/ TYPE HASH CODE (carriage return) 'EXIT' - END SUPERZAP, EXIT TO DOS (carriage return) PRINTER OUTPUT. APPEND ,P TO DD, DM, DFS, DTS OR DMDB (carriage return). Used at 54E0H.
6D0B-6D0D
DEFM 0BFH, " ", 03H BF 20 03
The message routine 6255H displays: SOURCE. Used at 59E6H, 5B53H, 64EFH.
6D0E-6D10
DEFM 0DBH, " ", 03H DB 20 03
The message routine 6255H displays: DESTINATION. Used at 57DFH, 5A09H, 5B6DH, 64D9H.
6D11-6D19
DEFM 0A0H, 8BH, 0A3H, 7EH, 78H, 0A1H, 67H, 66H, 03H A0 8B A3 7E 78 A1 67 66 03
The message routine 6255H displays: SURE YOU WANT TO DO THIS??? (Y OR N). Used at 6227H.
6D1A-6D20
DEFM 68H, 0A5H, 92H, 0BEH, "S", 67H, 03H 68 A5 92 BE 53 67 03
The message routine 6255H displays: seven asterisks, ZERO DISK SECTORS???. Used at 5B9EH.
6D21-6D27
DEFM 68H, 90H, 92H, 0BEH, "S", 67H, 03H 68 90 92 BE 53 67 03
The message routine 6255H displays: seven asterisks, COPY DISK SECTORS???. Used at 5B4DH.
6D28-6D2C
DEFM 68H, 90H, 92H, 91H, 03H 68 90 92 91 03
The message routine 6255H displays: seven asterisks, COPY DISK DATA. Used at 59E0H.
6D2D-6D35
DEFM " = ", 93H, 6BH, 8CH, 0B9H, 0C3H, 03H 20 3D 20 93 6B 8C B9 C3 03
The message routine 6255H displays: = DUMP'S BASE MEMORY ADDRESS. Used at 561DH.
6D36-6D3A
DEFM 97H, 0B9H, 0C3H, 6FH, 03H 97 B9 C3 6F 03
The message routine 6255H displays: MAIN MEMORY ADDRESS?. Used at 564FH.
6D3B-6D43
DEFM 0A8H, ",", 0B3H, 80H, 0BEH, 75H, 6BH, 6FH, 03H A8 2C B3 80 BE 75 6B 6F 03
The message routine 6255H displays: DRIVE, TRACK AND SECTOR #'S?. Used at 5545H.
6D44-6D4A
DEFM 0B3H, 80H, 0BEH, 75H, 6BH, 6FH, 03H B3 80 BE 75 6B 6F 03
The message routine 6255H displays: TRACK AND SECTOR #'S?. Used at 5554H.
6D4B-6D4F
DEFM 0DDH, 0B3H, 75H, 6FH, 03H DD B3 75 6F 03
The message routine 6255H displays: RELATIVE-SECTOR-WITHIN- TRACK #?. Used at 5563H.
6D50-6D57
DEFM 0A8H, 80H, 0DDH, 0A8H, 75H, 6BH, 6FH, 03H A8 80 DD A8 75 6B 6F 03
The message routine 6255H displays: DRIVE AND RELATIVE-SECTOR-WITHIN- DRIVE #'S?. Used at 5584H, 6792H.
6D58-6D5C
DEFM 0DDH, 0A8H, 75H, 6FH, 03H DD A8 75 6F 03
The message routine 6255H displays: RELATIVE-SECTOR-WITHIN- DRIVE #?. Used at 5593H.
6D5D-6D5F
DEFM 0CFH, 6FH, 03H CF 6F 03
The message routine 6255H displays: FILESPEC?. Used at 55CAH.
6D60-6D63
DEFM 95H, 9BH, 6FH, 03H 95 9B 6F 03
The message routine 6255H displays: FILE NAME?. Used at 5EA2H.
6D64-6D67
DEFM 95H, 0A2H, 6FH, 03H 95 A2 6F 03
The message routine 6255H displays: FILE TYPE?. Used at 5EB6H.
6D68-6D6C
DEFM 0DDH, 95H, 75H, 6FH, 03H DD 95 75 6F 03
The message routine 6255H displays: RELATIVE-SECTOR-WITHIN- FILE #?. Used at 5641H.
6D6D-6D70
DEFM 0BEH, 0A7H, 6FH, 03H BE A7 6F 03
The message routine 6255H displays: SECTOR COUNT?. Used at 66DCH.
6D71-6D74
DEFM 8DH, 0A7H, 6FH, 03H 8D A7 6F 03
The message routine 6255H displays: BYTE COUNT?. Used at 66E1H.
6D75-6D7A
DEFM 8DH, 0BAH, 0C2H, 0BEH, 6FH, 03H 8D BA C2 BE 6F 03
The message routine 6255H displays: BYTE OFFSET WITHIN SECTOR?. Used at 66EFH.
6D7B-6D80
DEFM 93H, 97H, 0B9H, 0C3H, 6FH, 03H 93 97 B9 C3 6F 03
The message routine 6255H displays: DUMP MAIN MEMORY ADDRESS?. Used at 5623H.
6D81-6D88
DEFM 0AEH, 0A4H, 0BEH, 9CH, 0D8H, 67H, 66H, 03H AE A4 BE 9C D8 67 66 03
The message routine 6255H displays: PAUSE WHEN SECTOR READ PROTECTED??? (Y OR N). Used at 5BA6H.
6D89-6D8F
DEFM 0AFH, 69H, 7EH, 0BDH, 7EH, 99H, 03H AF 69 7E BD 7E 99 03
The message routine 6255H displays: PRESS 'ENTER' TO RETURN TO MENU. Used at 6585H.
6D90-6DA1
DEFM 0B7H, 86H, 0C4H, 9FH, 7DH, 7FH, 7BH, 0BEH, 91H, 0DH, 08H, 0AFH, 69H, 7EH, 0C5H, 0B7H, 0CCH, 03H B7 86 C4 9F 7D 7F 7B BE 91 0D 08 AF 69 7E C5 B7 CC 03
The message routine 6255H displays: BUFFER MAY CONTAIN SOME OR ALL OF SECTOR DATA (carriage return) PRESS 'ENTER' TO DISPLAY BUFFER CONTENTS. Used at 654AH.
6DA2-6DB6
DEFM 72H, 0B1H, 65H, 79H, 7CH, 7EH, 0B5H, " MODIFIED", 0BEH, 7EH, 92H, 6DH, 03H 72 B1 65 79 7C 7E B5 20 4D 4F 44 49 46 49 45 44 BE 7E 92 6D 03
The message routine 6255H displays: (screen cleared) REPLY 'Y' IF OK TO WRITE MODIFIED SECTOR TO DISK. Used at 5D0AH.
6DB7-6DC3
DEFM 7AH, 7EH, 77H, " COPIED", 7EH, 0DH, 03H 7A 7E 77 20 43 4F 50 49 45 44 7E 0D 03
The message routine 6255H displays: IS TO BE COPIED TO (carriage return). Used at 57A9H.
6DC4-6DC7
DEFM 72H, 0DCH, 0D6H, 03H 72 DC D6 03
The message routine 6255H displays: (screen cleared) MODIFICATION COMPLETED. Used at 5D23H.
6DC8-6DD4
DEFM 72H, 0DCH, " CANCELLED", 03H 72 DC 20 43 41 4E 43 45 4C 4C 45 44 03
The message routine 6255H displays: (screen cleared) MODIFICATION CANCELLED. Used at 5D40H.
6DD5-6DDA
DEFM 0AFH, 69H, 7EH, 0CDH, 6DH, 03H AF 69 7E CD 6D 03
The message routine 6255H displays: PRESS 'ENTER' TO CONTINUE. Used at 56B2H, 5C12H, 5D29H, 61B1H.
6DDB-6DE6
DEFM 72H, 0C7H, 0DCH, 9AH, 8EH, 6AH, 0B1H, 61H, 7EH, 0CDH, 6DH, 03H 72 C7 DC 9A 8E 6A B1 61 7E CD 6D 03
The message routine 6255H displays: (screen cleared) INVALID MODIFICATION MODE CHAR. REPLY an asterisk TO CONTINUE. Used at 5DAAH.
6DE7-6DEA
DEFM 0C6H, 0CAH, 0CBH, 03H C6 CA CB 03
The message routine 6255H displays: ILLEGAL PRINTER REQUEST. Used at 65B9H.
6DEB-6DEE
DEFM 0DAH, 0A8H, 75H, 03H DA A8 75 03
The message routine 6255H displays: BAD/ILLEGAL DRIVE #. Used at 6728H.
6DEF-6DF2
DEFM 0DAH, 0B3H, 75H, 03H DA B3 75 03
The message routine 6255H displays: BAD/ILLEGAL TRACK #. Used at 674CH.
6DF3-6DF6
DEFM 0DAH, 0BEH, 75H, 03H DA BE 75 03
The message routine 6255H displays: BAD/ILLEGAL SECTOR #. Used at 676BH.
6DF7-6DFB
DEFM 0DAH, 0D3H, 0BEH, 75H, 03H DA D3 BE 75 03
The message routine 6255H displays: BAD/ILLEGAL RELATIVE SECTOR #. Used at 67AFH.
6DFC-6DFE
DEFM 0DAH, 0A7H, 03H DA A7 03
The message routine 6255H displays: BAD/ILLEGAL COUNT. Used at 678AH.
6DFF-6E03
DEFM 0DAH, 97H, 0B9H, 0C3H, 03H DA 97 B9 C3 03
The message routine 6255H displays: BAD/ILLEGAL MAIN MEMORY ADDRESS. Used at 6776H.
6E04-6E09
DEFM 0DAH, 0BAH, 0C2H, 0BEH, 0B4H, 03H DA BA C2 BE B4 03
The message routine 6255H displays: BAD/ILLEGAL OFFSET WITHIN SECTOR VALUE. Used at 670AH.
6E0A-6E0E
DEFM 8AH, 84H, 0D7H, "S", 03H 8A 84 D7 53 03
The message routine 6255H displays: TOO FEW PARAMETERS. Used at 6598H.
6E0F-6E13
DEFM 8AH, 98H, 0D7H, "S", 03H 8A 98 D7 53 03
The message routine 6255H displays: TOO MANY PARAMETERS. Used at 65A0H.
6E14-6E1F
DEFM 0C8H, " IMBEDDED", 0D7H, 03H C8 20 49 4D 42 45 44 44 45 44 D7 03
The message routine 6255H displays: MISSING IMBEDDED PARAMETER. Used at 65A5H.
6E20-6E25
DEFM 0BFH, 0BEH, 88H, 7BH, 0B0H, 03H BF BE 88 7B B0 03
The message routine 6255H displays: SOURCE SECTOR OUT OF RANGE. Used at 56A9H, 658EH.
6E26-6E2B
DEFM 0DBH, 0BEH, 88H, 7BH, 0B0H, 03H DB BE 88 7B B0 03
The message routine 6255H displays: DESTINATION SECTOR OUT OF RANGE. Used at 6593H.
6E2C-6E2F
DEFM 0BEH, 9CH, 0A9H, 03H BE 9C A9 03
The message routine 6255H displays: SECTOR READ ERROR. Used at 64ECH.
6E30-6E33
DEFM 0BEH, 0B5H, 0A9H, 03H BE B5 A9 03
The message routine 6255H displays: SECTOR WRITE ERROR. Used at 64D6H.
6E34-6E37
DEFM 0BEH, 0C1H, 0A9H, 03H BE C1 A9 03
The message routine 6255H displays: SECTOR VERIFY ERROR. Used at 64E2H.
6E38-6E3C
DEFM 0C0H, 0A9H, 8FH, " ", 03H C0 A9 8F 20 03
The message routine 6255H displays: SYSTEM ERROR CODE. Used at 651FH.
6E3D-6E58
DEFM 0BEH, 87H, " PREVIOUSLY SUCCESSFULLY", 9CH, 03H BE 87 20 50 52 45 56 49 4F 55 53 4C 59 20 53 55 43 43 45 53 53 46 55 4C 4C 59 9C 03
The message routine 6255H displays: SECTOR NOT PREVIOUSLY SUCCESSFULLY READ. Used at 65AAH.
6E59-6E70
DEFM 0D4H, " INTERNAL PROGRAMMING", 0A9H, 03H D4 20 49 4E 54 45 52 4E 41 4C 20 50 52 4F 47 52 41 4D 4D 49 4E 47 A9 03
The message routine 6255H displays: SUPERZAP INTERNAL PROGRAMMING ERROR. Used at 65AFH.
6E71-6E84
DEFM 0B1H, 62H, 85H, 0B2H, ",", 63H, 85H, 9EH, 0A9H, 0BEH, ",", 7DH, 64H, 7EH, 0DH, 08H, 0D9H, 0D0H, 6DH, 03H B1 62 85 B2 2C 63 85 9E A9 BE 2C 7D 64 7E 0D 08 D9 D0 6D 03
The message routine 6255H displays: REPLY 'R' FOR RETRY, 'S' FOR SKIP ERROR SECTOR, OR 'X' TO (carriage return) TERMINATE FUNCTION. Used at 6558H.
6E85-6E8C
DEFM 0D0H, 0D9H, "D BY", 0D1H, 03H D0 D9 44 20 42 59 D1 03
The message routine 6255H displays: FUNCTION TERMINATED BY OPERATOR. Used at 65B4H.
6E8D-6E8F
DEFM 0A8H, " ", 03H A8 20 03
The message routine 6255H displays: DRIVE. Used at 65D3H.
6E90-6E92
DEFM 0B3H, " ", 03H B3 20 03
The message routine 6255H displays: TRACK. Used at 65F7H.
6E93-6E95
DEFM 0BEH, " ", 03H BE 20 03
The message routine 6255H displays: SECTOR. Used at 6601H.
6E96-6E9A
DEFM "DRS ", 03H 44 52 53 20 03
The message routine 6255H displays: DRS. Used at 65E7H.
6E9B-6E9F
DEFM "FRS ", 03H 46 52 53 20 03
The message routine 6255H displays: FRS. Used at 65D9H.
6EA0-6EA2
DEFM ", ", 03H 2C 20 03
The message routine 6255H displays: ,. Used at 6617H.
6EA3-6EA6
DEFM "H ", 03H 48 20 20 03
The message routine 6255H displays: H. Used at 6643H.
6EA7-6EAA
DEFM "- ", 03H 2D 20 20 03
The message routine 6255H displays: -. Used at 5F75H.
6EAB-6EB2
DEFM 0BEH, 87H, 9CH, "ABLE", 03H BE 87 9C 41 42 4C 45 03
The message routine 6255H displays: SECTOR NOT READABLE. Used at 57CCH.
6EB3-6EB7
DEFM 0BEH, 87H, 9CH, 0D8H, 03H BE 87 9C D8 03
The message routine 6255H displays: SECTOR NOT READ PROTECTED. Used at 57DBH.
6EB8-6EBB
DEFM 0BEH, 9CH, 0D8H, 03H BE 9C D8 03
The message routine 6255H displays: SECTOR READ PROTECTED. Used at 57D1H, 5C0CH.
6EBC-6ECA
DEFM "SHALL IT ", 77H, 9CH, 0D8H, 67H, 66H, 03H 53 48 41 4C 4C 20 49 54 20 77 9C D8 67 66 03
The message routine 6255H displays: SHALL IT BE READ PROTECTED??? (Y OR N). Used at 57E9H.
6ECB-6EDA
DEFM "PARTIAL ", 0A6H, " DUE", 7EH, 83H, 03H 50 41 52 54 49 41 4C 20 A6 20 44 55 45 7E 83 03
The message routine 6255H displays: PARTIAL BLOCK DUE TO EOF. Used at 61ABH.
6EDB-6EE5
DEFM 72H, "NO MATCH", 0DH, 03H 72 4E 4F 20 4D 41 54 43 48 0D 03
The message routine 6255H displays: (screen cleared) NO MATCH (carriage return). Used at 59D5H.
6EE6-6EE8
DEFM 0D2H, 6FH, 03H D2 6F 03
The message routine 6255H displays: PASSWORD?. Used at 5E49H.
6EE9-6EFA
DEFM 0D0H, 0C6H, " UNDER DOS-CALL", 03H D0 C6 20 55 4E 44 45 52 20 44 4F 53 2D 43 41 4C 4C 03
The message routine 6255H displays: FUNCTION ILLEGAL UNDER DOS-CALL. Used at 65BEH.
6EFB-6EFF
DEFM 97H, 0B9H, 0B0H, 6DH, 03H 97 B9 B0 6D 03
The message routine 6255H displays: MAIN MEMORY RANGE. Used at 5F69H.

6F00H - Unused Bytes

The end of the file: 254 zero bytes that no instruction reads.

6F00-6FFD
DEFB 00H x 254 00 x 254
Zero bytes at the end of the last load record, 6F00H-6FFDH; nothing in SUPERZAP uses them.