LDOS 5.3.1 for the Model III - FED/CMD Disassembled

Page Customization

Introduction/Summary

LDOS 5.3.1 FED/CMD Disassembly - The File Editor (Model III)

FED/CMD, the LDOS File Editor (its title reads FED - File Editor Version 1.0.2, Copyright 1987 MISOSYS), displays and changes the records of a file one at a time: FED (filespec) (M-40-060, version 5). The record of 256 bytes is read into an edit buffer and shown in hex and as characters, either all 256 bytes (the 256 byte mode, with the inputs in a box at the right edge) or a window of 128 bytes with more room for the labels (the 128 byte mode). One letter is a command: the semicolon and the minus sign step through the records, B, E and R position, H and A change bytes in hex or as characters, S writes the record back, C, F, G, L, Z and M search the file or its load module structure, D, P and O print, T switches the display and = shows a byte in binary; ENTER alone shows the list of the commands. FED works on the file through @POSN, @READ and @VER and never closes it.

The file is a load module of 6918 bytes: a copyright record, then thirty load blocks for 59A8H-5BDBH, 5C0EH-6030H, 6063H-68F8H and 68FEH-746BH (6747 bytes) and the transfer address record for 6063H. The texts and a whole help screen of 1024 bytes come first, then the cells, then the code. Every buffer is below the file, from 5200H: the file control block 5242H, the edit buffer 5262H, the buffer of the file 5362H, a copy 5462H and the image of the screen 5562H, which is built in memory and copied to video memory. One file serves the Model I and the Model III: the start-up picks the address of the BREAK switch of LDOS by the ROM and puts a RET there, so that BREAK comes to FED as a key.

What FED Does

StepWhat Happens
The startThe BREAK switch, the video test for lower case, the file from the command line or from the prompt Filespec:; @FSPEC and @OPEN, the last record, record 0 shown (6063H, 657CH, 6C23H).
The command loopThe stack, the blinking cursors, the key; the state at 6013H says what the key means: a command letter, a digit of H, a character of A, ENTER after S, N or X, the characters after R, L, C or F (60ADH, 6B6BH, 61C6H).
MovingThe arrow keys in the record; the semicolon, the minus sign, B, E and R through the file (65FFH, 6284H).
ChangingH and A change the edit buffer, S writes it back, for DIR/SYS with the deleted data mark (66DFH, 6737H, 63A6H).
SearchingC and F look for a string from the cursor, G repeats the last search, L finds a load address, Z goes to the next load block, M works out where the byte at the cursor loads (701BH, 708AH, 7174H, 6466H, 730DH).
The screensThe two display modes built in the image of the screen, the input box, the errors, the help screen (6953H, 6A62H, 6D06H, 6DA6H, 6E58H).
Printing and the endD, P and O on the printer, BREAK while printing; X ends FED and puts the BREAK switch back (62F9H, 6ED9H, 6F9BH, 685DH).

About This Page

The site has no Model I page of FED/CMD, so this page is written from the bytes of the Model III file alone. The only operand chosen by the model is the address of the BREAK switch: 4405H on the Model III, 4315H on the Model I (6064H). Every byte of the file is shown at its address, and the work areas below the file are listed as rows that are not in the file. Found in the code: while D prints, the box of the record number shows the number at 602DH, the record of the last scan of Z, L or M (0 when there was none), and not the record being printed, since D reads its records through 72D1H. Every command that ends with an asterisk (704AH), every error and M clear the kind of the last search at 6030H, so that G after them shows an asterisk. S of DIR/SYS takes only error 06H of @VER as the good end: a result of 00H is shown as an error (6401H). The results of @POSN are not tested in 72D1H and 7331H; 6CB3H tests the result of @READ only after the display is built, which works because LDIR and 6953H leave Register Pair AF as @READ left it. The binary value is the key = (3DH), as on the help screen, and only in the 128 byte mode. The window of the 128 byte mode never starts above 80H. The scan of 72AFH with a count of 00H returns with the register sets exchanged. Not used: the 128 bytes of 00H at 64CEH-654DH, the code at 68EBH-68EEH (Register B is never 00H there), the cells 600EH and 6018H-6019H, the byte 0DH at 5AE4H and the spaces at 59D6H-59E4H and 5B79H-5BDBH.

Memory Map

Load Blocks in File Order

The copyright record (type 1FH, Copyright 1991 MISOSYS, Inc., All rights reserved), then thirty load blocks: 6747 bytes. 5BDCH-5C0DH, 6031H-6062H and 68F9H-68FDH are not in the file. The transfer address is 6063H.

AddressContents
59A8H-5AA7H, 5AA8H-5BA7H, 5BA8H-5BDBH256, 256 and 52 bytes: the labels, the name as shown, the title, the copyright, the prompts and the error texts
5C0EH-5D0DH, 5D0EH-5E0DH, 5E0EH-5F0DH, 5F0EH-600DH256 bytes each: the help screen, 16 rows of 64 characters
600EH-6030H35 bytes: the cells of FED
6063H-6162H to 6763H-6862H (eight blocks), 6863H-68F8H256 bytes each and 150 bytes: the start, the command loop, the commands, the spare area, the register saver, the cursor keys, the modify modes, the command line, the conversions
68FEH-69FDH to 72FEH-73FDH (eleven blocks), 73FEH-746BH256 bytes each and 110 bytes: the hex digits, the displays, the cursors, the file, the input box, the errors, the help screen, printing, the searches, L, the scan and M

Sections of the Disassembly

AddressContents
5200HThe Work Areas Below the File
59A8HThe Texts of the Screen
5C0EHThe Help Screen
600EHThe Cells of FED
6063HThe Start: the BREAK Switch and the File
60ADHThe Command Loop
610CHThe Characters After a Command
616AHCarry Out the Command
61A9HL: The Address to Locate
61C6HThe Command Letters
624EH=: The Byte in Binary
6284HForward, Backward, R, B and E
62F9HN, D, P, O and T
63A6HS: Save the Record
6409HX, F, C, L and G
6466HZ: The Next Load Block
64CEHA Spare Area
654EHClear the Screen; the Register Saver
657CHLower Case or Capitals
65B0HThe Name of the File as Shown
65E5HShow a Text
65FFHThe Cursor Keys
66DFHH: Hex Modify
6737HA: ASCII Modify
6791HThe Command Line
67DBHCursors Off; Hex Digits and Keys
68A5HNumbers in Decimal and Hex
6953HThe Display of the 256 Byte Mode
6A24HThe Record Number and the Last Record
6A62HThe Display of the 128 Byte Mode
6B6BHThe Blinking Cursors
6C23HAsk for the File and Open It
6C9BHRead a Record
6D06HThe Input Box
6DA6HThe Errors
6E58HThe Help Screen
6E96HExchange the Help Screen; BREAK While Printing
6ED9HPrint the Edit Buffer
6F9BHThe Printer and the Title
701BHF and C: Take the String
708AHThe Search for a String
7174HL: Locate a Load Address
72ADHMove Through the File
730DHM: The Load Address of the Byte

Memory FED/CMD Uses

AddressContents
0023H, 002BH, 0033H, 003BH, 0040HROM: the control request to a device (the printer status), the keyboard scan, the display of a character, the output of a character to the printer, the line input (the same in ROM 3.1 and ROM 1.3).
0125HThe ROM byte of the model test: 49H in ROM 3.1.
3840HThe keyboard matrix, row 6: bit 2, BREAK, while printing.
3C00H-3FFFHVideo memory: the screen image is copied there; the cursors, the input box and the inputs are written there directly.
4020H-4021HThe cursor of the video (the display control block +03H).
4025HThe printer's device control block, for the status request.
402DH@EXIT, the end of FED.
4405HThe BREAK switch of LDOS (4315H on the Model I): a RET while FED runs.
4409H@ERROR: the messages of the errors, short form, returning.
441CH, 4424H@FSPEC and @OPEN: the file.
4436H, 443CH, 4442H@READ, @VER and @POSN: a record of the file.
4764H-4765H, 4769H-476AHSYS0/SYS: the function of WRSECT (0DH) and of WRPROT (0EH); S of DIR/SYS puts 0EH into WRSECT for the write.
5200H-59A7HThe work areas: the input box, the file control block, the edit buffer, the buffer of the file, the copy, the screen image, the command line.

Variables

The entry points of FED/CMD, then the data of the file, the operands it changes, and the cells outside the file that it uses, by address.

Entry Points

AddressContents
6063HThe start of FED/CMD, the transfer address of the file.
609EH, 60A5HAsk for a file (N, an error before a file is open); clear the command line and go into the loop.
60ADHThe command loop: every command ends here.
61C6HThe command letters.
654EH, 655FHClear the screen; the register saver used by most routines.
657CH, 659BH, 65A7HThe video test for lower case; a capital with or without bit 7.
65B0H, 65E5H, 65F5HThe name as shown; show a text ended by bit 7; show one at 3FEEH.
6605H, 662EH, 6651H, 66B3HMove the cursor; one byte on; show the offset and the value; move the window.
674FH, 6768H, 6781HShow a byte as a character and in hex; store it and move on.
6791H, 679FH, 67BCH, 67C6HThe command line.
67DBHTake the cursors off the screen.
67F2H, 67FBH, 6818H, 6821HTwo hex digits as a byte; test for a digit and a hex digit.
682FH, 684FH, 685DHTake a key; BREAK; the end of FED.
6870H, 6880HClear the input line; a byte as two hex digits.
68A5H, 68FEH, 692EHRegister Pair DE in decimal; in hex; hex digits into Register Pair DE.
6953H, 6A62HBuild the display of the 256 and of the 128 byte mode.
6A24H, 6A49HShow the record number; the asterisk of the last record.
6B4EH, 6B5AHShow the screen image; clear it.
6B6BH, 6B7FH, 6B95H, 6BC7HThe blink; the command cursor; the record cursors; the places of the byte.
6C23H, 6C5DHAsk for the file; open it.
6C9BH, 6CC8H, 6CCFHRead a record; read and show it; read it and the next.
6D06H, 6D30H, 6D46H, 6D78HThe input box: draw, clear, keep, put back.
6DA6H, 6DBFH, 6DD6HAn error; its message; the prompt and the wait.
6E58H, 6E96HThe help screen; exchange it with the screen.
6EB2H, 6ED9H, 6F78H, 6F8DH, 6F92HBREAK while printing; print the record; a byte in hex, a line end, a character to the printer.
6F9BH, 6FBBHThe printer status; the title of the record.
701BH, 704AH, 705FHThe box for F and C; the asterisk; set up the string.
708AH, 70A0H, 70D2HThe search from the cursor, from a place, from the next record.
7138H, 7156H, 7162HShow the record found; the last record; the last byte of the file.
7174H, 7188HL from record 0; G for L.
7291H, 729BHSkip a block; show the record of the scan.
72ADH, 72AFH, 72D1HMove the scan one byte, Register A bytes; read record Register Pair BC.
72FEH, 744EH, 745DHCopy the buffer of the file to the edit buffer; keep and put back the edit buffer.
730DHM.

Data in the File

Address
Size
Contents
59A8H-59C7H
32 bytes
DEFM "00102030405060708090A0B0C0D0E0F0"
59A8H-59C7H: sixteen pairs of characters, a hex digit 0-F and 0: 69B2H copies them as the row labels 00-F0 of the 256 byte mode (from 5573H, one pair a row), 6AA4H in reversed order as the column labels 00-0F of the 128 byte mode, and 6AC1H eight of them as its row labels.
59C8H-59D5H
14 bytes
DEFB 20H x 14
59C8H-59D5H: the name of the file as shown: 65B0H fills it with spaces and copies the file name up to the period, the colon or 0DH, in capitals, then a colon and the drive digit (at the address kept at 6027H). 69C8H shows the 14 characters down column 33 in the 256 byte mode; 6FBBH copies them into the title of a printed record.
59D6H-59E4H
15 bytes
DEFB 20H x 15
59D6H-59E4H: fifteen spaces after the name. No instruction of FED/CMD addresses them: they only fill the room up to the title.
59E5H-5A02H
30 bytes
DEFM "FED - File Editor Version 1.0" / DEFB 0AEH
59E5H-5A02H: the title displayed at 3C00H, the top left corner of the screen, by 6C26H when FED asks for a file. 5A02H is AEH, the period with bit 7 set, the end of the text for 65E5H.
5A03H-5A06H
4 bytes
DEFM "2 " / DEFB 0A0H
5A03H-5A06H: the end of the version number: 2 and three spaces, the last (A0H) with bit 7 set. 6C2FH displays them after the title, so the screen reads Version 1.0.2.
5A07H-5A37H
49 bytes
DEFM "Copyright 1987 MISOSYS, Inc. All rights reserved" / DEFB 0AEH
5A07H-5A37H: the copyright line displayed at 3C40H, the second row, by 6C33H. The last byte, AEH, is the period with bit 7 set.
5A38H-5A41H
10 bytes
DEFM "Filespec:" / DEFB 0A0H
5A38H-5A41H: the prompt displayed at 3D00H, the fifth row, by 6C3CH; the file specification is typed after it through ROM 0040H. The last byte, A0H, is a space with bit 7 set.
5A42H-5A50H
15 bytes
DEFM "Relative Byte " / DEFB 0BEH
5A42H-5A50H: the label of the byte cursor in the 128 byte mode, copied to 5911H of the screen image by 6B35H; the offset of the byte follows at 5920H (6664H). The last byte, BEH, is the character 3EH with bit 7 set.
5A51H-5A58H
8 bytes
DEFM "Command" / DEFB 0BAH
5A51H-5A58H: the label of the command line in the 128 byte mode, copied to 5922H of the screen image by 6B41H. The last byte, BAH, is the colon with bit 7 set.
5A59H-5A83H
43 bytes
DEFM "Press <ENTER> to continue, <BREAK> to abor" / DEFB 0F4H
5A59H-5A83H: the prompt after an error, displayed at 3F0AH by 6DD6H. 6DF3H copies 5A5FH-5A65H, the word <ENTER> with its brackets, and 5A74H-5A7AH, <BREAK>, over the prompt in turn with spaces, so that the two keys blink. The last byte is F4H, the t with bit 7 set.
5A84H-5A8CH
9 bytes
DEFM " Drive "
5A84H-5A8CH: the first part of the title of a printed record: three spaces, Drive and a space; 6FD2H copies these 9 bytes after the name and 6FDBH puts the drive digit after them.
5A8DH-5A96H
10 bytes
DEFM " Record "
5A8DH-5A96H: the second part of the title of a printed record: three spaces, Record and a space; 6FDEH copies these 10 bytes and 6FEAH puts the record number in decimal after them.
5A97H-5A9AH
4 bytes
DEFM " X'"
5A97H-5A9AH: the third part of the title of a printed record: two spaces, X and the apostrophe; 6FF9H copies these 4 bytes and 7006H puts the record number in four hex digits after them, then an apostrophe (7015H).
5A9BH-5AE3H
73 bytes
DEFM "0123456789ABCDEF BYTE 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F"
5A9BH-5AE3H: the heading line of a printed record, 73 characters printed by 6EFFH: the column digits of the ASCII part, BYTE, and the column numbers 00-0F of the hex part with two extra spaces after 07.
5AE4H
1 byte
DEFB 0DH
5AE4H: 0DH after the heading line. 6EFFH prints 49H bytes and stops before it, then ends the line itself through 6F8DH: the byte is not used.
5AE5H-5AF5H
17 bytes
DEFM "Printer Not Read" / DEFB 0F9H
5AE5H-5AF5H: the text displayed at 3D98H by 6FACH when ROM 0023H finds the printer not ready. The last byte, F9H, is the y with bit 7 set.
5AF6H-5B10H
27 bytes
DEFM "File not load module forma" / DEFB 0F4H
5AF6H-5B10H: the error of Z and M when a type byte is not one of a load module, displayed at 3D93H by 71EDH. The last byte, F4H, is the t with bit 7 set.
5B11H-5B26H
22 bytes
DEFM "Byte not in load bloc" / DEFB 0EBH
5B11H-5B26H: the error of M when the byte at the cursor is not in a load block, displayed at 3D95H by 736FH. The last byte, EBH, is the k with bit 7 set.
5B27H-5B3CH
22 bytes
DEFM "Load address not foun" / DEFB 0E4H
5B27H-5B3CH: the error of L when the end of the file comes before the address, displayed at 3D96H by 71C0H. The last byte, E4H, is the d with bit 7 set.
5B3DH-5B53H
23 bytes
DEFM "Cursor not on Type byt" / DEFB 0E5H
5B3DH-5B53H: the error of Z when the cursor is not on a type byte, displayed at 3D94H through 71F3H by 64A4H. The last byte, E5H, is the e with bit 7 set.
5B54H-5B65H
18 bytes
DEFM " Loads at X' " / DEFB 0A7H
5B54H-5B65H: the answer of M in the 128 byte mode, displayed at 3FEEH by 742EH; the four hex digits of the address go to 3FFBH-3FFEH over the four spaces. The last byte, A7H, is the apostrophe with bit 7 set.
5B66H-5B6BH
6 bytes
DEFM "X' '="
5B66H-5B6BH: the start of the binary display of = (625DH copies these 6 bytes to 3FCAH) and of the value line of the 128 byte mode (66A8H): X, apostrophe, two places for the hex digits (5B68H-5B69H, stored by 6679H), apostrophe and the equals sign.
5B6CH-5B78H
13 bytes
DEFM " Values " / DEFB 0A0H
5B6CH-5B78H: three places for the decimal value (5B6CH-5B6EH, stored by 6686H), then the label Values and spaces, copied to 5951H of the screen image and to 3FEFH by 668FH and 6696H. The last byte, A0H, is a space with bit 7 set.
5B79H-5BDBH
99 bytes
DEFB 20H x 99
5B79H-5BDBH: 99 spaces that no instruction of FED/CMD addresses: they fill the load block up to its end at 5BDBH.
5C0EH-5C4DH
64 bytes
DEFB 20H x 64
5C0EH-5C4DH: row 0 of the help screen (video memory 3C00H), 64 spaces: a blank row between the groups of commands.
5C4EH-5C8DH
64 bytes
DEFM " <;> Forward ONE Record <BREAK> Cancels command"
5C4EH-5C8DH: row 1 of the help screen (video memory 3C40H): <;> forward one record, <BREAK> cancels the command.
5C8EH-5CCDH
64 bytes
DEFM " <-> Backward ONE Record <N><ENTER> New File "
5C8EH-5CCDH: row 2 of the help screen (video memory 3C80H): <-> backward one record, <N><ENTER> a new file.
5CCEH-5D0DH
64 bytes
DEFM " <B> Beginning Record of File <S><ENTER> Save Record "
5CCEH-5D0DH: row 3 of the help screen (video memory 3CC0H): <B> the first record, <S><ENTER> save the record; 3CE9H, the word ENTER of this row on the screen, is the text that blinks on the last row (6E69H).
5D0EH-5D4DH
64 bytes
DEFM " <E> Ending Record of File <X><ENTER> Exit FED "
5D0EH-5D4DH: row 4 of the help screen (video memory 3D00H): <E> the last record, <X><ENTER> exit FED.
5D4EH-5D8DH
64 bytes
DEFM " <R> Position to Record <H> Hexadecimal Modify "
5D4EH-5D8DH: row 5 of the help screen (video memory 3D40H): <R> position to a record, <H> hex modify.
5D8EH-5DCDH
64 bytes
DEFM " <Z> Go to next Load Block <A> ASCII Modify "
5D8EH-5DCDH: row 6 of the help screen (video memory 3D80H): <Z> the next load block, <A> ASCII modify.
5DCEH-5E0DH
64 bytes
DEFM " <M> Calculate Load Address <T> Toggle Display modes "
5DCEH-5E0DH: row 7 of the help screen (video memory 3DC0H): <M> the load address of the byte, <T> toggle the display mode.
5E0EH-5E4DH
64 bytes
DEFB 20H x 64
5E0EH-5E4DH: row 8 of the help screen (video memory 3E00H), 64 spaces: a blank row between the groups of commands.
5E4EH-5E8DH
64 bytes
DEFM " <C> Find ASCII String <F> Find Hex string "
5E4EH-5E8DH: row 9 of the help screen (video memory 3E40H): <C> find an ASCII string, <F> find a hex string.
5E8EH-5ECDH
64 bytes
DEFM " <L> Locate Hex Load Address <G> Go next occurrence "
5E8EH-5ECDH: row 10 of the help screen (video memory 3E80H): <L> locate a hex load address, <G> go to the next occurrence.
5ECEH-5F0DH
64 bytes
DEFB 20H x 64
5ECEH-5F0DH: row 11 of the help screen (video memory 3EC0H), 64 spaces: a blank row between the groups of commands.
5F0EH-5F4DH
64 bytes
DEFM " <D> Dump File to Printer <O> Output top-of-form "
5F0EH-5F4DH: row 12 of the help screen (video memory 3F00H): <D> dump the file to the printer, <O> top of form.
5F4EH-5F8DH
64 bytes
DEFM " <P> Send Buffer to Printer <=> Display Binary Value "
5F4EH-5F8DH: row 13 of the help screen (video memory 3F40H): <P> the buffer to the printer, <=> the binary value.
5F8EH-5FCDH
64 bytes
DEFB 20H x 64
5F8EH-5FCDH: row 14 of the help screen (video memory 3F80H), 64 spaces: a blank row between the groups of commands.
5FCEH-600DH
64 bytes
DEFM " Press <ENTER> to Return to Display Mode "
5FCEH-600DH: row 15 of the help screen (video memory 3FC0H): Press <ENTER> to Return to Display Mode; 6E76H blinks the word ENTER at 3FD3H-3FD7H with the spaces at 3FF6H.
600EH
1 byte
DEFB 00H
600EH: not used: no instruction of FED/CMD reads or writes it.
600FH
1 byte
DEFB 00H
600FH: the byte of the BREAK switch kept by 6072H (4405H on the Model III, 4315H on the Model I) and put back by 6869H when FED ends.
6010H-6011H
2 bytes
DEFB 00H x 2
6010H-6011H: the address of the BREAK switch, 4405H or 4315H, stored by 6077H; 6075H puts the RET there while FED runs, so that BREAK comes to FED as key 01H.
6012H
1 byte
DEFB 00H
6012H: 00H while no file is open, 01H from 60AAH on: 67DBH does nothing while it is 00H, and an error (6DA9H) goes back to the prompt for a file.
6013H
1 byte
DEFB 00H
6013H: the state of the command line: 00H no command, 01H and 02H the two digits of H, 03H A, 04H-08H R and its digits, 08H S, 09H N, 0AH X, 11H P, 12H D, 13H M, 14H-18H L, 18H Z, 42H F and 82H C; 6141H counts the characters typed by INC.
6014H
1 byte
DEFB 00H
6014H: the phase of the two cursors in the record, switched by 6B9BH: 01H while the cursor blocks B0H are shown.
6015H
1 byte
DEFB 00H
6015H: the phase of the cursor of the command line, switched by 6B82H: 01H while the block 8FH is shown at the cursor (4020H).
6016H-6017H
2 bytes
DEFB 00H x 2
6016H-6017H: the place in the command line (5962H-59A3H) for the next character typed, set by 679FH, 6791H and 7064H.
6018H-6019H
2 bytes
DEFB 00H x 2
6018H-6019H: not used: no instruction of FED/CMD reads or writes them.
601AH
1 byte
DEFB 00H
601AH: the count of the key scans to the next blink of the record cursors (6B6EH, reloaded with 19H).
601BH
1 byte
DEFB 0CH
601BH: 0CH in the file: the count of the blinks of the record cursors to the next blink of the command cursor (6B78H, reloaded with 0FH).
601CH-601DH
2 bytes
DEFB 00H x 2
601CH-601DH: the address of the byte at the cursor in the edit buffer, 5262H-5361H.
601EH
1 byte
DEFB 00H
601EH: the offset of the first byte shown in the 128 byte mode, a multiple of 10H from 00H to 80H (66D0H, 6A81H).
601FH
1 byte
DEFB 00H
601FH: 00H: the high byte when 601EH is loaded as a word (6A87H, 6AC4H, 6C02H): Register B then holds 00H.
6020H
1 byte
DEFB 00H
6020H: the display mode: 00H the 256 byte mode, 01H the 128 byte mode; T switches it (6397H).
6021H-6022H
2 bytes
DEFB 00H x 2
6021H-6022H: the number of the record in the edit buffer.
6023H-6024H
2 bytes
DEFB 00H x 2
6023H-6024H: the record number kept while D, a search or a scan reads other records, and the record the search found.
6025H-6026H
2 bytes
DEFB 00H x 2
6025H-6026H: the number of the last record of the file: the ending record number of the file control block less one (6C81H).
6027H-6028H
2 bytes
DEFB 00H x 2
6027H-6028H: the place of the drive digit in the shown name 59C8H-59D5H, after the colon (65E1H); 6C7BH stores the digit there.
6029H
1 byte
DEFB 00H
6029H: the count of the passes to the next blink of the prompt after an error or of the help screen (64H).
602AH
1 byte
DEFB 00H
602AH: the phase of that blink, switched by 6DEEH and 6E64H.
602BH
1 byte
DEFB 00H
602BH: the offset in the record of the byte being looked at by Z, L, M, C and F.
602CH
1 byte
DEFB 00H
602CH: 00H: the high byte when 602BH is loaded as a word (7192H); 717EH and 7322H store 0000H at 602BH-602CH.
602DH-602EH
2 bytes
DEFB 00H x 2
602DH-602EH: the number of the record being looked at by Z, L and M.
602FH
1 byte
DEFB 00H
602FH: the length byte of the load block less 2 (721AH): the bytes of the block after its address.
6030H
1 byte
DEFB 00H
6030H: the last search: 00H none, FFH the address of L at 6031H, else the length of the string at 6031H for C or F; G repeats it (6449H).
64CEH-654DH
128 bytes
DEFB 00H x 128
64CEH-654DH: 128 bytes of 00H that no instruction of FED/CMD addresses; the load block 6463H-6562H carries them as part of the code.
68EFH-68F8H
10 bytes
DEFW 2710H / DEFW 03E8H / DEFW 0064H / DEFW 000AH / DEFW 0001H
68EFH-68F8H: the powers of ten for 68A5H, each a word, low byte first: 10000, 1000, 100, 10 and 1.
6E2FH-6E57H
41 bytes
DEFB 9CH, 90H, 95H, 95H, 94H, 8FH, 8EH, 8AH, 96H, 90H, 92H, 95H, 93H, 8FH, 94H, 96H, 92H, 95H, 95H, 97H, 99H, 98H, 99H, 98H, 95H, 97H, 92H, 98H, 94H, 93H, 8FH, 98H, 96H, 93H, 95H, 9AH, 8FH, 8BH, 99H, 99H, 94H
6E2FH-6E57H: the low bytes of the places on row 6 (3D80H-3DBFH) where the messages of the errors 00H-28H start, so that each is in the middle of the row; 6DCBH takes the byte at 6E2FH + the error number. For a higher number the byte comes from the code after the table.

Operands Changed While It Runs

Address
Size
Contents
6571H
2 bytes
The rest of the routine that called the register saver (6560H).
6DCDH
1 byte
The error number, the displacement into the table at 6E2FH (6DC2H).
5B68H-5B69H, 5B6CH-5B6EHThe hex digits and the decimal value of the byte at the cursor in the value line (6679H, 6686H).
59C8H-59D5HThe name of the file as shown, with the drive digit (65B0H, 6C7BH).

Cells Outside the File That FED/CMD Uses

Address
Size
Contents
5200H-5241H
66 bytes
DEFS 66
5200H-5241H: not in the file. The save area of the input box: 6D46H copies the 16 characters under the box of the 256 byte mode (eight rows of two at 3DBDH) or the 30 characters of the input line of the 128 byte mode (3FCAH) here, and 6D78H puts them back. Only 5200H-521DH are used.
5242H-5261H
32 bytes
DEFS 32
5242H-5261H: not in the file. The file control block of the file being edited. 608BH or 6C4EH (ROM 0040H) puts the file specification here, @FSPEC (6C63H) checks it and @OPEN (6C6DH) opens it; FED then reads +06H (5248H, the drive), +07H (5249H, the directory entry code, 01H for DIR/SYS), +08H (524AH, the end of file byte) and +0CH-+0DH (524EH-524FH, the ending record number).
5262H-5361H
256 bytes
DEFS 256
5262H-5361H: not in the file. The edit buffer: the record shown on the screen. The modify commands change it here; S writes it back (63C7H). The cursor of the record is the address at 601CH.
5362H-5461H
256 bytes
DEFS 256
5362H-5461H: not in the file. The buffer of the file control block (HL at @OPEN, 6C68H): @READ puts each record here, and 6CB9H, 6CE4H and 72FEH copy it to the edit buffer at 5262H; S copies the edit buffer here first (63B4H).
5462H-5561H
256 bytes
DEFS 256
5462H-5561H: not in the file. A copy of the edit buffer, taken by 744EH before Z or M runs through the file and put back by 745DH, so the record shown before the scan comes back when the scan fails.
5562H-5961H
1024 bytes
DEFS 1024
5562H-5961H: not in the file. The image of the screen, 16 rows of 64 characters: 6953H builds the display of a record here and 6B4EH copies all 1024 bytes to video memory at 3C00H; the cursors and the modify commands write into it and into video memory together.
5962H-59A7H
70 bytes
DEFS 70
5962H-59A7H: not in the file. The command line: 5962H holds the letter of the command, the characters typed after it follow from 5963H; 6016H points at the next place. 679FH fills 5962H-59A3H with spaces (66 bytes); 59A4H-59A7H are not used.
5BDCH-5C0DH
50 bytes
DEFS 50
5BDCH-5C0DH: not in the file. The title of the record: 6FBBH writes the name, the drive, the record number in decimal and in hex here (the length is returned in Register A less 1DH); 6B28H copies it to 58E2H of the screen image and 6EF2H prints it.
6031H-6062H
50 bytes
DEFS 50
6031H-6062H: not in the file. The object of the last search: the address of L at 6031H-6032H (61B7H), or the bytes of the string of C or F (up to 30, from 7046H or 7080H). 6031H-6032H also hold the load address of the block being looked at by M (73E8H).
68F9H-68FDH
5 bytes
DEFS 5
68F9H-68FDH: not in the file. The digits written by 68A5H (up to five, decimal) and by 68FEH (four, hex).

Disassembly

5200H - The Work Areas Below the File

FED/CMD loads from 59A8H, so the memory from 5200H, where LDOS loads a command, up to 59A7H is free. FED uses it for the saved input box, the file control block, the edit buffer, the buffer of the file, the copy taken for a search, the image of the screen and the command line. None of these bytes is in the file.

5200-5241
DEFS 66
5200H-5241H: not in the file. The save area of the input box: 6D46H copies the 16 characters under the box of the 256 byte mode (eight rows of two at 3DBDH) or the 30 characters of the input line of the 128 byte mode (3FCAH) here, and 6D78H puts them back. Only 5200H-521DH are used.
5242-5261
DEFS 32
5242H-5261H: not in the file. The file control block of the file being edited. 608BH or 6C4EH (ROM 0040H) puts the file specification here, @FSPEC (6C63H) checks it and @OPEN (6C6DH) opens it; FED then reads +06H (5248H, the drive), +07H (5249H, the directory entry code, 01H for DIR/SYS), +08H (524AH, the end of file byte) and +0CH-+0DH (524EH-524FH, the ending record number).
5262-5361
DEFS 256
5262H-5361H: not in the file. The edit buffer: the record shown on the screen. The modify commands change it here; S writes it back (63C7H). The cursor of the record is the address at 601CH.
5362-5461
DEFS 256
5362H-5461H: not in the file. The buffer of the file control block (HL at @OPEN, 6C68H): @READ puts each record here, and 6CB9H, 6CE4H and 72FEH copy it to the edit buffer at 5262H; S copies the edit buffer here first (63B4H).
5462-5561
DEFS 256
5462H-5561H: not in the file. A copy of the edit buffer, taken by 744EH before Z or M runs through the file and put back by 745DH, so the record shown before the scan comes back when the scan fails.
5562-5961
DEFS 1024
5562H-5961H: not in the file. The image of the screen, 16 rows of 64 characters: 6953H builds the display of a record here and 6B4EH copies all 1024 bytes to video memory at 3C00H; the cursors and the modify commands write into it and into video memory together.
5962-59A7
DEFS 70
5962H-59A7H: not in the file. The command line: 5962H holds the letter of the command, the characters typed after it follow from 5963H; 6016H points at the next place. 679FH fills 5962H-59A3H with spaces (66 bytes); 59A4H-59A7H are not used.

59A8H - The Texts of the Screen

The first load block starts with the texts of the screens. 59A8H-59C7H are the digit pairs of the row and column labels, 59C8H-59D5H the name of the file as shown, then the title, the copyright, the labels and the error texts. A text displayed by 65E5H ends at the byte with bit 7 set, whose bit 7 is cleared on the screen.

59A8-59C7
DEFM "00102030405060708090A0B0C0D0E0F0" 30 30 31 30 32 30 33 30 34 30 35 30 36 30 37 30 38 30 39 30 41 30 42 30 43 30 44 30 45 30 46 30
59A8H-59C7H: sixteen pairs of characters, a hex digit 0-F and 0: 69B2H copies them as the row labels 00-F0 of the 256 byte mode (from 5573H, one pair a row), 6AA4H in reversed order as the column labels 00-0F of the 128 byte mode, and 6AC1H eight of them as its row labels.
59C8-59D5
DEFB 20H x 14 20 20 20 20 20 20 20 20 20 20 20 20 20 20
59C8H-59D5H: the name of the file as shown: 65B0H fills it with spaces and copies the file name up to the period, the colon or 0DH, in capitals, then a colon and the drive digit (at the address kept at 6027H). 69C8H shows the 14 characters down column 33 in the 256 byte mode; 6FBBH copies them into the title of a printed record.
59D6-59E4
DEFB 20H x 15 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
59D6H-59E4H: fifteen spaces after the name. No instruction of FED/CMD addresses them: they only fill the room up to the title.
59E5-5A02
DEFM "FED - File Editor Version 1.0" / DEFB 0AEH 46 45 44 20 2D 20 46 69 6C 65 20 45 64 69 74 6F 72 20 56 65 72 73 69 6F 6E 20 31 2E 30 AE
59E5H-5A02H: the title displayed at 3C00H, the top left corner of the screen, by 6C26H when FED asks for a file. 5A02H is AEH, the period with bit 7 set, the end of the text for 65E5H.
5A03-5A06
DEFM "2 " / DEFB 0A0H 32 20 20 A0
5A03H-5A06H: the end of the version number: 2 and three spaces, the last (A0H) with bit 7 set. 6C2FH displays them after the title, so the screen reads Version 1.0.2.
5A07-5A37
DEFM "Copyright 1987 MISOSYS, Inc. All rights reserved" / DEFB 0AEH 43 6F 70 79 72 69 67 68 74 20 31 39 38 37 20 4D 49 53 4F 53 59 53 2C 20 49 6E 63 2E 20 41 6C 6C 20 72 69 67 68 74 73 20 72 65 73 65 72 76 65 64 AE
5A07H-5A37H: the copyright line displayed at 3C40H, the second row, by 6C33H. The last byte, AEH, is the period with bit 7 set.
5A38-5A41
DEFM "Filespec:" / DEFB 0A0H 46 69 6C 65 73 70 65 63 3A A0
5A38H-5A41H: the prompt displayed at 3D00H, the fifth row, by 6C3CH; the file specification is typed after it through ROM 0040H. The last byte, A0H, is a space with bit 7 set.
5A42-5A50
DEFM "Relative Byte " / DEFB 0BEH 52 65 6C 61 74 69 76 65 20 42 79 74 65 20 BE
5A42H-5A50H: the label of the byte cursor in the 128 byte mode, copied to 5911H of the screen image by 6B35H; the offset of the byte follows at 5920H (6664H). The last byte, BEH, is the character 3EH with bit 7 set.
5A51-5A58
DEFM "Command" / DEFB 0BAH 43 6F 6D 6D 61 6E 64 BA
5A51H-5A58H: the label of the command line in the 128 byte mode, copied to 5922H of the screen image by 6B41H. The last byte, BAH, is the colon with bit 7 set.
5A59-5A83
DEFM "Press <ENTER> to continue, <BREAK> to abor" / DEFB 0F4H 50 72 65 73 73 20 3C 45 4E 54 45 52 3E 20 74 6F 20 63 6F 6E 74 69 6E 75 65 2C 20 3C 42 52 45 41 4B 3E 20 74 6F 20 61 62 6F 72 F4
5A59H-5A83H: the prompt after an error, displayed at 3F0AH by 6DD6H. 6DF3H copies 5A5FH-5A65H, the word <ENTER> with its brackets, and 5A74H-5A7AH, <BREAK>, over the prompt in turn with spaces, so that the two keys blink. The last byte is F4H, the t with bit 7 set.
5A84-5A8C
DEFM " Drive " 20 20 20 44 72 69 76 65 20
5A84H-5A8CH: the first part of the title of a printed record: three spaces, Drive and a space; 6FD2H copies these 9 bytes after the name and 6FDBH puts the drive digit after them.
5A8D-5A96
DEFM " Record " 20 20 20 52 65 63 6F 72 64 20
5A8DH-5A96H: the second part of the title of a printed record: three spaces, Record and a space; 6FDEH copies these 10 bytes and 6FEAH puts the record number in decimal after them.
5A97-5A9A
DEFM " X'" 20 20 58 27
5A97H-5A9AH: the third part of the title of a printed record: two spaces, X and the apostrophe; 6FF9H copies these 4 bytes and 7006H puts the record number in four hex digits after them, then an apostrophe (7015H).
5A9B-5AE3
DEFM "0123456789ABCDEF BYTE 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F" 30 31 32 33 34 35 36 37 38 39 41 42 43 44 45 46 20 20 42 59 54 45 20 20 30 30 20 30 31 20 30 32 20 30 33 20 30 34 20 30 35 20 30 36 20 30 37 20 20 20 30 38 20 30 39 20 30 41 20 30 42 20 30 43 20 30 44 20 30 45 20 30 46
5A9BH-5AE3H: the heading line of a printed record, 73 characters printed by 6EFFH: the column digits of the ASCII part, BYTE, and the column numbers 00-0F of the hex part with two extra spaces after 07.
5AE4
DEFB 0DH 0D
5AE4H: 0DH after the heading line. 6EFFH prints 49H bytes and stops before it, then ends the line itself through 6F8DH: the byte is not used.
5AE5-5AF5
DEFM "Printer Not Read" / DEFB 0F9H 50 72 69 6E 74 65 72 20 4E 6F 74 20 52 65 61 64 F9
5AE5H-5AF5H: the text displayed at 3D98H by 6FACH when ROM 0023H finds the printer not ready. The last byte, F9H, is the y with bit 7 set.
5AF6-5B10
DEFM "File not load module forma" / DEFB 0F4H 46 69 6C 65 20 6E 6F 74 20 6C 6F 61 64 20 6D 6F 64 75 6C 65 20 66 6F 72 6D 61 F4
5AF6H-5B10H: the error of Z and M when a type byte is not one of a load module, displayed at 3D93H by 71EDH. The last byte, F4H, is the t with bit 7 set.
5B11-5B26
DEFM "Byte not in load bloc" / DEFB 0EBH 42 79 74 65 20 6E 6F 74 20 69 6E 20 6C 6F 61 64 20 62 6C 6F 63 EB
5B11H-5B26H: the error of M when the byte at the cursor is not in a load block, displayed at 3D95H by 736FH. The last byte, EBH, is the k with bit 7 set.
5B27-5B3C
DEFM "Load address not foun" / DEFB 0E4H 4C 6F 61 64 20 61 64 64 72 65 73 73 20 6E 6F 74 20 66 6F 75 6E E4
5B27H-5B3CH: the error of L when the end of the file comes before the address, displayed at 3D96H by 71C0H. The last byte, E4H, is the d with bit 7 set.
5B3D-5B53
DEFM "Cursor not on Type byt" / DEFB 0E5H 43 75 72 73 6F 72 20 6E 6F 74 20 6F 6E 20 54 79 70 65 20 62 79 74 E5
5B3DH-5B53H: the error of Z when the cursor is not on a type byte, displayed at 3D94H through 71F3H by 64A4H. The last byte, E5H, is the e with bit 7 set.
5B54-5B65
DEFM " Loads at X' " / DEFB 0A7H 20 4C 6F 61 64 73 20 61 74 20 20 58 27 20 20 20 20 A7
5B54H-5B65H: the answer of M in the 128 byte mode, displayed at 3FEEH by 742EH; the four hex digits of the address go to 3FFBH-3FFEH over the four spaces. The last byte, A7H, is the apostrophe with bit 7 set.
5B66-5B6B
DEFM "X' '=" 58 27 20 20 27 3D
5B66H-5B6BH: the start of the binary display of = (625DH copies these 6 bytes to 3FCAH) and of the value line of the 128 byte mode (66A8H): X, apostrophe, two places for the hex digits (5B68H-5B69H, stored by 6679H), apostrophe and the equals sign.
5B6C-5B78
DEFM " Values " / DEFB 0A0H 20 20 20 56 61 6C 75 65 73 20 20 20 A0
5B6CH-5B78H: three places for the decimal value (5B6CH-5B6EH, stored by 6686H), then the label Values and spaces, copied to 5951H of the screen image and to 3FEFH by 668FH and 6696H. The last byte, A0H, is a space with bit 7 set.
5B79-5BDB
DEFB 20H x 99 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
5B79H-5BDBH: 99 spaces that no instruction of FED/CMD addresses: they fill the load block up to its end at 5BDBH.
5BDC-5C0D
DEFS 50
5BDCH-5C0DH: not in the file. The title of the record: 6FBBH writes the name, the drive, the record number in decimal and in hex here (the length is returned in Register A less 1DH); 6B28H copies it to 58E2H of the screen image and 6EF2H prints it.

