DOSPLUS 3.5 for the Model III - DISKDUMP/CMD Disassembled

Page Customization

Introduction/Summary

DOSPLUS 3.5 DISKDUMP/CMD Disassembly - The File Sector Display and Editor (Model III)

DISKDUMP/CMD shows and changes a file sector by sector, run from the DOS command level as DISKDUMP filespec; its heading reads DISKDUMP - DOSPLUS File dump/edit - 3.50. It is a load module of 4 blocks, 938 bytes, at 5200H-55A9H with the transfer address 5200H, after the two comment records (the name DISKDUMP and the copyright notice). DISKDUMP/CMD is on the Model III master only.

The file is opened with 256 byte records, so a record is a sector of the file. DISKDUMP writes the whole screen straight into the video RAM: 16 rows of 16 bytes, each row with its offset, eight groups of two bytes in hexadecimal and the 16 characters, or the bytes as characters alone after CLEAR. The four left columns hold the drive number (top row) and the low byte of the sector number (second row), and, in the modify mode, the offset of the cursor (fourth row) and the byte under it (fifth row).

The Parts of DISKDUMP/CMD

AddressContents
5200H-5264HThe file specification or the asterisk prompt, OPEN@, a sector read and shown (5200H, 520DH, 5235H, 524AH).
5265H-529FHThe command keys (5265H).
52A0H-5322HF, the last, first, previous and next sector, G (52A0H, 52E5H, 5307H).
5323H-5376HP, the byte of a load address (5323H).
5377H-541DHM, the modify mode, @, CLEAR, ENTER and BREAK (5377H, 53F0H, 5402H).
541EH-5534HThe screen address of a byte, the hexadecimal input, the display, a key, the errors (541EH, 543AH, 544BH, 5466H, 54EDH, 550EH, 551CH).
5535H-55A9HThe cursor keys, the heading and the variables (5535H).

How DISKDUMP Works

A file specification on the command line is opened at once; without one DISKDUMP shows its heading and an asterisk and takes up to 63 characters, ENTER alone asking again and BREAK returning to the DOS (520DH). A device is Illegal filespec. After OPEN@ the sector of the file control block's next record number is read by POSN@ and READ@, and BKSP@ sets the file back on it, so FCB+0AH always names the sector shown (524AH). Each command key ends by showing the sector again (5265H): the semicolon the next sector, the plus sign the last (the ending record number, less one when the end of file byte is 00H), the equal sign the first, the minus sign the previous; G takes a hexadecimal number. A sector before the first or past the last is not shown; the key is ignored (5307H). BREAK clears the screen and asks for another file without closing the one open (526CH).

Numbers are typed blind: hexadecimal digits are shifted into Register Pair BC until a space, ENTER or another control key, and other keys are ignored (544BH). F finds a byte, typed as a number in the hexadecimal mode or as one key in the character mode, and flashes two graphics blocks on every place it occurs until a key is pressed (52A0H). P reads the file from its start as a load module by GET@, passing each block byte by byte until the byte that loads at the address; the transfer record first is Invalid data provided, a record type of 20H or more Attempted to use non program file as a program (5323H). The byte found is the next one in the buffer, and the modify mode starts on it.

In the modify mode the cursor is two graphics blocks over the byte (5377H). The four arrows, SHIFT with the left and right arrows (the start and end of the row) and SHIFT with the up arrow (the first byte) move it through the table at 5535H; a digit pair (hexadecimal mode) or any other key (character mode) changes the byte and moves on; @ xxyy fills yy bytes with xx from the cursor, @ xx fills xx bytes with 00H, a count of 00H fills to the end (53F0H). ENTER writes the sector by WRITE@ and BKSP@; BREAK reads it again, so the changes are lost (5402H). Errors clear the screen, show the message, and go back to the asterisk prompt (5524H).

Differences from the Manual

The manual's table gives the colon for the next sector, its text the semicolon; the bytes take the semicolon only. Its text says F is used by typing G; F is the key. It does not say that the value to find is one key without ENTER in the character mode, that a number is ended by a space as well as ENTER and is not shown while it is typed, that the fill count 00H (and @ alone) fills to the end of the sector, that SHIFT with the arrows moves to the start or end of a row or of the sector, or how to leave DISKDUMP: BREAK at the command keys, then BREAK at the prompt. The sector number on the screen is its low byte only. When P does not find the address, the message is the DOS error Invalid data provided, then the prompt.

Variables

DISKDUMP/CMD Variables

Address
Size
Contents
55A5H
1 byte
Flash phase
FFH the blocks of F, 00H the sector (52AEH).
55A6H
1 byte
First display
FFH the left columns are cleared (5223H, 546FH).
55A7H
1 byte
Display mode
FFH hexadecimal, 00H characters (5402H).
55A8H-55A9H
2 bytes
P address
The load address to find (5326H).
55AAH-55C9H
32 bytes
FCB
The file control block of the file (5200H).
5600H-56FFH
256 bytes
Buffer
The reply, then the sector shown (523DH).

Memory Outside DISKDUMP/CMD

Address
Size
Contents
3C00H-3FFFH
1024 bytes
Video RAM
The whole screen, written straight (5466H, 541EH).

Outside Routines

AddressContents
441CHSYS0/SYS: FSPEC@ (5203H).
4467HSYS0/SYS: DSPLY@ (5210H).
4424HSYS0/SYS: OPEN@ (5240H).
4442HSYS0/SYS: POSN@ (524DH).
4436HSYS0/SYS: READ@ (5250H).
4439HSYS0/SYS: WRITE@ (540EH).
4445HSYS0/SYS: BKSP@ (5256H, 5414H).
443FHSYS0/SYS: REW@ (532DH).
4409HSYS0/SYS: ERROR@ (552FH).
0013HROM: input a byte from a control block, the file (5330H).
002BHROM: scan the keyboard (52D1H).
0033HROM: display a character (5215H).
0040HROM: line input (521DH).
0049HROM: wait for a key (550FH, 539AH).
01C9HROM: clear the screen (526CH).

Disassembly

5200H - DISKDUMP

DISKDUMP/CMD's transfer address, entered from the DOS command level with Register Pair HL at the command line after the word DISKDUMP: DISKDUMP filespec. DISKDUMP opens the file and shows one sector (a 256 byte record) at a time on the whole screen, in hexadecimal with the characters beside it or as characters alone, and takes one key commands: the next, previous, first and last sector, G to go to a sector, F to find a byte, P to find the byte that loads at an address, M to change the sector and write it back. BREAK at the command level asks for another file; BREAK at the prompt returns to the DOS.

5200
LD DE,55AAH 11 AA 55
Point Register Pair DE to 55AAH, DISKDUMP's file control block, for the file specification.
5203
GOSUB to 441CH, FSPEC@, to move the file specification at Register Pair HL into the file control block at Register Pair DE.
5206
If the Z FLAG is set (a valid file specification), JUMP to 5235H to open the file.
5208
CP 20H FE 20
Compare Register A, the character FSPEC@ stopped at, against 20H: the NC FLAG for a printable character.
520A
If the NC FLAG is set (a bad file specification), JUMP to 551CH for the error 2CH, Illegal filespec.

520DH - The Asterisk Prompt

Shows the heading and an asterisk and takes up to 63 characters as the file specification. BREAK returns to the DOS; ENTER alone asks again. 55A6H is set so that the next display clears the four left columns.

520D
LD HL,554BH 21 4B 55
Point Register Pair HL to 554BH, DISKDUMP's heading (DISKDUMP - DOSPLUS File dump/edit - 3.50) and the copyright line.
5210
GOSUB to 4467H, DSPLY@, to display the text at Register Pair HL up to and with the 0DH after the copyright line.
5213
LD A,2AH 3E 2A
Load Register A with 2AH, the asterisk shown as the prompt for the file specification.
5215
GOSUB to 0033H, the ROM's display of the character in Register A, the prompt.
5218
LD B,3FH 06 3F
Load Register B with 3FH, the most characters of the reply: 63.
521A
LD HL,5600H 21 00 56
Point Register Pair HL to 5600H, the buffer for the reply (later the sector shown).
521D
GOSUB to 0040H, the ROM's line input of up to Register B characters into the buffer at Register Pair HL; the C FLAG for BREAK.
5220
RET C D8
If the C FLAG is set (BREAK), RETurn to the DOS, which called DISKDUMP from the command level.
5221
LD A,FFH 3E FF
Load Register A with FFH, the value that makes the next display clear the four left columns of the screen.
5223
LD (55A6H),A 32 A6 55
Store Register A (FFH) into 55A6H, the flag of the first display after the prompt.
5226
LD DE,55AAH 11 AA 55
Point Register Pair DE to 55AAH, DISKDUMP's file control block, for the file specification.
5229
GOSUB to 441CH, FSPEC@, to move the file specification at Register Pair HL into the file control block at Register Pair DE.
522C
If the Z FLAG is set (a valid file specification), JUMP to 5235H to open the file.
522E
CP 20H FE 20
Compare Register A, the character FSPEC@ stopped at, against 20H: the NC FLAG for a printable character.
5230
If the NC FLAG is set (a bad file specification), JUMP to 551CH for the error 2CH, Illegal filespec.
5233
JUMP to 5213H to prompt again: the reply held no file specification.

5235H - Open the File

A device (@) is the error 2CH. OPEN@ with 256 byte records and the buffer 5600H, then the sector named by the file control block's next record number (FCB+0AH) is read and shown.

5235
LD A,(DE) 1A
Load Register A with the first character of the file control block at Register Pair DE.
5236
CP 40H FE 40
Compare Register A against 40H, the character @ that starts a device name.
5238
If the Z FLAG is set (a device, not a file), JUMP to 551CH for the error 2CH, Illegal filespec.
523B
LD B,00H 06 00
Load Register B with 00H, the logical record length for OPEN@: 256 byte records, one a sector.
523D
LD HL,5600H 21 00 56
Point Register Pair HL to 5600H, the buffer of the file, which holds the sector shown.
5240
GOSUB to 4424H, OPEN@, to open the file of the file control block at Register Pair DE.
5243
If the NZ FLAG is set (OPEN@ failed, its error code in Register A), JUMP to 5524H to post the error.
5246
LD BC,(55B4H) ED 4B B4 55
Load Register Pair BC with the next record number from 55B4H-55B5H (FCB+0AH): the sector to show.

524AH - Read and Show a Sector

Register Pair BC = the sector: POSN@, READ@ and BKSP@, so the next record number stays on the sector shown; then the display and the command keys.

524A
LD DE,55AAH 11 AA 55
Point Register Pair DE to 55AAH, DISKDUMP's file control block.
524D
GOSUB to 4442H, POSN@, to set the file at Register Pair DE to record Register Pair BC.
5250
GOSUB to 4436H, READ@, to read that record of the file at Register Pair DE into the buffer at 5600H.
5253
If the NZ FLAG is set (READ@ failed, its error code in Register A), JUMP to 5524H to post the error.
5256
GOSUB to 4445H, BKSP@, to set the file at Register Pair DE one record back, to the sector just read.
5259
GOSUB to 5466H to show the sector in the buffer at 5600H on the screen.
525C
LD HL,2020H 21 20 20
Load Register Pair HL with 2020H, two spaces.
525F
LD (3CC0H),HL 22 C0 3C
Store Register Pair HL (2020H) into 3CC0H-3CC1H, the screen place where the modify mode shows the offset of the cursor.
5262
LD (3D00H),HL 22 00 3D
Store Register Pair HL (2020H) into 3D00H-3D01H, the screen place where the modify mode shows the byte under the cursor.

5265H - The Command Keys

One key: BREAK another file, ; the next sector, + the last, = the first, minus the previous, F find, G go to, M modify, P find a load address, CLEAR the other display mode; any other key shows the sector again.

5265
GOSUB to 550EH to wait for a key, Register A, with a lower case letter made upper case.
5268
CP 01H FE 01
Compare Register A against 01H, the BREAK key.
526A
If the NZ FLAG is set (not BREAK), JUMP to 5271H for the other keys.
526C
GOSUB to 01C9H, the ROM's clear screen, before the prompt for another file.
526F
JUMP to 520DH for the heading and the prompt for another file; the file stays open.
5271
CP 3BH FE 3B
Compare Register A against 3BH, the semicolon: the next sector.
5273
If the Z FLAG is set (the semicolon), JUMP to 5307H for the next sector.
5276
CP 2BH FE 2B
Compare Register A against 2BH, the plus sign: the last sector.
5278
If the Z FLAG is set (the plus sign), JUMP to 52E5H for the last sector.
527A
CP 3DH FE 3D
Compare Register A against 3DH, the equal sign: the first sector.
527C
If the Z FLAG is set (the equal sign), JUMP to 52F4H for the first sector.
527F
CP 2DH FE 2D
Compare Register A against 2DH, the minus sign: the previous sector.
5281
If the Z FLAG is set (the minus sign), JUMP to 52FAH for the previous sector.
5284
CP 46H FE 46
Compare Register A against 46H, the letter F: find a byte.
5286
If the Z FLAG is set (F), JUMP to 52A0H to find a byte in the sector.
5288
CP 47H FE 47
Compare Register A against 47H, the letter G: go to a sector.
528A
If the Z FLAG is set (G), JUMP to 530EH for the number of the sector.
528D
CP 4DH FE 4D
Compare Register A against 4DH, the letter M: the modify mode.
528F
If the Z FLAG is set (M), JUMP to 5377H for the modify mode at the first byte.
5292
CP 50H FE 50
Compare Register A against 50H, the letter P: find the byte of a load address.
5294
If the Z FLAG is set (P), JUMP to 5323H for the address.
5297
CP 1FH FE 1F
Compare Register A against 1FH, the CLEAR key: the other display mode.
5299
If the NZ FLAG is set (another key), JUMP to 5259H to show the sector again.
529B
GOSUB to 5402H to switch between the hexadecimal and the character display.
529E
JUMP to 5259H to show the sector in the new mode.

52A0H - F, Find a Byte

In the hexadecimal mode a number ended by a space or ENTER (its low byte counts); in the character mode one key. Every byte of the sector equal to it flashes as two graphics blocks (8FH) on its place, about 512 keyboard scans on and off, until a key is pressed; the key is not kept.