5C0EH - The Help Screen

The load blocks from 5C0EH to 600DH hold a whole screen, 16 rows of 64 characters: the list of the commands. The key ENTER alone at the command line (6235H) swaps these 1024 bytes with video memory (6E96H), blinks ENTER on the last row until ENTER is pressed and swaps them back.

5C0E-5C4D
DEFB 20H x 64 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
5C0EH-5C4DH: row 0 of the help screen (video memory 3C00H), 64 spaces: a blank row between the groups of commands.
5C4E-5C8D
DEFM " <;> Forward ONE Record <BREAK> Cancels command" 20 20 20 3C 3B 3E 20 20 20 46 6F 72 77 61 72 64 20 4F 4E 45 20 52 65 63 6F 72 64 20 20 20 20 20 20 20 20 20 20 3C 42 52 45 41 4B 3E 20 20 20 20 20 43 61 6E 63 65 6C 73 20 63 6F 6D 6D 61 6E 64
5C4EH-5C8DH: row 1 of the help screen (video memory 3C40H): <;> forward one record, <BREAK> cancels the command.
5C8E-5CCD
DEFM " <-> Backward ONE Record <N><ENTER> New File " 20 20 20 3C 2D 3E 20 20 20 42 61 63 6B 77 61 72 64 20 4F 4E 45 20 52 65 63 6F 72 64 20 20 20 20 20 20 20 20 20 3C 4E 3E 3C 45 4E 54 45 52 3E 20 20 4E 65 77 20 46 69 6C 65 20 20 20 20 20 20 20
5C8EH-5CCDH: row 2 of the help screen (video memory 3C80H): <-> backward one record, <N><ENTER> a new file.
5CCE-5D0D
DEFM " <B> Beginning Record of File <S><ENTER> Save Record " 20 20 20 3C 42 3E 20 20 20 42 65 67 69 6E 6E 69 6E 67 20 52 65 63 6F 72 64 20 6F 66 20 46 69 6C 65 20 20 20 20 3C 53 3E 3C 45 4E 54 45 52 3E 20 20 53 61 76 65 20 52 65 63 6F 72 64 20 20 20 20
5CCEH-5D0DH: row 3 of the help screen (video memory 3CC0H): <B> the first record, <S><ENTER> save the record; 3CE9H, the word ENTER of this row on the screen, is the text that blinks on the last row (6E69H).
5D0E-5D4D
DEFM " <E> Ending Record of File <X><ENTER> Exit FED " 20 20 20 3C 45 3E 20 20 20 45 6E 64 69 6E 67 20 52 65 63 6F 72 64 20 6F 66 20 46 69 6C 65 20 20 20 20 20 20 20 3C 58 3E 3C 45 4E 54 45 52 3E 20 20 45 78 69 74 20 46 45 44 20 20 20 20 20 20 20
5D0EH-5D4DH: row 4 of the help screen (video memory 3D00H): <E> the last record, <X><ENTER> exit FED.
5D4E-5D8D
DEFM " <R> Position to Record <H> Hexadecimal Modify " 20 20 20 3C 52 3E 20 20 20 50 6F 73 69 74 69 6F 6E 20 74 6F 20 52 65 63 6F 72 64 20 20 20 20 20 20 20 20 20 20 3C 48 3E 20 20 20 48 65 78 61 64 65 63 69 6D 61 6C 20 4D 6F 64 69 66 79 20 20 20
5D4EH-5D8DH: row 5 of the help screen (video memory 3D40H): <R> position to a record, <H> hex modify.
5D8E-5DCD
DEFM " <Z> Go to next Load Block <A> ASCII Modify " 20 20 20 3C 5A 3E 20 20 20 47 6F 20 74 6F 20 6E 65 78 74 20 4C 6F 61 64 20 42 6C 6F 63 6B 20 20 20 20 20 20 20 3C 41 3E 20 20 20 41 53 43 49 49 20 4D 6F 64 69 66 79 20 20 20 20 20 20 20 20 20
5D8EH-5DCDH: row 6 of the help screen (video memory 3D80H): <Z> the next load block, <A> ASCII modify.
5DCE-5E0D
DEFM " <M> Calculate Load Address <T> Toggle Display modes " 20 20 20 3C 4D 3E 20 20 20 43 61 6C 63 75 6C 61 74 65 20 4C 6F 61 64 20 41 64 64 72 65 73 73 20 20 20 20 20 20 3C 54 3E 20 20 20 54 6F 67 67 6C 65 20 44 69 73 70 6C 61 79 20 6D 6F 64 65 73 20
5DCEH-5E0DH: row 7 of the help screen (video memory 3DC0H): <M> the load address of the byte, <T> toggle the display mode.
5E0E-5E4D
DEFB 20H x 64 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
5E0EH-5E4DH: row 8 of the help screen (video memory 3E00H), 64 spaces: a blank row between the groups of commands.
5E4E-5E8D
DEFM " <C> Find ASCII String <F> Find Hex string " 20 20 20 3C 43 3E 20 20 20 46 69 6E 64 20 41 53 43 49 49 20 53 74 72 69 6E 67 20 20 20 20 20 20 20 20 20 20 20 3C 46 3E 20 20 20 46 69 6E 64 20 48 65 78 20 73 74 72 69 6E 67 20 20 20 20 20 20
5E4EH-5E8DH: row 9 of the help screen (video memory 3E40H): <C> find an ASCII string, <F> find a hex string.
5E8E-5ECD
DEFM " <L> Locate Hex Load Address <G> Go next occurrence " 20 20 20 3C 4C 3E 20 20 20 4C 6F 63 61 74 65 20 48 65 78 20 4C 6F 61 64 20 41 64 64 72 65 73 73 20 20 20 20 20 3C 47 3E 20 20 20 47 6F 20 6E 65 78 74 20 6F 63 63 75 72 72 65 6E 63 65 20 20 20
5E8EH-5ECDH: row 10 of the help screen (video memory 3E80H): <L> locate a hex load address, <G> go to the next occurrence.
5ECE-5F0D
DEFB 20H x 64 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
5ECEH-5F0DH: row 11 of the help screen (video memory 3EC0H), 64 spaces: a blank row between the groups of commands.
5F0E-5F4D
DEFM " <D> Dump File to Printer <O> Output top-of-form " 20 20 20 3C 44 3E 20 20 20 44 75 6D 70 20 46 69 6C 65 20 74 6F 20 50 72 69 6E 74 65 72 20 20 20 20 20 20 20 20 3C 4F 3E 20 20 20 4F 75 74 70 75 74 20 74 6F 70 2D 6F 66 2D 66 6F 72 6D 20 20 20
5F0EH-5F4DH: row 12 of the help screen (video memory 3F00H): <D> dump the file to the printer, <O> top of form.
5F4E-5F8D
DEFM " <P> Send Buffer to Printer <=> Display Binary Value " 20 20 20 3C 50 3E 20 20 20 53 65 6E 64 20 42 75 66 66 65 72 20 74 6F 20 50 72 69 6E 74 65 72 20 20 20 20 20 20 3C 3D 3E 20 20 20 44 69 73 70 6C 61 79 20 42 69 6E 61 72 79 20 56 61 6C 75 65 20
5F4EH-5F8DH: row 13 of the help screen (video memory 3F40H): <P> the buffer to the printer, <=> the binary value.
5F8E-5FCD
DEFB 20H x 64 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
5F8EH-5FCDH: row 14 of the help screen (video memory 3F80H), 64 spaces: a blank row between the groups of commands.
5FCE-600D
DEFM " Press <ENTER> to Return to Display Mode " 20 20 20 20 20 20 20 20 20 20 20 20 50 72 65 73 73 20 3C 45 4E 54 45 52 3E 20 74 6F 20 52 65 74 75 72 6E 20 74 6F 20 44 69 73 70 6C 61 79 20 4D 6F 64 65 20 20 20 20 20 20 20 20 20 20 20 20 20
5FCEH-600DH: row 15 of the help screen (video memory 3FC0H): Press <ENTER> to Return to Display Mode; 6E76H blinks the word ENTER at 3FD3H-3FD7H with the spaces at 3FF6H.

600EH - The Cells of FED

The variables of FED/CMD, all 00H in the file but 601BH. The search string and the address of L follow beyond the load block, at 6031H-6062H.

600E
DEFB 00H 00
600EH: not used: no instruction of FED/CMD reads or writes it.
600F
DEFB 00H 00
600FH: the byte of the BREAK switch kept by 6072H (4405H on the Model III, 4315H on the Model I) and put back by 6869H when FED ends.
6010-6011
DEFB 00H x 2 00 x 2
6010H-6011H: the address of the BREAK switch, 4405H or 4315H, stored by 6077H; 6075H puts the RET there while FED runs, so that BREAK comes to FED as key 01H.
6012
DEFB 00H 00
6012H: 00H while no file is open, 01H from 60AAH on: 67DBH does nothing while it is 00H, and an error (6DA9H) goes back to the prompt for a file.
6013
DEFB 00H 00
6013H: the state of the command line: 00H no command, 01H and 02H the two digits of H, 03H A, 04H-08H R and its digits, 08H S, 09H N, 0AH X, 11H P, 12H D, 13H M, 14H-18H L, 18H Z, 42H F and 82H C; 6141H counts the characters typed by INC.
6014
DEFB 00H 00
6014H: the phase of the two cursors in the record, switched by 6B9BH: 01H while the cursor blocks B0H are shown.
6015
DEFB 00H 00
6015H: the phase of the cursor of the command line, switched by 6B82H: 01H while the block 8FH is shown at the cursor (4020H).
6016-6017
DEFB 00H x 2 00 x 2
6016H-6017H: the place in the command line (5962H-59A3H) for the next character typed, set by 679FH, 6791H and 7064H.
6018-6019
DEFB 00H x 2 00 x 2
6018H-6019H: not used: no instruction of FED/CMD reads or writes them.
601A
DEFB 00H 00
601AH: the count of the key scans to the next blink of the record cursors (6B6EH, reloaded with 19H).
601B
DEFB 0CH 0C
601BH: 0CH in the file: the count of the blinks of the record cursors to the next blink of the command cursor (6B78H, reloaded with 0FH).
601C-601D
DEFB 00H x 2 00 x 2
601CH-601DH: the address of the byte at the cursor in the edit buffer, 5262H-5361H.
601E
DEFB 00H 00
601EH: the offset of the first byte shown in the 128 byte mode, a multiple of 10H from 00H to 80H (66D0H, 6A81H).
601F
DEFB 00H 00
601FH: 00H: the high byte when 601EH is loaded as a word (6A87H, 6AC4H, 6C02H): Register B then holds 00H.
6020
DEFB 00H 00
6020H: the display mode: 00H the 256 byte mode, 01H the 128 byte mode; T switches it (6397H).
6021-6022
DEFB 00H x 2 00 x 2
6021H-6022H: the number of the record in the edit buffer.
6023-6024
DEFB 00H x 2 00 x 2
6023H-6024H: the record number kept while D, a search or a scan reads other records, and the record the search found.
6025-6026
DEFB 00H x 2 00 x 2
6025H-6026H: the number of the last record of the file: the ending record number of the file control block less one (6C81H).
6027-6028
DEFB 00H x 2 00 x 2
6027H-6028H: the place of the drive digit in the shown name 59C8H-59D5H, after the colon (65E1H); 6C7BH stores the digit there.
6029
DEFB 00H 00
6029H: the count of the passes to the next blink of the prompt after an error or of the help screen (64H).
602A
DEFB 00H 00
602AH: the phase of that blink, switched by 6DEEH and 6E64H.
602B
DEFB 00H 00
602BH: the offset in the record of the byte being looked at by Z, L, M, C and F.
602C
DEFB 00H 00
602CH: 00H: the high byte when 602BH is loaded as a word (7192H); 717EH and 7322H store 0000H at 602BH-602CH.
602D-602E
DEFB 00H x 2 00 x 2
602DH-602EH: the number of the record being looked at by Z, L and M.
602F
DEFB 00H 00
602FH: the length byte of the load block less 2 (721AH): the bytes of the block after its address.
6030
DEFB 00H 00
6030H: the last search: 00H none, FFH the address of L at 6031H, else the length of the string at 6031H for C or F; G repeats it (6449H).
6031-6062
DEFS 50
6031H-6062H: not in the file. The object of the last search: the address of L at 6031H-6032H (61B7H), or the bytes of the string of C or F (up to 30, from 7046H or 7080H). 6031H-6032H also hold the load address of the block being looked at by M (73E8H).

6063H - The Start: the BREAK Switch and the File

LDOS Ready loads FED/CMD at 59A8H-746BH and jumps to 6063H, the transfer address, with Register Pair HL at the rest of the command line. The command is FED (filespec): with a file specification FED opens it at once, else it shows its title and asks for one. 6064H tells the Model III from the Model I by the ROM byte 0125H and finds the BREAK switch of LDOS, which gets a RET while FED runs, so that the BREAK key reaches FED as key 01H. 657CH makes the texts capitals when the video has no lower case.

6063
PUSH HL E5
Save Register Pair HL (the command line after FED) to the stack across the set-up for the model and the video test.
6064
LD A,(0125H) 3A 25 01
Fetch the ROM byte at 0125H into Register A: 49H in ROM 3.1 of the Model III, another value in the Model I's ROM.
6067
CP 49H FE 49
Compare Register A against 49H: the Z FLAG on the Model III.
6069
LD HL,4315H 21 15 43
Point Register Pair HL to 4315H, the BREAK switch of LDOS on the Model I. LD does not change the flags of the compare.
606C
If the NZ FLAG is set (not the Model III), JUMP to 6071H with Register Pair HL = 4315H.
606E
LD HL,4405H 21 05 44
Point Register Pair HL to 4405H, the BREAK switch of LDOS on the Model III: a JP C3H to 4406H-4407H, the BREAK trap, or a RET C9H.
6071
LD A,(HL) 7E
Fetch the byte of the BREAK switch at Register Pair HL (4405H or 4315H) into Register A, to put it back when FED ends.
6072
LD (600FH),A 32 0F 60
Store Register A (the byte of the switch) at 600FH, which 6869H stores back at the end.
6075
LD (HL),C9H 36 C9
Store C9H, a RET, at the switch at Register Pair HL: the BREAK key no longer jumps to the trap, and the ROM's scan gives FED the key 01H.
6077
LD (6010H),HL 22 10 60
Store Register Pair HL (4405H or 4315H, the address of the switch) at 6010H-6011H for the end at 6866H.
607A
GOSUB to 657CH to test the video for lower case at 3C00H and, if it has none, to turn the lower case letters of the texts 59A8H-600DH into capitals.
607D
POP HL E1
Restore Register Pair HL from the stack: the command line after FED.
607E
XOR A AF
Set Register A to 00H by XOR A with itself, for the cell 6012H.
607F
LD (6012H),A 32 12 60
Store Register A (00H) at 6012H: no file is open yet, so an error goes back to the question for a file.
6082
LD A,(HL) 7E
Fetch the next character of the command line at Register Pair HL into Register A.
6083
CP 0DH FE 0D
Compare Register A against 0DH, the end of the line: the Z FLAG when FED is given no file specification.
6085
If the Z FLAG is set (FED alone), JUMP to 609EH to show the title and ask for a file.
6087
LD DE,5242H 11 42 52
Point Register Pair DE to 5242H, the file control block, where the file specification of the command line is copied.
608A
PUSH DE D5
Save Register Pair DE (5242H) to the stack: it comes back in Register Pair HL at 6094H.
608B
LD A,(HL) 7E
Fetch the character of the command line at Register Pair HL into Register A. 6092H loops back here.
608C
LD (DE),A 12
Store Register A (the character) at Register Pair DE in the file control block.
608D
INC HL 23
INCrement Register Pair HL to the next character of the command line.
608E
INC DE 13
INCrement Register Pair DE to the next place in the file control block.
608F
INC B 04
INCrement Register B, the count of the characters copied (65B0H takes the name from Register B). Register B is not set before: it holds what LDOS left in it.
6090
CP 0DH FE 0D
Compare Register A (the character just copied) against 0DH: the Z FLAG at the end of the line, which is copied too.
6092
If the NZ FLAG is set (not the end), JUMP back to 608BH to copy the next character.
6094
POP HL E1
Restore Register Pair HL from the stack: 5242H, the file specification in the file control block.
6095
XOR A AF
Set Register A to 00H by XOR A with itself, for the cell 6012H below.
6096
LD (6012H),A 32 12 60
Store Register A (00H) at 6012H: still no file open.
6099
GOSUB to 6C5DH to show the name, check the file specification at 5242H with @FSPEC, open the file and read and show record 0.
609C
JUMP to 60A5H to clear the command line and go into the command loop.
609E
XOR A AF
Set Register A to 00H by XOR A with itself. N (6307H) and an error before a file is open (6DADH) come here.
609F
LD (6012H),A 32 12 60
Store Register A (00H) at 6012H: no file is open.
60A2
GOSUB to 6C23H to clear the screen, show the title, the copyright and Filespec:, take the file specification and open the file.
60A5
GOSUB to 679FH to clear the command line at 5962H, point 6016H at it and set the state at 6013H to 00H. 685AH comes back here.
60A8
LD A,01H 3E 01
Load Register A with 01H: a file is open from here on (cell 6012H).
60AA
LD (6012H),A 32 12 60
Store Register A (01H) at 6012H: from now on an error shows the record again (6DB0H).

60ADH - The Command Loop

Every command ends by a jump to 60ADH. The stack is set again at 41E0H, the cursors blink, and the key from the ROM's keyboard scan is taken. The state at 6013H says what a key means: 00H, a new command (61C6H); 01H and 02H, a digit of H; 03H, a character of A; 08H-0AH, the ENTER after S, N or X. The four arrow keys and SHIFT UP ARROW move the cursor in every state but A. The other states collect the characters typed after R, L, C, F, D or P until ENTER or the last place.

60AD
LD SP,41E0H 31 E0 41
Load the Stack Pointer with 41E0H, below the printer driver at 41E5H: whatever a command left on the stack is dropped.
60B0
GOSUB to 6B6BH to count down the blink of the cursors and switch them when the count runs out.
60B3
GOSUB to 682FH to take a key from the ROM's keyboard scan into Register A: 00H for none; BREAK clears the command line and does not come back.
60B6
OR A B7
OR Register A with itself to set the Z FLAG when Register A is 00H, no key.
60B7
If the Z FLAG is set (no key), JUMP back to 60ADH to blink and scan again.
60BA
LD HL,6013H 21 13 60
Point Register Pair HL to 6013H, the state of the command line.
60BD
LD B,A 47
Copy Register A (the key) into Register B for the tests below.
60BE
LD A,(HL) 7E
Fetch the state at Register Pair HL (6013H) into Register A.
60BF
OR A B7
OR Register A with itself to set the Z FLAG when the state is 00H, no command.
60C0
If the Z FLAG is set (no command yet), JUMP to 61C6H to take the key in Register B as a new command.
60C3
CP 01H FE 01
Compare Register A (the state) against 01H, the first digit of H.
60C5
If the Z FLAG is set (H waits for its first digit), JUMP to 66DFH to take the key in Register B as that digit.
60C8
CP 02H FE 02
Compare Register A (the state) against 02H, the second digit of H.
60CA
If the Z FLAG is set (H waits for its second digit), JUMP to 670AH to take the key in Register B as that digit.
60CD
LD A,B 78
Copy Register B (the key) into Register A, to test it for the cursor keys.
60CE
CP 0AH FE 0A
Compare Register A (the key) against 0AH, DOWN ARROW.
60D0
If the Z FLAG is set (DOWN ARROW), JUMP to 65FFH to move the cursor down one row and come back to 60ADH.
60D3
CP 09H FE 09
Compare Register A (the key) against 09H, RIGHT ARROW.
60D5
If the Z FLAG is set (RIGHT ARROW), JUMP to 65FFH to move the cursor one byte right.
60D8
CP 08H FE 08
Compare Register A (the key) against 08H, LEFT ARROW.
60DA
If the Z FLAG is set (LEFT ARROW), JUMP to 65FFH to move the cursor one byte left.
60DD
CP 5BH FE 5B
Compare Register A (the key) against 5BH, UP ARROW.
60DF
If the Z FLAG is set (UP ARROW), JUMP to 65FFH to move the cursor up one row.
60E2
CP 1BH FE 1B
Compare Register A (the key) against 1BH, SHIFT UP ARROW.
60E4
If the Z FLAG is set (SHIFT UP ARROW), JUMP to 65FFH to put the cursor on byte 00H of the record.
60E7
LD A,(HL) 7E
Fetch the state at Register Pair HL (6013H) into Register A again.
60E8
CP 03H FE 03
Compare Register A (the state) against 03H, A: ASCII modify.
60EA
If the Z FLAG is set (ASCII modify), JUMP to 6737H to store the key in Register B at the cursor.
60ED
LD A,(HL) 7E
Fetch the state at Register Pair HL (6013H) into Register A.
60EE
CP 08H FE 08
Compare Register A (the state) against 08H: the CARRY FLAG for the states 04H-07H, R and its digits.
60F0
If the CARRY FLAG is set (R), JUMP to 610CH to take the key as a digit of the record number.
60F2
CP 10H FE 10
Compare Register A (the state) against 10H: the NO CARRY FLAG for P, D, M, L, Z, F and C.
60F4
If the NO CARRY FLAG is set (a state of 10H or more), JUMP to 610CH to take the key as a character of the command.
60F6
LD A,B 78
Copy Register B (the key) into Register A: the states 08H-0FH (S, N, X) wait for ENTER.
60F7
CP 0DH FE 0D
Compare Register A (the key) against 0DH, ENTER.
60F9
If the NZ FLAG is set (not ENTER), JUMP back to 60ADH: the key is not taken.
60FC
LD A,(HL) 7E
Fetch the state at Register Pair HL (6013H) into Register A.
60FD
CP 08H FE 08
Compare Register A (the state) against 08H, S.
60FF
If the Z FLAG is set (S then ENTER), JUMP to 63B1H to write the edit buffer to the file.
6102
CP 09H FE 09
Compare Register A (the state) against 09H, N.
6104
If the Z FLAG is set (N then ENTER), JUMP to 6304H to ask for a new file.
6107
CP 0AH FE 0A
Compare Register A (the state) against 0AH, X.
6109
If the Z FLAG is set (X then ENTER), JUMP to 685DH to clear the screen, put the BREAK switch back and end FED.

610CH - The Characters After a Command

The characters typed after R (four hex digits), L (four), F (hex digits) and C (any characters) go to the command line through 6791H, each shown at the cursor, which moves down the input box in the 256 byte mode and to the right in the 128 byte mode. The state is counted up by each character; when the last place is reached, or on ENTER, the command is carried out. ENTER is stored as 0DH at the end of what was typed.

610C
LD A,B 78
Copy Register B (the key) into Register A, to test it for ENTER.
610D
CP 0DH FE 0D
Compare Register A (the key) against 0DH, ENTER.
610F
LD A,(HL) 7E
Fetch the state at Register Pair HL (6013H) into Register A; LD does not change the flags of the compare.
6110
If the NZ FLAG is set (not ENTER), JUMP to 611BH to take the key as a character.
6112
PUSH HL E5
Save Register Pair HL (6013H, the state) to the stack while 0DH is stored.
6113
LD HL,(6016H) 2A 16 60
Fetch the place in the command line from 6016H-6017H into Register Pair HL.
6116
LD (HL),B 70
Store Register B (0DH, ENTER) at the place at Register Pair HL: the end of what was typed.
6117
POP HL E1
Restore Register Pair HL from the stack: 6013H.
6118
JUMP to 616AH to carry out the command by its state.
611B
CP 82H FE 82
Compare Register A (the state) against 82H, C: the NO CARRY FLAG for C, whose string may be any character.
611D
LD A,B 78
Copy Register B (the key) into Register A; LD does not change the flags of the compare.
611E
If the NO CARRY FLAG is set (C), JUMP to 6129H to take the key as it is.
6120
GOSUB to 65A7H to make the key in Register A a capital if it is a lower case letter.
6123
GOSUB to 6822H to test Register A for a hex digit: the CARRY FLAG for 0-9 and A-F.
6126
If the NO CARRY FLAG is set (not a hex digit), JUMP back to 60ADH: the key is not taken.
6129
GOSUB to 6791H to store Register A at the place in the command line, show it at the cursor and put a space at the next place.
612C
PUSH HL E5
Save Register Pair HL (6013H) to the stack across the cursor move.
612D
LD HL,(4020H) 2A 20 40
Fetch the cursor of the video, 4020H-4021H, into Register Pair HL.
6130
LD A,(6020H) 3A 20 60
Fetch the display mode from 6020H into Register A: 00H for the 256 byte mode, 01H for the 128 byte mode.
6133
OR A B7
OR Register A with itself to set the Z FLAG for the 256 byte mode.
6134
If the Z FLAG is set (256 byte mode), JUMP to 6139H to move the cursor down one row.
6136
INC HL 23
INCrement Register Pair HL (the cursor) to the next column: the 128 byte mode takes the input to the right of the command.
6137
JUMP to 613DH to store Register Pair HL as the new cursor of the video.
6139
LD DE,0040H 11 40 00
Load Register Pair DE with 0040H, the 64 characters of a row.
613C
ADD HL,DE 19
ADD Register Pair DE (0040H) to Register Pair HL (the cursor): the next row of the input box at the right edge of the screen.
613D
LD (4020H),HL 22 20 40
Store Register Pair HL (the new cursor) at 4020H-4021H, the cursor of the video.
6140
POP HL E1
Restore Register Pair HL from the stack: 6013H, the state.
6141
INC (HL) 34
INCrement the state at Register Pair HL (6013H): one more character typed.
6142
LD A,(HL) 7E
Fetch the state at Register Pair HL (6013H) into Register A.
6143
CP 08H FE 08
Compare Register A (the state) against 08H: the Z FLAG when R has its four digits (states 04H-07H counted to 08H).
6145
If the Z FLAG is set (the fourth digit of R), JUMP to 6180H to go to the record.
6147
If the CARRY FLAG is set (R with fewer than four digits), JUMP back to 60ADH for the next key.
614A
LD A,(HL) 7E
Fetch the state at Register Pair HL (6013H) into Register A.
614B
DEC A 3D
DECrement Register A, to test the state less one.
614C
CP 17H FE 17
Compare Register A against 17H: the CARRY FLAG for L with fewer than four digits (states 15H-17H) and for P and D.
614E
If the CARRY FLAG is set (more characters may come), JUMP back to 60ADH for the next key.
6151
If the Z FLAG is set (the state is 18H: the fourth digit of L), JUMP to 61A9H to locate the address.
6154
LD A,(6020H) 3A 20 60
Fetch the display mode from 6020H into Register A.
6157
OR A B7
OR Register A with itself to set the Z FLAG for the 256 byte mode.
6158
If the NZ FLAG is set (128 byte mode), JUMP to 6161H, where F and C take up to 30 characters.
615A
BIT 3,(HL) CB 5E
Test bit 3 of the state at Register Pair HL: F counts from 42H and C from 82H, so bit 3 is set after the sixth character (48H, 88H).
615C
If the Z FLAG is set (fewer than six characters), JUMP back to 60ADH for the next key.
615F
JUMP to 616AH: the input box of the 256 byte mode holds six characters, the string is complete.
6161
LD A,(HL) 7E
Fetch the state at Register Pair HL into Register A.
6162
DEC A 3D
DECrement Register A, the state less one, for the count of characters.
6163
AND 1FH E6 1F
Keep only bits 4-0 of Register A (AND 1FH): 1FH after the thirtieth character of F (60H) or C (A0H).
6165
CP 1FH FE 1F
Compare Register A against 1FH: the CARRY FLAG while fewer than 30 characters are typed.
6167
If the CARRY FLAG is set (room for more), JUMP back to 60ADH for the next key.

616AH - Carry Out the Command

The line typed is ended by 0DH; the state picks the routine: bit 6 F (702BH), bit 7 C (7073H), bit 4 L (61A9H), else R. R reads the four hex digits after the letter, refuses a number beyond the last record with an asterisk in the command line, and shows the record.

616A
PUSH HL E5
Save Register Pair HL (6013H, the state) to the stack while 0DH is stored.
616B
LD HL,(6016H) 2A 16 60
Fetch the place in the command line from 6016H-6017H into Register Pair HL.
616E
LD (HL),0DH 36 0D
Store 0DH at Register Pair HL: the end of the characters typed (the full count was reached without ENTER).
6170
POP HL E1
Restore Register Pair HL from the stack: 6013H, the state.
6171
BIT 6,(HL) CB 76
Test bit 6 of the state at Register Pair HL: set for F (42H-60H).
6173
If the NZ FLAG is set (F), JUMP to 702BH to turn the hex digits into bytes and search.
6176
BIT 7,(HL) CB 7E
Test bit 7 of the state at Register Pair HL: set for C (82H-A0H).
6178
If the NZ FLAG is set (C), JUMP to 7073H to take the characters and search.
617B
BIT 4,(HL) CB 66
Test bit 4 of the state at Register Pair HL: set for L (14H-18H); P (11H) and D (12H) never come here.
617D
If the NZ FLAG is set (L), JUMP to 61A9H to locate the load address.
6180
GOSUB to 6D30H to clear the input box of the 256 byte mode (nothing in the 128 byte mode). R comes here.
6183
GOSUB to 7064H to put the cursor back at the command and point 6016H at 5962H (Register Pair DE = 6030H, Register B = 00H).
6186
LD HL,5963H 21 63 59
Point Register Pair HL to 5963H, the digits typed after the letter R at 5962H.
6189
GOSUB to 692EH to take the hex digits at Register Pair HL into Register Pair DE, up to the first character that is not one.
618C
LD HL,(6025H) 2A 25 60
Fetch the number of the last record from 6025H-6026H into Register Pair HL.
618F
OR A B7
OR Register A with itself to clear the CARRY FLAG for the SBC.
6190
SBC HL,DE ED 52
SUBtract Register Pair DE (the record asked for) from Register Pair HL (the last record), with the CARRY FLAG (clear): the CARRY FLAG when it is beyond the last.
6192
If the CARRY FLAG is set (no such record), JUMP to 704AH to show an asterisk in the command line and go back to the loop.
6195
LD (6021H),DE ED 53 21 60
Store Register Pair DE (the record asked for) at 6021H-6022H, the record in the edit buffer.
6199
LD B,D 42
Copy Register D (the high byte of the record number) into Register B.
619A
LD C,E 4B
Copy Register E (the low byte) into Register C: Register Pair BC is the record number for 6CC8H.
619B
GOSUB to 6CC8H to read the record of Register Pair BC into the edit buffer and show it.
619E
GOSUB to 679FH to clear the command line and set the state at 6013H to 00H.
61A1
LD HL,5962H 21 62 59
Point Register Pair HL to 5962H, the place of the letter of the command.
61A4
LD (HL),52H 36 52
Store 52H, the letter R, at Register Pair HL (5962H): the command line shows the last command.
61A6
JUMP back to 60ADH, the command loop, for the next command key.

61A9H - L: The Address to Locate

After the fourth hex digit of L (or ENTER), the input box is drawn five rows high and what is under it is kept; the address is taken into 6031H, 6030H is set to FFH, the search kind of L, and the search starts from record 0 at 7174H.

61A9
LD A,05H 3E 05
Load Register A with 05H, the rows of the input box for 6D06H.
61AB
GOSUB to 6D06H to draw the input box of Register A rows at the right edge (256 byte mode) and set the cursor in it.
61AE
GOSUB to 6D46H to keep the characters of the input box at 5200H, for 6D78H to show them again after the search.
61B1
LD HL,5963H 21 63 59
Point Register Pair HL to 5963H, the digits typed after the letter L.
61B4
GOSUB to 692EH to take the hex digits at Register Pair HL into Register Pair DE: the load address to find.
61B7
LD (6031H),DE ED 53 31 60
Store Register Pair DE (the address) at 6031H-6032H, the object of the search.
61BB
LD A,FFH 3E FF
Load Register A with FFH, the search kind of L.
61BD
LD (6030H),A 32 30 60
Store Register A (FFH) at 6030H: G now repeats an L search (6449H).
61C0
GOSUB to 7064H to put the cursor back at the command line and point 6016H at 5962H.
61C3
JUMP to 7174H to run through the load blocks from record 0 for the address at 6031H.

61C6H - The Command Letters

With no command under way, the key in Register B picks the command: the letter is shown in the command line (5962H and at the cursor, 67BCH), and the commands that take more keys set their state at 6013H. ENTER alone shows the help screen; any other key goes to 65FFH, which moves the cursor for the arrow keys and ignores the rest.