52A0
LD HL,55A7H 21 A7 55
Point Register Pair HL to 55A7H, the display mode: FFH hexadecimal, 00H characters.
52A3
BIT 0,(HL) CB 46
Test bit 0 of the display mode at Register Pair HL: clear for the character display.
52A5
If the Z FLAG is set (the character display), GOSUB to 0049H, the ROM's wait for a key: Register A = the byte to find.
52A8
LD C,A 4F
Load Register C with Register A, the key, the byte to find in the character display.
52A9
BIT 0,(HL) CB 46
Test bit 0 of the display mode at Register Pair HL: set for the hexadecimal display.
52AB
If the NZ FLAG is set (hexadecimal), GOSUB to 544BH for a hexadecimal number in Register Pair BC: Register C = the byte.
52AE
LD HL,55A5H 21 A5 55
Point Register Pair HL to 55A5H, the phase of the flashing: FFH the blocks are shown, 00H the sector.
52B1
BIT 0,(HL) CB 46
Test bit 0 of the flash phase at Register Pair HL: set while the blocks are shown.
52B3
If the Z FLAG is set (the sector phase), JUMP to 52CBH to show the sector itself.
52B5
LD DE,5600H 11 00 56
Point Register Pair DE to 5600H, the first byte of the sector in the buffer.
52B8
LD A,(DE) 1A
Load Register A with the byte of the sector at Register Pair DE.
52B9
CP C B9
Compare Register A against Register C, the byte to find.
52BA
If the Z FLAG is set (a match), JUMP to 52C1H to put the blocks on its place.
52BC
INC E 1C
INCrement Register E by 1, to the next byte of the sector.
52BD
If the NZ FLAG is set (not past the last byte), JUMP to 52B8H for the next byte.
52BF
JUMP to 52CEH for the wait of the phase, with the blocks on the screen.
52C1
GOSUB to 541EH for Register Pair HL = the screen address of byte Register E of the sector.
52C4
LD (HL),8FH 36 8F
Store 8FH, a full graphics block, over the first digit of the byte at Register Pair HL.
52C6
INC L 2C
INCrement Register L by 1, to the place of the second digit.
52C7
LD (HL),8FH 36 8F
Store 8FH, a full graphics block, over the second digit of the byte at Register Pair HL.
52C9
JUMP to 52BCH for the next byte of the sector.
52CB
GOSUB to 5466H to show the sector in the buffer, the phase without the blocks.
52CE
LD HL,0200H 21 00 02
Load Register Pair HL with 0200H, the 512 keyboard scans of one phase.
52D1
GOSUB to 002BH, the ROM's scan of the keyboard: Register A = the key pressed, or 00H.
52D4
OR A B7
OR Register A with itself, to test it for zero.
52D5
If the NZ FLAG is set (a key), JUMP to 5259H to end the find and show the sector again.
52D8
DEC HL 2B
DECrement Register Pair HL by 1, one scan of the phase done.
52D9
LD A,H 7C
Load Register A with Register H, the high byte of the scans left.
52DA
OR L B5
OR Register A with Register L: the Z FLAG when Register Pair HL is zero.
52DB
If the NZ FLAG is set (scans left), JUMP to 52D1H to scan again.
52DD
LD HL,55A5H 21 A5 55
Point Register Pair HL to 55A5H, the phase of the flashing.
52E0
GOSUB to 5405H to change the phase at Register Pair HL to the other (XOR FFH).
52E3
JUMP to 52AEH for the next phase of the flashing of the bytes found.

52E5H - The Last, the First and the Previous Sector

+ takes the ending record number (FCB+0CH), less 1 when the end of file byte (FCB+08H) is 00H; = sector 0; minus the sector before the one shown, nothing at sector 0.

52E5
LD BC,(55B6H) ED 4B B6 55
Load Register Pair BC with the ending record number from 55B6H-55B7H (FCB+0CH).
52E9
LD A,(55B2H) 3A B2 55
Load Register A with the end of file byte from 55B2H (FCB+08H), the bytes of the last sector in use.
52EC
OR A B7
OR Register A with itself, to test the end of file byte for zero.
52ED
If the NZ FLAG is set (the last sector is partly used), JUMP to 524AH to show sector Register Pair BC.
52F0
DEC BC 0B
DECrement Register Pair BC by 1: the last sector is the one before the ending record number.
52F1
JUMP to 524AH to show sector Register Pair BC.
52F4
LD BC,0000H 01 00 00
Load Register Pair BC with 0000H, the first sector of the file.
52F7
JUMP to 524AH to show sector Register Pair BC.
52FA
LD BC,(55B4H) ED 4B B4 55
Load Register Pair BC with the next record number from 55B4H-55B5H (FCB+0AH): the sector shown.
52FE
LD A,B 78
Load Register A with Register B, the high byte of the sector shown.
52FF
OR C B1
OR Register A with Register C: the Z FLAG for sector 0.
5300
If the Z FLAG is set (sector 0), JUMP to 5259H: there is no sector before it.
5303
DEC BC 0B
DECrement Register Pair BC by 1, the sector before the one shown.
5304
JUMP to 524AH to show sector Register Pair BC.

5307H - The Next Sector and G

; the sector after the one shown; G a hexadecimal number. Either is shown only when it is not past the last sector (the ending record number, less 1 when the end of file byte is 00H).

5307
LD BC,(55B4H) ED 4B B4 55
Load Register Pair BC with the next record number from 55B4H-55B5H (FCB+0AH): the sector shown.
530B
INC BC 03
INCrement Register Pair BC by 1, the sector after the one shown.
530C
JUMP to 5311H for the test against the last sector.
530E
GOSUB to 544BH for a hexadecimal number in Register Pair BC, the sector to go to.
5311
LD HL,(55B6H) 2A B6 55
Load Register Pair HL with the ending record number from 55B6H-55B7H (FCB+0CH).
5314
LD A,(55B2H) 3A B2 55
Load Register A with the end of file byte from 55B2H (FCB+08H).
5317
OR A B7
OR Register A with itself, to test the end of file byte for zero; the C FLAG is cleared.
5318
If the NZ FLAG is set (the last sector is partly used), JUMP to 531BH.
531A
DEC HL 2B
DECrement Register Pair HL by 1: the last sector of the file.
531B
SBC HL,BC ED 42
SUBtract Register Pair BC from Register Pair HL with the C FLAG: the C FLAG when Register Pair BC is past the last sector.
531D
If the NC FLAG is set (within the file), JUMP to 524AH to show sector Register Pair BC.
5320
JUMP to 5259H: past the end of the file, the key is ignored.

5323H - P, Find the Byte of a Load Address

A hexadecimal address; the file is read from its start as a load module by GET@: type 01H blocks are passed byte by byte until the byte that loads at the address, other records skipped; type 02H (the transfer address) first is the error 2DH, a type of 20H or more the error 22H. The byte found starts the modify mode on its place.

5323
GOSUB to 544BH for a hexadecimal number in Register Pair BC, the load address to find.
5326
LD (55A8H),BC ED 43 A8 55
Store Register Pair BC, the address to find, into 55A8H-55A9H.
532A
LD DE,55AAH 11 AA 55
Point Register Pair DE to 55AAH, DISKDUMP's file control block.
532D
GOSUB to 443FH, REW@, to set the file at Register Pair DE to its start.
5330
GOSUB to 0013H, the ROM's input of a byte from the control block at Register Pair DE: Register A = the record type.
5333
CP 20H FE 20
Compare Register A against 20H: the NC FLAG for a type that a load module does not have.
5335
If the NC FLAG is set (not a load module), JUMP to 551FH for the error 22H, Attempted to use non program file as a program.
5338
LD H,A 67
Load Register H with Register A, the record type.
5339
GOSUB to 0013H to read the next byte of the file at Register Pair DE: Register A = the length of the record.
533C
LD B,A 47
Load Register B with Register A, the length of the record.
533D
GOSUB to 0013H to read the next byte of the file at Register Pair DE, the first byte of the record.
5340
LD L,A 6F
Load Register L with Register A, the first byte: for a type 01H record the low byte of its load address.
5341
DEC H 25
DECrement Register H by 1: the Z FLAG for the type 01H, a block to load.
5342
If the Z FLAG is set (a block), JUMP to 5350H to pass its bytes.
5344
DEC H 25
DECrement Register H by 1: the Z FLAG for the type 02H, the transfer address that ends the module.
5345
If the Z FLAG is set (the end of the module), JUMP to 5522H for the error 2DH, Invalid data provided.
5348
DEC B 05
DECrement Register B by 1, one byte of the record read: the Z FLAG when the record ends.
5349
If the Z FLAG is set (the record is read), JUMP to 5330H for the next record.
534B
GOSUB to 0013H to read the next byte of the record from the file at Register Pair DE, which is passed over.
534E
JUMP to 5348H to count the byte read from Register B, the bytes of the record left.
5350
GOSUB to 0013H to read the next byte of the file at Register Pair DE, the high byte of the load address.
5353
LD H,A 67
Load Register H with Register A: Register Pair HL = the load address of the block's first byte.
5354
DEC B 05
DECrement Register B by 1, for the low byte of the load address.
5355
DEC B 05
DECrement Register B by 1, for the high byte: Register B = the bytes of the block (00H for 256).
5356
PUSH DE D5
Save Register Pair DE, the file control block, to the top of the stack around the compare.
5357
EX DE,HL EB
Exchange Register Pair DE and Register Pair HL: Register Pair DE = the load address of the next byte.
5358
LD HL,(55A8H) 2A A8 55
Load Register Pair HL with the address to find from 55A8H-55A9H.
535B
OR A B7
OR Register A with itself, to clear the C FLAG for the SBC below.
535C
SBC HL,DE ED 52
SUBtract Register Pair DE from Register Pair HL with the C FLAG: the Z FLAG when the next byte loads at the address.
535E
EX DE,HL EB
Exchange Register Pair DE and Register Pair HL: Register Pair HL = the load address of the next byte again.
535F
POP DE D1
Restore Register Pair DE, the file control block, from the top of the stack.
5360
If the Z FLAG is set (the byte is found), JUMP to 536AH; it is the next byte of the file.
5362
GOSUB to 0013H to read the byte of the block from the file at Register Pair DE, which is passed over.
5365
INC HL 23
INCrement Register Pair HL by 1, the load address of the next byte.
5366
DECrement Register B and, while it is not zero, LOOP BACK to 5356H for the next byte of the block (DJNZ).
5368
JUMP to 5330H for the next record of the file.
536A
LD HL,55ABH 21 AB 55
Point Register Pair HL to 55ABH (FCB+01H), the flags of the file control block.
536D
RES 7,(HL) CB BE
Reset bit 7 of FCB+01H at Register Pair HL, the blocked flag that GET@ set, so the file goes on in whole sectors.
536F
LD A,(55AFH) 3A AF 55
Load Register A with the byte offset from 55AFH (FCB+05H): the place in the buffer of the next byte, the one found.
5372
LD E,A 5F
Load Register E with Register A, the offset of the byte found.
5373
LD D,56H 16 56
Load Register D with 56H: Register Pair DE = the byte found in the buffer at 5600H.
5375
JUMP to 537AH for the modify mode with the cursor on the byte found.

5377H - M, the Modify Mode

Register Pair DE = the cursor in the buffer. Shows the sector, the offset of the cursor at 3CC0H and its byte at 3D00H, and the cursor as two graphics blocks; each key returns through 537AH to show it again. The arrows move the cursor (table 5535H), @ fills, CLEAR changes the mode, ENTER writes the sector, BREAK reads it again; any other key is data: a character, or two hexadecimal digits.