61C6
LD A,B 78
Copy Register B (the key) into Register A, to compare it with the command letters. The letters are capitals here: 682FH has made them so.
61C7
CP 48H FE 48
Compare Register A (the key) against 48H, H: Hexadecimal Modify.
61C9
If the Z FLAG is set (H), JUMP to 6238H to start the hex modify mode.
61CC
CP 41H FE 41
Compare Register A (the key) against 41H, A: ASCII Modify.
61CE
If the Z FLAG is set (A), JUMP to 6243H to start the ASCII modify mode.
61D1
CP 3BH FE 3B
Compare Register A (the key) against 3BH, the semicolon: forward one record.
61D3
If the Z FLAG is set (the semicolon), JUMP to 6284H to show the next record.
61D6
CP 2DH FE 2D
Compare Register A (the key) against 2DH, the minus sign: backward one record.
61D8
If the Z FLAG is set (the minus sign), JUMP to 62A4H to show the record before.
61DB
CP 52H FE 52
Compare Register A (the key) against 52H, R: position to a record.
61DD
If the Z FLAG is set (R), JUMP to 62BEH to take the record number.
61E0
CP 42H FE 42
Compare Register A (the key) against 42H, B: the beginning of the file.
61E2
If the Z FLAG is set (B), JUMP to 62D1H to show record 0 with the cursor on its byte 00H.
61E5
CP 45H FE 45
Compare Register A (the key) against 45H, E: the end of the file.
61E7
If the Z FLAG is set (E), JUMP to 62EAH to show the last record with the cursor on the last byte of the file.
61EA
CP 4EH FE 4E
Compare Register A (the key) against 4EH, N: a new file.
61EC
If the Z FLAG is set (N), JUMP to 62F9H to wait for ENTER.
61EF
CP 50H FE 50
Compare Register A (the key) against 50H, P: print the record.
61F1
If the Z FLAG is set (P), JUMP to 6357H to print the edit buffer.
61F4
CP 54H FE 54
Compare Register A (the key) against 54H, T: toggle the display mode.
61F6
If the Z FLAG is set (T), JUMP to 638DH to switch between the 256 and the 128 byte mode.
61F9
CP 44H FE 44
Compare Register A (the key) against 44H, D: dump the file to the printer.
61FB
If the Z FLAG is set (D), JUMP to 630AH to print the records from the one shown to the end.
61FE
CP 53H FE 53
Compare Register A (the key) against 53H, S: save the record.
6200
If the Z FLAG is set (S), JUMP to 63A6H to wait for ENTER.
6203
CP 58H FE 58
Compare Register A (the key) against 58H, X: exit FED.
6205
If the Z FLAG is set (X), JUMP to 6409H to wait for ENTER.
6208
CP 46H FE 46
Compare Register A (the key) against 46H, F: find a hex string.
620A
If the Z FLAG is set (F), JUMP to 6414H to take the hex digits.
620D
CP 43H FE 43
Compare Register A (the key) against 43H, C: find an ASCII string.
620F
If the Z FLAG is set (C), JUMP to 6422H to take the characters.
6212
CP 47H FE 47
Compare Register A (the key) against 47H, G: go to the next occurrence.
6214
If the Z FLAG is set (G), JUMP to 6443H to repeat the last search from the cursor.
6217
CP 4CH FE 4C
Compare Register A (the key) against 4CH, L: locate a load address.
6219
If the Z FLAG is set (L), JUMP to 6430H to take the address.
621C
CP 4DH FE 4D
Compare Register A (the key) against 4DH, M: the load address of the byte at the cursor.
621E
If the Z FLAG is set (M), JUMP to 730DH to run through the load blocks to the cursor.
6221
CP 4FH FE 4F
Compare Register A (the key) against 4FH, O: top of form to the printer.
6223
If the Z FLAG is set (O), JUMP to 637BH to send 0CH to the printer.
6226
CP 5AH FE 5A
Compare Register A (the key) against 5AH, Z: the next load block.
6228
If the Z FLAG is set (Z), JUMP to 6466H to put the cursor on the next type byte.
622B
CP 3DH FE 3D
Compare Register A (the key) against 3DH, the equals sign: the binary value of the byte (SHIFT RIGHT ARROW in the manual).
622D
If the Z FLAG is set (the equals sign), JUMP to 624EH to show the byte in binary.
6230
CP 0DH FE 0D
Compare Register A (the key) against 0DH, ENTER.
6232
If the NZ FLAG is set (any other key), JUMP to 65FFH to take an arrow key or ignore the key and go back to the loop.
6235
JUMP to 6E58H to show the help screen until ENTER is pressed: ENTER alone is the help command.
6238
LD (HL),01H 36 01
Store 01H at Register Pair HL (6013H): H waits for the first hex digit of a byte.
623A
GOSUB to 67BCH to store Register A (48H, H) at the place in the command line and at the cursor.
623D
GOSUB to 6870H to clear the input line of the 128 byte mode at 3FCAH (nothing in the 256 byte mode).
6240
JUMP back to 60ADH, the command loop, for the digits of the hex modify mode.
6243
LD (HL),03H 36 03
Store 03H at Register Pair HL (6013H): A, every key but the arrows and BREAK goes into the record.
6245
GOSUB to 67BCH to store Register A (41H, A) at the place in the command line and at the cursor.
6248
GOSUB to 6870H to clear the input line of the 128 byte mode at 3FCAH.
624B
JUMP back to 60ADH, the command loop, for the characters of the ASCII modify mode.

624EH - =: The Byte in Binary

The equals sign works in the 128 byte mode only: the input line at 3FCAH gets X'hh'= (the hex digits kept at 5B68H by 6679H), then the eight bits of the byte at the cursor as 0 and 1, with a comma after the fourth. The byte is rotated eight times, so it is the same at the end.

624E
LD A,(6020H) 3A 20 60
Fetch the display mode from 6020H into Register A: 00H for the 256 byte mode.
6251
OR A B7
OR Register A with itself to set the Z FLAG for the 256 byte mode.
6252
If the Z FLAG is set (256 byte mode), JUMP back to 60ADH: the key is ignored, as the manual says.
6255
LD A,20H 3E 20
Load Register A with 20H, a space, for the command line: the equals sign is not shown there.
6257
GOSUB to 67BCH to store Register A (20H) at the place in the command line and at the cursor.
625A
GOSUB to 6870H to clear the input line of the 128 byte mode, 36 characters from 3FCAH.
625D
LD HL,5B66H 21 66 5B
Point Register Pair HL to 5B66H, the text X'hh'= with the hex digits of the byte at the cursor.
6260
LD DE,3FCAH 11 CA 3F
Point Register Pair DE to 3FCAH, the input line on the last row of the screen.
6263
LD BC,0006H 01 06 00
Load Register Pair BC with 0006H, the six characters of X'hh'=.
6266
LDIR ED B0
Copy Register Pair BC (6) bytes from Register Pair HL (5B66H) to Register Pair DE (3FCAH); Register Pair DE ends at 3FD0H.
6268
LD HL,(601CH) 2A 1C 60
Fetch the address of the byte at the cursor from 601CH-601DH into Register Pair HL.
626B
LD B,08H 06 08
Load Register B with 08H, the bits of the byte.
626D
LD A,30H 3E 30
Load Register A with 30H, the digit 0. 627FH loops back here.
626F
RLC (HL) CB 06
Rotate the byte at Register Pair HL left: bit 7 goes into the CARRY FLAG and into bit 0, so eight turns leave the byte as it was.
6271
If the NO CARRY FLAG is set (the bit is 0), JUMP to 6274H to show 0.
6273
INC A 3C
INCrement Register A to 31H, the digit 1: the bit was set.
6274
LD (DE),A 12
Store Register A (0 or 1) at Register Pair DE on the screen.
6275
INC DE 13
INCrement Register Pair DE to the next place of the input line.
6276
LD A,B 78
Copy Register B (the bits still to show, counted down) into Register A.
6277
CP 05H FE 05
Compare Register A against 05H: the Z FLAG after the fourth bit.
6279
If the NZ FLAG is set (not after the fourth bit), JUMP to 627FH.
627B
LD A,2CH 3E 2C
Load Register A with 2CH, a comma, between the two halves of the byte.
627D
LD (DE),A 12
Store Register A (the comma) at Register Pair DE on the screen.
627E
INC DE 13
INCrement Register Pair DE past the comma, to the next digit place.
627F
DECrement Register B and JUMP back to 626DH while it is not zero: the next bit.
6281
JUMP back to 60ADH, the command loop: the binary value stays until the line is cleared.

6284H - Forward, Backward, R, B and E

The semicolon shows the next record and the minus sign the one before, unless the last or the first is shown; the cursor keeps its place in the record. R takes four hex digits in the input box. B shows record 0 with the cursor on byte 00H; E shows the last record with the cursor on the last byte of the file, by the end of file byte of the file control block.

6284
LD A,2BH 3E 2B
Load Register A with 2BH, the plus sign, shown in the command line for forward motion.
6286
GOSUB to 67BCH to store Register A (2BH) at the place in the command line and at the cursor.
6289
LD HL,(6025H) 2A 25 60
Fetch the number of the last record from 6025H-6026H into Register Pair HL.
628C
LD BC,(6021H) ED 4B 21 60
Fetch the number of the record shown from 6021H-6022H into Register Pair BC.
6290
OR A B7
OR Register A with itself to clear the CARRY FLAG for the SBC.
6291
SBC HL,BC ED 42
SUBtract Register Pair BC (the record shown) from Register Pair HL (the last record): the Z FLAG when the last record is shown.
6293
If the Z FLAG is set (the last record), JUMP back to 60ADH: there is no record after it.
6296
INC BC 03
INCrement Register Pair BC to the next record.
6297
LD (6021H),BC ED 43 21 60
Store Register Pair BC (the next record) at 6021H-6022H.
629B
GOSUB to 6CC8H to read the record of Register Pair BC into the edit buffer and show it.
629E
GOSUB to 6870H to clear the input line of the 128 byte mode.
62A1
JUMP back to 60ADH, the command loop, with the next record shown.
62A4
GOSUB to 67BCH to store Register A (2DH, the minus sign) at the place in the command line and at the cursor.
62A7
LD BC,(6021H) ED 4B 21 60
Fetch the number of the record shown from 6021H-6022H into Register Pair BC.
62AB
LD A,B 78
Copy Register B (the high byte of the record number) into Register A.
62AC
OR C B1
OR Register C into Register A: the Z FLAG when Register Pair BC is 0000H, record 0.
62AD
If the Z FLAG is set (record 0), JUMP back to 60ADH: there is no record before it.
62B0
DEC BC 0B
DECrement Register Pair BC to the record before.
62B1
LD (6021H),BC ED 43 21 60
Store Register Pair BC (the record before) at 6021H-6022H.
62B5
GOSUB to 6CC8H to read the record of Register Pair BC into the edit buffer and show it.
62B8
GOSUB to 6870H to clear the input line of the 128 byte mode.
62BB
JUMP back to 60ADH, the command loop, with the record before shown.
62BE
LD (HL),04H 36 04
Store 04H at Register Pair HL (6013H): R waits for its four hex digits (states 04H-07H, 6145H).
62C0
GOSUB to 6791H to store Register A (52H, R) in the command line and at the cursor and to move the place on.
62C3
GOSUB to 6D30H to clear the input box of the 256 byte mode at 3DBDH.
62C6
LD A,05H 3E 05
Load Register A with 05H, the rows of the input box.
62C8
GOSUB to 6D06H to draw the input box of Register A (5) rows and put the cursor in it (3FCAH in the 128 byte mode).
62CB
GOSUB to 6870H to clear the input line of the 128 byte mode.
62CE
JUMP back to 60ADH, the command loop, for the digits of the record number.
62D1
GOSUB to 67BCH to store Register A (42H, B) at the place in the command line and at the cursor.
62D4
GOSUB to 67DBH to take the two cursors off the record and the command cursor off the screen.
62D7
LD HL,5262H 21 62 52
Point Register Pair HL to 5262H, byte 00H of the edit buffer.
62DA
LD (601CH),HL 22 1C 60
Store Register Pair HL (5262H) at 601CH-601DH: the cursor goes to byte 00H.
62DD
LD BC,0000H 01 00 00
Load Register Pair BC with 0000H, record 0, the first of the file.
62E0
LD (6021H),BC ED 43 21 60
Store Register Pair BC (0000H) at 6021H-6022H, the record to show.
62E4
GOSUB to 6CC8H to read record 0 (Register Pair BC) into the edit buffer and show it.
62E7
JUMP back to 60ADH, the command loop, at the beginning of the file.
62EA
GOSUB to 67BCH to store Register A (45H, E) at the place in the command line and at the cursor.
62ED
GOSUB to 67DBH to take the cursors off the screen.
62F0
GOSUB to 7162H to put the cursor (601CH) on the last byte of the file, by the end of file byte at 524AH.
62F3
GOSUB to 7156H to make the last record (6025H) the record shown, read it and show it.
62F6
JUMP back to 60ADH, the command loop, at the end of the file.

62F9H - N, D, P, O and T

N waits for ENTER and then asks for a new file. D prints the records from the one shown to the end, three to a page; P prints the edit buffer between two blank lines; O sends a top of form. Each checks the printer first (6F9BH). T switches the display mode and builds the screen again.

62F9
LD (HL),09H 36 09
Store 09H at Register Pair HL (6013H): N waits for ENTER (6104H).
62FB
GOSUB to 67BCH to store Register A (4EH, N) at the place in the command line and at the cursor.
62FE
GOSUB to 6870H to clear the input line of the 128 byte mode.
6301
JUMP back to 60ADH, the command loop, to wait for ENTER.
6304
GOSUB to 67DBH to take the cursors off the screen. N and ENTER come here (6104H).
6307
JUMP to 609EH to ask for the file specification of a new file; the file shown is not closed (the manual: FED never closes files).
630A
LD (HL),12H 36 12
Store 12H at Register Pair HL (6013H): D, which 6EBCH tells from P when BREAK stops the printing.
630C
GOSUB to 67BCH to store Register A (44H, D) at the place in the command line and at the cursor.
630F
GOSUB to 6870H to clear the input line of the 128 byte mode.
6312
GOSUB to 6F9BH to ask the printer for its status; if it is not ready the error is shown and FED goes to 704AH.
6315
LD BC,(6021H) ED 4B 21 60
Fetch the number of the record shown from 6021H-6022H into Register Pair BC.
6319
LD (6023H),BC ED 43 23 60
Store Register Pair BC (the record shown) at 6023H-6024H, to show it again at the end.
631D
GOSUB to 6331H to read and print the record of Register Pair BC and count it up. 632FH loops back here.
6320
GOSUB to 6F8DH to print a space and 0DH, a blank line after the record.
6323
GOSUB to 6331H to read and print the next record.
6326
GOSUB to 6F8DH to print a space and 0DH, a blank line after the record.
6329
GOSUB to 6331H to read and print the next record.
632C
GOSUB to 6F8DH to print a space and 0DH, a blank line after the record: three records of 22 lines fill a page of 66.
632F
JUMP back to 631DH for the next three records; 6331H ends the loop after the last record.
6331
PUSH BC C5
Save Register Pair BC (the record to print) to the stack.
6332
GOSUB to 72D1H to read the record of Register Pair BC through @POSN and @READ and copy it to the edit buffer; 72D1H also shows the number at 602DH-602EH, the record of the last scan, in the box of the record number.
6335
GOSUB to 6ED9H to print the edit buffer: the title, the heading and the 16 lines of ASCII and hex.
6338
POP BC C1
Restore Register Pair BC from the stack: the record just printed.
6339
INC BC 03
INCrement Register Pair BC to the next record.
633A
LD (6021H),BC ED 43 21 60
Store Register Pair BC (the next record) at 6021H-6022H.
633E
LD HL,(6025H) 2A 25 60
Fetch the number of the last record from 6025H-6026H into Register Pair HL.
6341
OR A B7
OR Register A with itself to clear the CARRY FLAG for the SBC.
6342
SBC HL,BC ED 42
SUBtract Register Pair BC (the next record) from Register Pair HL (the last record): the CARRY FLAG when the last record is printed.
6344
RET NC D0
If the NO CARRY FLAG is set (more records), RETurn to 6320H, 6326H or 632CH to go on printing.
6345
LD BC,(6023H) ED 4B 23 60
Fetch the record that was shown from 6023H-6024H into Register Pair BC.
6349
LD (6021H),BC ED 43 21 60
Store Register Pair BC (that record) at 6021H-6022H, to show it again.
634D
XOR A AF
Set Register A to 00H by XOR A with itself, for the state.
634E
LD (6013H),A 32 13 60
Store Register A (00H) at 6013H: no command under way.
6351
GOSUB to 6CC8H to read the record of Register Pair BC into the edit buffer and show it.
6354
JUMP back to 60ADH, the command loop. The return address of 6331H is left on the stack: 60ADH sets the Stack Pointer again.
6357
LD (HL),11H 36 11
Store 11H at Register Pair HL (6013H): P, which 6EBCH tells from D when BREAK stops the printing.
6359
GOSUB to 67BCH to store Register A (50H, P) at the place in the command line and at the cursor.
635C
GOSUB to 6870H to clear the input line of the 128 byte mode.
635F
GOSUB to 6F9BH to ask the printer for its status; if it is not ready the error is shown and FED goes to 704AH.
6362
GOSUB to 6F8DH to print a space and 0DH, a blank line before the record.
6365
GOSUB to 6F8DH to print a space and 0DH, a second blank line.
6368
GOSUB to 6ED9H to print the edit buffer: the title, the heading and the 16 lines of ASCII and hex.
636B
GOSUB to 67DBH to take the cursors off the screen.
636E
GOSUB to 6F8DH to print a space and 0DH, a blank line after the record.
6371
GOSUB to 6F8DH to print a space and 0DH, a second blank line.
6374
XOR A AF
Set Register A to 00H by XOR A with itself, for the state.
6375
LD (6013H),A 32 13 60
Store Register A (00H) at 6013H: no command under way.
6378
JUMP back to 60ADH, the command loop, after the record is printed.
637B
GOSUB to 67BCH to store Register A (4FH, O) at the place in the command line and at the cursor.
637E
GOSUB to 6870H to clear the input line of the 128 byte mode.
6381
GOSUB to 67DBH to take the cursors off the screen.
6384
GOSUB to 6F9BH to ask the printer for its status; if it is not ready the error is shown and FED goes to 704AH.
6387
GOSUB to 6F85H to send 0CH, top of form, to the printer.
638A
JUMP back to 60ADH, the command loop, after the top of form.
638D
GOSUB to 67BCH to store Register A (54H, T) at the place in the command line and at the cursor.
6390
GOSUB to 67DBH to take the cursors off the screen.
6393
LD HL,6020H 21 20 60
Point Register Pair HL to 6020H, the display mode.
6396
LD A,(HL) 7E
Fetch the display mode at Register Pair HL (6020H) into Register A.
6397
XOR 01H EE 01
Flip bit 0 of Register A (XOR 01H): 00H, the 256 byte mode, becomes 01H, the 128 byte mode, and back.
6399
LD (HL),A 77
Store Register A (the new mode) at Register Pair HL (6020H).
639A
GOSUB to 6953H to build the display of the edit buffer in the screen image at 5562H in the new mode.
639D
GOSUB to 6B4EH to copy the screen image (1024 bytes) to video memory at 3C00H.
63A0
GOSUB to 67C6H to put the cursor at the command line of the new mode (3FFFH or 3FC8H).
63A3
JUMP back to 60ADH, the command loop, in the new mode.

63A6H - S: Save the Record

S waits for ENTER; then the edit buffer is copied into the buffer of the file, the file is positioned to the record shown and the record is written with @VER (write and read back). For DIR/SYS, the directory entry code 01H at 5249H, the operand of SYS0's WRSECT is set for the time of the write to WRPROT's 0EH, so that the sector gets the deleted data mark every directory sector has; the read back then gives error 06H, which is the good end here.

63A6
LD (HL),08H 36 08
Store 08H at Register Pair HL (6013H): S waits for ENTER (60FFH).
63A8
GOSUB to 67BCH to store Register A (53H, S) at the place in the command line and at the cursor.
63AB
GOSUB to 6870H to clear the input line of the 128 byte mode.
63AE
JUMP back to 60ADH, the command loop, to wait for ENTER.
63B1
GOSUB to 67DBH to take the cursors off the screen. S and ENTER come here (60FFH).
63B4
LD HL,5262H 21 62 52
Point Register Pair HL to 5262H, the edit buffer.
63B7
LD DE,5362H 11 62 53
Point Register Pair DE to 5362H, the buffer of the file control block, which @VER writes from.
63BA
LD BC,0100H 01 00 01
Load Register Pair BC with 0100H, the 256 bytes of a record.
63BD
LDIR ED B0
Copy Register Pair BC (256) bytes from Register Pair HL (5262H) to Register Pair DE (5362H); Register Pair BC ends at 0000H.
63BF
LD HL,6013H 21 13 60
Point Register Pair HL to 6013H, the state of the command line.
63C2
LD (HL),B 70
Store Register B (00H after the LDIR) at Register Pair HL (6013H): no command under way.
63C3
LD BC,(6021H) ED 4B 21 60
Fetch the number of the record shown from 6021H-6022H into Register Pair BC.
63C7
LD DE,5242H 11 42 52
Point Register Pair DE to 5242H, the file control block.
63CA
GOSUB to 4442H, @POSN, to position the file of the control block at Register Pair DE to record Register Pair BC.
63CD
If the NZ FLAG is set (an error, number in Register A), JUMP to 6DA6H to show the error and the record again.
63D0
LD HL,4764H 21 64 47
Point Register Pair HL to 4764H, the operand of LD A,0DH in SYS0/SYS's WRSECT (4763H), and the JR after it.
63D3
LD E,(HL) 5E
Fetch the byte at Register Pair HL (4764H, 0DH) into Register E.
63D4
INC HL 23
INCrement Register Pair HL to 4765H, the JR opcode after it.
63D5
LD D,(HL) 56
Fetch the byte at Register Pair HL (4765H, 18H) into Register D: Register Pair DE holds the two bytes to put back.
63D6
PUSH DE D5
Save Register Pair DE (the bytes of 4764H-4765H) to the stack.
63D7
LD A,(5249H) 3A 49 52
Fetch the directory entry code of the file from 5249H, +07H of the file control block, into Register A.
63DA
CP 01H FE 01
Compare Register A against 01H, the directory entry code of DIR/SYS.
63DC
If the NZ FLAG is set (not DIR/SYS), JUMP to 63E7H to write the record as it is.
63DE
LD DE,476AH 11 6A 47
Point Register Pair DE to 476AH, the JR opcode of WRPROT (4768H), after its operand 0EH at 4769H.
63E1
LD A,(DE) 1A
Fetch the byte at Register Pair DE (476AH, 18H) into Register A.
63E2
LD (HL),A 77
Store Register A at Register Pair HL (4765H): the JR stays a JR.
63E3
DEC DE 1B
DECrement Register Pair DE to 4769H, the function 0EH of WRPROT.
63E4
DEC HL 2B
DECrement Register Pair HL to 4764H, the function 0DH of WRSECT.
63E5
LD A,(DE) 1A
Fetch the byte at Register Pair DE (4769H, 0EH) into Register A.
63E6
LD (HL),A 77
Store Register A (0EH) at Register Pair HL (4764H): WRSECT now writes with the deleted data mark.
63E7
LD DE,5242H 11 42 52
Point Register Pair DE to 5242H, the file control block.
63EA
GOSUB to 443CH, @VER, to write the record from 5362H to the file at Register Pair DE and read it back.
63ED
POP HL E1
Restore Register Pair HL from the stack: the two bytes of 4764H-4765H as they were.
63EE
LD (4764H),HL 22 64 47
Store Register Pair HL at 4764H-4765H: WRSECT is SYS0/SYS's again.
63F1
PUSH AF F5
Save Register Pair AF (the error number of @VER and its flags) to the stack.
63F2
LD A,(5249H) 3A 49 52
Fetch the directory entry code of the file from 5249H into Register A.
63F5
CP 01H FE 01
Compare Register A against 01H, the directory entry code of DIR/SYS.
63F7
If the Z FLAG is set (DIR/SYS), JUMP to 6400H, where error 06H is the good end.
63F9
POP AF F1
Restore Register Pair AF from the stack: the result of @VER.
63FA
If the NZ FLAG is set (an error, number in Register A), JUMP to 6DA6H to show the error and the record again.
63FD
JUMP back to 60ADH, the command loop: the record is saved.
6400
POP AF F1
Restore Register Pair AF from the stack: the result of @VER for DIR/SYS.
6401
CP 06H FE 06
Compare Register A against 06H, the error of a sector read with the deleted data mark.
6403
If the NZ FLAG is set (any other result, even 00H), JUMP to 6DA6H to show the error of Register A.
6406
JUMP back to 60ADH, the command loop: the directory record is saved.

6409H - X, F, C, L and G

X waits for ENTER and then ends FED. F (hex digits) and C (characters) open an input box of seven rows (the input line in the 128 byte mode) for the string; L opens one of five rows for the address. G repeats the last search: from the byte after the cursor for a string, from the block after the found address for L, or shows an asterisk when there was none.

6409
LD (HL),0AH 36 0A
Store 0AH at Register Pair HL (6013H): X waits for ENTER (6107H).
640B
GOSUB to 67BCH to store Register A (58H, X) at the place in the command line and at the cursor.
640E
GOSUB to 6870H to clear the input line of the 128 byte mode.
6411
JUMP back to 60ADH, the command loop, to wait for ENTER.
6414
LD (HL),42H 36 42
Store 42H at Register Pair HL (6013H): F, bit 6 set; each hex digit counts it up (6141H).
6416
GOSUB to 67BCH to store Register A (46H, F) at the place in the command line and at the cursor.
6419
GOSUB to 6870H to clear the input line of the 128 byte mode.
641C
GOSUB to 701BH to draw the input box of seven rows and move the place in the command line past the letter.
641F
JUMP back to 60ADH, the command loop, for the hex digits.
6422
LD (HL),82H 36 82
Store 82H at Register Pair HL (6013H): C, bit 7 set; each character counts it up.
6424
GOSUB to 67BCH to store Register A (43H, C) at the place in the command line and at the cursor.
6427
GOSUB to 6870H to clear the input line of the 128 byte mode.
642A
GOSUB to 701BH to draw the input box of seven rows and move the place in the command line past the letter.
642D
JUMP back to 60ADH, the command loop, for the characters.
6430
LD (HL),14H 36 14
Store 14H at Register Pair HL (6013H): L, bit 4 set; its four digits count it to 18H (6151H).
6432
GOSUB to 6791H to store Register A (4CH, L) in the command line and at the cursor and to move the place on.
6435
GOSUB to 6870H to clear the input line of the 128 byte mode.
6438
GOSUB to 6D30H to clear the input box of the 256 byte mode at 3DBDH.
643B
LD A,05H 3E 05
Load Register A with 05H, the rows of the input box.
643D
GOSUB to 6D06H to draw the input box of Register A (5) rows and put the cursor in it.
6440
JUMP back to 60ADH, the command loop, for the four hex digits of the address.
6443
GOSUB to 67BCH to store Register A (47H, G) at the place in the command line and at the cursor.
6446
GOSUB to 67DBH to take the cursors off the screen.
6449
LD DE,6030H 11 30 60
Point Register Pair DE to 6030H, the kind of the last search.
644C
LD A,(DE) 1A
Fetch the kind of the last search at Register Pair DE (6030H) into Register A.
644D
OR A B7
OR Register A with itself to set the Z FLAG when it is 00H, no search yet.
644E
If the Z FLAG is set (nothing to repeat), JUMP to 704AH to show an asterisk in the command line.
6451
INC A 3C
INCrement Register A: the Z FLAG when the kind was FFH, an L search.
6452
If the Z FLAG is set (L), JUMP to 7188H to go on through the load blocks from the record at 602DH.
6455
LD HL,(601CH) 2A 1C 60
Fetch the address of the byte at the cursor from 601CH-601DH into Register Pair HL.
6458
LD DE,5262H 11 62 52
Point Register Pair DE to 5262H, the edit buffer.
645B
OR A B7
OR Register A with itself to clear the CARRY FLAG for the SBC.
645C
SBC HL,DE ED 52
SUBtract Register Pair DE (5262H) from Register Pair HL: Register L = the offset of the cursor in the record.
645E
LD A,L 7D
Copy Register L (the offset of the cursor) into Register A, for 70A0H.
645F
INC L 2C
INCrement Register L: the Z FLAG when the cursor is on byte FFH, the last of the record.
6460
If the NZ FLAG is set (not the last byte), JUMP to 70A0H to search from the byte after the cursor in this record.
6463
JUMP to 70D2H to search from the next record, after the last byte.

6466H - Z: The Next Load Block

With the cursor on a type byte (01H, 05H, 07H, 10H or 1FH) of a load module, Z skips its block by its length byte and puts the cursor on the next type byte, reading the records it passes into. A type byte 02H, the transfer address, ends the zip with an asterisk; any other byte gives Cursor not on Type byte.

6466
LD (HL),18H 36 18
Store 18H at Register Pair HL (6013H): the state of the command Z.
6468
GOSUB to 67BCH to store Register A (5AH, Z) at the place in the command line and at the cursor.
646B
GOSUB to 6870H to clear the input line of the 128 byte mode.
646E
GOSUB to 67DBH to take the cursors off the screen.
6471
LD BC,(6021H) ED 4B 21 60
Fetch the number of the record shown from 6021H-6022H into Register Pair BC.
6475
LD (602DH),BC ED 43 2D 60
Store Register Pair BC (the record shown) at 602DH-602EH, the record the scan is in.
6479
LD HL,(601CH) 2A 1C 60
Fetch the address of the byte at the cursor from 601CH-601DH into Register Pair HL.
647C
PUSH HL E5
Save Register Pair HL (the cursor) to the stack.
647D
LD DE,5262H 11 62 52
Point Register Pair DE to 5262H, the edit buffer.
6480
OR A B7
OR Register A with itself to clear the CARRY FLAG for the SBC.
6481
SBC HL,DE ED 52
SUBtract Register Pair DE (5262H) from Register Pair HL: Register L = the offset of the cursor in the record.
6483
LD A,L 7D
Copy Register L (the offset of the cursor) into Register A.
6484
LD (602BH),A 32 2B 60
Store Register A (the offset) at 602BH, the place of the scan in the record.
6487
POP HL E1
Restore Register Pair HL from the stack: the address of the byte at the cursor.
6488
LD A,(HL) 7E
Fetch the byte at the cursor at Register Pair HL into Register A: the type byte.
6489
CP 02H FE 02
Compare Register A against 02H, the type of the transfer address record.
648B
If the NZ FLAG is set (not 02H), JUMP to 6490H to check the other types.
648D
JUMP to 704AH to show an asterisk in the command line: the transfer address ends the load module.
6490
CP 01H FE 01
Compare Register A against 01H, a load block.
6492
If the Z FLAG is set (01H), JUMP to 64ADH to skip the block.
6494
CP 05H FE 05
Compare Register A against 05H, a module name record.
6496
If the Z FLAG is set (05H), JUMP to 64ADH to skip the record.
6498
CP 07H FE 07
Compare Register A against 07H, another type of record of a load module.
649A
If the Z FLAG is set (07H), JUMP to 64ADH to skip the record.
649C
CP 10H FE 10
Compare Register A against 10H, another type of record of a load module.
649E
If the Z FLAG is set (10H), JUMP to 64ADH to skip the record.
64A0
CP 1FH FE 1F
Compare Register A against 1FH, a copyright record.
64A2
If the Z FLAG is set (1FH), JUMP to 64ADH to skip the record.
64A4
LD HL,5B3DH 21 3D 5B
Point Register Pair HL to 5B3DH, the text Cursor not on Type byte.
64A7
LD DE,3D94H 11 94 3D
Point Register Pair DE to 3D94H, row 6 of the screen, where the text is shown.
64AA
JUMP to 71F3H to clear the screen, show the text at Register Pair DE, wait for ENTER and show the record again.
64AD
GOSUB to 72ADH to move the scan on one byte, to the length byte, into Register A (and the next record if needed).
64B0
SUB 02H D6 02
SUBtract 02H from Register A (the length): the bytes after the two of the address for a load block.
64B2
GOSUB to 72AFH to move the scan on by Register A bytes (00H counts as 256).
64B5
LD A,03H 3E 03
Load Register A with 03H: the two address bytes and one more, to the next type byte.
64B7
GOSUB to 72AFH to move the scan on by Register A (3) bytes: Register Pair HL is at the next type byte.
64BA
LD (601CH),HL 22 1C 60
Store Register Pair HL (the next type byte in the edit buffer) at 601CH-601DH, the cursor.
64BD
LD BC,(602DH) ED 4B 2D 60
Fetch the record the scan ended in from 602DH-602EH into Register Pair BC.
64C1
LD (6021H),BC ED 43 21 60
Store Register Pair BC at 6021H-6022H, the record to show.
64C5
GOSUB to 6CC8H to read the record of Register Pair BC into the edit buffer and show it with the cursor.
64C8
GOSUB to 679FH to clear the command line and set the state at 6013H to 00H.
64CB
JUMP back to 60ADH, the command loop, with the cursor on the next type byte.

64CEH - A Spare Area

128 bytes of 00H in the file between the commands and the routines. No instruction of FED/CMD reads or writes them.

64CE-654D
DEFB 00H x 128 00 x 128
64CEH-654DH: 128 bytes of 00H that no instruction of FED/CMD addresses; the load block 6463H-6562H carries them as part of the code.

654EH - Clear the Screen; the Register Saver

654EH fills video memory 3C00H-3FFFH with spaces. Many routines start with CALL 655FH: it takes the rest of the routine as a subroutine, after saving Register Pairs HL, DE, BC, AF, IX and IY, and gives them all back when the routine returns, so the caller finds every register as it was.

654E
GOSUB to 655FH to save every register and run the rest of this routine as a subroutine.
6551
LD HL,3C00H 21 00 3C
Point Register Pair HL to 3C00H, the first byte of video memory.
6554
LD DE,3C01H 11 01 3C
Point Register Pair DE to 3C01H, the next byte, for the fill by LDIR.
6557
LD BC,03FFH 01 FF 03
Load Register Pair BC with 03FFH, the 1023 bytes after the first.
655A
LD (HL),20H 36 20
Store 20H, a space, at Register Pair HL (3C00H): the LDIR copies it on.
655C
LDIR ED B0
Copy Register Pair BC (1023) bytes from Register Pair HL to Register Pair DE: 3C00H-3FFFH are all spaces.
655E
RET C9
RETurn to 6573H in the register saver, which gives back the registers and returns to the caller.
655F
EX (SP),HL E3
Exchange Register Pair HL with the word at the top of the stack (Stack Pointer SP): Register Pair HL = the address after the CALL 655FH, the rest of the routine; the stack holds the caller's Register Pair HL.
6560
LD (6571H),HL 22 71 65
Store Register Pair HL (the rest of the routine) at 6571H-6572H, the operand of the JP at 6570H.
6563
POP HL E1
Restore Register Pair HL from the stack: the caller's Register Pair HL, as it was before the CALL.
6564
PUSH HL E5
Save Register Pair HL to the stack, to be given back at 657AH.
6565
PUSH DE D5
Save Register Pair DE to the stack, to be given back at 6579H.
6566
PUSH BC C5
Save Register Pair BC to the stack, to be given back at 6578H.
6567
PUSH AF F5
Save Register Pair AF to the stack, to be given back at 6577H.
6568
PUSH IX DD E5
Save Index Register IX to the stack, to be given back at 6575H.
656A
PUSH IY FD E5
Save Index Register IY to the stack, to be given back at 6573H.
656C
LD DE,6573H 11 73 65
Point Register Pair DE to 6573H, the place the routine returns to.
656F
PUSH DE D5
Save Register Pair DE (6573H) to the stack: the RET of the routine comes to 6573H.
6570
JUMP to the rest of the routine: the operand 6571H-6572H (0000H in the file) is stored by 6560H. Register Pair DE is 6573H here; the other registers are the caller's.
6573
POP IY FD E1
Restore Index Register IY from the stack: the routine has returned here.
6575
POP IX DD E1
Restore Index Register IX from the stack, as the caller had it.
6577
POP AF F1
Restore Register Pair AF from the stack: the flags are the caller's too.
6578
POP BC C1
Restore Register Pair BC from the stack, as the caller had it.
6579
POP DE D1
Restore Register Pair DE from the stack, as the caller had it.
657A
POP HL E1
Restore Register Pair HL from the stack, as the caller had it.
657B
RET C9
RETurn to the caller of the routine that called 655FH, with every register as it was.

657CH - Lower Case or Capitals

A machine without the lower case kit shows a lower case letter as another character, so FED tries a lower case a (61H) at 3C00H: if it reads back, the video has lower case; else every lower case letter of the texts 59A8H-600DH (including the help screen) is made a capital, keeping bit 7 of the bytes that end a text.

657C
GOSUB to 655FH to save every register and run the rest of this routine as a subroutine.
657F
LD HL,3C00H 21 00 3C
Point Register Pair HL to 3C00H, the top left corner of video memory.
6582
LD B,(HL) 46
Fetch the character at Register Pair HL (3C00H) into Register B, to put it back.
6583
LD A,61H 3E 61
Load Register A with 61H, a lower case a, the test character.
6585
LD (HL),A 77
Store Register A (61H) at Register Pair HL (3C00H) in video memory.
6586
CP (HL) BE
Compare Register A (61H) against the byte at Register Pair HL: the Z FLAG when video memory kept the lower case letter.
6587
LD (HL),B 70
Store Register B (the character that was there) back at Register Pair HL (3C00H).
6588
RET Z C8
If the Z FLAG is set (the video has lower case), RETurn: the texts stay as they are.
6589
LD HL,59A8H 21 A8 59
Point Register Pair HL to 59A8H, the start of the texts and the help screen.
658C
LD BC,0666H 01 66 06
Load Register Pair BC with 0666H, the 1638 bytes from 59A8H to 600DH.
658F
LD A,(HL) 7E
Fetch the byte at Register Pair HL into Register A. 6598H loops back here.
6590
GOSUB to 659BH to make Register A a capital if it is a lower case letter, keeping bit 7.
6593
LD (HL),A 77
Store Register A (the byte, now in capitals) back at Register Pair HL.
6594
INC HL 23
INCrement Register Pair HL to the next byte of the texts.
6595
DEC BC 0B
DECrement Register Pair BC, the count of the bytes left.
6596
LD A,B 78
Copy Register B into Register A, to test Register Pair BC for zero.
6597
OR C B1
OR Register C into Register A: the Z FLAG when Register Pair BC is 0000H.
6598
If the NZ FLAG is set (bytes left), JUMP back to 658FH.
659A
RET C9
RETurn to 6573H in the register saver: every text is in capitals.
659B
BIT 7,A CB 7F
Test bit 7 of Register A: set for the last byte of a text.
659D
If the Z FLAG is set (bit 7 clear), JUMP to 65A7H to make Register A a capital.
659F
RES 7,A CB BF
Clear bit 7 of Register A, to look at the character.
65A1
GOSUB to 65A7H to make Register A a capital if it is a lower case letter.
65A4
SET 7,A CB FF
Set bit 7 of Register A again: the byte still ends its text.
65A6
RET C9
RETurn with Register A a capital with bit 7 set.
65A7
CP 61H FE 61
Compare Register A against 61H, the lower case a: the CARRY FLAG below it.
65A9
RET C D8
If the CARRY FLAG is set (not a lower case letter), RETurn with Register A as it is.
65AA
CP 7BH FE 7B
Compare Register A against 7BH, the character after the lower case z.
65AC
RET NC D0
If the NO CARRY FLAG is set (above z), RETurn with Register A as it is.
65AD
RES 5,A CB AF
Clear bit 5 of Register A: 61H-7AH become 41H-5AH, the capitals.
65AF
RET C9
RETurn with Register A a capital letter (41H-5AH).

65B0H - The Name of the File as Shown

The name shown on the screen and printed in the title is taken from the file specification at 5242H: up to Register B characters, in capitals, ending at the period of the extension, the colon of the drive or 0DH, at 59C8H-59D5H; a colon follows, and the place after it is kept at 6027H for the drive digit.