5377
LD DE,5600H 11 00 56
Point Register Pair DE to 5600H, the cursor on the first byte of the sector.
537A
GOSUB to 5466H to show the sector in the buffer at 5600H on the screen.
537D
EX DE,HL EB
Exchange Register Pair DE and Register Pair HL: Register Pair HL = the cursor in the buffer.
537E
LD DE,3CC0H 11 C0 3C
Point Register Pair DE to 3CC0H, the screen place for the offset of the cursor.
5381
LD A,L 7D
Load Register A with Register L, the offset of the cursor in the sector.
5382
GOSUB to 54FAH to show the offset in Register A as two hexadecimal digits at Register Pair DE.
5385
LD DE,3D00H 11 00 3D
Point Register Pair DE to 3D00H, the screen place for the byte under the cursor.
5388
LD A,(HL) 7E
Load Register A with the byte under the cursor at Register Pair HL.
5389
GOSUB to 54FAH to show the byte in Register A as two hexadecimal digits at Register Pair DE.
538C
EX DE,HL EB
Exchange Register Pair DE and Register Pair HL: Register Pair DE = the cursor in the buffer again.
538D
GOSUB to 541EH for Register Pair HL = the screen address of byte Register E of the sector.
5390
LD (HL),8FH 36 8F
Store 8FH, a full graphics block, the cursor, over the first digit of the byte at Register Pair HL.
5392
INC L 2C
INCrement Register L by 1, to the place of the second digit.
5393
LD (HL),8FH 36 8F
Store 8FH, a full graphics block, over the second digit of the byte at Register Pair HL.
5395
LD BC,537AH 01 7A 53
Load Register Pair BC with 537AH, the return address that shows the sector and the cursor again.
5398
PUSH BC C5
Save Register Pair BC (537AH) to the top of the stack, so that the key routines return to 537AH.
5399
PUSH DE D5
Save Register Pair DE, the cursor, to the top of the stack around the wait for a key.
539A
GOSUB to 0049H, the ROM's wait for a key: Register A = the key.
539D
POP DE D1
Restore Register Pair DE, the cursor, from the top of the stack.
539E
CP 40H FE 40
Compare Register A against 40H, the character @: fill bytes.
53A0
If the Z FLAG is set (@), JUMP to 53F0H to fill from the cursor.
53A3
CP 1FH FE 1F
Compare Register A against 1FH, the CLEAR key: the other display mode.
53A5
If the Z FLAG is set (CLEAR), JUMP to 5402H to switch the display mode, which returns to 537AH.
53A8
CP 0DH FE 0D
Compare Register A against 0DH, the ENTER key: write the sector.
53AA
If the Z FLAG is set (ENTER), JUMP to 540AH to write the sector to the file.
53AD
CP 01H FE 01
Compare Register A against 01H, the BREAK key: undo the changes.
53AF
If the Z FLAG is set (BREAK), JUMP to 541AH to read the sector again.
53B2
LD HL,5535H 21 35 55
Point Register Pair HL to 5535H, the table of the cursor keys: the key, a mask and an addend.
53B5
INC (HL) 34
INCrement the byte at Register Pair HL by 1, the first half of a test of the table's key for zero.
53B6
DEC (HL) 35
DECrement the byte at Register Pair HL by 1, back to the key: the Z FLAG for the 00H that ends the table.
53B7
If the Z FLAG is set (not a cursor key), JUMP to 53C6H to take the key as data.
53B9
CP (HL) BE
Compare Register A, the key pressed, against the key of the table at Register Pair HL.
53BA
INC HL 23
INCrement Register Pair HL by 1, to the mask of the entry.
53BB
LD C,(HL) 4E
Load Register C with the mask of the entry at Register Pair HL.
53BC
INC HL 23
INCrement Register Pair HL by 1, to the addend of the entry.
53BD
LD B,(HL) 46
Load Register B with the addend of the entry at Register Pair HL.
53BE
INC HL 23
INCrement Register Pair HL by 1, to the next entry of the table.
53BF
If the NZ FLAG is set (another key), JUMP to 53B5H for the next entry.
53C1
LD A,E 7B
Load Register A with Register E, the offset of the cursor.
53C2
AND C A1
AND Register A with Register C, the mask of the entry.
53C3
ADD A,B 80
ADD Register B, the addend of the entry, to Register A: the new offset of the cursor.
53C4
LD E,A 5F
Load Register E with Register A: Register Pair DE = the new cursor in the buffer.
53C5
RET C9
RETurn to 537AH to show the cursor in its new place.
53C6
LD HL,55A7H 21 A7 55
Point Register Pair HL to 55A7H, the display mode: FFH hexadecimal, 00H characters.
53C9
BIT 0,(HL) CB 46
Test bit 0 of the display mode at Register Pair HL: set for the hexadecimal display.
53CB
If the Z FLAG is set (the character display), JUMP to 53EDH to store the key itself.
53CD
GOSUB to 5513H to make a lower case letter in Register A upper case.
53D0
GOSUB to 543AH for the value of a hexadecimal digit in Register A, the C FLAG for any other key, Register B the character.
53D3
If the C FLAG is set (not a digit), JUMP to 5399H to wait for another key.
53D5
LD C,A 4F
Load Register C with Register A, the value of the first digit.
53D6
GOSUB to 541EH for Register Pair HL = the screen address of byte Register E of the sector.
53D9
LD (HL),B 70
Store Register B, the first digit typed, on the screen at Register Pair HL, in place of the first block.
53DA
SLA C CB 21
Shift Register C left one bit, the first of four that make the first digit the high half of the byte (SLA).
53DC
SLA C CB 21
Shift Register C left one bit, the second of four (SLA).
53DE
SLA C CB 21
Shift Register C left one bit, the third of four (SLA).
53E0
SLA C CB 21
Shift Register C left one bit, the fourth of four: Register C = the high half of the new byte (SLA).
53E2
GOSUB to 550EH to wait for a key, Register A, with a lower case letter made upper case.
53E5
GOSUB to 543AH for the value of a hexadecimal digit in Register A, the C FLAG for any other key, Register B the character.
53E8
If the C FLAG is set (not a digit), JUMP to 53E2H to wait for another key: the byte is not done.
53EA
INC L 2C
INCrement Register L by 1, to the screen place of the second digit.
53EB
LD (HL),B 70
Store Register B, the second digit typed, on the screen at Register Pair HL.
53EC
ADD A,C 81
ADD Register C, the high half, to Register A, the value of the second digit: the new byte.
53ED
LD (DE),A 12
Store Register A, the new byte, into the buffer at Register Pair DE, the cursor.
53EE
INC E 1C
INCrement Register E by 1, the cursor to the next byte (from the last byte to the first).
53EF
RET C9
RETurn to 537AH to show the change and the cursor.

53F0H - @, Fill

A hexadecimal number xxyy: Register B = xx the byte, Register C = yy the count (@ xx alone fills xx bytes with 00H); a count of 00H fills to the end of the sector. The cursor does not move.

53F0
GOSUB to 544BH for a hexadecimal number in Register Pair BC: Register B the fill byte, Register C the count.
53F3
LD H,D 62
Load Register H with Register D, the high byte of the cursor.
53F4
LD L,E 6B
Load Register L with Register E: Register Pair HL = the cursor in the buffer, where the fill starts.
53F5
INC C 0C
INCrement Register C by 1, the first half of a test of the count for zero.
53F6
DEC C 0D
DECrement Register C by 1, back to the count: the Z FLAG when it is 00H.
53F7
If the NZ FLAG is set (a count), JUMP to 53FCH to fill.
53F9
XOR A AF
Set Register A to 00H (XOR A), for the count to the end of the sector.
53FA
SUB E 93
SUBtract Register E, the offset of the cursor, from Register A: the bytes from the cursor to the end (00H for 256).
53FB
LD C,A 4F
Load Register C with Register A, the count to the end of the sector.
53FC
LD (HL),B 70
Store Register B, the fill byte, into the buffer at Register Pair HL.
53FD
INC L 2C
INCrement Register L by 1, to the next byte of the buffer.
53FE
DEC C 0D
DECrement Register C by 1, one byte filled: the Z FLAG when the count is done.
53FF
If the NZ FLAG is set (bytes left), JUMP to 53FCH to fill the next byte.
5401
RET C9
RETurn to 537AH, or to the caller, with the bytes filled.

5402H - CLEAR, ENTER and BREAK

5402H changes the display mode (5405H changes the byte at Register Pair HL, also the flash phase). ENTER writes the buffer as the sector of the next record number by WRITE@, then BKSP@ keeps it there. BREAK reads the sector again, so the changes are lost.

5402
LD HL,55A7H 21 A7 55
Point Register Pair HL to 55A7H, the display mode: FFH hexadecimal, 00H characters.
5405
LD A,(HL) 7E
Load Register A with the byte at Register Pair HL, the display mode or the flash phase.
5406
XOR FFH EE FF
XOR Register A with FFH: FFH becomes 00H and 00H becomes FFH.
5408
LD (HL),A 77
Store Register A, the other value, into the byte at Register Pair HL.
5409
RET C9
RETurn to the caller with the byte at Register Pair HL changed.
540A
POP BC C1
Restore Register Pair BC from the top of the stack: 537AH, which the write does not return to.
540B
LD DE,55AAH 11 AA 55
Point Register Pair DE to 55AAH, DISKDUMP's file control block.
540E
GOSUB to 4439H, WRITE@, to write the buffer as the record of the file at Register Pair DE.
5411
If the NZ FLAG is set (WRITE@ failed, its error code in Register A), JUMP to 5524H to post the error.
5414
GOSUB to 4445H, BKSP@, to set the file at Register Pair DE one record back, to the sector written.
5417
JUMP to 5259H to show the sector written and take the next command key.
541A
POP BC C1
Restore Register Pair BC from the top of the stack: 537AH, which BREAK does not return to.
541B
JUMP to 5246H to read the sector shown from the file again, without the changes.