65B0
GOSUB to 655FH to save every register and run the rest of this routine as a subroutine.
65B3
LD HL,59C8H 21 C8 59
Point Register Pair HL to 59C8H, the name as shown.
65B6
LD DE,59C9H 11 C9 59
Point Register Pair DE to 59C9H, the next byte, for the fill by LDIR.
65B9
LD (HL),20H 36 20
Store 20H, a space, at Register Pair HL (59C8H).
65BB
PUSH BC C5
Save Register Pair BC (Register B, the count of the characters of the specification) to the stack.
65BC
LD BC,000DH 01 0D 00
Load Register Pair BC with 000DH, the 13 bytes after the first.
65BF
LDIR ED B0
Copy Register Pair BC (13) bytes from Register Pair HL to Register Pair DE: 59C8H-59D5H are spaces.
65C1
POP BC C1
Restore Register Pair BC from the stack: Register B is the count of the characters.
65C2
LD HL,5242H 21 42 52
Point Register Pair HL to 5242H, the file specification in the file control block.
65C5
LD DE,59C8H 11 C8 59
Point Register Pair DE to 59C8H, the name as shown.
65C8
LD A,(HL) 7E
Fetch the character at Register Pair HL into Register A. 65DBH loops back here.
65C9
GOSUB to 65A7H to make Register A a capital if it is a lower case letter.
65CC
CP 2EH FE 2E
Compare Register A against 2EH, the period before the extension.
65CE
If the Z FLAG is set (the period), JUMP to 65DDH: the name ends here.
65D0
CP 3AH FE 3A
Compare Register A against 3AH, the colon before the drive.
65D2
If the Z FLAG is set (the colon), JUMP to 65DDH: the name ends here.
65D4
CP 0DH FE 0D
Compare Register A against 0DH, the end of the line.
65D6
If the Z FLAG is set (the end), JUMP to 65DDH: the name ends here.
65D8
LD (DE),A 12
Store Register A (the character) at Register Pair DE in the name as shown.
65D9
INC DE 13
INCrement Register Pair DE to the next place of the name.
65DA
INC HL 23
INCrement Register Pair HL to the next character of the specification.
65DB
DECrement Register B and JUMP back to 65C8H while it is not zero.
65DD
EX DE,HL EB
Exchange Register Pair DE and Register Pair HL: Register Pair HL = the place after the name.
65DE
LD (HL),3AH 36 3A
Store 3AH, a colon, at Register Pair HL after the name.
65E0
INC HL 23
INCrement Register Pair HL to the place after the colon, for the drive digit.
65E1
LD (6027H),HL 22 27 60
Store Register Pair HL (the place of the drive digit) at 6027H-6028H; 6C7BH puts the digit there.
65E4
RET C9
RETurn to 6573H in the register saver, which restores the registers.

65E5H - Show a Text

65E5H copies the text at Register Pair HL to Register Pair DE up to the byte with bit 7 set, whose bit 7 it clears at the destination; it returns Register Pair HL at that last byte and Register Pair DE after the copy. 65F5H shows a text at 3FEEH.

65E5
EX DE,HL EB
Exchange Register Pair DE and Register Pair HL: Register Pair DE = the text, Register Pair HL = the place to show it.
65E6
LD A,(DE) 1A
Fetch the character of the text at Register Pair DE into Register A. 65EEH loops back here.
65E7
LD (HL),A 77
Store Register A (the character) at Register Pair HL.
65E8
BIT 7,(HL) CB 7E
Test bit 7 of the byte at Register Pair HL: set on the last character of the text.
65EA
If the NZ FLAG is set (the last character), JUMP to 65F0H.
65EC
INC HL 23
INCrement Register Pair HL to the next place.
65ED
INC DE 13
INCrement Register Pair DE to the next character of the text.
65EE
JUMP back to 65E6H to copy the next character.
65F0
RES 7,(HL) CB BE
Clear bit 7 of the byte at Register Pair HL: the last character is shown as itself.
65F2
EX DE,HL EB
Exchange Register Pair DE and Register Pair HL: Register Pair HL = the last character of the text, Register Pair DE = the last place written.
65F3
INC DE 13
INCrement Register Pair DE to the place after the text, where another text can follow.
65F4
RET C9
RETurn with Register Pair HL at the last byte of the text and Register Pair DE after the copy.
65F5
GOSUB to 655FH to save every register and run the rest of this routine as a subroutine.
65F8
LD DE,3FEEH 11 EE 3F
Point Register Pair DE to 3FEEH, row 15, column 46 of the screen.
65FB
GOSUB to 65E5H to show the text at Register Pair HL at Register Pair DE (3FEEH).
65FE
RET C9
RETurn to 6573H in the register saver, which restores the registers.

65FFH - The Cursor Keys

The arrow keys move the cursor of the record: LEFT and RIGHT ARROW one byte, UP and DOWN ARROW one row of 16 bytes, SHIFT UP ARROW to byte 00H. A move that would leave the record is not made. The 128 byte mode scrolls its window when the cursor leaves it; the offset and, in the 128 byte mode, the value of the byte are shown again.

65FF
GOSUB to 6605H to move the cursor by the key in Register A, or to do nothing for any other key.
6602
JUMP back to 60ADH, the command loop, after the cursor move.
6605
CP 1BH FE 1B
Compare Register A (the key) against 1BH, SHIFT UP ARROW.
6607
If the NZ FLAG is set (another key), JUMP to 6615H.
6609
GOSUB to 67DBH to take the cursors off the screen.
660C
LD HL,5262H 21 62 52
Point Register Pair HL to 5262H, byte 00H of the edit buffer.
660F
LD (601CH),HL 22 1C 60
Store Register Pair HL (5262H) at 601CH-601DH: the cursor goes to byte 00H.
6612
JUMP to 664EH to move the window of the 128 byte mode and show the offset.
6615
CP 08H FE 08
Compare Register A (the key) against 08H, LEFT ARROW.
6617
If the Z FLAG is set (LEFT ARROW), JUMP to 6629H: one byte back.
6619
CP 09H FE 09
Compare Register A (the key) against 09H, RIGHT ARROW.
661B
If the Z FLAG is set (RIGHT ARROW), JUMP to 662EH: one byte on.
661D
CP 0AH FE 0A
Compare Register A (the key) against 0AH, DOWN ARROW.
661F
If the Z FLAG is set (DOWN ARROW), JUMP to 6633H: one row on.
6621
CP 5BH FE 5B
Compare Register A (the key) against 5BH, UP ARROW.
6623
RET NZ C0
If the NZ FLAG is set (not a cursor key), RETurn: nothing is done.
6624
LD DE,FFF0H 11 F0 FF
Load Register Pair DE with FFF0H, minus 16: one row back.
6627
JUMP to 6636H to move the cursor by Register Pair DE.
6629
LD DE,FFFFH 11 FF FF
Load Register Pair DE with FFFFH, minus 1: one byte back.
662C
JUMP to 6636H to move the cursor by Register Pair DE.
662E
LD DE,0001H 11 01 00
Load Register Pair DE with 0001H: one byte on. 678EH comes here after a modify.
6631
JUMP to 6636H to move the cursor by Register Pair DE.
6633
LD DE,0010H 11 10 00
Load Register Pair DE with 0010H: one row of 16 bytes on.
6636
PUSH DE D5
Save Register Pair DE (the move) to the stack.
6637
LD HL,(601CH) 2A 1C 60
Fetch the address of the byte at the cursor from 601CH-601DH into Register Pair HL.
663A
PUSH HL E5
Save Register Pair HL (the cursor) to the stack.
663B
ADD HL,DE 19
ADD Register Pair DE (the move) to Register Pair HL: the new place of the cursor.
663C
LD DE,5262H 11 62 52
Point Register Pair DE to 5262H, the start of the edit buffer.
663F
OR A B7
OR Register A with itself to clear the CARRY FLAG for the SBC.
6640
SBC HL,DE ED 52
SUBtract Register Pair DE (5262H) from Register Pair HL: Register H is 00H while the new place is in the record.
6642
LD A,H 7C
Copy Register H into Register A: 00H inside the record, another value outside it.
6643
POP HL E1
Restore Register Pair HL from the stack: the cursor as it was.
6644
POP DE D1
Restore Register Pair DE from the stack: the move.
6645
OR A B7
OR Register A with itself to set the Z FLAG when the new place is in the record.
6646
RET NZ C0
If the NZ FLAG is set (the move would leave the record), RETurn: the cursor stays.
6647
GOSUB to 67DBH to take the cursors off the screen.
664A
ADD HL,DE 19
ADD Register Pair DE (the move) to Register Pair HL (the cursor).
664B
LD (601CH),HL 22 1C 60
Store Register Pair HL (the new cursor) at 601CH-601DH.
664E
GOSUB to 66B3H to move the window of the 128 byte mode so that it holds the cursor. 6612H comes here.
6651
GOSUB to 655FH to save every register and run the rest of this routine as a subroutine. Many commands call 6651H to show the offset again.
6654
LD HL,(601CH) 2A 1C 60
Fetch the address of the byte at the cursor from 601CH-601DH into Register Pair HL.
6657
LD DE,5262H 11 62 52
Point Register Pair DE to 5262H, the start of the edit buffer.
665A
OR A B7
OR Register A with itself to clear the CARRY FLAG for the SBC.
665B
SBC HL,DE ED 52
SUBtract Register Pair DE (5262H) from Register Pair HL: Register L = the offset of the cursor in the record.
665D
LD A,L 7D
Copy Register L (the offset) into Register A.
665E
GOSUB to 6880H to turn Register A into two hex digits: Register L the first, Register H the second.
6661
LD (3FBEH),HL 22 BE 3F
Store Register Pair HL (the two digits) at 3FBEH-3FBFH on the screen, after the character 3EH at 3FBDH.
6664
LD (5920H),HL 22 20 59
Store Register Pair HL (the two digits) at 5920H-5921H, the same place in the screen image.
6667
GOSUB to 666BH to show the value of the byte in the 128 byte mode.
666A
RET C9
RETurn to 6573H in the register saver, which restores the registers.
666B
LD A,(6020H) 3A 20 60
Fetch the display mode from 6020H into Register A.
666E
DEC A 3D
DECrement Register A: the Z FLAG for the 128 byte mode (01H), and Register A = 00H.
666F
RET NZ C0
If the NZ FLAG is set (256 byte mode), RETurn: the value line is only in the 128 byte mode.
6670
LD HL,(601CH) 2A 1C 60
Fetch the address of the byte at the cursor from 601CH-601DH into Register Pair HL.
6673
LD E,(HL) 5E
Fetch the byte at the cursor at Register Pair HL into Register E.
6674
LD D,A 57
Copy Register A (00H) into Register D: Register Pair DE = the value of the byte, 0-255.
6675
LD A,E 7B
Copy Register E (the byte at the cursor) into Register A for 6880H.
6676
GOSUB to 6880H to turn Register A into two hex digits in Register L and Register H.
6679
LD (5B68H),HL 22 68 5B
Store Register Pair HL (the two digits) at 5B68H-5B69H, in the text X'hh'=.
667C
GOSUB to 68A5H to write Register Pair DE in decimal at 68F9H: Register B = the count of the digits, Register Pair HL = 68F9H.
667F
LD DE,5B6CH 11 6C 5B
Point Register Pair DE to 5B6CH, the places of the decimal value after X'hh'=.
6682
LD C,B 48
Copy Register B (the count of the digits) into Register C.
6683
LD B,00H 06 00
Load Register B with 00H: Register Pair BC = the count of the digits.
6685
PUSH BC C5
Save Register Pair BC (the count of the digits) to the stack.
6686
LDIR ED B0
Copy Register Pair BC bytes from Register Pair HL (68F9H, the digits) to Register Pair DE (5B6CH).
6688
LD HL,5B6FH 21 6F 5B
Point Register Pair HL to 5B6FH, the text Values.
668B
PUSH HL E5
Save Register Pair HL (5B6FH) to the stack, to show the text twice.
668C
LD DE,5951H 11 51 59
Point Register Pair DE to 5951H, row 15 of the screen image.
668F
GOSUB to 65E5H to show the text at Register Pair HL (Values) at Register Pair DE (5951H).
6692
POP HL E1
Restore Register Pair HL from the stack: 5B6FH.
6693
LD DE,3FEFH 11 EF 3F
Point Register Pair DE to 3FEFH, the same place on the screen.
6696
GOSUB to 65E5H to show the text at Register Pair HL (Values) at Register Pair DE (3FEFH).
6699
POP BC C1
Restore Register Pair BC from the stack: the count of the digits.
669A
LD A,06H 3E 06
Load Register A with 06H, the characters of X'hh'=.
669C
ADD A,C 81
ADD Register C (the count of the digits) to Register A: the length of X'hh'= and the value.
669D
LD C,A 4F
Copy Register A (the length) into Register C: Register Pair BC = the length.
669E
LD DE,4000H 11 00 40
Point Register Pair DE to 4000H, the end of video memory plus one.
66A1
GOSUB to 66A7H to copy the Register Pair BC bytes of 5B66H so that they end at 3FFFH, the bottom right corner.
66A4
LD DE,5962H 11 62 59
Point Register Pair DE to 5962H, the end of the screen image plus one: the copy ends at 5961H.
66A7
PUSH BC C5
Save Register Pair BC (the length) to the stack.
66A8
LD HL,5B66H 21 66 5B
Point Register Pair HL to 5B66H, the text X'hh'= and the value.
66AB
EX DE,HL EB
Exchange Register Pair DE and Register Pair HL: Register Pair HL = the end plus one.
66AC
SBC HL,BC ED 42
SUBtract Register Pair BC (the length) from Register Pair HL, with the CARRY FLAG (clear here): the place where the text starts.
66AE
EX DE,HL EB
Exchange Register Pair DE and Register Pair HL: Register Pair DE = that place, Register Pair HL = 5B66H.
66AF
LDIR ED B0
Copy Register Pair BC bytes from Register Pair HL (5B66H) to Register Pair DE.
66B1
POP BC C1
Restore Register Pair BC from the stack: the length.
66B2
RET C9
RETurn: to 66A4H after the copy to the screen, to 6573H after the copy to the screen image.
66B3
LD HL,(601CH) 2A 1C 60
Fetch the address of the byte at the cursor from 601CH-601DH into Register Pair HL.
66B6
LD DE,5262H 11 62 52
Point Register Pair DE to 5262H, the start of the edit buffer.
66B9
OR A B7
OR Register A with itself to clear the CARRY FLAG for the SBC.
66BA
SBC HL,DE ED 52
SUBtract Register Pair DE (5262H) from Register Pair HL: Register L = the offset of the cursor.
66BC
LD A,(601EH) 3A 1E 60
Fetch the offset of the first byte of the window from 601EH into Register A.
66BF
CP L BD
Compare Register A (the window) against Register L (the cursor): the Z FLAG when the cursor is on the first byte shown.
66C0
RET Z C8
If the Z FLAG is set (the first byte of the window), RETurn: the window stays.
66C1
If the NO CARRY FLAG is set (the cursor is above the window), JUMP to 66CDH to start the window at the cursor's row.
66C3
ADD A,7FH C6 7F
ADD 7FH to Register A: the offset of the last byte of the window.
66C5
CP L BD
Compare Register A (the last byte shown) against Register L (the cursor).
66C6
RET NC D0
If the NO CARRY FLAG is set (the cursor is in the window), RETurn: the window stays.
66C7
LD A,(601EH) 3A 1E 60
Fetch the offset of the first byte of the window from 601EH into Register A.
66CA
ADD A,10H C6 10
ADD 10H to Register A: the window moves down one row.
66CC
LD L,A 6F
Copy Register A into Register L, for the AND below.
66CD
LD A,L 7D
Copy Register L into Register A: the cursor's offset, or the window moved one row.
66CE
AND F0H E6 F0
Keep only bits 7-4 of Register A (AND F0H): the start of a row.
66D0
LD (601EH),A 32 1E 60
Store Register A (the new start of the window) at 601EH.
66D3
LD A,(6020H) 3A 20 60
Fetch the display mode from 6020H into Register A.
66D6
OR A B7
OR Register A with itself to set the Z FLAG for the 256 byte mode.
66D7
RET Z C8
If the Z FLAG is set (256 byte mode), RETurn: nothing is shown again.
66D8
GOSUB to 6953H to build the display of the new window in the screen image.
66DB
GOSUB to 6B4EH to copy the screen image to video memory at 3C00H.
66DE
RET C9
RETurn to the caller with the window moved and shown again.

66DFH - H: Hex Modify

In the hex modify mode the first hex digit typed replaces the first digit of the byte at the cursor on the screen, and the byte of the edit buffer becomes the value of the two digits shown; the second digit replaces the second, the byte is stored again, and the cursor moves to the next byte (unless it is on the last). The ASCII column shows the new byte. Any other key at the first digit is taken as an arrow key or ignored; at the second digit it is ignored.

66DF
GOSUB to 6821H to test the key in Register B for a hex digit: the CARRY FLAG and Register A the digit in capitals.
66E2
If the CARRY FLAG is set (a hex digit), JUMP to 66E8H to change the first digit.
66E4
LD A,B 78
Copy Register B (the key) into Register A, for the cursor keys.
66E5
JUMP to 65FFH to move the cursor for an arrow key, or do nothing.
66E8
GOSUB to 6BC7H to work out the places of the byte on the screen: Register Pair DE its ASCII column, Register Pair BC its hex digits (offsets from 3C00H).
66EB
GOSUB to 67DBH to take the cursors off the screen.
66EE
LD HL,5562H 21 62 55
Point Register Pair HL to 5562H, the screen image.
66F1
ADD HL,BC 09
ADD Register Pair BC (the place of the hex digits) to Register Pair HL.
66F2
LD (HL),A 77
Store Register A (the digit typed) at Register Pair HL, the first hex digit in the screen image.
66F3
LD HL,3C00H 21 00 3C
Point Register Pair HL to 3C00H, video memory.
66F6
ADD HL,BC 09
ADD Register Pair BC (the place of the hex digits) to Register Pair HL.
66F7
LD (HL),A 77
Store Register A (the digit typed) at Register Pair HL, the first hex digit on the screen.
66F8
GOSUB to 67F2H to take the two hex digits at Register Pair HL on the screen as a byte in Register A.
66FB
LD HL,(601CH) 2A 1C 60
Fetch the address of the byte at the cursor from 601CH-601DH into Register Pair HL.
66FE
LD (HL),A 77
Store Register A (the new byte) at Register Pair HL in the edit buffer.
66FF
GOSUB to 674FH to show the byte in the ASCII column of the screen and the screen image.
6702
LD HL,6013H 21 13 60
Point Register Pair HL to 6013H, the state of the command line.
6705
LD (HL),02H 36 02
Store 02H at Register Pair HL (6013H): the second digit comes next.
6707
JUMP to 689FH to show the offset again and go back to the command loop.
670A
GOSUB to 6821H to test the key in Register B for a hex digit: the CARRY FLAG and Register A the digit.
670D
If the NO CARRY FLAG is set (not a hex digit), JUMP back to 60ADH: the key is ignored.
6710
GOSUB to 67DBH to take the cursors off the screen.
6713
GOSUB to 6BC7H to work out the places of the byte on the screen: Register Pair DE the ASCII column, Register Pair BC the hex digits.
6716
LD HL,5563H 21 63 55
Point Register Pair HL to 5563H, the screen image plus one: the second hex digit.
6719
ADD HL,BC 09
ADD Register Pair BC (the place of the hex digits) to Register Pair HL.
671A
LD (HL),A 77
Store Register A (the digit typed) at Register Pair HL, the second hex digit in the screen image.
671B
DEC HL 2B
DECrement Register Pair HL to the first hex digit in the screen image.
671C
LD D,(HL) 56
Fetch the first hex digit at Register Pair HL into Register D.
671D
LD HL,3C01H 21 01 3C
Point Register Pair HL to 3C01H, video memory plus one: the second hex digit.
6720
ADD HL,BC 09
ADD Register Pair BC (the place of the hex digits) to Register Pair HL.
6721
LD (HL),A 77
Store Register A (the digit typed) at Register Pair HL, the second hex digit on the screen.
6722
LD E,A 5F
Copy Register A (the second digit) into Register E: Register D and Register E hold the two digits.
6723
GOSUB to 67FBH to take the hex digits in Register D and Register E as a byte in Register A.
6726
GOSUB to 674FH to show the byte in the ASCII column of the screen and the screen image.
6729
GOSUB to 6781H to store Register A in the edit buffer and move the cursor on unless it is on the last byte.
672C
GOSUB to 6651H to show the offset of the cursor again.
672F
LD HL,6013H 21 13 60
Point Register Pair HL to 6013H, the state of the command line.
6732
LD (HL),01H 36 01
Store 01H at Register Pair HL (6013H): the next byte's first digit comes next.
6734
JUMP back to 60ADH, the command loop, for the next hex digit.

6737H - A: ASCII Modify

In the ASCII modify mode each key (but BREAK and the arrows, taken before) is stored in the byte at the cursor, shown in the ASCII column (as 88H when it is a control code or above 7FH) and in hex, and the cursor moves to the next byte. A key with bit 7 set is ignored.

6737
LD A,B 78
Copy Register B (the key) into Register A, to store it in the record.
6738
BIT 7,A CB 7F
Test bit 7 of Register A: set for the keys above 7FH.
673A
If the NZ FLAG is set (bit 7 set), JUMP to 65FFH, which does nothing for such a key.
673D
GOSUB to 67DBH to take the cursors off the screen.
6740
GOSUB to 674FH to show Register A in the ASCII column of the screen and the screen image.
6743
GOSUB to 6768H to show Register A as two hex digits on the screen and in the screen image.
6746
GOSUB to 6781H to store Register A in the edit buffer and move the cursor on unless it is on the last byte.
6749
GOSUB to 6651H to show the offset of the cursor again.
674C
JUMP back to 60ADH, the command loop, for the next character.
674F
GOSUB to 6BC7H to work out the places of the byte on the screen: Register Pair DE the ASCII column, Register Pair BC the hex digits.
6752
LD B,A 47
Copy Register A (the byte) into Register B, the character to show.
6753
BIT 7,A CB 7F
Test bit 7 of Register A: set for the bytes 80H-FFH, not shown as such.
6755
If the NZ FLAG is set (80H-FFH), JUMP to 675BH to show 88H instead.
6757
CP 20H FE 20
Compare Register A against 20H, the space: the CARRY FLAG for a control code.
6759
If the NO CARRY FLAG is set (20H-7FH), JUMP to 675DH to show the character.
675B
LD B,88H 06 88
Load Register B with 88H, the graphics character shown for a byte that cannot be displayed.
675D
LD HL,3C00H 21 00 3C
Point Register Pair HL to 3C00H, video memory.
6760
ADD HL,DE 19
ADD Register Pair DE (the place of the ASCII column) to Register Pair HL.
6761
LD (HL),B 70
Store Register B (the character) at Register Pair HL on the screen.
6762
LD HL,5562H 21 62 55
Point Register Pair HL to 5562H, the screen image.
6765
ADD HL,DE 19
ADD Register Pair DE (the place of the ASCII column) to Register Pair HL.
6766
LD (HL),B 70
Store Register B (the character) at Register Pair HL in the screen image.
6767
RET C9
RETurn with Register A the byte as it was, for 6768H and 6781H.
6768
PUSH AF F5
Save Register Pair AF (the byte) to the stack.
6769
GOSUB to 6BC7H to work out the places of the byte on the screen: Register Pair BC the hex digits.
676C
GOSUB to 6880H to turn Register A into two hex digits: Register L the first, Register H the second.
676F
LD E,H 5C
Copy Register H (the second digit) into Register E.
6770
LD D,L 55
Copy Register L (the first digit) into Register D.
6771
LD HL,5562H 21 62 55
Point Register Pair HL to 5562H, the screen image.
6774
ADD HL,BC 09
ADD Register Pair BC (the place of the hex digits) to Register Pair HL.
6775
LD (HL),D 72
Store Register D (the first digit) at Register Pair HL in the screen image.
6776
INC HL 23
INCrement Register Pair HL to the place of the second digit.
6777
LD (HL),E 73
Store Register E (the second digit) at Register Pair HL in the screen image.
6778
LD HL,3C00H 21 00 3C
Point Register Pair HL to 3C00H, video memory.
677B
ADD HL,BC 09
ADD Register Pair BC (the place of the hex digits) to Register Pair HL.
677C
LD (HL),D 72
Store Register D (the first digit) at Register Pair HL on the screen.
677D
INC HL 23
INCrement Register Pair HL to the place of the second digit.
677E
LD (HL),E 73
Store Register E (the second digit) at Register Pair HL on the screen.
677F
POP AF F1
Restore Register Pair AF from the stack: the byte.
6780
RET C9
RETurn with Register A the byte, as it was before 6768H.
6781
LD HL,(601CH) 2A 1C 60
Fetch the address of the byte at the cursor from 601CH-601DH into Register Pair HL.
6784
LD (HL),A 77
Store Register A (the new byte) at Register Pair HL in the edit buffer.
6785
PUSH HL E5
Save Register Pair HL (the cursor) to the stack.
6786
LD DE,5361H 11 61 53
Point Register Pair DE to 5361H, the last byte of the edit buffer.
6789
OR A B7
OR Register A with itself to clear the CARRY FLAG for the SBC.
678A
SBC HL,DE ED 52
SUBtract Register Pair DE (5361H) from Register Pair HL: the Z FLAG when the cursor is on the last byte.
678C
POP HL E1
Restore Register Pair HL from the stack: the cursor.
678D
RET Z C8
If the Z FLAG is set (the last byte), RETurn: the cursor stays.
678E
JUMP to 662EH to move the cursor one byte on.

6791H - The Command Line

The command line is kept at 5962H; 6016H points at the place of the next character. 67BCH stores a character there and at the cursor of the video, 6791H also moves the place on and puts a space after it, 679FH clears the line, puts the cursor at the command and sets the state to 00H, and 67C6H puts the cursor at the command (3FFFH in the 256 byte mode, 3FC8H in the 128 byte mode).

6791
GOSUB to 655FH to save every register and run the rest of this routine as a subroutine.
6794
GOSUB to 67BCH to store Register A at the place in the command line and at the cursor; Register Pair HL = that place.
6797
INC HL 23
INCrement Register Pair HL to the next place of the command line.
6798
LD (6016H),HL 22 16 60
Store Register Pair HL (the next place) at 6016H-6017H.
679B
LD A,20H 3E 20
Load Register A with 20H, a space, for the place after the character.
679D
LD (HL),A 77
Store Register A (20H) at Register Pair HL, the next place of the command line.
679E
RET C9
RETurn to 6573H in the register saver, which restores the registers.
679F
GOSUB to 655FH to save every register and run the rest of this routine as a subroutine.
67A2
LD HL,5962H 21 62 59
Point Register Pair HL to 5962H, the command line.
67A5
LD (6016H),HL 22 16 60
Store Register Pair HL (5962H) at 6016H-6017H: the next character goes to the start.
67A8
LD DE,5963H 11 63 59
Point Register Pair DE to 5963H, the next byte, for the fill by LDIR.
67AB
LD (HL),20H 36 20
Store 20H, a space, at Register Pair HL (5962H).
67AD
LD BC,0041H 01 41 00
Load Register Pair BC with 0041H, the 65 bytes after the first.
67B0
LDIR ED B0
Copy Register Pair BC (65) bytes from Register Pair HL to Register Pair DE: 5962H-59A3H are spaces.
67B2
GOSUB to 67C6H to put the cursor of the video at the command of the display mode.
67B5
LD (HL),20H 36 20
Store 20H, a space, at Register Pair HL (59A3H after the LDIR, already a space).
67B7
XOR A AF
Set Register A to 00H by XOR A with itself, for the state.
67B8
LD (6013H),A 32 13 60
Store Register A (00H) at 6013H: no command under way.
67BB
RET C9
RETurn to 6573H in the register saver, which restores the registers.
67BC
LD HL,(6016H) 2A 16 60
Fetch the place in the command line from 6016H-6017H into Register Pair HL.
67BF
LD (HL),A 77
Store Register A (the character) at Register Pair HL in the command line.
67C0
LD DE,(4020H) ED 5B 20 40
Fetch the cursor of the video from 4020H-4021H into Register Pair DE.
67C4
LD (DE),A 12
Store Register A (the character) at Register Pair DE on the screen.
67C5
RET C9
RETurn with Register Pair HL at the place in the command line.
67C6
GOSUB to 655FH to save every register and run the rest of this routine as a subroutine.
67C9
LD A,(6020H) 3A 20 60
Fetch the display mode from 6020H into Register A.
67CC
OR A B7
OR Register A with itself to set the Z FLAG for the 256 byte mode.
67CD
If the Z FLAG is set (256 byte mode), JUMP to 67D4H.
67CF
LD HL,3FC8H 21 C8 3F
Point Register Pair HL to 3FC8H, row 15, column 8: after Command: in the 128 byte mode.
67D2
JUMP to 67D7H to store the cursor of Register Pair HL.
67D4
LD HL,3FFFH 21 FF 3F
Point Register Pair HL to 3FFFH, the bottom right corner: after C: in the 256 byte mode.
67D7
LD (4020H),HL 22 20 40
Store Register Pair HL at 4020H-4021H, the cursor of the video.
67DA
RET C9
RETurn to 6573H in the register saver, which restores the registers.

67DBH - Cursors Off; Hex Digits and Keys

67DBH takes the blinking cursors off the screen before the screen or the record changes. 67F2H and 67FBH turn two hex digits into a byte; 6818H and 6821H test for a digit and a hex digit. 682FH takes a key: BREAK clears the command and the boxes, and the letters are made capitals except for C, F and A. 685DH ends FED; 6870H clears the input line of the 128 byte mode; 6880H turns a byte into two hex digits.

67DB
GOSUB to 655FH to save every register and run the rest of this routine as a subroutine.
67DE
LD A,(6012H) 3A 12 60
Fetch the cell 6012H into Register A: 00H while no file is open.
67E1
OR A B7
OR Register A with itself to set the Z FLAG when no file is open.
67E2
RET Z C8
If the Z FLAG is set (no file, no cursors), RETurn to 6573H.
67E3
LD A,(6014H) 3A 14 60
Fetch the phase of the record cursors from 6014H into Register A.
67E6
OR A B7
OR Register A with itself to set the Z FLAG when they are not shown.
67E7
If the NZ FLAG is set (the cursor blocks are shown), GOSUB to 6B95H to show the bytes under them again.
67EA
LD A,(6015H) 3A 15 60
Fetch the phase of the command cursor from 6015H into Register A.
67ED
OR A B7
OR Register A with itself to set the Z FLAG when it is not shown.
67EE
If the NZ FLAG is set (the block is shown), GOSUB to 6B7FH to show the character under it again.
67F1
RET C9
RETurn to 6573H in the register saver, which restores the registers.
67F2
PUSH DE D5
Save Register Pair DE to the stack: Register D and Register E get the two digits.
67F3
LD D,(HL) 56
Fetch the first hex digit at Register Pair HL into Register D.
67F4
INC HL 23
INCrement Register Pair HL to the second hex digit.
67F5
LD E,(HL) 5E
Fetch the second hex digit at Register Pair HL into Register E.
67F6
GOSUB to 67FBH to take Register D and Register E as a byte in Register A.
67F9
POP DE D1
Restore Register Pair DE from the stack, as the caller had it.
67FA
RET C9
RETurn with Register A the byte of the two digits.
67FB
LD A,D 7A
Copy Register D (the first hex digit, a character) into Register A.
67FC
SUB 30H D6 30
SUBtract 30H from Register A: 0-9 for the digits.
67FE
CP 0AH FE 0A
Compare Register A against 0AH: the CARRY FLAG for 0-9.
6800
If the CARRY FLAG is set (0-9), JUMP to 6804H.
6802
SUB 07H D6 07
SUBtract 07H from Register A: the letters A-F (11H-16H) become 0AH-0FH.
6804
SLA A CB 27
Shift Register A left (SLA): the value of the digit times 2.
6806
SLA A CB 27
Shift Register A left (SLA): the value of the digit times 4.
6808
SLA A CB 27
Shift Register A left (SLA): the value of the digit times 8.
680A
SLA A CB 27
Shift Register A left: the digit times 16, the high half of the byte.
680C
LD D,A 57
Copy Register A (the high half) into Register D.
680D
LD A,E 7B
Copy Register E (the second hex digit, a character) into Register A.
680E
SUB 30H D6 30
SUBtract 30H from Register A: 0-9 for the digits.
6810
CP 0AH FE 0A
Compare Register A against 0AH: the CARRY FLAG for 0-9.
6812
If the CARRY FLAG is set (0-9), JUMP to 6816H.
6814
SUB 07H D6 07
SUBtract 07H from Register A: the letters A-F become 0AH-0FH.
6816
ADD A,D 82
ADD Register D (the high half) to Register A: the byte.
6817
RET C9
RETurn with Register A the byte of the two digits.
6818
CP 30H FE 30
Compare Register A against 30H, the digit 0: the CARRY FLAG below it.
681A
If the CARRY FLAG is set (below 0), JUMP to 681FH to clear the CARRY FLAG.
681C
CP 3AH FE 3A
Compare Register A against 3AH, the character after 9: the CARRY FLAG for 0-9.
681E
RET C9
RETurn with the CARRY FLAG set for a digit 0-9, clear for the others.
681F
CCF 3F
Complement the CARRY FLAG: set before, clear now, for a character that is not a digit.
6820
RET C9
RETurn with the NO CARRY FLAG: the character is not a digit 0-9.
6821
LD A,B 78
Copy Register B (the key) into Register A, to test it for a hex digit.
6822
GOSUB to 6818H to test Register A for a digit 0-9: the CARRY FLAG.
6825
RET C D8
If the CARRY FLAG is set (0-9), RETurn with it.
6826
RES 5,A CB AF
Clear bit 5 of Register A: a lower case letter becomes a capital.
6828
CP 41H FE 41
Compare Register A against 41H, the letter A: the CARRY FLAG below it.
682A
If the CARRY FLAG is set (below A), JUMP to 681FH: not a hex digit.
682C
CP 47H FE 47
Compare Register A against 47H, the letter after F: the CARRY FLAG for A-F.
682E
RET C9
RETurn with the CARRY FLAG for a hex digit, Register A in capitals.
682F
PUSH DE D5
Save Register Pair DE to the stack: Register D holds the key below.
6830
GOSUB to 002BH, the ROM's keyboard scan: Register A = the key pressed, or 00H for none.
6833
CP 01H FE 01
Compare Register A against 01H, the code of BREAK.
6835
If the Z FLAG is set (BREAK), JUMP to 684FH to cancel the command.
6837
LD D,A 57
Copy Register A (the key) into Register D while the state is looked at.
6838
LD A,(6013H) 3A 13 60
Fetch the state of the command line from 6013H into Register A.
683B
CP 32H FE 32
Compare Register A against 32H: the NO CARRY FLAG for F (42H up) and C (82H up), whose characters are kept as typed.
683D
If the NO CARRY FLAG is set (F or C), JUMP to 6844H with the key as it is.
683F
CP 03H FE 03
Compare Register A against 03H, the ASCII modify mode, which also keeps the key as typed.
6841
If the NZ FLAG is set (another state), GOSUB to 6847H to make the key in Register D a capital.
6844
LD A,D 7A
Copy Register D (the key, in capitals or as typed) into Register A.
6845
POP DE D1
Restore Register Pair DE from the stack, as the caller had it.
6846
RET C9
RETurn with Register A the key, or 00H for none.
6847
PUSH AF F5
Save Register Pair AF (the flags) to the stack.
6848
LD A,D 7A
Copy Register D (the key) into Register A, to make it a capital.
6849
GOSUB to 65A7H to make Register A a capital if it is a lower case letter.
684C
LD D,A 57
Copy Register A (the key) back into Register D.
684D
POP AF F1
Restore Register Pair AF from the stack: the flags of the caller.
684E
RET C9
RETurn with Register D the key in capitals and the flags as they were.
684F
GOSUB to 679FH to clear the command line and set the state to 00H. 6ECEH and 6ED6H come here when BREAK stops the printing.
6852
GOSUB to 6B4EH to copy the screen image to video memory: the input boxes are gone.
6855
LD A,0FH 3E 0F
Load Register A with 0FH, the code that turns the cursor of the video off.
6857
GOSUB to 0033H, the ROM's display of the character in Register A (0FH).
685A
JUMP to 60A5H to clear the command line again and go back to the command loop.
685D
GOSUB to 654EH to clear the screen. X and ENTER, and BREAK at the question for a file, come here.
6860
LD HL,3C00H 21 00 3C
Point Register Pair HL to 3C00H, the top left corner of the screen.
6863
LD (4020H),HL 22 20 40
Store Register Pair HL (3C00H) at 4020H-4021H, the cursor of the video.
6866
LD HL,(6010H) 2A 10 60
Fetch the address of the BREAK switch from 6010H-6011H into Register Pair HL.
6869
LD A,(600FH) 3A 0F 60
Fetch the byte of the switch kept at 600FH into Register A.
686C
LD (HL),A 77
Store Register A at Register Pair HL: the BREAK switch is as it was before FED.
686D
JUMP to 402DH, @EXIT, to end FED and go back to LDOS Ready (or the JCL job). The file is not closed.
6870
LD A,(6020H) 3A 20 60
Fetch the display mode from 6020H into Register A.
6873
OR A B7
OR Register A with itself to set the Z FLAG for the 256 byte mode.
6874
RET Z C8
If the Z FLAG is set (256 byte mode), RETurn: there is no input line.
6875
LD HL,3FCAH 21 CA 3F
Point Register Pair HL to 3FCAH, the input line after the command in the 128 byte mode.
6878
LD B,24H 06 24
Load Register B with 24H, the 36 characters of the input line (to 3FEDH).
687A
LD (HL),20H 36 20
Store 20H, a space, at Register Pair HL. 687DH loops back here.
687C
INC HL 23
INCrement Register Pair HL to the next place of the input line.
687D
DECrement Register B and JUMP back to 687AH while it is not zero.
687F
RET C9
RETurn with the input line 3FCAH-3FEDH cleared to spaces.
6880
PUSH BC C5
Save Register Pair BC to the stack: Register B holds the byte below.
6881
LD B,A 47
Copy Register A (the byte) into Register B, for the second half.
6882
AND F0H E6 F0
Keep only bits 7-4 of Register A (AND F0H): the high half of the byte.
6884
RRCA 0F
Rotate Register A right through bit 0: the high half moves down.
6885
RRCA 0F
Rotate Register A right through bit 0 (RRCA), the second of four.
6886
RRCA 0F
Rotate Register A right through bit 0 (RRCA), the third of four.
6887
RRCA 0F
Rotate Register A right again: Register A = the high half, 0-15.
6888
GOSUB to 6899H to add 07H to Register A when it is 0AH-0FH.
688B
LD L,A 6F
Copy Register A into Register L: the first digit, less 30H.
688C
LD A,B 78
Copy Register B (the byte) into Register A, for its low half.
688D
AND 0FH E6 0F
Keep only bits 3-0 of Register A (AND 0FH): the low half of the byte.
688F
GOSUB to 6899H to add 07H to Register A when it is 0AH-0FH.
6892
LD H,A 67
Copy Register A into Register H: the second digit, less 30H.
6893
LD BC,3030H 01 30 30
Load Register Pair BC with 3030H, the character 0 for both digits.
6896
ADD HL,BC 09
ADD Register Pair BC (3030H) to Register Pair HL: Register L and Register H are the two hex digits as characters.
6897
POP BC C1
Restore Register Pair BC from the stack, as the caller had it.
6898
RET C9
RETurn with Register L the first and Register H the second hex digit.
6899
CP 0AH FE 0A
Compare Register A against 0AH: the CARRY FLAG for 0-9.
689B
RET C D8
If the CARRY FLAG is set (0-9), RETurn with Register A as it is.
689C
ADD A,07H C6 07
ADD 07H to Register A: 0AH-0FH become 11H-16H, which 3030H turns into A-F.
689E
RET C9
RETurn with Register A ready for the character 0 to be added.
689F
GOSUB to 6651H to show the offset of the cursor again.
68A2
JUMP back to 60ADH, the command loop, with the offset shown.