541EH - The Screen Address of a Byte

Register E = the offset of a byte in the sector (row in bits 7-4, column in bits 3-0): returns Register Pair HL = the screen address of its first digit, 3C00H + 64 x row + 8 + 2 x column + column / 2. Register Pair BC is saved.

541E
PUSH BC C5
Save Register Pair BC to the top of the stack while the address is made.
541F
LD A,E 7B
Load Register A with Register E, the offset of the byte.
5420
RLCA 07
Rotate Register A left one bit, the first of two (RLCA).
5421
RLCA 07
Rotate Register A left one bit, the second of two: the row's bits 5-4 in bits 7-6 and its bits 7-6 in bits 1-0 (RLCA).
5422
LD C,A 4F
Load Register C with Register A, the rotated offset.
5423
AND C0H E6 C0
AND Register A with C0H, keeping bits 7-6: the low byte of 64 times the row.
5425
LD L,A 6F
Load Register L with Register A, the low byte of the start of the screen row.
5426
LD A,C 79
Load Register A with Register C, the rotated offset.
5427
AND 03H E6 03
AND Register A with 03H, keeping bits 1-0, the high part of 64 times the row.
5429
ADD A,3CH C6 3C
ADD 3CH to Register A, the high byte of the video RAM at 3C00H.
542B
LD H,A 67
Load Register H with Register A: Register Pair HL = the start of the screen row of the byte.
542C
LD A,E 7B
Load Register A with Register E, the offset of the byte.
542D
AND 0FH E6 0F
AND Register A with 0FH, keeping the column of the byte, 0-15.
542F
LD C,A 4F
Load Register C with Register A, the column of the byte, 0-15.
5430
ADD A,A 87
ADD Register A to itself: two times the column.
5431
SRL C CB 39
Shift Register C right one bit (SRL): half the column.
5433
ADD A,C 81
ADD Register C, half the column, to Register A: two and a half times the column.
5434
ADD A,08H C6 08
ADD 08H to Register A, the column of the first byte on the screen row.
5436
OR L B5
OR Register A with Register L, the low byte of the start of the screen row.
5437
LD L,A 6F
Load Register L with Register A: Register Pair HL = the screen place of the byte.
5438
POP BC C1
Restore Register Pair BC from the top of the stack.
5439
RET C9
RETurn to the caller with the screen address in Register Pair HL.

543AH - A Hexadecimal Digit

Register A = a character: returns the NC FLAG and Register A = its value 0-15 for 0-9 and A-F, else the C FLAG; Register B = the character.

543A
LD B,A 47
Load Register B with Register A, the character, kept for the screen.
543B
SUB 30H D6 30
SUBtract 30H from Register A, the character 0: the C FLAG below 0.
543D
RET C D8
If the C FLAG is set (below 0), RETurn to the caller with the C FLAG: not a digit.
543E
CP 0AH FE 0A
Compare Register A against 0AH: the C FLAG for 0-9.
5440
If the C FLAG is set (0-9), JUMP to 5449H, where the CCF makes it the NC FLAG.
5442
CP 11H FE 11
Compare Register A against 11H: the C FLAG for the characters between 9 and A.
5444
RET C D8
If the C FLAG is set (not a digit), RETurn to the caller with the C FLAG.
5445
SUB 07H D6 07
SUBtract 07H from Register A: A-F become 0AH-0FH.
5447
CP 10H FE 10
Compare Register A against 10H: the C FLAG for 0AH-0FH, a digit A-F.
5449
CCF 3F
Complement the C FLAG (CCF): the NC FLAG for a digit, the C FLAG for any other character.
544A
RET C9
RETurn to the caller with the NC FLAG and the value of the digit in Register A, or the C FLAG.

544BH - A Hexadecimal Number

Takes keys until a space, ENTER, BREAK or any other key below 21H; each hexadecimal digit is shifted into Register Pair BC from the right, other keys are ignored. Nothing is shown.

544B
LD BC,0000H 01 00 00
Load Register Pair BC with 0000H, the number before the first digit.
544E
GOSUB to 550EH to wait for a key, Register A, with a lower case letter made upper case.
5451
CP 21H FE 21
Compare Register A against 21H: the C FLAG for a space, ENTER, BREAK or another control key.
5453
RET C D8
If the C FLAG is set (the end), RETurn to the caller with the number in Register Pair BC.
5454
PUSH BC C5
Save Register Pair BC, the number so far, to the top of the stack, since 543AH changes Register B.
5455
GOSUB to 543AH for the value of a hexadecimal digit in Register A, the C FLAG for any other key.
5458
POP BC C1
Restore Register Pair BC, the number so far, from the top of the stack.
5459
If the C FLAG is set (not a digit), JUMP to 544EH: the key is ignored.
545B
LD H,B 60
Load Register H with Register B, the high byte of the number.
545C
LD L,C 69
Load Register L with Register C: Register Pair HL = the number so far.
545D
ADD HL,HL 29
ADD Register Pair HL to itself, the first of four doublings (ADD HL,HL).
545E
ADD HL,HL 29
ADD Register Pair HL to itself, the second of four doublings (ADD HL,HL).
545F
ADD HL,HL 29
ADD Register Pair HL to itself, the third of four doublings (ADD HL,HL).
5460
ADD HL,HL 29
ADD Register Pair HL to itself, the fourth: Register Pair HL = 16 times the number (ADD HL,HL).
5461
ADD A,L 85
ADD Register L to Register A, the value of the digit: the low byte of the new number.
5462
LD C,A 4F
Load Register C with Register A, the low byte of the new number.
5463
LD B,H 44
Load Register B with Register H: Register Pair BC = 16 times the number plus the digit.
5464
JUMP to 544EH for the next key of the number in Register Pair BC.

5466H - Show the Sector

Writes the whole screen straight into the video RAM, in the second register set (EXX), so the main registers are kept. Each of 16 rows: four columns (spaces only on the first display after the prompt), the offset, a colon, then eight groups of two bytes, each a space and four hexadecimal digits (or a space, a character, a space, a character), a space and the 16 characters (spaces in the character mode). Then the drive (FCB+06H) at 3C00H and the low byte of the sector (FCB+0AH) at 3C40H; 55A6H is cleared.