68A5H - Numbers in Decimal and Hex

68A5H writes Register Pair DE in decimal at 68F9H without leading zeros by subtracting the powers of ten at 68EFH, and returns the count of the digits in Register B and Register Pair HL = 68F9H. 68FEH writes Register Pair DE as four hex digits at 68F9H and returns Index Register IX = 68F9H. 692EH takes the hex digits at Register Pair HL into Register Pair DE.

68A5
LD BC,0100H 01 00 01
Load Register Pair BC with 0100H: Register B = 1, the count that already holds the last digit; Register C = 00H, no digit other than 0 written yet.
68A8
PUSH IY FD E5
Save Index Register IY to the stack: it points at the powers of ten below.
68AA
EX DE,HL EB
Exchange Register Pair DE and Register Pair HL: Register Pair HL = the number to write.
68AB
LD IX,68F9H DD 21 F9 68
Point Index Register IX to 68F9H, the place of the first digit.
68AF
PUSH IX DD E5
Save Index Register IX (68F9H) to the stack: it comes back in Register Pair HL at 68E5H.
68B1
LD IY,68EFH FD 21 EF 68
Point Index Register IY to 68EFH, the table of the powers of ten 10000, 1000, 100, 10 and 1.
68B5
XOR A AF
Set Register A to 00H by XOR A with itself: the digit for this power. 68DCH and 68E3H loop back here.
68B6
LD D,(IY+01H) FD 56 01
Fetch the high byte of the power at Index Register IY +01H into Register D.
68B9
LD E,(IY+00H) FD 5E 00
Fetch the low byte of the power at Index Register IY +00H into Register E: Register Pair DE = the power of ten.
68BC
OR A B7
OR Register A with itself to clear the CARRY FLAG for the SBC. 68C2H loops back here.
68BD
SBC HL,DE ED 52
SUBtract Register Pair DE (the power) from Register Pair HL (what is left of the number): the CARRY FLAG when it does not go.
68BF
If the CARRY FLAG is set (the power no longer goes), JUMP to 68C4H with Register A the digit.
68C1
INC A 3C
INCrement Register A, the digit: the power went once more.
68C2
JUMP back to 68BCH to subtract the power again.
68C4
ADD HL,DE 19
ADD Register Pair DE (the power) back to Register Pair HL: what is left of the number.
68C5
ADD A,30H C6 30
ADD 30H to Register A: the digit as a character.
68C7
LD (IX+00H),A DD 77 00
Store Register A (the digit) at Index Register IX +00H.
68CA
INC IY FD 23
INCrement Index Register IY past the low byte of the power.
68CC
INC IY FD 23
INCrement Index Register IY to the next power of ten.
68CE
LD A,E 7B
Copy Register E (the low byte of the power just used) into Register A.
68CF
CP 01H FE 01
Compare Register A against 01H: the Z FLAG for the power 1, the last digit.
68D1
If the Z FLAG is set (the last digit), JUMP to 68E5H: it stays at Index Register IX, already counted in Register B.
68D3
BIT 0,C CB 41
Test bit 0 of Register C: set once a digit other than a leading 0 has been written.
68D5
If the NZ FLAG is set (digits have started), JUMP to 68DEH to keep this digit.
68D7
LD A,(IX+00H) DD 7E 00
Fetch the digit just written at Index Register IX +00H into Register A.
68DA
CP 30H FE 30
Compare Register A against 30H, the digit 0: a leading zero.
68DC
If the Z FLAG is set (a leading zero), JUMP back to 68B5H: the next digit is written over it.
68DE
LD C,01H 0E 01
Load Register C with 01H: the digits have started, every later 0 is kept.
68E0
INC IX DD 23
INCrement Index Register IX to the place of the next digit.
68E2
INC B 04
INCrement Register B, the count of the digits.
68E3
JUMP back to 68B5H for the next power of ten.
68E5
POP HL E1
Restore Register Pair HL from the stack: 68F9H, the first digit.
68E6
POP IY FD E1
Restore Index Register IY from the stack, as the caller had it.
68E8
LD A,B 78
Copy Register B (the count of the digits) into Register A.
68E9
OR A B7
OR Register A with itself to set the Z FLAG when it is 00H; Register B starts at 1, so it never is.
68EA
RET NZ C0
If the NZ FLAG is set (always), RETurn with Register B the count of the digits and Register Pair HL = 68F9H.
68EB
LD (HL),30H 36 30
Store 30H, the digit 0, at Register Pair HL (68F9H). Not reached: Register B is never 00H at 68E8H.
68ED
INC B 04
INCrement Register B to one digit. Not reached, as 68EBH before it.
68EE
RET C9
RETurn with one digit. Not reached, as 68EBH before it.
68EF-68F8
DEFW 2710H / DEFW 03E8H / DEFW 0064H / DEFW 000AH / DEFW 0001H 10 27 E8 03 64 00 0A 00 01 00
68EFH-68F8H: the powers of ten for 68A5H, each a word, low byte first: 10000, 1000, 100, 10 and 1.
68F9-68FD
DEFS 5
68F9H-68FDH: not in the file. The digits written by 68A5H (up to five, decimal) and by 68FEH (four, hex).
68FE
LD IX,68F9H DD 21 F9 68
Point Index Register IX to 68F9H, the place of the first hex digit.
6902
PUSH IX DD E5
Save Index Register IX (68F9H) to the stack, to return it.
6904
LD C,D 4A
Copy Register D (the high byte of the number) into Register C, the byte to write first.
6905
LD B,02H 06 02
Load Register B with 02H, the two bytes of Register Pair DE.
6907
LD A,F0H 3E F0
Load Register A with F0H, the mask of the high half of a byte. 691EH loops back here.
6909
AND C A1
AND Register C (the byte) into Register A: its high half.
690A
RRCA 0F
Rotate Register A right through bit 0 (RRCA), the first of four.
690B
RRCA 0F
Rotate Register A right through bit 0 (RRCA), the second of four.
690C
RRCA 0F
Rotate Register A right through bit 0 (RRCA), the third of four.
690D
RRCA 0F
Rotate Register A right through bit 0 (RRCA): Register A = the high half, 0-15.
690E
GOSUB to 6920H to store Register A as a hex digit at Index Register IX and move Index Register IX on.
6911
LD A,0FH 3E 0F
Load Register A with 0FH, the mask of the low half of a byte.
6913
AND C A1
AND Register C (the byte) into Register A: its low half, 0-15.
6914
GOSUB to 6920H to store Register A as a hex digit at Index Register IX and move Index Register IX on.
6917
DEC B 05
DECrement Register B, the count of the bytes left.
6918
If the NZ FLAG is set (Register E is still to do), JUMP to 691DH.
691A
POP IX DD E1
Restore Index Register IX from the stack: 68F9H, the first of the four hex digits.
691C
RET C9
RETurn with the four hex digits of Register Pair DE at 68F9H-68FCH.
691D
LD C,E 4B
Copy Register E (the low byte of the number) into Register C.
691E
JUMP back to 6907H to write the two digits of Register C.
6920
ADD A,30H C6 30
ADD 30H to Register A: 0-9 become the characters 0-9.
6922
CP 3AH FE 3A
Compare Register A against 3AH: the CARRY FLAG for 0-9.
6924
If the CARRY FLAG is set (0-9), JUMP to 6928H.
6926
ADD A,07H C6 07
ADD 07H to Register A: 3AH-3FH become the letters A-F.
6928
LD (IX+00H),A DD 77 00
Store Register A (the hex digit) at Index Register IX +00H.
692B
INC IX DD 23
INCrement Index Register IX to the place of the next digit.
692D
RET C9
RETurn with Index Register IX at the next place.
692E
LD DE,0000H 11 00 00
Load Register Pair DE with 0000H, the number before any digit.
6931
LD A,(HL) 7E
Fetch the character at Register Pair HL into Register A. 6951H loops back here.
6932
CP 30H FE 30
Compare Register A against 30H, the digit 0: the CARRY FLAG below it (a space, 0DH).
6934
RET C D8
If the CARRY FLAG is set (not a digit), RETurn with the number in Register Pair DE.
6935
SUB 30H D6 30
SUBtract 30H from Register A: 0-9 for the digits.
6937
CP 0AH FE 0A
Compare Register A against 0AH: the CARRY FLAG for 0-9.
6939
If the CARRY FLAG is set (0-9), JUMP to 6945H to add the digit.
693B
RES 5,A CB AF
Clear bit 5 of Register A: a lower case letter (31H-36H here) becomes 11H-16H.
693D
SUB 07H D6 07
SUBtract 07H from Register A: the letters A-F become 0AH-0FH.
693F
CP 10H FE 10
Compare Register A against 10H: the NO CARRY FLAG beyond F.
6941
RET NC D0
If the NO CARRY FLAG is set (not a hex digit), RETurn with the number in Register Pair DE.
6942
CP 0AH FE 0A
Compare Register A against 0AH: the CARRY FLAG for the characters between 9 and A.
6944
RET C D8
If the CARRY FLAG is set (not a hex digit), RETurn with the number in Register Pair DE.
6945
EX DE,HL EB
Exchange Register Pair DE and Register Pair HL: Register Pair HL = the number so far.
6946
ADD HL,HL 29
ADD Register Pair HL to itself: the number times 2.
6947
ADD HL,HL 29
ADD Register Pair HL to itself: the number times 4.
6948
ADD HL,HL 29
ADD Register Pair HL to itself: the number times 8.
6949
ADD HL,HL 29
ADD Register Pair HL to itself: the number times 16.
694A
EX DE,HL EB
Exchange Register Pair DE and Register Pair HL: Register Pair DE = the number times 16, Register Pair HL the text.
694B
ADD A,E 83
ADD Register E to Register A (the digit): the low half of Register E is 0 after the shift, so there is no carry.
694C
LD E,A 5F
Copy Register A into Register E: the digit is in the number.
694D
LD A,00H 3E 00
Load Register A with 00H, for the carry into Register D.
694F
ADC A,D 8A
ADD Register D and the CARRY FLAG (clear) to Register A. The sum is not stored: Register D needs no change.
6950
INC HL 23
INCrement Register Pair HL to the next character.
6951
JUMP back to 6931H for the next character of the hex number.

6953H - The Display of the 256 Byte Mode

The screen image at 5562H is cleared and the record drawn into it: the 16 rows of the record as characters (columns 0-15), a bar, the row labels 00-F0 with 3EH after them, and the 128 words in hex, eight to a row from column 21. The right edge holds the record number down column 61 in a box, an asterisk below it for the last record, the name of the file down column 63, the offset after 3EH on row 14 and C: on row 15. The 128 byte mode is built at 6A62H instead.

6953
GOSUB to 655FH to save every register and run the rest of this routine as a subroutine.
6956
GOSUB to 6B5AH to fill the screen image 5562H-5961H with spaces.
6959
LD A,(6020H) 3A 20 60
Fetch the display mode from 6020H into Register A.
695C
OR A B7
OR Register A with itself to set the Z FLAG for the 256 byte mode.
695D
If the NZ FLAG is set (128 byte mode), JUMP to 6A62H to build that display instead.
6960
LD HL,5262H 21 62 52
Point Register Pair HL to 5262H, the edit buffer.
6963
PUSH HL E5
Save Register Pair HL (5262H) to the stack, for the hex part.
6964
LD DE,5562H 11 62 55
Point Register Pair DE to 5562H, row 0, column 0 of the screen image.
6967
LD B,10H 06 10
Load Register B with 10H, the 16 rows of the record.
6969
LD C,10H 0E 10
Load Register C with 10H, the 16 bytes of a row. 6984H loops back here.
696B
LD A,(HL) 7E
Fetch the byte of the record at Register Pair HL into Register A. 697AH loops back here.
696C
BIT 7,A CB 7F
Test bit 7 of Register A: set for the bytes 80H-FFH, not shown as such.
696E
If the NZ FLAG is set (80H-FFH), JUMP to 6974H to show 88H.
6970
CP 20H FE 20
Compare Register A against 20H, the space: the CARRY FLAG for a control code.
6972
If the NO CARRY FLAG is set (20H-7FH), JUMP to 6976H to show the character.
6974
LD A,88H 3E 88
Load Register A with 88H, the graphics character shown for a byte that cannot be displayed.
6976
LD (DE),A 12
Store Register A (the character) at Register Pair DE in the screen image.
6977
INC DE 13
INCrement Register Pair DE to the next column.
6978
INC HL 23
INCrement Register Pair HL to the next byte of the record.
6979
DEC C 0D
DECrement Register C, the bytes left in the row.
697A
If the NZ FLAG is set (bytes left), JUMP back to 696BH.
697C
PUSH HL E5
Save Register Pair HL (the next byte of the record) to the stack.
697D
EX DE,HL EB
Exchange Register Pair DE and Register Pair HL: Register Pair HL = the place after the row.
697E
LD DE,0030H 11 30 00
Load Register Pair DE with 0030H, the 48 columns to the start of the next row.
6981
ADD HL,DE 19
ADD Register Pair DE (0030H) to Register Pair HL: column 0 of the next row.
6982
EX DE,HL EB
Exchange Register Pair DE and Register Pair HL: Register Pair DE = that place.
6983
POP HL E1
Restore Register Pair HL from the stack: the next byte of the record.
6984
DECrement Register B and JUMP back to 6969H while it is not zero: the next row.
6986
POP HL E1
Restore Register Pair HL from the stack: 5262H, the start of the record again.
6987
LD IY,5577H FD 21 77 55
Point Index Register IY to 5577H, row 0, column 21 of the screen image, where the hex part starts.
698B
LD B,10H 06 10
Load Register B with 10H, the 16 rows of words in hex.
698D
LD C,08H 0E 08
Load Register C with 08H, the eight words of a row. 69B0H loops back here.
698F
LD D,(HL) 56
Fetch the byte at Register Pair HL into Register D: the first byte of the word, shown first. 69A9H loops back here.
6990
INC HL 23
INCrement Register Pair HL to the second byte.
6991
LD E,(HL) 5E
Fetch the byte at Register Pair HL into Register E: the second byte of the word.
6992
INC HL 23
INCrement Register Pair HL to the next word of the record.
6993
PUSH BC C5
Save Register Pair BC (the counts) to the stack.
6994
GOSUB to 68FEH to write Register Pair DE as four hex digits at 68F9H; Index Register IX = 68F9H.
6997
LD B,04H 06 04
Load Register B with 04H, the four hex digits of the word.
6999
LD A,(IX+00H) DD 7E 00
Fetch the digit at Index Register IX +00H into Register A. 69A3H loops back here.
699C
LD (IY+00H),A FD 77 00
Store Register A (the digit) at Index Register IY +00H in the screen image.
699F
INC IX DD 23
INCrement Index Register IX to the next digit.
69A1
INC IY FD 23
INCrement Index Register IY to the next column.
69A3
DECrement Register B and JUMP back to 6999H while it is not zero.
69A5
INC IY FD 23
INCrement Index Register IY past a space between the words.
69A7
POP BC C1
Restore Register Pair BC from the stack: the counts.
69A8
DEC C 0D
DECrement Register C, the words left in the row.
69A9
If the NZ FLAG is set (words left), JUMP back to 698FH.
69AB
LD DE,0018H 11 18 00
Load Register Pair DE with 0018H, the 24 columns to column 21 of the next row (8 x 5 + 24 = 64).
69AE
ADD IY,DE FD 19
ADD Register Pair DE (0018H) to Index Register IY.
69B0
DECrement Register B and JUMP back to 698DH while it is not zero: the next row.
69B2
LD HL,59A8H 21 A8 59
Point Register Pair HL to 59A8H, the labels 00, 10, ... F0.
69B5
LD DE,5573H 11 73 55
Point Register Pair DE to 5573H, row 0, column 17 of the screen image.
69B8
LD B,10H 06 10
Load Register B with 10H, the 16 rows that get a label.
69BA
PUSH BC C5
Save Register Pair BC (the count) to the stack. 69C6H loops back here.
69BB
LD BC,0002H 01 02 00
Load Register Pair BC with 0002H, the two characters of a label.
69BE
LDIR ED B0
Copy Register Pair BC (2) bytes from Register Pair HL (the label) to Register Pair DE.
69C0
EX DE,HL EB
Exchange Register Pair DE and Register Pair HL: Register Pair HL = the place after the label.
69C1
LD C,3EH 0E 3E
Load Register C with 3EH, the 62 columns to the next row (Register B is 00H after the LDIR).
69C3
ADD HL,BC 09
ADD Register Pair BC (003EH) to Register Pair HL: column 17 of the next row.
69C4
EX DE,HL EB
Exchange Register Pair DE and Register Pair HL: Register Pair DE = that place, Register Pair HL the next label.
69C5
POP BC C1
Restore Register Pair BC from the stack: the count.
69C6
DECrement Register B and JUMP back to 69BAH while it is not zero.
69C8
LD HL,55A1H 21 A1 55
Point Register Pair HL to 55A1H, row 0, column 63 of the screen image.
69CB
LD DE,59C8H 11 C8 59
Point Register Pair DE to 59C8H, the name of the file as shown.
69CE
LD B,0EH 06 0E
Load Register B with 0EH, the 14 characters of the name.
69D0
LD A,(DE) 1A
Fetch the character of the name at Register Pair DE into Register A. 69D9H loops back here.
69D1
LD (HL),A 77
Store Register A at Register Pair HL: the name runs down column 63.
69D2
INC DE 13
INCrement Register Pair DE to the next character of the name.
69D3
PUSH DE D5
Save Register Pair DE (the next character of the name) to the stack.
69D4
LD DE,0040H 11 40 00
Load Register Pair DE with 0040H, one row of 64 columns.
69D7
ADD HL,DE 19
ADD Register Pair DE (0040H) to Register Pair HL: the same column of the next row.
69D8
POP DE D1
Restore Register Pair DE from the stack: the name.
69D9
DECrement Register B and JUMP back to 69D0H while it is not zero.
69DB
LD HL,569FH 21 9F 56
Point Register Pair HL to 569FH, row 4, column 61 of the screen image.
69DE
LD (HL),83H 36 83
Store 83H, a graphics character (the top two blocks), at Register Pair HL: the bottom of the box of the record number.
69E0
INC HL 23
INCrement Register Pair HL to 56A0H, row 4, column 62.
69E1
LD (HL),83H 36 83
Store 83H, the same graphics character, at Register Pair HL.
69E3
LD HL,55A0H 21 A0 55
Point Register Pair HL to 55A0H, row 0, column 62 of the screen image.
69E6
LD DE,0040H 11 40 00
Load Register Pair DE with 0040H, one row of 64 columns.
69E9
LD B,04H 06 04
Load Register B with 04H, the four rows of the record number.
69EB
LD (HL),AAH 36 AA
Store AAH, a graphics character (the right column of blocks), at Register Pair HL: the side of the box. 69EEH loops back here.
69ED
ADD HL,DE 19
ADD Register Pair DE (0040H) to Register Pair HL: the next row.
69EE
DECrement Register B and JUMP back to 69EBH while it is not zero.
69F0
LD HL,591FH 21 1F 59
Point Register Pair HL to 591FH, row 14, column 61 of the screen image.
69F3
LD (HL),3EH 36 3E
Store 3EH at Register Pair HL: the mark before the offset of the cursor at 5920H-5921H.
69F5
GOSUB to 6651H to show the offset of the cursor at 3FBEH and 5920H.
69F8
GOSUB to 6A49H to put an asterisk at 56DFH, under the record number, when the last record is shown.
69FB
LD HL,559FH 21 9F 55
Point Register Pair HL to 559FH, row 0, column 61 of the screen image.
69FE
GOSUB to 6A24H to write the record number in hex down column 61 from Register Pair HL.
6A01
LD HL,3A43H 21 43 3A
Load Register Pair HL with 3A43H: Register L = 43H, C, Register H = 3AH, the colon.
6A04
LD (595FH),HL 22 5F 59
Store Register Pair HL at 595FH-5960H, row 15, columns 61-62: C: before the command at 3FFFH.
6A07
LD HL,5572H 21 72 55
Point Register Pair HL to 5572H, row 0, column 16 of the screen image.
6A0A
LD A,AAH 3E AA
Load Register A with AAH, the graphics character of the bars.
6A0C
GOSUB to 6A1AH to store Register A down 16 rows from Register Pair HL: the bar between the characters and the labels.
6A0F
LD HL,559EH 21 9E 55
Point Register Pair HL to 559EH, row 0, column 60 of the screen image.
6A12
GOSUB to 6A1AH to store Register A (AAH) down 16 rows: the bar after the hex part.
6A15
LD HL,5575H 21 75 55
Point Register Pair HL to 5575H, row 0, column 19 of the screen image.
6A18
LD A,3EH 3E 3E
Load Register A with 3EH, the mark after each row label.
6A1A
LD B,10H 06 10
Load Register B with 10H, the 16 rows. 6A0CH and 6A12H come here.
6A1C
LD (HL),A 77
Store Register A at Register Pair HL. 6A21H loops back here.
6A1D
LD DE,0040H 11 40 00
Load Register Pair DE with 0040H, one row of 64 columns.
6A20
ADD HL,DE 19
ADD Register Pair DE (0040H) to Register Pair HL: the same column of the next row.
6A21
DECrement Register B and JUMP back to 6A1CH while it is not zero.
6A23
RET C9
RETurn: to 6A0FH, 6A15H, or 6573H in the register saver at the end of the display.

6A24H - The Record Number and the Last Record

6A24H writes the number of the record (6021H) in four hex digits: down a column from Register Pair HL in the 256 byte mode (559FH in the screen image, or 3C3DH on the screen during a search), across row 3 at 3CC5H in the 128 byte mode. 6A49H puts an asterisk under the number (56DFH), or at Register Pair DE after the title in the 128 byte mode, when the record is the last.

6A24
GOSUB to 655FH to save every register and run the rest of this routine as a subroutine.
6A27
PUSH HL E5
Save Register Pair HL (the place of the first digit) to the stack.
6A28
LD DE,(6021H) ED 5B 21 60
Fetch the number of the record from 6021H-6022H into Register Pair DE.
6A2C
GOSUB to 68FEH to write Register Pair DE as four hex digits at 68F9H; Index Register IX = 68F9H.
6A2F
LD DE,0040H 11 40 00
Load Register Pair DE with 0040H, the step to the next row.
6A32
LD B,04H 06 04
Load Register B with 04H, the four hex digits of the record number.
6A34
POP HL E1
Restore Register Pair HL from the stack: the place of the first digit.
6A35
LD A,(6020H) 3A 20 60
Fetch the display mode from 6020H into Register A.
6A38
OR A B7
OR Register A with itself to set the Z FLAG for the 256 byte mode.
6A39
If the Z FLAG is set (256 byte mode), JUMP to 6A3FH to write down the column.
6A3B
LD E,A 5F
Copy Register A (01H) into Register E: Register Pair DE = 0001H, the step to the next column.
6A3C
LD HL,3CC5H 21 C5 3C
Point Register Pair HL to 3CC5H, row 3, column 5 of the screen, in the 128 byte mode.
6A3F
LD A,(IX+00H) DD 7E 00
Fetch the digit at Index Register IX +00H into Register A. 6A46H loops back here.
6A42
LD (HL),A 77
Store Register A (the digit) at Register Pair HL.
6A43
ADD HL,DE 19
ADD Register Pair DE (the step) to Register Pair HL: the next row or column.
6A44
INC IX DD 23
INCrement Index Register IX to the next digit.
6A46
DECrement Register B and JUMP back to 6A3FH while it is not zero.
6A48
RET C9
RETurn to 6573H in the register saver, which restores the registers.
6A49
LD BC,(6021H) ED 4B 21 60
Fetch the number of the record shown from 6021H-6022H into Register Pair BC.
6A4D
LD HL,(6025H) 2A 25 60
Fetch the number of the last record from 6025H-6026H into Register Pair HL.
6A50
OR A B7
OR Register A with itself to clear the CARRY FLAG for the SBC.
6A51
SBC HL,BC ED 42
SUBtract Register Pair BC from Register Pair HL: the Z FLAG when the record shown is the last.
6A53
RET NZ C0
If the NZ FLAG is set (not the last record), RETurn: no asterisk.
6A54
LD A,(6020H) 3A 20 60
Fetch the display mode from 6020H into Register A.
6A57
OR A B7
OR Register A with itself to set the Z FLAG for the 256 byte mode.
6A58
LD A,2AH 3E 2A
Load Register A with 2AH, the asterisk; LD does not change the flags.
6A5A
If the Z FLAG is set (256 byte mode), JUMP to 6A5EH to put it under the record number.
6A5C
LD (DE),A 12
Store Register A (the asterisk) at Register Pair DE, after the title in the screen image (6B30H).
6A5D
RET C9
RETurn with the asterisk after the title of the 128 byte mode.
6A5E
LD (56DFH),A 32 DF 56
Store Register A (the asterisk) at 56DFH, row 5, column 61 of the screen image, under the record number.
6A61
RET C9
RETurn with the asterisk under the record number.

6A62H - The Display of the 128 Byte Mode

The 128 byte mode shows a window of eight rows of the record: its 128 characters across rows 0-1, the column labels 00-0F on row 3, the hex bytes of each row with its label on rows 5-12 between two lines of 8CH, the title of the record on row 14 with Relative Byte and the offset, and Command: on row 15. The window starts at the row of the cursor when the cursor is outside it, at 80H at most.

6A62
LD HL,(601CH) 2A 1C 60
Fetch the address of the byte at the cursor from 601CH-601DH into Register Pair HL.
6A65
LD DE,5262H 11 62 52
Point Register Pair DE to 5262H, the start of the edit buffer.
6A68
OR A B7
OR Register A with itself to clear the CARRY FLAG for the SBC.
6A69
SBC HL,DE ED 52
SUBtract Register Pair DE (5262H) from Register Pair HL: Register L = the offset of the cursor.
6A6B
LD A,(601EH) 3A 1E 60
Fetch the offset of the first byte of the window from 601EH into Register A.
6A6E
CP L BD
Compare Register A (the window) against Register L (the cursor): the Z FLAG when the cursor is on the first byte shown.
6A6F
If the Z FLAG is set (the cursor starts the window), JUMP to 6A84H: the window stays.
6A71
If the NO CARRY FLAG is set (the cursor is above the window), JUMP to 6A78H to move the window.
6A73
ADD A,7FH C6 7F
ADD 7FH to Register A: the offset of the last byte of the window.
6A75
CP L BD
Compare Register A (the last byte shown) against Register L (the cursor).
6A76
If the NO CARRY FLAG is set (the cursor is in the window), JUMP to 6A84H: the window stays.
6A78
LD A,L 7D
Copy Register L (the offset of the cursor) into Register A.
6A79
CP 80H FE 80
Compare Register A against 80H: the CARRY FLAG for the first half of the record.
6A7B
If the CARRY FLAG is set (below 80H), JUMP to 6A7FH: the window starts at the cursor's row.
6A7D
LD A,80H 3E 80
Load Register A with 80H: the window shows the second half of the record.
6A7F
AND F0H E6 F0
Keep only bits 7-4 of Register A (AND F0H): the start of a row.
6A81
LD (601EH),A 32 1E 60
Store Register A (the start of the window) at 601EH.
6A84
LD HL,5262H 21 62 52
Point Register Pair HL to 5262H, the start of the edit buffer.
6A87
LD BC,(601EH) ED 4B 1E 60
Fetch the word at 601EH into Register Pair BC: Register C the start of the window, Register B (601FH) 00H.
6A8B
ADD HL,BC 09
ADD Register Pair BC (the start of the window) to Register Pair HL: the first byte shown.
6A8C
PUSH HL E5
Save Register Pair HL (the first byte shown) to the stack, for the hex part.
6A8D
LD DE,5562H 11 62 55
Point Register Pair DE to 5562H, row 0, column 0 of the screen image.
6A90
LD B,80H 06 80
Load Register B with 80H, the 128 bytes of the window.
6A92
LD A,(HL) 7E
Fetch the byte of the record at Register Pair HL into Register A. 6AA0H loops back here.
6A93
BIT 7,A CB 7F
Test bit 7 of Register A: set for the bytes 80H-FFH, not shown as such.
6A95
If the NZ FLAG is set (80H-FFH), JUMP to 6A9BH to show 88H.
6A97
CP 20H FE 20
Compare Register A against 20H, the space: the CARRY FLAG for a control code.
6A99
If the NO CARRY FLAG is set (20H-7FH), JUMP to 6A9DH to show the character.
6A9B
LD A,88H 3E 88
Load Register A with 88H, the graphics character shown for a byte that cannot be displayed.
6A9D
LD (DE),A 12
Store Register A (the character) at Register Pair DE in the screen image.
6A9E
INC HL 23
INCrement Register Pair HL to the next byte of the record.
6A9F
INC DE 13
INCrement Register Pair DE to the next column: rows 0 and 1 hold the 128 characters.
6AA0
DECrement Register B and JUMP back to 6A92H while it is not zero.
6AA2
LD B,10H 06 10
Load Register B with 10H, the 16 column labels.
6AA4
LD HL,562EH 21 2E 56
Point Register Pair HL to 562EH, row 3, column 12 of the screen image: the second character of the first label.
6AA7
LD DE,59A8H 11 A8 59
Point Register Pair DE to 59A8H, the pairs 00, 10, ... F0.
6AAA
LD A,(DE) 1A
Fetch the first character of the pair at Register Pair DE (the hex digit) into Register A. 6ABCH loops back here.
6AAB
LD (HL),A 77
Store Register A (the hex digit) at Register Pair HL, the second character of the label.
6AAC
INC DE 13
INCrement Register Pair DE to the second character of the pair, 0.
6AAD
DEC HL 2B
DECrement Register Pair HL to the first character of the label.
6AAE
LD A,(DE) 1A
Fetch the 0 of the pair at Register Pair DE into Register A.
6AAF
LD (HL),A 77
Store Register A (0) at Register Pair HL: the label reads 0 and the digit, 00 to 0F.
6AB0
INC HL 23
INCrement Register Pair HL, the first of four steps to the next label.
6AB1
INC HL 23
INCrement Register Pair HL, the second of four steps.
6AB2
INC HL 23
INCrement Register Pair HL, the third of four steps.
6AB3
INC HL 23
INCrement Register Pair HL: the second character of the next label, three columns on.
6AB4
LD A,B 78
Copy Register B (the labels left) into Register A.
6AB5
CP 09H FE 09
Compare Register A against 09H: the Z FLAG after the eighth label, 07.
6AB7
If the NZ FLAG is set (not after the eighth), JUMP to 6ABBH.
6AB9
INC HL 23
INCrement Register Pair HL, the first of two extra columns between 07 and 08.
6ABA
INC HL 23
INCrement Register Pair HL, the second extra column.
6ABB
INC DE 13
INCrement Register Pair DE to the next pair of 59A8H.
6ABC
DECrement Register B and JUMP back to 6AAAH while it is not zero.
6ABE
LD DE,56A8H 11 A8 56
Point Register Pair DE to 56A8H, row 5, column 6 of the screen image, for the row labels.
6AC1
LD HL,59A8H 21 A8 59
Point Register Pair HL to 59A8H, the pairs 00, 10, ... F0.
6AC4
LD BC,(601EH) ED 4B 1E 60
Fetch the word at 601EH into Register Pair BC: Register C the start of the window, Register B 00H.
6AC8
SRL C CB 39
Shift Register C right: the start of the window divided by 2.
6ACA
SRL C CB 39
Shift Register C right (SRL): the start of the window divided by 4.
6ACC
SRL C CB 39
Shift Register C right: divided by 8, twice the row number, the offset of its pair in 59A8H.
6ACE
ADD HL,BC 09
ADD Register Pair BC to Register Pair HL: the label of the first row shown.
6ACF
LD B,08H 06 08
Load Register B with 08H, the eight rows of the window.
6AD1
LD A,(HL) 7E
Fetch the first character of the label at Register Pair HL into Register A. 6AE4H loops back here.
6AD2
LD (DE),A 12
Store Register A at Register Pair DE in the screen image.
6AD3
INC HL 23
INCrement Register Pair HL to the second character of the label.
6AD4
INC DE 13
INCrement Register Pair DE to the next column.
6AD5
LD A,(HL) 7E
Fetch the second character of the label at Register Pair HL into Register A.
6AD6
LD (DE),A 12
Store Register A at Register Pair DE in the screen image.
6AD7
INC HL 23
INCrement Register Pair HL to the next label.
6AD8
INC DE 13
INCrement Register Pair DE to the column after the label.
6AD9
LD A,3EH 3E 3E
Load Register A with 3EH, the mark after the label.
6ADB
LD (DE),A 12
Store Register A (3EH) at Register Pair DE, after the row label.
6ADC
PUSH BC C5
Save Register Pair BC (the count) to the stack.
6ADD
EX DE,HL EB
Exchange Register Pair DE and Register Pair HL: Register Pair HL = the place in the screen image.
6ADE
LD BC,003EH 01 3E 00
Load Register Pair BC with 003EH, the 62 columns to the next row.
6AE1
ADD HL,BC 09
ADD Register Pair BC (003EH) to Register Pair HL: column 6 of the next row.
6AE2
EX DE,HL EB
Exchange Register Pair DE and Register Pair HL: Register Pair DE = that place, Register Pair HL the next label.
6AE3
POP BC C1
Restore Register Pair BC from the stack: the count.
6AE4
DECrement Register B and JUMP back to 6AD1H while it is not zero.
6AE6
POP DE D1
Restore Register Pair DE from the stack: the first byte shown, for the hex part.
6AE7
LD HL,56ADH 21 AD 56
Point Register Pair HL to 56ADH, row 5, column 11 of the screen image.
6AEA
LD C,08H 0E 08
Load Register C with 08H, the eight rows of the window in hex.
6AEC
LD B,10H 06 10
Load Register B with 10H, the 16 bytes of a row. 6B0FH loops back here.
6AEE
LD A,(DE) 1A
Fetch the byte of the record at Register Pair DE into Register A. 6B06H loops back here.
6AEF
PUSH HL E5
Save Register Pair HL (the place in the screen image) to the stack.
6AF0
EXX D9
Exchange Register Pairs BC, DE and HL with the alternate set (EXX): the counts and the pointers are kept there while 6880H uses the registers.
6AF1
GOSUB to 6880H to turn Register A into two hex digits: Register L the first, Register H the second.
6AF4
EX DE,HL EB
Exchange Register Pair DE and Register Pair HL: Register E the first digit, Register D the second.
6AF5
POP HL E1
Restore Register Pair HL from the stack: the place in the screen image.
6AF6
LD (HL),E 73
Store Register E (the first digit) at Register Pair HL.
6AF7
INC HL 23
INCrement Register Pair HL to the place of the second digit.
6AF8
LD (HL),D 72
Store Register D (the second digit) at Register Pair HL.
6AF9
INC HL 23
INCrement Register Pair HL past the second digit.
6AFA
INC HL 23
INCrement Register Pair HL past the space after the byte.
6AFB
PUSH HL E5
Save Register Pair HL (the next place) to the stack.
6AFC
EXX D9
Exchange the register sets back (EXX): the alternate set holds the work of 6880H again, the counts and the pointer to the record are back.
6AFD
POP HL E1
Restore Register Pair HL from the stack: the next place in the screen image.
6AFE
INC DE 13
INCrement Register Pair DE to the next byte of the record.
6AFF
LD A,B 78
Copy Register B (the bytes left in the row) into Register A.
6B00
CP 09H FE 09
Compare Register A against 09H: the Z FLAG after the eighth byte.
6B02
If the NZ FLAG is set (not after the eighth), JUMP to 6B06H.
6B04
INC HL 23
INCrement Register Pair HL, the first of two extra columns in the middle of the row.
6B05
INC HL 23
INCrement Register Pair HL, the second extra column.
6B06
DECrement Register B and JUMP back to 6AEEH while it is not zero.
6B08
PUSH DE D5
Save Register Pair DE (the next byte of the record) to the stack.
6B09
LD DE,000EH 11 0E 00
Load Register Pair DE with 000EH, the 14 columns to column 11 of the next row (16 x 3 + 2 + 14 = 64).
6B0C
ADD HL,DE 19
ADD Register Pair DE (000EH) to Register Pair HL.
6B0D
POP DE D1
Restore Register Pair DE from the stack: the next byte of the record.
6B0E
DEC C 0D
DECrement Register C, the rows of the window left to show.
6B0F
If the NZ FLAG is set (rows left), JUMP back to 6AECH.
6B11
LD HL,566DH 21 6D 56
Point Register Pair HL to 566DH, row 4, column 11 of the screen image.
6B14
LD BC,318CH 01 8C 31
Load Register Pair BC with 318CH: Register B = 31H, the 49 columns of the lines; Register C = 8CH, the graphics character of a line.
6B17
LD (HL),C 71
Store Register C (8CH) at Register Pair HL, the line above the hex rows. 6B20H loops back here.
6B18
PUSH HL E5
Save Register Pair HL (the place on row 4) to the stack.
6B19
LD DE,0240H 11 40 02
Load Register Pair DE with 0240H, nine rows of 64 columns.
6B1C
ADD HL,DE 19
ADD Register Pair DE (0240H) to Register Pair HL: the same column of row 13.
6B1D
LD (HL),C 71
Store Register C (8CH) at Register Pair HL, the line below the hex rows.
6B1E
POP HL E1
Restore Register Pair HL from the stack: the place on row 4.
6B1F
INC HL 23
INCrement Register Pair HL to the next column.
6B20
DECrement Register B and JUMP back to 6B17H while it is not zero.
6B22
GOSUB to 6FBBH to write the title of the record at 5BDCH: Register A = its length less 1DH.
6B25
ADD A,1DH C6 1D
ADD 1DH to Register A: the length of the title.
6B27
LD C,A 4F
Copy Register A (the length) into Register C.
6B28
LD HL,5BDCH 21 DC 5B
Point Register Pair HL to 5BDCH, the title of the record just written.
6B2B
LD DE,58E2H 11 E2 58
Point Register Pair DE to 58E2H, row 14, column 0 of the screen image.
6B2E
LD B,00H 06 00
Load Register B with 00H: Register Pair BC = the length of the title.
6B30
LDIR ED B0
Copy Register Pair BC bytes from Register Pair HL (5BDCH) to Register Pair DE (58E2H); Register Pair DE ends after the title.
6B32
GOSUB to 6A49H to put an asterisk at Register Pair DE, after the title, when the last record is shown.
6B35
LD HL,5A42H 21 42 5A
Point Register Pair HL to 5A42H, the text Relative Byte and 3EH.
6B38
LD DE,5911H 11 11 59
Point Register Pair DE to 5911H, row 14, column 47 of the screen image.
6B3B
GOSUB to 65E5H to show the text at Register Pair HL at Register Pair DE.
6B3E
GOSUB to 6651H to show the offset of the cursor at 5920H and 3FBEH and the value line.
6B41
LD HL,5A51H 21 51 5A
Point Register Pair HL to 5A51H, the text Command:.
6B44
LD DE,5922H 11 22 59
Point Register Pair DE to 5922H, row 15, column 0 of the screen image.
6B47
GOSUB to 65E5H to show the text at Register Pair HL at Register Pair DE.
6B4A
GOSUB to 67C6H to put the cursor at 3FC8H, after Command:.
6B4D
RET C9
RETurn to 6573H in the register saver at the end of the display.
6B4E
LD HL,5562H 21 62 55
Point Register Pair HL to 5562H, the screen image.
6B51
LD DE,3C00H 11 00 3C
Point Register Pair DE to 3C00H, video memory.
6B54
LD BC,0400H 01 00 04
Load Register Pair BC with 0400H, the 1024 bytes of the screen.
6B57
LDIR ED B0
Copy Register Pair BC (1024) bytes from Register Pair HL (5562H) to Register Pair DE (3C00H): the screen image is shown.
6B59
RET C9
RETurn with the screen image on the screen at 3C00H-3FFFH.
6B5A
GOSUB to 655FH to save every register and run the rest of this routine as a subroutine.
6B5D
LD HL,5562H 21 62 55
Point Register Pair HL to 5562H, the screen image.
6B60
LD DE,5563H 11 63 55
Point Register Pair DE to 5563H, the next byte, for the fill by LDIR.
6B63
LD BC,03FFH 01 FF 03
Load Register Pair BC with 03FFH, the 1023 bytes after the first.
6B66
LD (HL),20H 36 20
Store 20H, a space, at Register Pair HL (5562H).
6B68
LDIR ED B0
Copy Register Pair BC (1023) bytes from Register Pair HL to Register Pair DE: 5562H-5961H are spaces.
6B6A
RET C9
RETurn to 6573H in the register saver, which restores the registers.

6B6BH - The Blinking Cursors

Each pass of the command loop counts 601AH down; every 25 passes the two cursors of the record (the byte in the ASCII part and its hex digits) switch between the blocks B0H and the bytes under them, and every 15 of those switches the command cursor switches between the block 8FH and the character of the command line under it. 6BC7H works out where the byte at the cursor is shown.

6B6B
GOSUB to 655FH to save every register and run the rest of this routine as a subroutine.
6B6E
LD HL,601AH 21 1A 60
Point Register Pair HL to 601AH, the count of the passes to the next blink.
6B71
DEC (HL) 35
DECrement the count at Register Pair HL (601AH).
6B72
RET NZ C0
If the NZ FLAG is set (the count runs on), RETurn to 6573H in the register saver.
6B73
LD (HL),19H 36 19
Store 19H at Register Pair HL (601AH): 25 passes to the next blink.
6B75
GOSUB to 6B95H to switch the two cursors of the record.
6B78
LD HL,601BH 21 1B 60
Point Register Pair HL to 601BH, the count of the blinks to the next blink of the command cursor.
6B7B
DEC (HL) 35
DECrement the count at Register Pair HL (601BH).
6B7C
RET NZ C0
If the NZ FLAG is set (the count runs on), RETurn to 6573H in the register saver.
6B7D
LD (HL),0FH 36 0F
Store 0FH at Register Pair HL (601BH): 15 blinks to the next one of the command cursor.
6B7F
LD HL,6015H 21 15 60
Point Register Pair HL to 6015H, the phase of the command cursor. 67EEH calls here to take the block off.
6B82
LD A,(HL) 7E
Fetch the phase at Register Pair HL (6015H) into Register A.
6B83
XOR 01H EE 01
Flip bit 0 of Register A (XOR 01H): the Z FLAG when the block was shown and now goes.
6B85
LD (HL),A 77
Store Register A (the new phase) at Register Pair HL (6015H).
6B86
LD HL,(4020H) 2A 20 40
Fetch the cursor of the video from 4020H-4021H into Register Pair HL; LD does not change the flags of the XOR.
6B89
If the Z FLAG is set (the block goes), JUMP to 6B8EH to show the character under it.
6B8B
LD (HL),8FH 36 8F
Store 8FH, the graphics character of a full block, at Register Pair HL, the cursor.
6B8D
RET C9
RETurn with the block shown at the cursor of the video.
6B8E
LD DE,(6016H) ED 5B 16 60
Fetch the place in the command line from 6016H-6017H into Register Pair DE.
6B92
LD A,(DE) 1A
Fetch the character of the command line at Register Pair DE into Register A.
6B93
LD (HL),A 77
Store Register A at Register Pair HL, the cursor: the character is shown again.
6B94
RET C9
RETurn with the character shown at the cursor of the video.
6B95
GOSUB to 6BC7H to work out the places of the byte at the cursor: Register Pair DE in the ASCII part, Register Pair BC its hex digits. 67E7H calls here to take the blocks off.
6B98
LD HL,6014H 21 14 60
Point Register Pair HL to 6014H, the phase of the record cursors.
6B9B
LD A,(HL) 7E
Fetch the phase at Register Pair HL (6014H) into Register A.
6B9C
XOR 01H EE 01
Flip bit 0 of Register A (XOR 01H): the Z FLAG when the blocks were shown and now go.
6B9E
LD (HL),A 77
Store Register A (the new phase) at Register Pair HL (6014H).
6B9F
If the Z FLAG is set (the blocks go), JUMP to 6BAFH to show the byte again.
6BA1
LD A,B0H 3E B0
Load Register A with B0H, the graphics character of the cursor blocks (the bottom row of blocks).
6BA3
LD HL,3C00H 21 00 3C
Point Register Pair HL to 3C00H, video memory.
6BA6
PUSH HL E5
Save Register Pair HL (3C00H) to the stack, for the hex digits.
6BA7
ADD HL,DE 19
ADD Register Pair DE (the place in the ASCII part) to Register Pair HL.
6BA8
LD (HL),A 77
Store Register A (B0H) at Register Pair HL: the cursor in the ASCII part.
6BA9
POP HL E1
Restore Register Pair HL from the stack: 3C00H.
6BAA
ADD HL,BC 09
ADD Register Pair BC (the place of the hex digits) to Register Pair HL.
6BAB
LD (HL),A 77
Store Register A (B0H) at Register Pair HL, over the first hex digit.
6BAC
INC HL 23
INCrement Register Pair HL to the second hex digit.
6BAD
LD (HL),A 77
Store Register A (B0H) at Register Pair HL, over the second hex digit.
6BAE
RET C9
RETurn with the two cursors shown as blocks B0H.
6BAF
LD HL,5562H 21 62 55
Point Register Pair HL to 5562H, the screen image, which holds what is under the cursors.
6BB2
PUSH HL E5
Save Register Pair HL (5562H) to the stack, for the hex digits.
6BB3
ADD HL,DE 19
ADD Register Pair DE (the place in the ASCII part) to Register Pair HL.
6BB4
LD A,(HL) 7E
Fetch the character of the screen image at Register Pair HL into Register A.
6BB5
LD HL,3C00H 21 00 3C
Point Register Pair HL to 3C00H, video memory.
6BB8
PUSH HL E5
Save Register Pair HL (3C00H) to the stack, for the hex digits.
6BB9
ADD HL,DE 19
ADD Register Pair DE (the place in the ASCII part) to Register Pair HL.
6BBA
LD (HL),A 77
Store Register A (the character) at Register Pair HL: the ASCII part is as in the image.
6BBB
POP HL E1
Restore Register Pair HL from the stack: 3C00H.
6BBC
ADD HL,BC 09
ADD Register Pair BC (the place of the hex digits) to Register Pair HL.
6BBD
EX DE,HL EB
Exchange Register Pair DE and Register Pair HL: Register Pair DE = the hex digits on the screen.
6BBE
POP HL E1
Restore Register Pair HL from the stack: 5562H.
6BBF
ADD HL,BC 09
ADD Register Pair BC (the place of the hex digits) to Register Pair HL: the digits in the screen image.
6BC0
LD A,(HL) 7E
Fetch the first hex digit at Register Pair HL into Register A.
6BC1
LD (DE),A 12
Store Register A at Register Pair DE on the screen.
6BC2
INC DE 13
INCrement Register Pair DE to the second digit on the screen.
6BC3
INC HL 23
INCrement Register Pair HL to the second digit in the screen image.
6BC4
LD A,(HL) 7E
Fetch the second hex digit at Register Pair HL into Register A.
6BC5
LD (DE),A 12
Store Register A at Register Pair DE on the screen.
6BC6
RET C9
RETurn with the byte shown again in both places.
6BC7
LD HL,(601CH) 2A 1C 60
Fetch the address of the byte at the cursor from 601CH-601DH into Register Pair HL.
6BCA
LD DE,5262H 11 62 52
Point Register Pair DE to 5262H, the start of the edit buffer.
6BCD
PUSH AF F5
Save Register Pair AF to the stack: Register A and the flags come back unchanged.
6BCE
LD A,(6020H) 3A 20 60
Fetch the display mode from 6020H into Register A.
6BD1
OR A B7
OR Register A with itself to set the Z FLAG for the 256 byte mode.
6BD2
If the NZ FLAG is set (128 byte mode), JUMP to 6BFFH.
6BD5
XOR A AF
Set Register A to 00H by XOR A with itself, which also clears the CARRY FLAG for the SBC.
6BD6
SBC HL,DE ED 52
SUBtract Register Pair DE (5262H) from Register Pair HL: Register L = the offset of the cursor.
6BD8
LD D,A 57
Copy Register A (00H) into Register D, the high byte of the row below.
6BD9
LD B,A 47
Copy Register A (00H) into Register B, the high byte of the column below.
6BDA
LD A,L 7D
Copy Register L (the offset) into Register A.
6BDB
AND 0FH E6 0F
Keep only bits 3-0 of Register A (AND 0FH): the column of the byte in its row, 0-15.
6BDD
LD C,A 4F
Copy Register A (the column) into Register C: Register Pair BC = the column.
6BDE
LD A,L 7D
Copy Register L (the offset) into Register A.
6BDF
AND F0H E6 F0
Keep only bits 7-4 of Register A (AND F0H): the row times 16.
6BE1
LD E,A 5F
Copy Register A into Register E: Register Pair DE = the row times 16.
6BE2
EX DE,HL EB
Exchange Register Pair DE and Register Pair HL: Register Pair HL = the row times 16.
6BE3
ADD HL,HL 29
ADD Register Pair HL to itself: the row times 32.
6BE4
ADD HL,HL 29
ADD Register Pair HL to itself: the row times 64, the start of the row on the screen.
6BE5
PUSH HL E5
Save Register Pair HL (the start of the row) to the stack.
6BE6
ADD HL,BC 09
ADD Register Pair BC (the column) to Register Pair HL: the place in the ASCII part, columns 0-15.
6BE7
EX DE,HL EB
Exchange Register Pair DE and Register Pair HL: Register Pair DE = the place in the ASCII part.
6BE8
POP HL E1
Restore Register Pair HL from the stack: the start of the row.
6BE9
INC C 0C
INCrement Register C: the count of the steps over the hex part, the column plus one.
6BEA
LD A,12H 3E 12
Load Register A with 12H: column 18, three before the first hex digit at column 21.
6BEC
LD B,02H 06 02
Load Register B with 02H: the step from the first to the second byte of a word. 6BF5H loops back here.
6BEE
BIT 0,C CB 41
Test bit 0 of Register C: set on the odd counts, the step to the first byte of a word.
6BF0
If the Z FLAG is set (an even count), JUMP to 6BF3H with the step 2.
6BF2
INC B 04
INCrement Register B to 03H: the step over the space between two words.
6BF3
ADD A,B 80
ADD Register B (the step) to Register A: the column of the hex digits.
6BF4
DEC C 0D
DECrement Register C, the steps over the hex part still to add.
6BF5
If the NZ FLAG is set (steps left), JUMP back to 6BECH.
6BF7
LD B,00H 06 00
Load Register B with 00H. 6C21H comes here for the 128 byte mode.
6BF9
LD C,A 4F
Copy Register A (the column of the hex digits) into Register C: Register Pair BC = the column.
6BFA
ADD HL,BC 09
ADD Register Pair BC (the column) to Register Pair HL (the start of the row): the place of the hex digits.
6BFB
PUSH HL E5
Save Register Pair HL (the place of the hex digits) to the stack, to pass it to Register Pair BC.
6BFC
POP BC C1
Restore Register Pair BC from the stack: Register Pair BC = the place of the hex digits.
6BFD
POP AF F1
Restore Register Pair AF from the stack: Register A and the flags as the caller had them.
6BFE
RET C9
RETurn with Register Pair DE the place in the ASCII part and Register Pair BC the place of the hex digits, offsets from 3C00H and 5562H.
6BFF
OR A B7
OR Register A with itself to clear the CARRY FLAG for the SBC.
6C00
SBC HL,DE ED 52
SUBtract Register Pair DE (5262H) from Register Pair HL: the offset of the cursor in the record.
6C02
LD DE,(601EH) ED 5B 1E 60
Fetch the word at 601EH into Register Pair DE: the start of the window, Register D (601FH) 00H.
6C06
OR A B7
OR Register A with itself to clear the CARRY FLAG for the SBC.
6C07
SBC HL,DE ED 52
SUBtract Register Pair DE (the start of the window) from Register Pair HL: the offset in the window, 00H-7FH.
6C09
LD E,L 5D
Copy Register L into Register E: Register Pair DE = the offset in the window, the place in the ASCII part of rows 0-1.
6C0A
LD A,L 7D
Copy Register L (the offset in the window) into Register A.
6C0B
AND F0H E6 F0
Keep only bits 7-4 of Register A (AND F0H): the row of the window times 16.
6C0D
LD L,A 6F
Copy Register A into Register L: Register Pair HL = the row times 16.
6C0E
ADD HL,HL 29
ADD Register Pair HL to itself: the row times 32.
6C0F
ADD HL,HL 29
ADD Register Pair HL to itself: the row times 64.
6C10
LD BC,014BH 01 4B 01
Load Register Pair BC with 014BH, row 5, column 11: the first hex digit of the window.
6C13
ADD HL,BC 09
ADD Register Pair BC (014BH) to Register Pair HL: the first hex digit of the row.
6C14
BIT 3,E CB 5B
Test bit 3 of Register E: set for the bytes 8-15 of the row.
6C16
If the Z FLAG is set (bytes 0-7), JUMP to 6C1AH.
6C18
INC HL 23
INCrement Register Pair HL, the first of two extra columns in the middle of the row.
6C19
INC HL 23
INCrement Register Pair HL, the second extra column.
6C1A
LD A,E 7B
Copy Register E (the offset in the window) into Register A.
6C1B
AND 0FH E6 0F
Keep only bits 3-0 of Register A (AND 0FH): the column of the byte, 0-15.
6C1D
LD B,A 47
Copy Register A (the column) into Register B.
6C1E
SLA A CB 27
Shift Register A left (SLA): the column of the byte times 2.
6C20
ADD A,B 80
ADD Register B (the column) to Register A: the column times 3, the places of the byte from the start of the row.
6C21
JUMP to 6BF7H to add Register A to Register Pair HL and return the places.

6C23H - Ask for the File and Open It

The screen is cleared and shows the title, the copyright and Filespec:; up to 23 characters are taken into the file control block through the ROM. BREAK ends FED; an empty line gives error 13H. The specification is checked by @FSPEC and the file opened by @OPEN with the buffer 5362H and records of 256 bytes. The drive digit goes after the name, the number of the last record is kept, and record 0 is read and shown with the cursor on byte 00H.

6C23
GOSUB to 654EH to clear the screen for the question for a file.
6C26
LD HL,59E5H 21 E5 59
Point Register Pair HL to 59E5H, the title FED - File Editor Version 1.0.
6C29
LD DE,3C00H 11 00 3C
Point Register Pair DE to 3C00H, the top left corner of the screen.
6C2C
GOSUB to 65E5H to show the text at Register Pair HL at Register Pair DE; Register Pair HL ends at its last byte (5A02H).
6C2F
INC HL 23
INCrement Register Pair HL to 5A03H, the end of the version number.
6C30
GOSUB to 65E5H to show the text at Register Pair HL after the title: Version 1.0.2.
6C33
LD HL,5A07H 21 07 5A
Point Register Pair HL to 5A07H, the copyright line.
6C36
LD DE,3C40H 11 40 3C
Point Register Pair DE to 3C40H, row 1 of the screen.
6C39
GOSUB to 65E5H to show the text at Register Pair HL at Register Pair DE.
6C3C
LD HL,5A38H 21 38 5A
Point Register Pair HL to 5A38H, the prompt Filespec:.
6C3F
LD DE,3D00H 11 00 3D
Point Register Pair DE to 3D00H, row 4 of the screen.
6C42
GOSUB to 65E5H to show the text at Register Pair HL at Register Pair DE; Register Pair DE ends after it.
6C45
LD (4020H),DE ED 53 20 40
Store Register Pair DE (the place after the prompt) at 4020H-4021H, the cursor of the video.
6C49
LD B,17H 06 17
Load Register B with 17H, the 23 characters the line may hold.
6C4B
LD HL,5242H 21 42 52
Point Register Pair HL to 5242H, the file control block, where the line is put.
6C4E
GOSUB to 0040H, the ROM's line input: up to Register B characters at Register Pair HL, ended by 0DH; Register B = the count, the CARRY FLAG for BREAK.
6C51
If the CARRY FLAG is set (BREAK), JUMP to 685DH to end FED.
6C54
LD A,B 78
Copy Register B (the count of the characters typed) into Register A.
6C55
OR A B7
OR Register A with itself to set the Z FLAG for an empty line.
6C56
If the NZ FLAG is set (characters typed), JUMP to 6C5DH to open the file.
6C58
LD A,13H 3E 13
Load Register A with 13H, error 19, an illegal file name. 6C66H comes here when @FSPEC refuses the specification.
6C5A
JUMP to 6DA6H to show the error and ask for the file again.
6C5D
GOSUB to 65B0H to put the name of the file (Register B characters at 5242H) at 59C8H as shown. 6099H comes here with the command line.
6C60
LD DE,5242H 11 42 52
Point Register Pair DE to 5242H, the file control block.
6C63
GOSUB to 441CH, @FSPEC, to check the file specification at Register Pair DE and put it in the form @OPEN takes.
6C66
If the NZ FLAG is set (a bad specification), JUMP back to 6C58H for error 13H.
6C68
LD HL,5362H 21 62 53
Point Register Pair HL to 5362H, the buffer of 256 bytes for the file.
6C6B
LD B,00H 06 00
Load Register B with 00H, the logical record length 256.
6C6D
GOSUB to 4424H, @OPEN, to open the file at Register Pair DE with the buffer at Register Pair HL and records of Register B bytes.
6C70
If the NZ FLAG is set (an error, number in Register A), JUMP to 6DA6H to show it.
6C73
LD A,(5248H) 3A 48 52
Fetch the drive of the file from 5248H, +06H of the file control block, into Register A.
6C76
ADD A,30H C6 30
ADD 30H to Register A: the drive number as a digit.
6C78
LD HL,(6027H) 2A 27 60
Fetch the place of the drive digit in the shown name from 6027H-6028H into Register Pair HL.
6C7B
LD (HL),A 77
Store Register A (the drive digit) at Register Pair HL, after the colon.
6C7C
LD BC,(524EH) ED 4B 4E 52
Fetch the ending record number from 524EH-524FH, +0CH-+0DH of the file control block, into Register Pair BC.
6C80
DEC BC 0B
DECrement Register Pair BC: the number of the last record.
6C81
LD (6025H),BC ED 43 25 60
Store Register Pair BC (the last record) at 6025H-6026H.
6C85
LD BC,0000H 01 00 00
Load Register Pair BC with 0000H, record 0, the first of the file.
6C88
LD (6021H),BC ED 43 21 60
Store Register Pair BC (0000H) at 6021H-6022H, the record shown.
6C8C
LD HL,5262H 21 62 52
Point Register Pair HL to 5262H, byte 00H of the edit buffer.
6C8F
LD (601CH),HL 22 1C 60
Store Register Pair HL (5262H) at 601CH-601DH: the cursor starts on byte 00H.
6C92
LD A,1CH 3E 1C
Load Register A with 1CH, the code that puts the cursor of the video home.
6C94
GOSUB to 0033H, the ROM's display of the character in Register A (1CH).
6C97
GOSUB to 6CC8H to read record 0 (Register Pair BC) into the edit buffer and show it.
6C9A
RET C9
RETurn with the first record of the file on the screen.

6C9BH - Read a Record

6C9BH positions the file to record Register Pair BC, reads it, copies it to the edit buffer and builds the display; 6CC8H shows it too. 6CCFH, for the searches, reads the record at 6021H into the edit buffer and the one after it (unless it is the last) into the buffer at 5362H, so that a string may run on over the end of the record. An error goes to 6DA6H.

6C9B
LD A,(6013H) 3A 13 60
Fetch the state of the command line from 6013H into Register A.
6C9E
OR A B7
OR Register A with itself to set the Z FLAG when no command is under way.
6C9F
If the Z FLAG is set (no command), GOSUB to 67DBH to take the cursors off the screen.
6CA2
CP 04H FE 04
Compare Register A (the state) against 04H: the NO CARRY FLAG for the states from R on.
6CA4
If the NO CARRY FLAG is set (R and the others), GOSUB to 67DBH to take the cursors off the screen.
6CA7
LD DE,5242H 11 42 52
Point Register Pair DE to 5242H, the file control block.
6CAA
GOSUB to 4442H, @POSN, to position the file at Register Pair DE to record Register Pair BC.
6CAD
If the NZ FLAG is set (an error, number in Register A), JUMP to 6DA6H to show it.
6CB0
LD DE,5242H 11 42 52
Point Register Pair DE to 5242H, the file control block.
6CB3
GOSUB to 4436H, @READ, to read the record into the buffer 5362H; its error is tested at 6CC4H.
6CB6
LD BC,0100H 01 00 01
Load Register Pair BC with 0100H, the 256 bytes of a record.
6CB9
LD HL,5362H 21 62 53
Point Register Pair HL to 5362H, the buffer of the file.
6CBC
LD DE,5262H 11 62 52
Point Register Pair DE to 5262H, the edit buffer.
6CBF
LDIR ED B0
Copy Register Pair BC (256) bytes from Register Pair HL to Register Pair DE; LDIR leaves the Z FLAG of @READ alone.
6CC1
GOSUB to 6953H to build the display of the edit buffer; it gives back Register Pair AF, still the result of @READ.
6CC4
If the NZ FLAG is set (@READ failed, number in Register A), JUMP to 6DA6H to show the error.
6CC7
RET C9
RETurn with the record in the edit buffer and the screen image built.
6CC8
GOSUB to 6C9BH to read record Register Pair BC and build the display.
6CCB
GOSUB to 6B4EH to copy the screen image to video memory at 3C00H.
6CCE
RET C9
RETurn with the record on the screen at 3C00H-3FFFH.
6CCF
LD BC,(6021H) ED 4B 21 60
Fetch the number of the record from 6021H-6022H into Register Pair BC.
6CD3
PUSH BC C5
Save Register Pair BC (the record) to the stack.
6CD4
LD DE,5242H 11 42 52
Point Register Pair DE to 5242H, the file control block.
6CD7
PUSH DE D5
Save Register Pair DE (5242H, the file control block) to the stack.
6CD8
GOSUB to 4442H, @POSN, to position the file at Register Pair DE to record Register Pair BC.
6CDB
If the NZ FLAG is set (an error, number in Register A), JUMP to 6DA6H to show it.
6CDE
GOSUB to 4436H, @READ, to read the record into the buffer 5362H.
6CE1
If the NZ FLAG is set (an error, number in Register A), JUMP to 6DA6H to show it.
6CE4
LD HL,5362H 21 62 53
Point Register Pair HL to 5362H, the buffer of the file.
6CE7
LD DE,5262H 11 62 52
Point Register Pair DE to 5262H, the edit buffer.
6CEA
LD BC,0100H 01 00 01
Load Register Pair BC with 0100H, the 256 bytes of a record.
6CED
LDIR ED B0
Copy Register Pair BC (256) bytes from Register Pair HL to Register Pair DE: the record is in the edit buffer.
6CEF
POP DE D1
Restore Register Pair DE from the stack: 5242H, the file control block.
6CF0
POP BC C1
Restore Register Pair BC from the stack: the number of the record.
6CF1
LD HL,(6025H) 2A 25 60
Fetch the number of the last record from 6025H-6026H into Register Pair HL.
6CF4
OR A B7
OR Register A with itself to clear the CARRY FLAG for the SBC.
6CF5
SBC HL,BC ED 42
SUBtract Register Pair BC (the record) from Register Pair HL: the Z FLAG for the last record.
6CF7
RET Z C8
If the Z FLAG is set (the last record), RETurn: no record follows.
6CF8
INC BC 03
INCrement Register Pair BC to the next record.
6CF9
GOSUB to 4442H, @POSN, to position the file at Register Pair DE to record Register Pair BC.
6CFC
If the NZ FLAG is set (an error, number in Register A), JUMP to 6DA6H to show it.
6CFF
GOSUB to 4436H, @READ, to read the next record into the buffer 5362H, right after the edit buffer.
6D02
If the NZ FLAG is set (an error, number in Register A), JUMP to 6DA6H to show it.
6D05
RET C9
RETurn with the record at 5262H and the next one at 5362H.

6D06H - The Input Box

In the 256 byte mode the characters typed after R, L, C and F go down columns 61-62 at the right edge in a box of graphics characters drawn from row 6; in the 128 byte mode they go on the input line at 3FCAH. 6D30H clears the box, 6D46H keeps what is under it at 5200H and 6D78H puts it back.

6D06
LD B,A 47
Copy Register A (the rows of the box) into Register B.
6D07
LD A,(6020H) 3A 20 60
Fetch the display mode from 6020H into Register A.
6D0A
OR A B7
OR Register A with itself to set the Z FLAG for the 256 byte mode.
6D0B
If the Z FLAG is set (256 byte mode), JUMP to 6D14H to draw the box.
6D0D
LD HL,3FCAH 21 CA 3F
Point Register Pair HL to 3FCAH, the input line of the 128 byte mode.
6D10
LD (4020H),HL 22 20 40
Store Register Pair HL (3FCAH) at 4020H-4021H, the cursor of the video.
6D13
RET C9
RETurn with the cursor of the video on the input line at 3FCAH.
6D14
LD HL,3DBDH 21 BD 3D
Point Register Pair HL to 3DBDH, row 6, column 61 of the screen.
6D17
LD (HL),8CH 36 8C
Store 8CH, a graphics character (the middle row of blocks), at Register Pair HL: the top edge of the box.
6D19
INC HL 23
INCrement Register Pair HL to 3DBEH, column 62.
6D1A
LD (HL),ACH 36 AC
Store ACH, a graphics character (the middle row and the bottom right block), at Register Pair HL: the top right corner.
6D1C
LD DE,0040H 11 40 00
Load Register Pair DE with 0040H, one row of 64 columns.
6D1F
ADD HL,DE 19
ADD Register Pair DE (0040H) to Register Pair HL: column 62 of the next row. 6D22H loops back here.
6D20
LD (HL),AAH 36 AA
Store AAH, a graphics character (the right column of blocks), at Register Pair HL: the right side of the box.
6D22
DECrement Register B and JUMP back to 6D1FH while it is not zero.
6D24
LD (HL),83H 36 83
Store 83H, a graphics character (the top row of blocks), at Register Pair HL: the bottom right corner.
6D26
DEC HL 2B
DECrement Register Pair HL to column 61 of the same row.
6D27
LD (HL),83H 36 83
Store 83H at Register Pair HL: the bottom edge of the box.
6D29
LD HL,3DFDH 21 FD 3D
Point Register Pair HL to 3DFDH, row 7, column 61: the first place in the box.
6D2C
LD (4020H),HL 22 20 40
Store Register Pair HL (3DFDH) at 4020H-4021H, the cursor of the video.
6D2F
RET C9
RETurn with the box drawn and the cursor in it.
6D30
LD A,(6020H) 3A 20 60
Fetch the display mode from 6020H into Register A.
6D33
OR A B7
OR Register A with itself to set the Z FLAG for the 256 byte mode.
6D34
RET NZ C0
If the NZ FLAG is set (128 byte mode), RETurn: there is no box.
6D35
LD HL,3DBDH 21 BD 3D
Point Register Pair HL to 3DBDH, row 6, column 61 of the screen.
6D38
LD DE,003FH 11 3F 00
Load Register Pair DE with 003FH, the 63 columns to column 61 of the next row.
6D3B
LD B,08H 06 08
Load Register B with 08H, the eight rows of the box.
6D3D
LD (HL),20H 36 20
Store 20H, a space, at Register Pair HL, column 61. 6D43H loops back here.
6D3F
INC HL 23
INCrement Register Pair HL to column 62 of the same row.
6D40
LD (HL),20H 36 20
Store 20H, a space, at Register Pair HL, column 62.
6D42
ADD HL,DE 19
ADD Register Pair DE (003FH) to Register Pair HL: column 61 of the next row.
6D43
DECrement Register B and JUMP back to 6D3DH while it is not zero.
6D45
RET C9
RETurn with columns 61-62 of rows 6-13 cleared.
6D46
GOSUB to 655FH to save every register and run the rest of this routine as a subroutine.
6D49
LD A,(6020H) 3A 20 60
Fetch the display mode from 6020H into Register A.
6D4C
OR A B7
OR Register A with itself to set the Z FLAG for the 256 byte mode.
6D4D
If the NZ FLAG is set (128 byte mode), JUMP to 6D6CH to keep the input line.
6D4F
LD B,08H 06 08
Load Register B with 08H, the eight rows of the box.
6D51
LD HL,3DBDH 21 BD 3D
Point Register Pair HL to 3DBDH, row 6, column 61 of the screen.
6D54
LD DE,003FH 11 3F 00
Load Register Pair DE with 003FH, the 63 columns to column 61 of the next row.
6D57
LD IX,5200H DD 21 00 52
Point Index Register IX to 5200H, the save area.
6D5B
LD A,(HL) 7E
Fetch the character at Register Pair HL (column 61) into Register A. 6D69H loops back here.
6D5C
LD (IX+00H),A DD 77 00
Store Register A at Index Register IX +00H in the save area.
6D5F
INC HL 23
INCrement Register Pair HL to column 62 of the same row.
6D60
INC IX DD 23
INCrement Index Register IX to the next place of the save area.
6D62
LD A,(HL) 7E
Fetch the character at Register Pair HL (column 62) into Register A.
6D63
LD (IX+00H),A DD 77 00
Store Register A at Index Register IX +00H in the save area.
6D66
INC IX DD 23
INCrement Index Register IX to the next place of the save area.
6D68
ADD HL,DE 19
ADD Register Pair DE (003FH) to Register Pair HL: column 61 of the next row.
6D69
DECrement Register B and JUMP back to 6D5BH while it is not zero.
6D6B
RET C9
RETurn to 6573H in the register saver with 16 characters at 5200H-520FH.
6D6C
LD HL,3FCAH 21 CA 3F
Point Register Pair HL to 3FCAH, the input line of the 128 byte mode.
6D6F
LD DE,5200H 11 00 52
Point Register Pair DE to 5200H, the save area.
6D72
LD BC,001EH 01 1E 00
Load Register Pair BC with 001EH, 30 characters. 6DA4H comes here to put them back.
6D75
LDIR ED B0
Copy Register Pair BC (30) bytes from Register Pair HL to Register Pair DE.
6D77
RET C9
RETurn to 6573H in the register saver, which restores the registers.
6D78
GOSUB to 655FH to save every register and run the rest of this routine as a subroutine.
6D7B
LD A,(6020H) 3A 20 60
Fetch the display mode from 6020H into Register A.
6D7E
OR A B7
OR Register A with itself to set the Z FLAG for the 256 byte mode.
6D7F
If the NZ FLAG is set (128 byte mode), JUMP to 6D9EH to put the input line back.
6D81
LD B,08H 06 08
Load Register B with 08H, the eight rows of the box.
6D83
LD DE,003FH 11 3F 00
Load Register Pair DE with 003FH, the 63 columns to column 61 of the next row.
6D86
LD HL,3DBDH 21 BD 3D
Point Register Pair HL to 3DBDH, row 6, column 61 of the screen.
6D89
LD IX,5200H DD 21 00 52
Point Index Register IX to 5200H, the save area.
6D8D
LD A,(IX+00H) DD 7E 00
Fetch the character at Index Register IX +00H of the save area into Register A. 6D9BH loops back here.
6D90
LD (HL),A 77
Store Register A at Register Pair HL (column 61).
6D91
INC HL 23
INCrement Register Pair HL to column 62 of the same row.
6D92
INC IX DD 23
INCrement Index Register IX to the next place of the save area.
6D94
LD A,(IX+00H) DD 7E 00
Fetch the character at Index Register IX +00H into Register A.
6D97
LD (HL),A 77
Store Register A at Register Pair HL (column 62).
6D98
INC IX DD 23
INCrement Index Register IX to the next place of the save area.
6D9A
ADD HL,DE 19
ADD Register Pair DE (003FH) to Register Pair HL: column 61 of the next row.
6D9B
DECrement Register B and JUMP back to 6D8DH while it is not zero.
6D9D
RET C9
RETurn to 6573H in the register saver with the box area as it was.
6D9E
LD HL,5200H 21 00 52
Point Register Pair HL to 5200H, the save area.
6DA1
LD DE,3FCAH 11 CA 3F
Point Register Pair DE to 3FCAH, the input line of the 128 byte mode.
6DA4
JUMP to 6D72H to copy the 30 characters back.

6DA6H - The Errors

An error of LDOS (number in Register A) clears the screen and is shown by @ERROR on row 6, in the middle by the table at 6E2FH, with Press <ENTER> to continue, <BREAK> to abort below it; the two key names blink. BREAK ends FED; ENTER goes back to the question for a file when none is open, else shows the record again with the cursor on byte 00H and an asterisk in the command line. 6DD6H shows the prompt and waits for the other error texts of FED too.