5466
EXX D9
Exchange Register Pairs BC, DE and HL with the alternate set (EXX), so the main registers are kept.
5467
LD DE,3C00H 11 00 3C
Point Register Pair DE to 3C00H, the first place of the video RAM.
546A
LD HL,5600H 21 00 56
Point Register Pair HL to 5600H, the first byte of the sector in the buffer.
546D
LD B,04H 06 04
Load Register B with 04H, the four left columns of the screen row.
546F
LD A,(55A6H) 3A A6 55
Load Register A with the flag of the first display from 55A6H.
5472
OR A B7
OR Register A with itself, to test the flag for zero.
5473
If the Z FLAG is set (not the first display), JUMP to 5478H: the column keeps what it shows.
5475
LD A,20H 3E 20
Load Register A with 20H, a space that clears the column.
5477
LD (DE),A 12
Store Register A, the space, into the video RAM at Register Pair DE.
5478
INC DE 13
INCrement Register Pair DE by 1, to the next place of the screen.
5479
DECrement Register B and, while it is not zero, LOOP BACK to 546FH for the next column (DJNZ).
547B
LD A,L 7D
Load Register A with Register L, the offset of the row's first byte in the sector.
547C
GOSUB to 54FAH to show the offset in Register A as two hexadecimal digits at Register Pair DE.
547F
LD A,3AH 3E 3A
Load Register A with 3AH, the colon after the offset.
5481
GOSUB to 550BH to put the colon in Register A on the screen at Register Pair DE.
5484
LD A,20H 3E 20
Load Register A with 20H, the space before a group of two bytes.
5486
GOSUB to 550BH to put the space in Register A on the screen at Register Pair DE.
5489
LD A,(55A7H) 3A A7 55
Load Register A with the display mode from 55A7H: FFH hexadecimal, 00H characters.
548C
OR A B7
OR Register A with itself, to test the display mode for zero.
548D
If the NZ FLAG is set (hexadecimal), JUMP to 54A3H for the two bytes in hexadecimal.
548F
GOSUB to 54EDH to put the byte at Register Pair HL on the screen at Register Pair DE as a character.
5492
LD A,20H 3E 20
Load Register A with 20H, the space after the character.
5494
GOSUB to 550BH to put the space in Register A on the screen at Register Pair DE.
5497
INC L 2C
INCrement Register L by 1, to the second byte of the group.
5498
GOSUB to 54EDH to put the byte at Register Pair HL on the screen at Register Pair DE as a character.
549B
LD A,20H 3E 20
Load Register A with 20H, the space after the second character.
549D
GOSUB to 550BH to put the space in Register A on the screen at Register Pair DE.
54A0
INC L 2C
INCrement Register L by 1, to the first byte of the next group.
54A1
JUMP to 54ADH for the test of the end of the row.
54A3
LD A,(HL) 7E
Load Register A with the first byte of the group at Register Pair HL.
54A4
GOSUB to 54FAH to show the byte in Register A as two hexadecimal digits at Register Pair DE.
54A7
INC L 2C
INCrement Register L by 1, to the second byte of the group.
54A8
LD A,(HL) 7E
Load Register A with the second byte of the group at Register Pair HL.
54A9
GOSUB to 54FAH to show the byte in Register A as two hexadecimal digits at Register Pair DE.
54AC
INC L 2C
INCrement Register L by 1, to the first byte of the next group.
54AD
LD A,L 7D
Load Register A with Register L, the offset of the next byte.
54AE
AND 0FH E6 0F
AND Register A with 0FH: the Z FLAG at the start of the next row of 16 bytes.
54B0
If the NZ FLAG is set (more of the row), JUMP to 5484H for the next group.
54B2
LD A,20H 3E 20
Load Register A with 20H, the space before the characters of the row.
54B4
GOSUB to 550BH to put the space in Register A on the screen at Register Pair DE.
54B7
LD A,L 7D
Load Register A with Register L, the offset of the next row.
54B8
SUB 10H D6 10
SUBtract 10H from Register A, back to the first byte of this row.
54BA
LD L,A 6F
Load Register L with Register A: Register Pair HL = the first byte of the row again.
54BB
LD A,(55A7H) 3A A7 55
Load Register A with the display mode from 55A7H: FFH hexadecimal, 00H characters.
54BE
OR A B7
OR Register A with itself, to test the display mode for zero.
54BF
PUSH AF F5
Save Register Pair AF, the Z FLAG of the character mode, to the top of the stack.
54C0
LD A,20H 3E 20
Load Register A with 20H, a space, the place of a character in the character mode.
54C2
If the Z FLAG is set (the character mode), GOSUB to 550BH to put the space in Register A at Register Pair DE.
54C5
POP AF F1
Restore Register Pair AF, the flags of the display mode, from the top of the stack.
54C6
If the NZ FLAG is set (hexadecimal), GOSUB to 54EDH to put the byte at Register Pair HL at Register Pair DE as a character.
54C9
INC L 2C
INCrement Register L by 1, to the next byte of the row.
54CA
LD A,L 7D
Load Register A with Register L, the offset of the next byte.
54CB
AND 0FH E6 0F
AND Register A with 0FH: the Z FLAG at the end of the row.
54CD
If the NZ FLAG is set (more of the row), JUMP to 54BBH for the next character.
54CF
INC L 2C
INCrement Register L by 1, the first half of a test of Register L for zero.
54D0
DEC L 2D
DECrement Register L by 1, back: the Z FLAG when Register L is 00H, past the last row.
54D1
If the NZ FLAG is set (more rows), JUMP to 546DH for the next row of the screen.
54D3
LD DE,3C00H 11 00 3C
Point Register Pair DE to 3C00H, the top left place of the screen.
54D6
LD A,(55B0H) 3A B0 55
Load Register A with the drive from 55B0H (FCB+06H).
54D9
AND 0FH E6 0F
AND Register A with 0FH, keeping the drive number.
54DB
GOSUB to 54FAH to show the drive in Register A as two hexadecimal digits at Register Pair DE.
54DE
LD DE,3C40H 11 40 3C
Point Register Pair DE to 3C40H, the first place of the second screen row.
54E1
LD A,(55B4H) 3A B4 55
Load Register A with the low byte of the next record number from 55B4H (FCB+0AH), the sector shown.
54E4
GOSUB to 54FAH to show the sector in Register A as two hexadecimal digits at Register Pair DE.
54E7
XOR A AF
Set Register A to 00H (XOR A), for the flag of the first display.
54E8
LD (55A6H),A 32 A6 55
Store Register A (00H) into 55A6H: the next display keeps the four left columns.
54EB
EXX D9
Exchange Register Pairs BC, DE and HL back from the alternate set (EXX), the main set again.
54EC
RET C9
RETurn to the caller with the sector on the screen.

54EDH - A Character, Two Hexadecimal Digits, a Place

54EDH puts the byte at Register Pair HL on the screen as a character, a period for a byte below 20H or from C0H on; 54FAH puts Register A as two hexadecimal digits (Register C changed); 550BH puts Register A at Register Pair DE and moves on.

54ED
LD A,(HL) 7E
Load Register A with the byte at Register Pair HL.
54EE
CP 20H FE 20
Compare Register A against 20H: the C FLAG for a control code.
54F0
If the C FLAG is set (a control code), JUMP to 54F6H for a period.
54F2
CP C0H FE C0
Compare Register A against C0H: the C FLAG below the space compression codes.
54F4
If the C FLAG is set (a character or a graphics block), JUMP to 550BH to put it on the screen.
54F6
LD A,2EH 3E 2E
Load Register A with 2EH, the period shown for a byte with no character.
54F8
JUMP to 550BH to put the period on the screen at Register Pair DE.
54FA
LD C,A 4F
Load Register C with Register A, the byte, for the low digit.
54FB
RRA 1F
Rotate Register A right through the C FLAG, the first of four that bring the high digit to bits 3-0 (RRA).
54FC
RRA 1F
Rotate Register A right through the C FLAG, the second of four (RRA).
54FD
RRA 1F
Rotate Register A right through the C FLAG, the third of four (RRA).
54FE
RRA 1F
Rotate Register A right through the C FLAG, the fourth of four: the high digit in bits 3-0 (RRA).
54FF
GOSUB to 5503H to put the high digit in bits 3-0 of Register A on the screen at Register Pair DE.
5502
LD A,C 79
Load Register A with Register C, the byte, for the low digit.
5503
AND 0FH E6 0F
AND Register A with 0FH, keeping the digit in bits 3-0.
5505
ADD A,90H C6 90
ADD 90H to Register A, the first step of the DAA method for a hexadecimal digit.
5507
DAA 27
Decimal adjust Register A (DAA): 90H-99H for 0-9, or 00H-05H with the C FLAG for 0AH-0FH.
5508
ADC A,40H CE 40
ADD 40H and the C FLAG to Register A (ADC), the third step of the DAA method.
550A
DAA 27
Decimal adjust Register A (DAA): the character 0-9 or A-F of the digit.
550B
LD (DE),A 12
Store Register A, the character, into the video RAM at Register Pair DE.
550C
INC DE 13
INCrement Register Pair DE by 1, to the next place of the screen.
550D
RET C9
RETurn to the caller with Register Pair DE at the next place.

550EH - A Key

Waits for a key by the ROM's 0049H; a lower case letter becomes upper case (5513H, also entered on its own). Register Pair DE is saved.

550E
PUSH DE D5
Save Register Pair DE to the top of the stack around the wait for a key.
550F
GOSUB to 0049H, the ROM's wait for a key: Register A = the key.
5512
POP DE D1
Restore Register Pair DE from the top of the stack.
5513
CP 41H FE 41
Compare Register A against 41H, the letter A: the C FLAG below it.
5515
RET C D8
If the C FLAG is set (below A), RETurn to the caller with the key unchanged.
5516
CP 7BH FE 7B
Compare Register A against 7BH, the character after z: the NC FLAG from it on.
5518
RET NC D0
If the NC FLAG is set (after z), RETurn to the caller with the key unchanged.
5519
RES 5,A CB AF
Reset bit 5 of Register A: a lower case letter becomes upper case.
551B
RET C9
RETurn to the caller with the key in Register A.

551CH - The Errors

551CH the error 2CH, Illegal filespec; 551FH, inside the LD BC at 551EH, 22H, Attempted to use non program file as a program; 5522H, inside the LD BC at 5521H, 2DH, Invalid data provided; 5524H any error code in Register A. The screen is cleared when it shows a sector, the error is posted with bits 7 and 6 set (ERROR@ returns, no frame), and DISKDUMP goes back to the asterisk prompt.

551C
LD A,2CH 3E 2C
Load Register A with 2CH, the error code of Illegal filespec, and fall into the LD BC below.
551E
LD BC,223EH 01 3E 22
551FH enters inside this LD BC,223EH: its bytes 3EH 22H read as LD A,22H, the error of a file that is not a load module; from above it only loads Register Pair BC.
5521
LD BC,2D3EH 01 3E 2D
5522H enters inside this LD BC,2D3EH: its bytes 3EH 2DH read as LD A,2DH, Invalid data provided; from above it only loads Register Pair BC.
5524
PUSH AF F5
Save Register Pair AF, the error code in Register A, to the top of the stack.
5525
LD A,(55A6H) 3A A6 55
Load Register A with the flag of the first display from 55A6H: 00H once a sector is on the screen.
5528
OR A B7
OR Register A with itself, to test the flag for zero.
5529
If the Z FLAG is set (a sector is shown), GOSUB to 01C9H, the ROM's clear screen.
552C
POP AF F1
Restore Register Pair AF, the error code in Register A, from the top of the stack.
552D
OR C0H F6 C0
OR Register A with C0H, setting bits 7 and 6: ERROR@ returns, and shows the message without the frame of asterisks.
552F
GOSUB to 4409H, ERROR@, to show the message of the error code in Register A.
5532
JUMP to 5213H for the asterisk prompt and another file.

5535H - The Data

The table of the cursor keys of the modify mode (5535H, three bytes an entry: the key, the mask ANDed with the offset, the addend), the heading and the variables. The file control block 55AAH-55C9H and the buffer 5600H are not loaded.

5535-5537
DEFB 09H,FFH,01H 09 FF 01
The right arrow (09H): the offset plus 1, the next byte.
5538-553A
DEFB 08H,FFH,FFH 08 FF FF
The left arrow (08H): the offset plus FFH, the byte before.
553B-553D
DEFB 0AH,FFH,10H 0A FF 10
The down arrow (0AH): the offset plus 10H, the byte below.
553E-5540
DEFB 5BH,FFH,F0H 5B FF F0
The up arrow (5BH): the offset plus F0H, the byte above.
5541-5543
DEFB 19H,F0H,0FH 19 F0 0F
SHIFT and the right arrow (19H): the offset AND F0H plus 0FH, the last byte of the row.
5544-5546
DEFB 18H,F0H,00H 18 F0 00
SHIFT and the left arrow (18H): the offset AND F0H, the first byte of the row.
5547-5549
DEFB 1BH,00H,00H 1B 00 00
SHIFT and the up arrow (1BH): the offset 00H, the first byte of the sector.
554A
DEFB 00H 00
The 00H that ends the table of the cursor keys.
554B-5573
DEFM "DISKDUMP - DOSPLUS File dump/edit - 3.50" / DEFB 0AH 44 49 53 4B 44 55 4D 50 20 2D 20 44 4F 53 50 4C 55 53 20 46 69 6C 65 20 64 75 6D 70 2F 65 64 69 74 20 2D 20 33 2E 35 30 0A
The heading (520DH): DISKDUMP - DOSPLUS File dump/edit - 3.50 and a line feed.
5574-55A4
DEFM "(c) Copyright 1983, Micro-Systems Software Inc." / DEFB 0AH,0DH 28 63 29 20 43 6F 70 79 72 69 67 68 74 20 31 39 38 33 2C 20 4D 69 63 72 6F 2D 53 79 73 74 65 6D 73 20 53 6F 66 74 77 61 72 65 20 49 6E 63 2E 0A 0D
The copyright line, a line feed and the 0DH at which DSPLY@ stops.
55A5
DEFB FFH FF
The phase of the flashing of F (52AEH): FFH the blocks are shown, 00H the sector.
55A6
DEFB FFH FF
The flag of the first display (5223H, 546FH): FFH the four left columns are cleared, 00H once a sector is shown.
55A7
DEFB FFH FF
The display mode (52A0H, 5489H, 5402H): FFH hexadecimal with the characters, 00H characters alone.
55A8-55A9
DEFB FFH,FFH FF FF
The load address of P (5326H, 5358H), FFFFH as loaded.
55AA-55C9
DEFS 32
The file control block of the file (5200H): FCB+01H 55ABH, FCB+05H 55AFH, FCB+06H 55B0H the drive, FCB+08H 55B2H the end of file byte, FCB+0AH 55B4H the next record number, FCB+0CH 55B6H the ending record number.
5600-56FF
DEFS 256
The reply to the asterisk prompt (521AH), then the buffer of the file: the sector shown and changed (523DH).