6DA6
GOSUB to 6DBFH to show the error of Register A and wait for ENTER (BREAK ends FED there).
6DA9
LD A,(6012H) 3A 12 60
Fetch the cell 6012H into Register A: 00H while no file is open.
6DAC
OR A B7
OR Register A with itself to set the Z FLAG when no file is open.
6DAD
If the Z FLAG is set (no file open), JUMP to 609EH to ask for a file again.
6DB0
GOSUB to 6B4EH to copy the screen image to video memory: the record is shown again.
6DB3
LD HL,5262H 21 62 52
Point Register Pair HL to 5262H, byte 00H of the edit buffer.
6DB6
LD (601CH),HL 22 1C 60
Store Register Pair HL (5262H) at 601CH-601DH: the cursor goes to byte 00H.
6DB9
GOSUB to 6651H to show the offset of the cursor again.
6DBC
JUMP to 704AH to show an asterisk in the command line and go back to the loop.
6DBF
GOSUB to 654EH to clear the screen for the message of the error.
6DC2
LD (6DCDH),A 32 CD 6D
Store Register A (the error number) at 6DCDH, the displacement of the LD L,(IX+00H) at 6DCBH.
6DC5
LD IX,6E2FH DD 21 2F 6E
Point Index Register IX to 6E2FH, the table of the columns of the messages.
6DC9
LD H,3DH 26 3D
Load Register H with 3DH, the high byte of the places on row 6.
6DCB
LD L,(IX+00H) DD 6E 00
Fetch the byte at Index Register IX + the error number (stored over the +00H) into Register L: Register Pair HL = the place of the message.
6DCE
LD (4020H),HL 22 20 40
Store Register Pair HL (the place of the message) at 4020H-4021H, the cursor of the video.
6DD1
ADD A,C0H C6 C0
ADD C0H to Register A (the error number): bit 7 set, @ERROR returns; bit 6 set, the short form of the message.
6DD3
GOSUB to 4409H, @ERROR, to display the message of Register A at the cursor and return.
6DD6
LD HL,5A59H 21 59 5A
Point Register Pair HL to 5A59H, the text Press <ENTER> to continue, <BREAK> to abort.
6DD9
LD DE,3F0AH 11 0A 3F
Point Register Pair DE to 3F0AH, row 12, column 10 of the screen.
6DDC
GOSUB to 65E5H to show the text at Register Pair HL at Register Pair DE.
6DDF
GOSUB to 002BH, the ROM's keyboard scan: Register A = a key, or 00H for none. 6DE3H loops back here.
6DE2
OR A B7
OR Register A with itself to set the Z FLAG when no key came.
6DE3
If the NZ FLAG is set (a key), JUMP back to 6DDFH: the keys typed before are passed over.
6DE5
LD HL,6029H 21 29 60
Point Register Pair HL to 6029H, the count of the passes to the next blink.
6DE8
LD (HL),64H 36 64
Store 64H at Register Pair HL (6029H): 100 passes to the next blink. 6E20H comes back here.
6DEA
LD BC,602AH 01 2A 60
Point Register Pair BC to 602AH, the phase of the blink.
6DED
LD A,(BC) 0A
Fetch the phase at Register Pair BC (602AH) into Register A.
6DEE
XOR 01H EE 01
Flip bit 0 of Register A (XOR 01H): the Z FLAG when the key names go.
6DF0
LD (BC),A 02
Store Register A (the new phase) at Register Pair BC (602AH).
6DF1
If the Z FLAG is set (the names go), JUMP to 6E0AH to put spaces over them.
6DF3
LD HL,5A5FH 21 5F 5A
Point Register Pair HL to 5A5FH, the word <ENTER> in the prompt text.
6DF6
LD DE,3F10H 11 10 3F
Point Register Pair DE to 3F10H, its place on the screen.
6DF9
LD BC,0007H 01 07 00
Load Register Pair BC with 0007H, the seven characters of the word.
6DFC
PUSH BC C5
Save Register Pair BC (0007H) to the stack, for the second word.
6DFD
LDIR ED B0
Copy Register Pair BC (7) bytes from Register Pair HL to Register Pair DE: <ENTER> is shown.
6DFF
POP BC C1
Restore Register Pair BC from the stack: 0007H.
6E00
LD HL,5A74H 21 74 5A
Point Register Pair HL to 5A74H, the word <BREAK> in the prompt text.
6E03
LD DE,3F25H 11 25 3F
Point Register Pair DE to 3F25H, its place on the screen.
6E06
LDIR ED B0
Copy Register Pair BC (7) bytes from Register Pair HL to Register Pair DE: <BREAK> is shown.
6E08
JUMP to 6E1CH to count the passes and look at the keys.
6E0A
LD HL,3C00H 21 00 3C
Point Register Pair HL to 3C00H, the top row of the screen, which is blank after the clear.
6E0D
LD DE,3F10H 11 10 3F
Point Register Pair DE to 3F10H, the place of <ENTER>.
6E10
LD BC,0007H 01 07 00
Load Register Pair BC with 0007H, the seven characters of the word.
6E13
PUSH BC C5
Save Register Pair BC (0007H) to the stack, for the second word.
6E14
LDIR ED B0
Copy Register Pair BC (7) spaces from Register Pair HL to Register Pair DE: <ENTER> is gone.
6E16
POP BC C1
Restore Register Pair BC from the stack: 0007H.
6E17
LD DE,3F25H 11 25 3F
Point Register Pair DE to 3F25H, the place of <BREAK>; Register Pair HL = 3C07H, still blank.
6E1A
LDIR ED B0
Copy Register Pair BC (7) spaces from Register Pair HL to Register Pair DE: <BREAK> is gone.
6E1C
LD HL,6029H 21 29 60
Point Register Pair HL to 6029H, the count of the passes. 6E2CH loops back here.
6E1F
DEC (HL) 35
DECrement the count at Register Pair HL (6029H).
6E20
If the Z FLAG is set (the count ran out), JUMP back to 6DE8H to switch the key names.
6E22
GOSUB to 002BH, the ROM's keyboard scan: Register A = a key, or 00H for none.
6E25
CP 01H FE 01
Compare Register A against 01H, the code of BREAK.
6E27
If the Z FLAG is set (BREAK), JUMP to 685DH to end FED.
6E2A
CP 0DH FE 0D
Compare Register A against 0DH, ENTER, the key that goes on.
6E2C
If the NZ FLAG is set (no key or another key), JUMP back to 6E1CH.
6E2E
RET C9
RETurn after ENTER, with the error text still on the screen.
6E2F-6E57
DEFB 9CH, 90H, 95H, 95H, 94H, 8FH, 8EH, 8AH, 96H, 90H, 92H, 95H, 93H, 8FH, 94H, 96H, 92H, 95H, 95H, 97H, 99H, 98H, 99H, 98H, 95H, 97H, 92H, 98H, 94H, 93H, 8FH, 98H, 96H, 93H, 95H, 9AH, 8FH, 8BH, 99H, 99H, 94H 9C 90 95 95 94 8F 8E 8A 96 90 92 95 93 8F 94 96 92 95 95 97 99 98 99 98 95 97 92 98 94 93 8F 98 96 93 95 9A 8F 8B 99 99 94
6E2FH-6E57H: the low bytes of the places on row 6 (3D80H-3DBFH) where the messages of the errors 00H-28H start, so that each is in the middle of the row; 6DCBH takes the byte at 6E2FH + the error number. For a higher number the byte comes from the code after the table.

6E58H - The Help Screen

ENTER alone shows the list of the commands at 5C0EH in place of the screen and blinks the word ENTER on its last row until ENTER is pressed; the screen as it was comes back, since 6E96H exchanges the two.

6E58
GOSUB to 6E96H to exchange video memory with the help screen at 5C0EH.
6E5B
LD HL,6029H 21 29 60
Point Register Pair HL to 6029H, the count of the passes to the next blink.
6E5E
LD (HL),64H 36 64
Store 64H at Register Pair HL (6029H): 100 passes to the next blink. 6E85H comes back here.
6E60
LD BC,602AH 01 2A 60
Point Register Pair BC to 602AH, the phase of the blink.
6E63
LD A,(BC) 0A
Fetch the phase at Register Pair BC (602AH) into Register A.
6E64
XOR 01H EE 01
Flip bit 0 of Register A (XOR 01H): the Z FLAG when the word goes.
6E66
LD (BC),A 02
Store Register A (the new phase) at Register Pair BC (602AH).
6E67
If the Z FLAG is set (the word goes), JUMP to 6E76H.
6E69
LD HL,3CE9H 21 E9 3C
Point Register Pair HL to 3CE9H, the word ENTER in row 3 of the help screen.
6E6C
LD DE,3FD3H 11 D3 3F
Point Register Pair DE to 3FD3H, the word ENTER of the last row.
6E6F
LD BC,0005H 01 05 00
Load Register Pair BC with 0005H, the five letters.
6E72
LDIR ED B0
Copy Register Pair BC (5) bytes from Register Pair HL to Register Pair DE: ENTER is shown.
6E74
JUMP to 6E81H to count the passes and look at the keys.
6E76
LD HL,3FF6H 21 F6 3F
Point Register Pair HL to 3FF6H, five spaces at the end of the last row.
6E79
LD DE,3FD3H 11 D3 3F
Point Register Pair DE to 3FD3H, the word ENTER of the last row.
6E7C
LD BC,0005H 01 05 00
Load Register Pair BC with 0005H, the five letters.
6E7F
LDIR ED B0
Copy Register Pair BC (5) spaces from Register Pair HL to Register Pair DE: ENTER is gone.
6E81
LD HL,6029H 21 29 60
Point Register Pair HL to 6029H, the count of the passes. 6E8DH loops back here.
6E84
DEC (HL) 35
DECrement the count at Register Pair HL (6029H).
6E85
If the Z FLAG is set (the count ran out), JUMP back to 6E5EH to switch the word.
6E88
GOSUB to 002BH, the ROM's keyboard scan: Register A = a key, or 00H for none.
6E8B
CP 0DH FE 0D
Compare Register A against 0DH, ENTER; BREAK and the other keys are passed over.
6E8D
If the NZ FLAG is set (not ENTER), JUMP back to 6E81H.
6E90
GOSUB to 6E96H to exchange the help screen and video memory again: the record is back.
6E93
JUMP back to 60ADH, the command loop, with the record shown.

6E96H - Exchange the Help Screen; BREAK While Printing

6E96H exchanges the 1024 bytes of video memory with the help screen at 5C0EH, so a second call puts both back. 6EB2H runs after every character sent to the printer: when BREAK is held (row 6 of the keyboard matrix, bit 2), P sends 0DH and D shows the record that was shown before, and both end at 684FH.

6E96
LD HL,3C00H 21 00 3C
Point Register Pair HL to 3C00H, video memory.
6E99
LD IX,5C0EH DD 21 0E 5C
Point Index Register IX to 5C0EH, the help screen.
6E9D
LD BC,0400H 01 00 04
Load Register Pair BC with 0400H, the 1024 bytes of a screen.
6EA0
LD D,(HL) 56
Fetch the byte of video memory at Register Pair HL into Register D. 6EAEH loops back here.
6EA1
LD A,(IX+00H) DD 7E 00
Fetch the byte of the help screen at Index Register IX +00H into Register A.
6EA4
LD (HL),A 77
Store Register A at Register Pair HL: the help screen's byte is shown.
6EA5
LD (IX+00H),D DD 72 00
Store Register D at Index Register IX +00H: the screen's byte is kept in its place.
6EA8
INC HL 23
INCrement Register Pair HL to the next byte of video memory.
6EA9
INC IX DD 23
INCrement Index Register IX to the next byte of the help screen.
6EAB
DEC BC 0B
DECrement Register Pair BC, the count of the bytes left.
6EAC
LD A,B 78
Copy Register B into Register A, to test Register Pair BC for zero.
6EAD
OR C B1
OR Register C into Register A: the Z FLAG when Register Pair BC is 0000H.
6EAE
If the NZ FLAG is set (bytes left), JUMP back to 6EA0H.
6EB1
RET C9
RETurn with the screen and the help screen exchanged.
6EB2
GOSUB to 655FH to save every register and run the rest of this routine as a subroutine. 6F98H jumps here after each character printed.
6EB5
LD HL,3840H 21 40 38
Point Register Pair HL to 3840H, row 6 of the keyboard matrix: ENTER, CLEAR, BREAK and the arrows.
6EB8
LD A,(HL) 7E
Fetch the keys of row 6 at Register Pair HL into Register A.
6EB9
BIT 2,A CB 57
Test bit 2 of Register A, the BREAK key in row 6 of the matrix.
6EBB
RET Z C8
If the Z FLAG is set (BREAK is not held), RETurn to 6573H: printing goes on.
6EBC
LD A,(6013H) 3A 13 60
Fetch the state from 6013H into Register A: 11H for P, 12H for D.
6EBF
CP 11H FE 11
Compare Register A (the state) against 11H, the command P.
6EC1
If the Z FLAG is set (P), JUMP to 6ED1H to end the printed line.
6EC3
LD BC,(6023H) ED 4B 23 60
Fetch the record that was shown before D from 6023H-6024H into Register Pair BC.
6EC7
LD (6021H),BC ED 43 21 60
Store Register Pair BC (that record) at 6021H-6022H.
6ECB
GOSUB to 6CC8H to read the record of Register Pair BC into the edit buffer and show it.
6ECE
JUMP to 684FH to clear the command line and go back to the loop; 60ADH sets the stack again.
6ED1
LD A,0DH 3E 0D
Load Register A with 0DH, the carriage return, to end the line on the printer.
6ED3
GOSUB to 003BH, the ROM's output of the character in Register A to the printer.
6ED6
JUMP to 684FH to clear the command line and go back to the loop.

6ED9H - Print the Edit Buffer

P and D print the record in the edit buffer: the title (name, drive, record in decimal and in hex) in the middle of the line, a blank line, the heading of the columns, a line of 73 equals signs, then 16 lines, each with the 16 bytes as characters (a period for the codes below 20H and from 7FH up), the offset of the row between < and >, and the 16 bytes in hex with two more spaces in the middle; a blank line ends it. Every line ends with a space and 0DH.

6ED9
GOSUB to 67DBH to take the cursors off the screen.
6EDC
GOSUB to 6FBBH to write the title of the record at 5BDCH: Register A = its length less 1DH, Register Pair DE = 5BDCH.
6EDF
PUSH AF F5
Save Register Pair AF (the length less 1DH) to the stack.
6EE0
LD B,A 47
Copy Register A (the length less 1DH) into Register B.
6EE1
LD A,2DH 3E 2D
Load Register A with 2DH: 45, the room the title is centred in, less 1DH.
6EE3
SUB B 90
SUBtract Register B from Register A: the spaces left over.
6EE4
SRA A CB 2F
Shift Register A right, keeping bit 7 (SRA): half of them go before the title.
6EE6
LD B,A 47
Copy Register A (the spaces before the title) into Register B.
6EE7
LD A,20H 3E 20
Load Register A with 20H, a space. 6EECH loops back here.
6EE9
GOSUB to 6F92H to send Register A (20H) to the printer.
6EEC
DECrement Register B and JUMP back to 6EE7H while it is not zero.
6EEE
POP AF F1
Restore Register Pair AF from the stack: the length less 1DH.
6EEF
ADD A,1DH C6 1D
ADD 1DH to Register A: the length of the title.
6EF1
LD B,A 47
Copy Register A (the length) into Register B.
6EF2
LD A,(DE) 1A
Fetch the character of the title at Register Pair DE into Register A. 6EF7H loops back here.
6EF3
GOSUB to 6F92H to send Register A to the printer.
6EF6
INC DE 13
INCrement Register Pair DE to the next character of the title.
6EF7
DECrement Register B and JUMP back to 6EF2H while it is not zero.
6EF9
GOSUB to 6F8DH to send a space and 0DH, the end of the title line.
6EFC
GOSUB to 6F8DH to send a space and 0DH, a blank line.
6EFF
LD HL,5A9BH 21 9B 5A
Point Register Pair HL to 5A9BH, the heading of the columns.
6F02
LD B,49H 06 49
Load Register B with 49H, the 73 characters of the heading.
6F04
LD A,(HL) 7E
Fetch the character of the heading at Register Pair HL into Register A. 6F09H loops back here.
6F05
GOSUB to 6F92H to send Register A to the printer.
6F08
INC HL 23
INCrement Register Pair HL to the next character of the heading.
6F09
DECrement Register B and JUMP back to 6F04H while it is not zero.
6F0B
GOSUB to 6F8DH to send a space and 0DH, the end of the heading.
6F0E
LD B,49H 06 49
Load Register B with 49H, the 73 characters of the line under the heading.
6F10
LD A,3DH 3E 3D
Load Register A with 3DH, the equals sign. 6F15H loops back here.
6F12
GOSUB to 6F92H to send Register A (3DH) to the printer.
6F15
DECrement Register B and JUMP back to 6F10H while it is not zero.
6F17
GOSUB to 6F8DH to send a space and 0DH, the end of the line of equals signs.
6F1A
LD HL,5262H 21 62 52
Point Register Pair HL to 5262H, the edit buffer.
6F1D
LD B,10H 06 10
Load Register B with 10H, the 16 lines of the record.
6F1F
PUSH BC C5
Save Register Pair BC (the count of the lines) to the stack. 6F72H loops back here.
6F20
PUSH HL E5
Save Register Pair HL (the first byte of the line) to the stack.
6F21
LD B,10H 06 10
Load Register B with 10H, the 16 bytes of the line.
6F23
LD A,(HL) 7E
Fetch the byte of the record at Register Pair HL into Register A. 6F32H loops back here.
6F24
CP 20H FE 20
Compare Register A against 20H, the space: the CARRY FLAG for a control code.
6F26
If the CARRY FLAG is set (below 20H), JUMP to 6F2CH to print a period.
6F28
CP 7FH FE 7F
Compare Register A against 7FH: the CARRY FLAG for 20H-7EH.
6F2A
If the CARRY FLAG is set (a printable character), JUMP to 6F2EH to print it.
6F2C
LD A,2EH 3E 2E
Load Register A with 2EH, the period printed for a byte that is not a character.
6F2E
GOSUB to 6F92H to send Register A to the printer.
6F31
INC HL 23
INCrement Register Pair HL to the next byte of the line.
6F32
DECrement Register B and JUMP back to 6F23H while it is not zero.
6F34
POP HL E1
Restore Register Pair HL from the stack: the first byte of the line, for the hex part.
6F35
GOSUB to 6F89H to send a space to the printer.
6F38
GOSUB to 6F89H to send a second space to the printer.
6F3B
LD A,3CH 3E 3C
Load Register A with 3CH, the character before the offset.
6F3D
GOSUB to 6F92H to send Register A (3CH) to the printer.
6F40
PUSH HL E5
Save Register Pair HL (the first byte of the line) to the stack.
6F41
LD DE,5262H 11 62 52
Point Register Pair DE to 5262H, the start of the edit buffer.
6F44
OR A B7
OR Register A with itself to clear the CARRY FLAG for the SBC.
6F45
SBC HL,DE ED 52
SUBtract Register Pair DE (5262H) from Register Pair HL: Register L = the offset of the line.
6F47
LD A,L 7D
Copy Register L (the offset of the line) into Register A.
6F48
POP HL E1
Restore Register Pair HL from the stack: the first byte of the line.
6F49
GOSUB to 6F78H to send Register A (the offset) to the printer as two hex digits.
6F4C
LD A,3EH 3E 3E
Load Register A with 3EH, the character after the offset.
6F4E
GOSUB to 6F92H to send Register A (3EH) to the printer.
6F51
GOSUB to 6F89H to send a space to the printer.
6F54
GOSUB to 6F89H to send a second space to the printer.
6F57
LD B,10H 06 10
Load Register B with 10H, the 16 bytes of the line.
6F59
LD A,(HL) 7E
Fetch the byte of the record at Register Pair HL into Register A. 6F6CH loops back here.
6F5A
GOSUB to 6F78H to send Register A to the printer as two hex digits.
6F5D
GOSUB to 6F89H to send a space after the byte.
6F60
LD A,B 78
Copy Register B (the bytes left in the line) into Register A.
6F61
CP 09H FE 09
Compare Register A against 09H: the Z FLAG after the eighth byte.
6F63
If the NZ FLAG is set (not after the eighth), JUMP to 6F6BH.
6F65
GOSUB to 6F89H to send a space in the middle of the line.
6F68
GOSUB to 6F89H to send a second space in the middle of the line.
6F6B
INC HL 23
INCrement Register Pair HL to the next byte of the line.
6F6C
DECrement Register B and JUMP back to 6F59H while it is not zero.
6F6E
GOSUB to 6F8DH to send a space and 0DH, the end of the line.
6F71
POP BC C1
Restore Register Pair BC from the stack: the count of the lines.
6F72
DECrement Register B and JUMP back to 6F1FH while it is not zero: the next line.
6F74
GOSUB to 6F8DH to send a space and 0DH, a blank line after the record.
6F77
RET C9
RETurn with the record printed, 22 lines in all with the blank line before it.
6F78
GOSUB to 655FH to save every register and run the rest of this routine as a subroutine.
6F7B
GOSUB to 6880H to turn Register A into two hex digits: Register L the first, Register H the second.
6F7E
LD A,L 7D
Copy Register L (the first digit) into Register A.
6F7F
GOSUB to 6F92H to send Register A (the first digit) to the printer.
6F82
LD A,H 7C
Copy Register H (the second digit) into Register A.
6F83
JUMP to 6F92H to send Register A (the second digit) to the printer and return.
6F85
LD A,0CH 3E 0C
Load Register A with 0CH, top of form. O comes here (6387H).
6F87
JUMP to 6F92H to send Register A (0CH) to the printer.
6F89
LD A,20H 3E 20
Load Register A with 20H, a space, for the printer.
6F8B
JUMP to 6F92H to send Register A (20H) to the printer.
6F8D
GOSUB to 6F89H to send a space to the printer before the end of the line.
6F90
LD A,0DH 3E 0D
Load Register A with 0DH, the carriage return.
6F92
GOSUB to 655FH to save every register and run the rest of this routine as a subroutine.
6F95
GOSUB to 003BH, the ROM's output of the character in Register A to the printer; it waits while the printer is busy.
6F98
JUMP to 6EB2H to look for BREAK; it returns to the caller when BREAK is not held.

6F9BH - The Printer and the Title

6F9BH asks the printer for its status through the ROM: when it is not ready, Printer Not Ready is shown with the prompt, the record is shown again and the command ends with an asterisk. 6FBBH writes the title of the record at 5BDCH: the name, Drive and the drive digit, Record and the number in decimal, X and the number in four hex digits between apostrophes.

6F9B
GOSUB to 655FH to save every register and run the rest of this routine as a subroutine.
6F9E
XOR A AF
Set Register A to 00H by XOR A with itself, for the control request.
6F9F
LD DE,4025H 11 25 40
Point Register Pair DE to 4025H, the printer's device control block.
6FA2
GOSUB to 0023H, the ROM's control request (Register B = 04H inside it) to the device at Register Pair DE: the Z FLAG when the printer is ready.
6FA5
RET Z C8
If the Z FLAG is set (the printer is ready), RETurn to 6573H.
6FA6
GOSUB to 654EH to clear the screen for the text of the error.
6FA9
LD DE,3D98H 11 98 3D
Point Register Pair DE to 3D98H, row 6, column 24 of the screen.
6FAC
LD HL,5AE5H 21 E5 5A
Point Register Pair HL to 5AE5H, the text Printer Not Ready.
6FAF
GOSUB to 65E5H to show the text at Register Pair HL at Register Pair DE.
6FB2
GOSUB to 6DD6H to show Press <ENTER> to continue, <BREAK> to abort and wait for ENTER (BREAK ends FED).
6FB5
GOSUB to 6B4EH to copy the screen image to video memory: the record is shown again.
6FB8
JUMP to 704AH to show an asterisk in the command line and go back to the loop.
6FBB
LD DE,5BDCH 11 DC 5B
Point Register Pair DE to 5BDCH, the place of the title.
6FBE
PUSH DE D5
Save Register Pair DE (5BDCH) to the stack, to return it.
6FBF
LD B,00H 06 00
Load Register B with 00H, the count of the characters of the name.
6FC1
LD HL,59C8H 21 C8 59
Point Register Pair HL to 59C8H, the name of the file as shown, ended by a colon.
6FC4
LD A,(HL) 7E
Fetch the character of the name at Register Pair HL into Register A. 6FCDH loops back here.
6FC5
CP 3AH FE 3A
Compare Register A against 3AH, the colon after the name.
6FC7
If the Z FLAG is set (the colon), JUMP to 6FCFH.
6FC9
LD (DE),A 12
Store Register A (the character) at Register Pair DE in the title.
6FCA
INC DE 13
INCrement Register Pair DE to the next place of the title.
6FCB
INC HL 23
INCrement Register Pair HL to the next character of the name.
6FCC
INC B 04
INCrement Register B, the count of the characters of the name.
6FCD
JUMP back to 6FC4H for the next character of the name.
6FCF
PUSH BC C5
Save Register Pair BC (Register B, the length of the name) to the stack.
6FD0
INC HL 23
INCrement Register Pair HL past the colon, to the drive digit.
6FD1
PUSH HL E5
Save Register Pair HL (the drive digit) to the stack.
6FD2
LD HL,5A84H 21 84 5A
Point Register Pair HL to 5A84H, three spaces, Drive and a space.
6FD5
LD BC,0009H 01 09 00
Load Register Pair BC with 0009H, the nine characters.
6FD8
LDIR ED B0
Copy Register Pair BC (9) bytes from Register Pair HL to Register Pair DE in the title.
6FDA
POP HL E1
Restore Register Pair HL from the stack: the drive digit.
6FDB
LD A,(HL) 7E
Fetch the drive digit at Register Pair HL into Register A.
6FDC
LD (DE),A 12
Store Register A (the drive digit) at Register Pair DE in the title.
6FDD
INC DE 13
INCrement Register Pair DE to the next place of the title.
6FDE
LD HL,5A8DH 21 8D 5A
Point Register Pair HL to 5A8DH, three spaces, Record and a space.
6FE1
LD C,0AH 0E 0A
Load Register C with 0AH, the ten characters (Register B is 00H after the LDIR).
6FE3
LDIR ED B0
Copy Register Pair BC (10) bytes from Register Pair HL to Register Pair DE in the title.
6FE5
PUSH DE D5
Save Register Pair DE (the place of the decimal number) to the stack.
6FE6
LD DE,(6021H) ED 5B 21 60
Fetch the number of the record from 6021H-6022H into Register Pair DE.
6FEA
GOSUB to 68A5H to write Register Pair DE in decimal at 68F9H: Register B = the count of the digits, Register Pair HL = 68F9H.
6FED
POP DE D1
Restore Register Pair DE from the stack: the place of the decimal number.
6FEE
LD C,B 48
Copy Register B (the count of the digits) into Register C, to return it.
6FEF
LD A,(HL) 7E
Fetch the digit at Register Pair HL into Register A. 6FF3H loops back here.
6FF0
LD (DE),A 12
Store Register A (the digit) at Register Pair DE in the title.
6FF1
INC DE 13
INCrement Register Pair DE to the next place of the title.
6FF2
INC HL 23
INCrement Register Pair HL to the next digit.
6FF3
DECrement Register B and JUMP back to 6FEFH while it is not zero.
6FF5
LD A,C 79
Copy Register C (the count of the digits) into Register A.
6FF6
POP BC C1
Restore Register Pair BC from the stack: Register B = the length of the name.
6FF7
ADD A,B 80
ADD Register B (the length of the name) to Register A: the parts of the title that vary.
6FF8
PUSH AF F5
Save Register Pair AF (that length) to the stack.
6FF9
LD HL,5A97H 21 97 5A
Point Register Pair HL to 5A97H, two spaces, X and the apostrophe.
6FFC
LD BC,0004H 01 04 00
Load Register Pair BC with 0004H, the four characters.
6FFF
LDIR ED B0
Copy Register Pair BC (4) bytes from Register Pair HL to Register Pair DE in the title.
7001
PUSH DE D5
Save Register Pair DE (the place of the hex number) to the stack.
7002
LD DE,(6021H) ED 5B 21 60
Fetch the number of the record from 6021H-6022H into Register Pair DE.
7006
GOSUB to 68FEH to write Register Pair DE as four hex digits at 68F9H; Index Register IX = 68F9H.
7009
POP DE D1
Restore Register Pair DE from the stack: the place of the hex number.
700A
LD B,04H 06 04
Load Register B with 04H, the four hex digits.
700C
LD A,(IX+00H) DD 7E 00
Fetch the digit at Index Register IX +00H into Register A. 7013H loops back here.
700F
LD (DE),A 12
Store Register A (the digit) at Register Pair DE in the title.
7010
INC IX DD 23
INCrement Index Register IX to the next digit.
7012
INC DE 13
INCrement Register Pair DE to the next place of the title.
7013
DECrement Register B and JUMP back to 700CH while it is not zero.
7015
LD A,27H 3E 27
Load Register A with 27H, the apostrophe that closes the hex number.
7017
LD (DE),A 12
Store Register A (27H) at Register Pair DE, the last character of the title.
7018
POP AF F1
Restore Register Pair AF from the stack: Register A = the length of the title less 1DH, the 29 characters that are always there.
7019
POP DE D1
Restore Register Pair DE from the stack: 5BDCH, the title.
701A
RET C9
RETurn with Register A the length less 1DH and Register Pair DE = 5BDCH.

701BH - F and C: Take the String

701BH opens the input box of seven rows for F and C and moves the place in the command line past the letter. After ENTER or the last place, F (702BH) turns the pairs of hex digits into bytes at 6031H, refusing an odd count, and C (7073H) takes the characters as typed; the count goes to 6030H and the search starts at the cursor (708AH). 704AH shows an asterisk at the command and forgets the last search.

701B
GOSUB to 6D30H to clear the input box of the 256 byte mode at 3DBDH.
701E
LD A,07H 3E 07
Load Register A with 07H, the rows of the input box.
7020
GOSUB to 6D06H to draw the input box of Register A (7) rows and put the cursor in it (3FCAH in the 128 byte mode).
7023
LD HL,(6016H) 2A 16 60
Fetch the place in the command line from 6016H-6017H into Register Pair HL: the letter just stored.
7026
INC HL 23
INCrement Register Pair HL past the letter: the characters typed follow it.
7027
LD (6016H),HL 22 16 60
Store Register Pair HL (the next place) at 6016H-6017H.
702A
RET C9
RETurn with the box drawn for the string of F or C.
702B
LD HL,(6016H) 2A 16 60
Fetch the place in the command line from 6016H-6017H into Register Pair HL: the 0DH after the digits.
702E
LD DE,5962H 11 62 59
Point Register Pair DE to 5962H, the start of the command line (the letter F).
7031
OR A B7
OR Register A with itself to clear the CARRY FLAG for the SBC.
7032
SBC HL,DE ED 52
SUBtract Register Pair DE (5962H) from Register Pair HL: Register L = the count of the digits plus one.
7034
BIT 0,L CB 45
Test bit 0 of Register L: clear when the count of the digits is odd.
7036
If the Z FLAG is set (an odd count of hex digits), JUMP to 704AH to show an asterisk.
7038
GOSUB to 705FH to take the block off the cursor and point Register Pair HL to 5962H, Register Pair DE to 6030H, Register B = 00H.
703B
PUSH DE D5
Save Register Pair DE (6030H, the place of the count) to the stack.
703C
INC HL 23
INCrement Register Pair HL to the next digit of the command line. 7048H loops back here.
703D
INC DE 13
INCrement Register Pair DE to the next place of the string at 6031H.
703E
LD A,(HL) 7E
Fetch the character at Register Pair HL into Register A.
703F
CP 0DH FE 0D
Compare Register A against 0DH, the end of the digits.
7041
If the Z FLAG is set (the end), JUMP to 7084H to store the count.
7043
GOSUB to 67F2H to take the two hex digits at Register Pair HL as a byte in Register A; Register Pair HL ends at the second digit.
7046
LD (DE),A 12
Store Register A (the byte) at Register Pair DE in the string.
7047
INC B 04
INCrement Register B, the count of the bytes.
7048
JUMP back to 703CH for the next pair of digits.
704A
GOSUB to 679FH to clear the command line, point 6016H at 5962H and set the state to 00H.
704D
LD HL,(6016H) 2A 16 60
Fetch the place in the command line from 6016H-6017H into Register Pair HL: 5962H.
7050
LD (HL),2AH 36 2A
Store 2AH, the asterisk, at Register Pair HL (5962H): the command cursor shows it under its block.
7052
GOSUB to 6D30H to clear the input box of the 256 byte mode.
7055
GOSUB to 6870H to clear the input line of the 128 byte mode.
7058
XOR A AF
Set Register A to 00H by XOR A with itself, for the cell 6030H.
7059
LD (6030H),A 32 30 60
Store Register A (00H) at 6030H: the last search is forgotten, G now gives an asterisk.
705C
JUMP back to 60ADH, the command loop, with the asterisk shown.
705F
LD HL,(4020H) 2A 20 40
Fetch the cursor of the video from 4020H-4021H into Register Pair HL.
7062
LD (HL),20H 36 20
Store 20H, a space, at Register Pair HL: the place of the cursor in the box is cleared.
7064
GOSUB to 67C6H to put the cursor at the command of the display mode.
7067
LD DE,6030H 11 30 60
Point Register Pair DE to 6030H, the count of the string.
706A
LD HL,5962H 21 62 59
Point Register Pair HL to 5962H, the start of the command line.
706D
LD (6016H),HL 22 16 60
Store Register Pair HL (5962H) at 6016H-6017H: the place in the command line is its start again.
7070
LD B,00H 06 00
Load Register B with 00H, the count of the bytes of the string.
7072
RET C9
RETurn with Register Pair HL = 5962H, Register Pair DE = 6030H.
7073
GOSUB to 705FH to take the block off the cursor and point Register Pair HL to 5962H, Register Pair DE to 6030H.
7076
PUSH DE D5
Save Register Pair DE (6030H, the place of the count) to the stack.
7077
LD B,00H 06 00
Load Register B with 00H, the count of the characters.
7079
INC HL 23
INCrement Register Pair HL to the next character of the command line. 7082H loops back here.
707A
INC DE 13
INCrement Register Pair DE to the next place of the string at 6031H.
707B
LD A,(HL) 7E
Fetch the character at Register Pair HL into Register A.
707C
CP 0DH FE 0D
Compare Register A against 0DH, the end of the characters.
707E
If the Z FLAG is set (the end), JUMP to 7084H to store the count.
7080
LD (DE),A 12
Store Register A (the character, as typed) at Register Pair DE in the string.
7081
INC B 04
INCrement Register B, the count of the characters.
7082
JUMP back to 7079H for the next character of the string.
7084
POP HL E1
Restore Register Pair HL from the stack: 6030H.
7085
LD (HL),B 70
Store Register B (the count of the bytes of the string) at Register Pair HL (6030H).
7086
LD A,B 78
Copy Register B (the count of the string) into Register A.
7087
OR A B7
OR Register A with itself to set the Z FLAG for an empty string.
7088
If the Z FLAG is set (nothing typed), JUMP to 704AH to show an asterisk.

708AH - The Search for a String

The search starts at the byte at the cursor (G: at the byte after it): each record and the one after it are read (6CCFH), the first byte of the string is looked for to the end of the record and the rest is compared from there, running on into the next record when needed. The number of each record searched is shown; BREAK held stops it. When the string is found the record is shown with the cursor on its first byte; at the end of the file the last record is shown with the cursor on its last byte and an asterisk.

708A
GOSUB to 67DBH to take the cursors off the screen.
708D
GOSUB to 67C6H to put the cursor at the command of the display mode.
7090
LD A,07H 3E 07
Load Register A with 07H, the rows of the input box.
7092
GOSUB to 6D06H to draw the input box of Register A (7) rows again.
7095
LD HL,(601CH) 2A 1C 60
Fetch the address of the byte at the cursor from 601CH-601DH into Register Pair HL.
7098
LD DE,5262H 11 62 52
Point Register Pair DE to 5262H, the start of the edit buffer.
709B
XOR A AF
Set Register A to 00H by XOR A with itself, which also clears the CARRY FLAG for the SBC.
709C
SBC HL,DE ED 52
SUBtract Register Pair DE (5262H) from Register Pair HL: Register L = the offset of the cursor.
709E
LD A,L 7D
Copy Register L (the offset of the cursor) into Register A.
709F
DEC A 3D
DECrement Register A: the byte before the cursor, so that the search starts on the cursor's byte.
70A0
LD (602BH),A 32 2B 60
Store Register A at 602BH, the place before the first byte to look at. G comes here with the cursor's own offset (6460H).
70A3
LD BC,(6021H) ED 4B 21 60
Fetch the number of the record shown from 6021H-6022H into Register Pair BC.
70A7
LD (6023H),BC ED 43 23 60
Store Register Pair BC at 6023H-6024H, the record to show again.
70AB
GOSUB to 6CCFH to read the record of 6021H into the edit buffer and the next one into 5362H. 70EAH loops back here.
70AE
LD A,(602BH) 3A 2B 60
Fetch the place before the first byte to look at from 602BH into Register A.
70B1
INC A 3C
INCrement Register A: the offset of the first byte to look at.
70B2
LD E,A 5F
Copy Register A (the offset) into Register E.
70B3
LD D,00H 16 00
Load Register D with 00H: Register Pair DE = the offset.
70B5
NEG ED 44
Negate Register A: 256 less the offset, the bytes to look at (00H counts 256).
70B7
LD B,A 47
Copy Register A (the count of the bytes to look at) into Register B.
70B8
LD HL,5262H 21 62 52
Point Register Pair HL to 5262H, the start of the edit buffer.
70BB
ADD HL,DE 19
ADD Register Pair DE (the offset) to Register Pair HL: the first byte to look at.
70BC
LD IX,6030H DD 21 30 60
Point Index Register IX to 6030H, the count of the string; its bytes follow. 7150H comes back here.
70C0
LD A,(IX+01H) DD 7E 01
Fetch the first byte of the string at Index Register IX +01H (6031H) into Register A.
70C3
CP (HL) BE
Compare Register A against the byte at Register Pair HL: the Z FLAG when the first byte matches. 70C8H loops back here.
70C4
If the Z FLAG is set (the first byte matches), JUMP to 70EDH to compare the rest.
70C7
INC HL 23
INCrement Register Pair HL to the next byte of the record.
70C8
DECrement Register B and JUMP back to 70C3H while it is not zero.
70CA
GOSUB to 6EB2H to look at the BREAK key: held, the search stops through 684FH. 7153H comes here.
70CD
LD A,FFH 3E FF
Load Register A with FFH, the place before byte 00H.
70CF
LD (602BH),A 32 2B 60
Store Register A (FFH) at 602BH: the next record is searched from its byte 00H.
70D2
LD HL,(6025H) 2A 25 60
Fetch the number of the last record from 6025H-6026H into Register Pair HL. G comes here when the cursor is on the last byte (6463H).
70D5
LD BC,(6021H) ED 4B 21 60
Fetch the number of the record searched from 6021H-6022H into Register Pair BC.
70D9
OR A B7
OR Register A with itself to clear the CARRY FLAG for the SBC.
70DA
SBC HL,BC ED 42
SUBtract Register Pair BC from Register Pair HL: the Z FLAG when the last record has been searched.
70DC
If the Z FLAG is set (the end of the file), JUMP to 712CH: the string is not found.
70DF
INC BC 03
INCrement Register Pair BC to the next record.
70E0
LD (6021H),BC ED 43 21 60
Store Register Pair BC (the next record) at 6021H-6022H.
70E4
LD HL,3C3DH 21 3D 3C
Point Register Pair HL to 3C3DH, the place of the record number on the screen.
70E7
GOSUB to 6A24H to show the number of the record being searched.
70EA
JUMP back to 70ABH to search the next record.
70ED
PUSH BC C5
Save Register Pair BC (Register B, the bytes left in the record) to the stack.
70EE
LD B,(IX+00H) DD 46 00
Fetch the count of the string from Index Register IX +00H (6030H) into Register B.
70F1
DEC B 05
DECrement Register B: the bytes of the string after the first.
70F2
If the Z FLAG is set (a string of one byte), JUMP to 7105H: it is found.
70F5
LD D,H 54
Copy Register H into Register D, the high byte of the place of the first byte.
70F6
LD E,L 5D
Copy Register L into Register E: Register Pair DE = the place of the first byte.
70F7
INC DE 13
INCrement Register Pair DE to the byte after it, which may be in the next record at 5362H.
70F8
LD C,(IX+02H) DD 4E 02
Fetch the next byte of the string at Index Register IX +02H into Register C. 7103H loops back here.
70FB
LD A,(DE) 1A
Fetch the byte of the record at Register Pair DE into Register A.
70FC
CP C B9
Compare Register A against Register C (the byte of the string).
70FD
If the NZ FLAG is set (they differ), JUMP to 7145H to go on from the byte after the first.
7100
INC IX DD 23
INCrement Index Register IX: the next byte of the string comes at +02H.
7102
INC DE 13
INCrement Register Pair DE to the next byte of the record.
7103
DECrement Register B and JUMP back to 70F8H while it is not zero.
7105
LD DE,5262H 11 62 52
Point Register Pair DE to 5262H, the start of the edit buffer: the string is found at Register Pair HL.
7108
LD (601CH),HL 22 1C 60
Store Register Pair HL (the first byte of the string) at 601CH-601DH: the cursor goes there.
710B
XOR A AF
Set Register A to 00H by XOR A with itself, which also clears the CARRY FLAG for the SBC.
710C
LD (6013H),A 32 13 60
Store Register A (00H) at 6013H: no command under way.
710F
SBC HL,DE ED 52
SUBtract Register Pair DE (5262H) from Register Pair HL: Register L = the offset of the string.
7111
LD A,L 7D
Copy Register L (the offset) into Register A.
7112
LD (602BH),A 32 2B 60
Store Register A (the offset of the string found) at 602BH.
7115
LD BC,(6021H) ED 4B 21 60
Fetch the number of the record found from 6021H-6022H into Register Pair BC.
7119
LD (6023H),BC ED 43 23 60
Store Register Pair BC (the record found) at 6023H-6024H.
711D
POP BC C1
Restore Register Pair BC from the stack: the count saved at 70EDH, no longer needed.
711E
GOSUB to 7138H to show the record found with the cursor and keep the input box on the screen.
7121
LD HL,5962H 21 62 59
Point Register Pair HL to 5962H, the letter of the command (C or F).
7124
LD A,(HL) 7E
Fetch the letter at Register Pair HL into Register A.
7125
GOSUB to 679FH to clear the command line and set the state to 00H.
7128
LD (HL),A 77
Store Register A (the letter) at Register Pair HL (5962H): the command line shows the last command.
7129
JUMP back to 60ADH, the command loop, with the cursor on the string found.
712C
LD HL,5361H 21 61 53
Point Register Pair HL to 5361H, the last byte of the edit buffer.
712F
LD (601CH),HL 22 1C 60
Store Register Pair HL (5361H) at 601CH-601DH: the cursor goes to byte FFH.
7132
GOSUB to 7156H to read and show the last record of the file.
7135
JUMP to 704AH to show an asterisk in the command line: not found.
7138
GOSUB to 6D46H to keep the characters of the input box at 5200H.
713B
LD BC,(6021H) ED 4B 21 60
Fetch the number of the record from 6021H-6022H into Register Pair BC.
713F
GOSUB to 6CC8H to read the record of Register Pair BC into the edit buffer and show it.
7142
JUMP to 6D78H to put the input box back on the screen and return.
7145
POP BC C1
Restore Register Pair BC from the stack: Register B, the bytes left in the record.
7146
DEC B 05
DECrement Register B, for the byte passed over.
7147
INC HL 23
INCrement Register Pair HL to the byte after the one that matched the first.
7148
LD DE,5362H 11 62 53
Point Register Pair DE to 5362H, the end of the edit buffer plus one.
714B
EX DE,HL EB
Exchange Register Pair DE and Register Pair HL: Register Pair HL = 5362H.
714C
OR A B7
OR Register A with itself to clear the CARRY FLAG for the SBC.
714D
SBC HL,DE ED 52
SUBtract Register Pair DE (the next byte) from Register Pair HL (5362H): the Z FLAG at the end of the record.
714F
EX DE,HL EB
Exchange Register Pair DE and Register Pair HL: Register Pair HL = the next byte again.
7150
If the NZ FLAG is set (bytes left in the record), JUMP back to 70BCH to look for the first byte again.
7153
JUMP to 70CAH to go on with the next record of the file.
7156
LD BC,(6025H) ED 4B 25 60
Fetch the number of the last record from 6025H-6026H into Register Pair BC.
715A
LD (6021H),BC ED 43 21 60
Store Register Pair BC (the last record) at 6021H-6022H.
715E
GOSUB to 6CC8H to read the record of Register Pair BC into the edit buffer and show it.
7161
RET C9
RETurn with the last record of the file on the screen.
7162
LD H,00H 26 00
Load Register H with 00H, the high byte of the offset.
7164
LD A,(524AH) 3A 4A 52
Fetch the end of file byte from 524AH, +08H of the file control block, into Register A.
7167
LD L,A 6F
Copy Register A into Register L: Register Pair HL = the bytes used in the last record.
7168
OR A B7
OR Register A with itself to set the Z FLAG when it is 00H, a full record.
7169
If the NZ FLAG is set (a part record), JUMP to 716CH.
716B
INC H 24
INCrement Register H: Register Pair HL = 0100H, all 256 bytes used.
716C
LD DE,5261H 11 61 52
Point Register Pair DE to 5261H, the byte before the edit buffer.
716F
ADD HL,DE 19
ADD Register Pair DE (5261H) to Register Pair HL: the last byte of the file in the edit buffer.
7170
LD (601CH),HL 22 1C 60
Store Register Pair HL (the last byte) at 601CH-601DH, the cursor.
7173
RET C9
RETurn with the cursor on the last byte of the file.

7174H - L: Locate a Load Address

L runs through the load module from record 0, block by block: a load block (type 01H) whose addresses hold the one at 6031H gives the record and the byte, shown with the cursor on it; the other records of a load module are skipped by their length. The transfer address record (02H) ends the search with Load address not found; any other type byte gives File not load module format. G goes on from the block after the one found (7188H). BREAK held shows the record that was shown before.

7174
GOSUB to 67DBH to take the cursors off the screen.
7177
LD BC,0000H 01 00 00
Load Register Pair BC with 0000H, record 0 and byte 00H.
717A
LD (602DH),BC ED 43 2D 60
Store Register Pair BC (0000H) at 602DH-602EH: the scan starts in record 0.
717E
LD (602BH),BC ED 43 2B 60
Store Register Pair BC (0000H) at 602BH-602CH: the scan starts at byte 00H.
7182
GOSUB to 72FEH to copy the buffer of the file (5362H) to the edit buffer.
7185
GOSUB to 744EH to keep a copy of the edit buffer at 5462H.
7188
LD BC,(602DH) ED 4B 2D 60
Fetch the record of the scan from 602DH-602EH into Register Pair BC. G comes here for L (6452H).
718C
GOSUB to 72D1H to read the record of Register Pair BC into the edit buffer and show its number; it returns with the other register set.
718F
LD HL,5262H 21 62 52
Point Register Pair HL to 5262H, the edit buffer.
7192
LD BC,(602BH) ED 4B 2B 60
Fetch the place of the scan from 602BH-602CH into Register Pair BC (Register B 00H).
7196
ADD HL,BC 09
ADD Register Pair BC (the offset) to Register Pair HL: the byte of the scan.
7197
PUSH DE D5
Save Register Pair DE to the stack across the key scan. 7202H, 724CH and 720BH come back here.
7198
GOSUB to 002BH, the ROM's keyboard scan: Register A = a key, or 00H for none.
719B
POP DE D1
Restore Register Pair DE from the stack, as it was before the scan.
719C
CP 01H FE 01
Compare Register A against 01H, the code of BREAK.
719E
If the NZ FLAG is set (no BREAK), JUMP to 71B1H to look at the type byte.
71A0
XOR A AF
Set Register A to 00H by XOR A with itself, for the cells below.
71A1
LD (6030H),A 32 30 60
Store Register A (00H) at 6030H: the search is forgotten.
71A4
LD (6013H),A 32 13 60
Store Register A (00H) at 6013H: no command under way.
71A7
LD BC,(6021H) ED 4B 21 60
Fetch the record that was shown from 6021H-6022H into Register Pair BC.
71AB
GOSUB to 6CC8H to read the record of Register Pair BC into the edit buffer and show it.
71AE
JUMP back to 60ADH, the command loop, after BREAK stopped L.
71B1
LD A,(HL) 7E
Fetch the type byte at Register Pair HL into Register A.
71B2
CP 02H FE 02
Compare Register A against 02H, the transfer address record that ends a load module.
71B4
If the NZ FLAG is set (another type), JUMP to 71D6H.
71B6
LD BC,(6021H) ED 4B 21 60
Fetch the record that was shown from 6021H-6022H into Register Pair BC.
71BA
GOSUB to 6C9BH to read the record of Register Pair BC into the edit buffer and build its display.
71BD
GOSUB to 654EH to clear the screen for the text of the error.
71C0
LD HL,5B27H 21 27 5B
Point Register Pair HL to 5B27H, the text Load address not found.
71C3
LD DE,3D96H 11 96 3D
Point Register Pair DE to 3D96H, row 6, column 22 of the screen.
71C6
GOSUB to 65E5H to show the text at Register Pair HL at Register Pair DE.
71C9
GOSUB to 6DD6H to show the prompt Press <ENTER> and wait for ENTER (BREAK ends FED).
71CC
GOSUB to 6B4EH to copy the screen image to video memory: the record is shown again.
71CF
XOR A AF
Set Register A to 00H by XOR A with itself, for the cell 6030H.
71D0
LD (6030H),A 32 30 60
Store Register A (00H) at 6030H: G has nothing to repeat.
71D3
JUMP to 704AH to show an asterisk in the command line.
71D6
CP 01H FE 01
Compare Register A against 01H, a load block.
71D8
If the Z FLAG is set (01H), JUMP to 720DH to see whether it holds the address.
71DA
CP 05H FE 05
Compare Register A against 05H, a module name record.
71DC
If the Z FLAG is set (05H), JUMP to 7202H to skip the record.
71DE
CP 07H FE 07
Compare Register A against 07H, another type of record of a load module.
71E0
If the Z FLAG is set (07H), JUMP to 7202H to skip the record.
71E2
CP 10H FE 10
Compare Register A against 10H, another type of record of a load module.
71E4
If the Z FLAG is set (10H), JUMP to 7202H to skip the record.
71E6
CP 1FH FE 1F
Compare Register A against 1FH, a copyright record.
71E8
If the Z FLAG is set (1FH), JUMP to 7202H to skip the record.
71EA
GOSUB to 745DH to put the copy of the edit buffer back from 5462H. 73A1H comes here for M.
71ED
LD HL,5AF6H 21 F6 5A
Point Register Pair HL to 5AF6H, the text File not load module format.
71F0
LD DE,3D93H 11 93 3D
Point Register Pair DE to 3D93H, row 6, column 19 of the screen.
71F3
GOSUB to 654EH to clear the screen. Z comes here with its own text (64AAH).
71F6
GOSUB to 65E5H to show the text at Register Pair HL at Register Pair DE.
71F9
GOSUB to 6DD6H to show the prompt Press <ENTER> and wait for ENTER (BREAK ends FED).
71FC
GOSUB to 6B4EH to copy the screen image to video memory: the record is shown again.
71FF
JUMP to 704AH to show an asterisk in the command line.
7202
GOSUB to 72ADH to move the scan on one byte, to the length byte, into Register A.
7205
GOSUB to 72AFH to move the scan on by Register A bytes: to the last byte of the record.
7208
GOSUB to 72ADH to move the scan on one byte, to the next type byte.
720B
JUMP back to 7197H to look at the next type byte.
720D
LD BC,(602DH) ED 4B 2D 60
Fetch the record of the scan from 602DH-602EH into Register Pair BC: the record where the block starts.
7211
LD (6023H),BC ED 43 23 60
Store Register Pair BC at 6023H-6024H, kept for G.
7215
GOSUB to 72ADH to move the scan on one byte, to the length byte, into Register A.
7218
SUB 02H D6 02
SUBtract 02H from Register A: the bytes of the block after the address.
721A
LD (602FH),A 32 2F 60
Store Register A (the count, 00H for 256) at 602FH.
721D
GOSUB to 72ADH to move the scan on one byte, to the low byte of the load address.
7220
LD E,A 5F
Copy Register A (the low byte) into Register E.
7221
PUSH DE D5
Save Register Pair DE to the stack across the next byte.
7222
GOSUB to 72ADH to move the scan on one byte, to the high byte of the load address.
7225
POP DE D1
Restore Register Pair DE from the stack: Register E the low byte.
7226
LD D,A 57
Copy Register A (the high byte) into Register D: Register Pair DE = the load address of the block.
7227
PUSH HL E5
Save Register Pair HL (the place of the high byte in the edit buffer) to the stack.
7228
LD H,D 62
Copy Register D (the high byte of the load address) into Register H.
7229
LD L,E 6B
Copy Register E into Register L: Register Pair HL = the load address.
722A
LD A,(602FH) 3A 2F 60
Fetch the count of the bytes of the block from 602FH into Register A.
722D
LD C,A 4F
Copy Register A (the count of the bytes) into Register C.
722E
LD B,00H 06 00
Load Register B with 00H: Register Pair BC = the count.
7230
OR A B7
OR Register A with itself to set the Z FLAG for a count of 00H, 256 bytes.
7231
DEC BC 0B
DECrement Register Pair BC: the count less one; DEC of a pair leaves the Z FLAG of the OR.
7232
If the NZ FLAG is set (a count of 1-255), JUMP to 7235H.
7234
INC B 04
INCrement Register B: Register Pair BC = 00FFH, 256 less one.
7235
ADD HL,BC 09
ADD Register Pair BC to Register Pair HL: the last address of the block.
7236
LD BC,(6031H) ED 4B 31 60
Fetch the address to find from 6031H-6032H into Register Pair BC.
723A
OR A B7
OR Register A with itself to clear the CARRY FLAG for the SBC.
723B
SBC HL,BC ED 42
SUBtract Register Pair BC (the address) from Register Pair HL (the last address of the block): the CARRY FLAG when the block ends below it.
723D
If the CARRY FLAG is set (the block ends below the address), JUMP to 7248H to skip it.
723F
LD H,D 62
Copy Register D (the high byte of the load address) into Register H.
7240
LD L,E 6B
Copy Register E into Register L: Register Pair HL = the load address of the block.
7241
OR A B7
OR Register A with itself to clear the CARRY FLAG for the SBC.
7242
SBC HL,BC ED 42
SUBtract Register Pair BC (the address) from Register Pair HL (the first address of the block).
7244
If the Z FLAG is set (the address is the first of the block), JUMP to 724FH.
7246
If the CARRY FLAG is set (the address is inside the block), JUMP to 7257H.
7248
POP HL E1
Restore Register Pair HL from the stack: the high byte of the load address in the edit buffer.
7249
GOSUB to 7291H to move the scan over the bytes of the block to the next type byte.
724C
JUMP to 7197H to look at the next type byte of the load module.
724F
POP HL E1
Restore Register Pair HL from the stack: the high byte of the load address.
7250
PUSH HL E5
Save Register Pair HL to the stack again, for 7274H.
7251
LD A,(602BH) 3A 2B 60
Fetch the place of the scan from 602BH into Register A.
7254
PUSH AF F5
Save Register Pair AF (the place) to the stack, for 7270H.
7255
JUMP to 7267H to move one byte on, to the first byte of the block.
7257
LD H,B 60
Copy Register B (the high byte of the address to find) into Register H.
7258
LD L,C 69
Copy Register C into Register L: Register Pair HL = the address to find.
7259
OR A B7
OR Register A with itself to clear the CARRY FLAG for the SBC.
725A
SBC HL,DE ED 52
SUBtract Register Pair DE (the load address) from Register Pair HL: Register L = the place of the address in the block.
725C
LD B,L 45
Copy Register L (the place in the block) into Register B.
725D
POP HL E1
Restore Register Pair HL from the stack: the high byte of the load address.
725E
PUSH HL E5
Save Register Pair HL to the stack again, for 7274H.
725F
LD A,(602BH) 3A 2B 60
Fetch the place of the scan from 602BH into Register A.
7262
PUSH AF F5
Save Register Pair AF (the place) to the stack, for 7270H.
7263
LD A,B 78
Copy Register B (the place in the block) into Register A.
7264
GOSUB to 72AFH to move the scan on by Register A bytes, to the byte before the one found.
7267
GOSUB to 72ADH to move the scan on one byte: Register Pair HL at the byte of the address.
726A
LD (601CH),HL 22 1C 60
Store Register Pair HL (the byte found) at 601CH-601DH: the cursor goes there.
726D
GOSUB to 729BH to make the record of the scan the record shown, build its display and show it with the box.
7270
POP AF F1
Restore Register Pair AF from the stack: the place of the high byte of the load address.
7271
LD (602BH),A 32 2B 60
Store Register A at 602BH: the scan is back at the start of the block.
7274
POP HL E1
Restore Register Pair HL from the stack: the high byte of the load address in the edit buffer.
7275
LD BC,(6023H) ED 4B 23 60
Fetch the record where the block starts from 6023H-6024H into Register Pair BC.
7279
LD (602DH),BC ED 43 2D 60
Store Register Pair BC at 602DH-602EH: the scan is in that record again.
727D
GOSUB to 7291H to move the scan over the bytes of the block, so that G goes on from the next block.
7280
XOR A AF
Set Register A to 00H by XOR A with itself, for the state.
7281
LD (6013H),A 32 13 60
Store Register A (00H) at 6013H: no command under way.
7284
LD BC,(6021H) ED 4B 21 60
Fetch the record found from 6021H-6022H into Register Pair BC.
7288
GOSUB to 6CC8H to read the record of Register Pair BC into the edit buffer and show it.
728B
GOSUB to 6D78H to put the input box back on the screen.
728E
JUMP back to 60ADH, the command loop, with the cursor on the address found.
7291
LD A,(602FH) 3A 2F 60
Fetch the count of the bytes of the block from 602FH into Register A.
7294
GOSUB to 72AFH to move the scan on by Register A bytes, to the last byte of the block.
7297
GOSUB to 72ADH to move the scan on one byte, to the next type byte.
729A
RET C9
RETurn with Register Pair HL at the next type byte.
729B
LD BC,(602DH) ED 4B 2D 60
Fetch the record of the scan from 602DH-602EH into Register Pair BC.
729F
LD (6021H),BC ED 43 21 60
Store Register Pair BC at 6021H-6022H: it is the record shown.
72A3
GOSUB to 6953H to build the display of the edit buffer.
72A6
GOSUB to 6B4EH to copy the screen image to video memory at 3C00H.
72A9
GOSUB to 6D78H to put the input box back on the screen.
72AC
RET C9
RETurn with the record of the scan on the screen.

72ADH - Move Through the File

72ADH moves the scan of Z, L and M one byte on, 72AFH by Register A bytes (00H counts 256), keeping the offset at 602BH: when it passes the end of the record, the next record (602DH) is read into the edit buffer through @POSN and @READ, its number is shown, and Register Pair HL is moved back by 100H into it. Register Pair HL and Register A (the byte reached) are returned; the routine works in the other register set (EXX), and a count of 00H returns with the sets exchanged.

72AD
LD A,01H 3E 01
Load Register A with 01H: the scan moves one byte on.
72AF
PUSH HL E5
Save Register Pair HL (the place of the scan) to the stack.
72B0
EXX D9
Exchange Register Pairs BC, DE and HL with the alternate set (EXX): the caller's Register Pairs BC and DE are kept there.
72B1
POP HL E1
Restore Register Pair HL from the stack: the place of the scan, in this set.
72B2
OR A B7
OR Register A with itself to set the Z FLAG for a count of 00H.
72B3
If the NZ FLAG is set (a count of 1-255), JUMP to 72BBH.
72B5
DEC A 3D
DECrement Register A to FFH, 255 bytes first.
72B6
GOSUB to 72BBH to move on 255 bytes; it returns after a second EXX.
72B9
LD A,01H 3E 01
Load Register A with 01H: the 256th byte of a count of 00H.
72BB
LD C,A 4F
Copy Register A (the count of the bytes to move) into Register C.
72BC
LD B,00H 06 00
Load Register B with 00H: Register Pair BC = the count.
72BE
ADD HL,BC 09
ADD Register Pair BC (the count) to Register Pair HL: the new place of the scan.
72BF
LD A,(602BH) 3A 2B 60
Fetch the place of the scan in the record from 602BH into Register A.
72C2
ADD A,C 81
ADD Register C (the count) to Register A: the CARRY FLAG when the scan passes the end of the record.
72C3
LD (602BH),A 32 2B 60
Store Register A (the new place in the record) at 602BH.
72C6
If the NO CARRY FLAG is set (still in the record), JUMP to 72F9H to fetch the byte.
72C8
LD BC,(602DH) ED 4B 2D 60
Fetch the record of the scan from 602DH-602EH into Register Pair BC.
72CC
INC BC 03
INCrement Register Pair BC to the next record.
72CD
LD (602DH),BC ED 43 2D 60
Store Register Pair BC (the next record) at 602DH-602EH.
72D1
LD DE,5242H 11 42 52
Point Register Pair DE to 5242H, the file control block. 6332H and 718CH call here to read record Register Pair BC.
72D4
GOSUB to 4442H, @POSN, to position the file at Register Pair DE to record Register Pair BC.
72D7
GOSUB to 4436H, @READ, to read the record into the buffer 5362H; the result of @POSN is not tested.
72DA
If the NZ FLAG is set (@READ failed, number in Register A), JUMP to 6DA6H to show the error.
72DD
PUSH HL E5
Save Register Pair HL (the place of the scan) to the stack.
72DE
LD HL,3C3DH 21 3D 3C
Point Register Pair HL to 3C3DH, the place of the record number on the screen.
72E1
LD BC,(6021H) ED 4B 21 60
Fetch the record shown from 6021H-6022H into Register Pair BC, to keep it.
72E5
LD DE,(602DH) ED 5B 2D 60
Fetch the record of the scan from 602DH-602EH into Register Pair DE.
72E9
LD (6021H),DE ED 53 21 60
Store Register Pair DE at 6021H-6022H for 6A24H, which shows the number at 6021H.
72ED
GOSUB to 6A24H to show the number of the record of the scan on the screen.
72F0
POP HL E1
Restore Register Pair HL from the stack: the place of the scan.
72F1
LD (6021H),BC ED 43 21 60
Store Register Pair BC (the record shown) back at 6021H-6022H.
72F5
GOSUB to 72FEH to copy the record just read from 5362H to the edit buffer.
72F8
DEC H 25
DECrement Register H: Register Pair HL, past the end of the edit buffer (5362H on), goes back by 100H into the new record.
72F9
LD A,(HL) 7E
Fetch the byte of the scan at Register Pair HL into Register A.
72FA
PUSH HL E5
Save Register Pair HL (the place of the scan) to the stack.
72FB
EXX D9
Exchange the register sets back (EXX): the alternate set holds the work of the scan again.
72FC
POP HL E1
Restore Register Pair HL from the stack: the place of the scan, for the caller.
72FD
RET C9
RETurn with Register Pair HL the place of the scan and Register A its byte.
72FE
GOSUB to 655FH to save every register and run the rest of this routine as a subroutine.
7301
LD HL,5362H 21 62 53
Point Register Pair HL to 5362H, the buffer of the file.
7304
LD DE,5262H 11 62 52
Point Register Pair DE to 5262H, the edit buffer.
7307
LD BC,0100H 01 00 01
Load Register Pair BC with 0100H, the 256 bytes of a record.
730A
LDIR ED B0
Copy Register Pair BC (256) bytes from Register Pair HL to Register Pair DE.
730C
RET C9
RETurn to 6573H in the register saver, which restores the registers.

730DH - M: The Load Address of the Byte

M runs through the load module from record 0 to the byte at the cursor. Blocks that end three records or more before the cursor's record are skipped by their length; in the others the address of each byte is counted from the block's load address until the cursor's byte is reached, and the address is shown: down the input box in the 256 byte mode, as Loads at X'nnnn' on the last row in the 128 byte mode. A transfer address record before the byte gives Byte not in load block. The edit buffer is kept at 5462H for the time of the scan.

730D
LD (HL),13H 36 13
Store 13H at Register Pair HL (6013H): the state of the command M.
730F
GOSUB to 67BCH to store Register A (4DH, M) at the place in the command line and at the cursor.
7312
GOSUB to 6870H to clear the input line of the 128 byte mode.
7315
GOSUB to 67DBH to take the cursors off the screen.
7318
GOSUB to 744EH to keep a copy of the edit buffer at 5462H.
731B
LD BC,0000H 01 00 00
Load Register Pair BC with 0000H, record 0 and byte 00H.
731E
LD (602DH),BC ED 43 2D 60
Store Register Pair BC (0000H) at 602DH-602EH: the scan starts in record 0.
7322
LD (602BH),BC ED 43 2B 60
Store Register Pair BC (0000H) at 602BH-602CH: the scan starts at byte 00H.
7326
LD DE,(6021H) ED 5B 21 60
Fetch the record shown from 6021H-6022H into Register Pair DE: the record of the cursor.
732A
LD (6023H),DE ED 53 23 60
Store Register Pair DE (the record of the cursor) at 6023H-6024H.
732E
LD DE,5242H 11 42 52
Point Register Pair DE to 5242H, the file control block.
7331
GOSUB to 4442H, @POSN, to position the file at Register Pair DE to record Register Pair BC (0000H).
7334
GOSUB to 4436H, @READ, to read record 0 into the buffer 5362H; the result of @POSN is not tested.
7337
If the NZ FLAG is set (@READ failed, number in Register A), JUMP to 6DA6H to show the error.
733A
GOSUB to 72FEH to copy record 0 from 5362H to the edit buffer.
733D
LD HL,5262H 21 62 52
Point Register Pair HL to 5262H, byte 00H of the edit buffer: the first type byte.
7340
GOSUB to 002BH, the ROM's keyboard scan: Register A = a key, or 00H for none. 73ADH, 73D3H and 7411H come back here.
7343
CP 01H FE 01
Compare Register A against 01H, the code of BREAK.
7345
If the NZ FLAG is set (no BREAK), JUMP to 735CH to look at the type byte.
7347
LD BC,(6023H) ED 4B 23 60
Fetch the record of the cursor from 6023H-6024H into Register Pair BC.
734B
LD (6021H),BC ED 43 21 60
Store Register Pair BC at 6021H-6022H: it is the record shown again.
734F
GOSUB to 745DH to put the copy of the edit buffer back from 5462H.
7352
GOSUB to 6B4EH to copy the screen image to video memory at 3C00H.
7355
XOR A AF
Set Register A to 00H by XOR A with itself, for the state.
7356
LD (6013H),A 32 13 60
Store Register A (00H) at 6013H: no command under way.
7359
JUMP back to 60ADH, the command loop, after BREAK stopped M.
735C
LD A,(HL) 7E
Fetch the type byte at Register Pair HL into Register A.
735D
CP 02H FE 02
Compare Register A against 02H, the transfer address record that ends a load module.
735F
If the NZ FLAG is set (another type), JUMP to 7381H.
7361
LD BC,(6023H) ED 4B 23 60
Fetch the record of the cursor from 6023H-6024H into Register Pair BC.
7365
LD (6021H),BC ED 43 21 60
Store Register Pair BC at 6021H-6022H: it is the record shown again.
7369
GOSUB to 745DH to put the copy of the edit buffer back from 5462H.
736C
GOSUB to 654EH to clear the screen for the text of the error.
736F
LD HL,5B11H 21 11 5B
Point Register Pair HL to 5B11H, the text Byte not in load block.
7372
LD DE,3D95H 11 95 3D
Point Register Pair DE to 3D95H, row 6, column 21 of the screen.
7375
GOSUB to 65E5H to show the text at Register Pair HL at Register Pair DE.
7378
GOSUB to 6DD6H to show the prompt Press <ENTER> and wait for ENTER (BREAK ends FED).
737B
GOSUB to 6B4EH to copy the screen image to video memory: the record is shown again.
737E
JUMP to 704AH to show an asterisk in the command line.
7381
CP 01H FE 01
Compare Register A against 01H, a load block.
7383
If the Z FLAG is set (01H, a load block), JUMP to 73B0H.
7386
CP 05H FE 05
Compare Register A against 05H, a module name record.
7388
If the Z FLAG is set (05H), JUMP to 73A4H to skip the record.
738A
CP 07H FE 07
Compare Register A against 07H, another type of record of a load module.
738C
If the Z FLAG is set (07H), JUMP to 73A4H to skip the record.
738E
CP 10H FE 10
Compare Register A against 10H, another type of record of a load module.
7390
If the Z FLAG is set (10H), JUMP to 73A4H to skip the record.
7392
CP 1FH FE 1F
Compare Register A against 1FH, a copyright record.
7394
If the Z FLAG is set (1FH), JUMP to 73A4H to skip the record.
7396
LD BC,(6023H) ED 4B 23 60
Fetch the record of the cursor from 6023H-6024H into Register Pair BC.
739A
LD (6021H),BC ED 43 21 60
Store Register Pair BC at 6021H-6022H: it is the record shown again.
739E
GOSUB to 745DH to put the copy of the edit buffer back from 5462H.
73A1
JUMP to 71EAH to show File not load module format.
73A4
GOSUB to 72ADH to move the scan on one byte, to the length byte, into Register A.
73A7
GOSUB to 72AFH to move the scan on by Register A bytes: to the last byte of the record.
73AA
GOSUB to 72ADH to move the scan on one byte, to the next type byte.
73AD
JUMP to 7340H to look at the next type byte of the load module.
73B0
PUSH HL E5
Save Register Pair HL (the type byte) to the stack.
73B1
LD HL,(6023H) 2A 23 60
Fetch the record of the cursor from 6023H-6024H into Register Pair HL.
73B4
LD DE,(602DH) ED 5B 2D 60
Fetch the record of the scan from 602DH-602EH into Register Pair DE.
73B8
OR A B7
OR Register A with itself to clear the CARRY FLAG for the SBC.
73B9
SBC HL,DE ED 52
SUBtract Register Pair DE (the record of the scan) from Register Pair HL: the records still to go to the cursor.
73BB
EX DE,HL EB
Exchange Register Pair DE and Register Pair HL: Register Pair DE = the records to go.
73BC
POP HL E1
Restore Register Pair HL from the stack: the type byte.
73BD
LD A,D 7A
Copy Register D (the high byte of the records to go) into Register A.
73BE
OR A B7
OR Register A with itself to set the Z FLAG when it is 00H.
73BF
If the NZ FLAG is set (256 records or more to go), JUMP to 73C6H to skip the block.
73C1
LD A,E 7B
Copy Register E (the records to go) into Register A.
73C2
CP 03H FE 03
Compare Register A against 03H: the CARRY FLAG for fewer than three.
73C4
If the CARRY FLAG is set (the block may reach the cursor), JUMP to 73D6H to count its bytes.
73C6
GOSUB to 72ADH to move the scan on one byte, to the length byte, into Register A.
73C9
SUB 02H D6 02
SUBtract 02H from Register A: the bytes of the block after the address.
73CB
GOSUB to 72AFH to move the scan on by Register A bytes (00H counts 256).
73CE
LD A,03H 3E 03
Load Register A with 03H: the two address bytes and one more, to the next type byte.
73D0
GOSUB to 72AFH to move the scan on by Register A (3) bytes.
73D3
JUMP to 7340H to look at the next type byte of the load module.
73D6
LD BC,(601CH) ED 4B 1C 60
Fetch the address of the byte at the cursor from 601CH-601DH into Register Pair BC: Register C, its low byte, is compared below.
73DA
GOSUB to 72ADH to move the scan on one byte, to the length byte, into Register A.
73DD
SUB 02H D6 02
SUBtract 02H from Register A: the bytes of the block after the address (00H counts 256).
73DF
LD B,A 47
Copy Register A (the count of the bytes) into Register B.
73E0
GOSUB to 72ADH to move the scan on one byte, to the low byte of the load address.
73E3
LD E,A 5F
Copy Register A (the low byte) into Register E.
73E4
GOSUB to 72ADH to move the scan on one byte, to the high byte of the load address.
73E7
LD D,A 57
Copy Register A (the high byte) into Register D: Register Pair DE = the load address.
73E8
LD (6031H),DE ED 53 31 60
Store Register Pair DE (the address of the first byte) at 6031H-6032H.
73EC
GOSUB to 72ADH to move the scan on one byte, to the first byte of the block.
73EF
LD DE,(6023H) ED 5B 23 60
Fetch the record of the cursor from 6023H-6024H into Register Pair DE.
73F3
PUSH HL E5
Save Register Pair HL (the byte of the scan) to the stack. 740FH loops back here.
73F4
LD HL,(602DH) 2A 2D 60
Fetch the record of the scan from 602DH-602EH into Register Pair HL.
73F7
OR A B7
OR Register A with itself to clear the CARRY FLAG for the SBC.
73F8
SBC HL,DE ED 52
SUBtract Register Pair DE (the record of the cursor) from Register Pair HL: the Z FLAG when the scan is in that record.
73FA
POP HL E1
Restore Register Pair HL from the stack: the byte of the scan.
73FB
If the NZ FLAG is set (another record), JUMP to 7401H.
73FD
LD A,C 79
Copy Register C (the low byte of the cursor's address) into Register A.
73FE
CP L BD
Compare Register A against Register L (the low byte of the scan's address): the Z FLAG on the cursor's byte.
73FF
If the Z FLAG is set (the byte at the cursor), JUMP to 7414H to show its address.
7401
GOSUB to 72ADH to move the scan on one byte of the block.
7404
PUSH DE D5
Save Register Pair DE (the record of the cursor) to the stack.
7405
LD DE,(6031H) ED 5B 31 60
Fetch the address of the byte from 6031H-6032H into Register Pair DE.
7409
INC DE 13
INCrement Register Pair DE: the address of the next byte.
740A
LD (6031H),DE ED 53 31 60
Store Register Pair DE (the address of the next byte) at 6031H-6032H.
740E
POP DE D1
Restore Register Pair DE from the stack: the record of the cursor.
740F
DECrement Register B and JUMP back to 73F3H while it is not zero: the next byte of the block.
7411
JUMP to 7340H: the scan is at the next type byte.
7414
LD DE,(6031H) ED 5B 31 60
Fetch the address of the byte at the cursor from 6031H-6032H into Register Pair DE.
7418
GOSUB to 68FEH to write Register Pair DE as four hex digits at 68F9H; Index Register IX = 68F9H.
741B
GOSUB to 6D30H to clear the input box of the 256 byte mode.
741E
LD A,05H 3E 05
Load Register A with 05H, the rows of the input box.
7420
GOSUB to 6D06H to draw the input box of Register A (5) rows; it leaves Register Pair HL at 3DFDH, the first place in it.
7423
LD DE,0040H 11 40 00
Load Register Pair DE with 0040H, the step down the box.
7426
LD B,04H 06 04
Load Register B with 04H, the four hex digits.
7428
LD A,(6020H) 3A 20 60
Fetch the display mode from 6020H into Register A.
742B
OR A B7
OR Register A with itself to set the Z FLAG for the 256 byte mode.
742C
If the Z FLAG is set (256 byte mode), JUMP to 7438H to write down the box from 3DFDH.
742E
LD HL,5B54H 21 54 5B
Point Register Pair HL to 5B54H, the text Loads at X'.
7431
GOSUB to 65F5H to show the text at Register Pair HL at 3FEEH.
7434
LD HL,3FFBH 21 FB 3F
Point Register Pair HL to 3FFBH, the four places between the apostrophes.
7437
LD E,A 5F
Copy Register A (01H) into Register E: Register Pair DE = 0001H, the step to the next column.
7438
LD A,(IX+00H) DD 7E 00
Fetch the digit at Index Register IX +00H into Register A. 743FH loops back here.
743B
LD (HL),A 77
Store Register A (the digit) at Register Pair HL on the screen.
743C
INC IX DD 23
INCrement Index Register IX to the next digit.
743E
ADD HL,DE 19
ADD Register Pair DE (the step) to Register Pair HL: the next place.
743F
DECrement Register B and JUMP back to 7438H while it is not zero.
7441
GOSUB to 745DH to put the copy of the edit buffer back from 5462H.
7444
GOSUB to 679FH to clear the command line and set the state to 00H.
7447
XOR A AF
Set Register A to 00H by XOR A with itself, for the cell 6030H.
7448
LD (6030H),A 32 30 60
Store Register A (00H) at 6030H: the last search is forgotten.
744B
JUMP back to 60ADH, the command loop, with the address shown.
744E
GOSUB to 655FH to save every register and run the rest of this routine as a subroutine.
7451
LD HL,5262H 21 62 52
Point Register Pair HL to 5262H, the edit buffer.
7454
LD DE,5462H 11 62 54
Point Register Pair DE to 5462H, the place of the copy.
7457
LD BC,0100H 01 00 01
Load Register Pair BC with 0100H, the 256 bytes of a record.
745A
LDIR ED B0
Copy Register Pair BC (256) bytes from Register Pair HL to Register Pair DE: the copy is kept.
745C
RET C9
RETurn to 6573H in the register saver, which restores the registers.
745D
GOSUB to 655FH to save every register and run the rest of this routine as a subroutine.
7460
LD HL,5462H 21 62 54
Point Register Pair HL to 5462H, the copy of the edit buffer.
7463
LD DE,5262H 11 62 52
Point Register Pair DE to 5262H, the edit buffer.
7466
LD BC,0100H 01 00 01
Load Register Pair BC with 0100H, the 256 bytes of a record.
7469
LDIR ED B0
Copy Register Pair BC (256) bytes from Register Pair HL to Register Pair DE: the edit buffer is as it was.
746B
RET C9
RETurn to 6573H in the register saver, which restores the registers.