LDOS 5.3.1 for the Model III - LCOMM/CMD Disassembled

Page Customization

Introduction/Summary

LDOS 5.3.1 LCOMM/CMD Disassembly - The Terminal Program (Model III)

LCOMM/CMD is the terminal program of LDOS 5 for the Model I and Model III (COMM on version 6, M-40-060). It talks to a device that a serial driver has been set to, usually the CL device, never to the RS-232 hardware itself: LCOMM devspec (XLATES=X'fftt', XLATER=X'fftt', NULL=ON/OFF, XON=d, XOFF=d). KI/DVR must be active, because the functions are given with CLEAR and the keys of the top row, which KI/DVR returns as the key plus 80H: CLEAR 1 to CLEAR 7 choose the KI, DO, PR, CL, FS (file send) and FR (file receive) devices and DTD (dump to disk), and a second key, CLEAR : (ON), CLEAR - (OFF), CLEAR 9 (ID), CLEAR 0 (RES), CLEAR SHIFT % (REWND) or CLEAR SHIFT ampersand (PEOF), acts on it; CLEAR with SHIFT and a key switches DUPLX, ECHO, ECOLF, ACCLF, DCC, 8-B and HNDSH, clears the screen (CLS), runs a DOS command (CMD) or ends LCOMM (EXIT); CLEAR 8 shows the menu.

The file is a load module of 2646 bytes: a record of type 1FH with the text Copyright 1991 MISOSYS, Inc., All rights reserved, thirteen load blocks for 6000H-674AH, 67EBH-6802H, 6804H-681DH and 6C00H-6E6DH (2539 bytes) and the transfer address record for 6C00H. The start-up at 6C00H opens the device, sets up six buffers and two background tasks, and is then itself given to the buffers: every buffer is a chain of pages of 256 bytes, from 6C00H to HIGH$, taken and given back as it grows and shrinks (the dynamic buffering of the manual). Task 8 reads the line into the receive buffer and sends from the send buffer on every clock tick (30 a second); task 9 empties the printer buffer. The main loop at 6000H moves the characters between the buffers, the video and the files. Most switches are the operands of the instructions that test them.

What LCOMM Does

StepWhat Happens
The start-upThe banner, the KI/DVR test, the device and the parameters, the free list of pages and the six buffers, the two tasks, the control request 57H to the line driver, the parameter values into the operands (6C00H, 6C3EH, 6CB3H).
The main loopA key or a byte of the file being sent goes to the send buffer; a received character is translated, filtered and handled by the handshake, echoed, and shown, printed and kept for the receive file; then the device steps (6000H, 6036H, 6060H, 60B8H, 63C7H).
The tasksOn every tick: a character from the line into the receive buffer and one from the send buffer to the line; one character to the printer (63D7H, 6405H, 6475H).
The keysA key without bit 7 into the keyboard buffer, BREAK as a modem break, a CLEAR key as a command with its second key (6434H, 614AH, 621CH, 6242H).
The functionsID, RES, REWND, PEOF, the menu with the free memory, CMD, CLS and EXIT (6371H, 632DH, 6362H, 6280H, 6503H, 6276H, 61F3H).
The buffersPut, take, empty; take a page from the free list and give it back (648FH, 64B4H, 6335H, 64D4H).

About This Page

The site has no Model I page of LCOMM/CMD, so this page is written from the bytes of the Model III file alone. Every byte of the file is shown at its address. Found in the code: the NULL parameter does not work. @PARAM stores the value of NULL and N at 6E65H-6E66H, but the start-up takes the null switch from 6E64H (6CEDH), which no parameter reaches, so received nulls are always kept; and since 6E66H is also the low byte of the XS value, NULL, NULL=ON or N (written before any XS) makes LCOMM send FFH for every null. The FS buffer 67FBH gets a page at the start and is never used again (the file is read a byte at a time, and only while 18 pages are free, 6804H). RES of the FR device closes the file without emptying its buffer 67FFH, and DTD takes characters out of that buffer even when no FR file is open, so they are lost (6139H). The result of @FSPEC at ID is not tested (6391H). The warning of 2K is given each time a buffer takes a page while seven or fewer are free, and the XOFF it sends waits like any character while the sending is stopped. EXIT does not empty the printer buffer. The line driver gets the control request 57H, with Index Register IY at the receive routine 63DFH, at the start and 58H at EXIT; RS232T/DVR of this diskette (not paged) takes 56H as the request to keep Index Register IY as a routine to jump to after each received character and 57H as the request to switch it off, and passes over 58H. The modem break is the request 01H (RS232T/DVR clears bit 2 of the UART control byte), a delay of ROM 0060H, and a null, whose output writes the control byte back.

Memory Map

Load Blocks in File Order

The thirteen load blocks of the file, after the copyright record: 2539 bytes. 674BH-67EAH, 6803H and 681EH-6BFFH are not in the file. The transfer address is 6C00H.

AddressContents
6000H-60FFH, 6100H-61FFH, 6200H-62FFH, 6300H-63FFH, 6400H-64FFH256 bytes each: the main loop, the output, the command keys, the menu, the functions, the tasks and the buffer routines
6500H-65FFH, 6600H-66FFH, 6700H-674AH256, 256 and 75 bytes: CMD, the texts, the menu and its table, the warnings
67EBH-6802H24 bytes: the six buffer control blocks
6804H-681DH26 bytes: the file room test and the buffer calls with the interrupts off
6C00H-6CFFH, 6D00H-6DFFH, 6E00H-6E6DH256, 256 and 110 bytes: the start-up, its texts, the parameter table and the values

Sections of the Disassembly

AddressContents
6000HThe Main Loop: the Buffer Warning and the Keyboard Buffer
6036HA Character to Send
6060HA Received Character
60B8HEcho, Line Ends and the Output
60FAHThe Output of a Character: Video, Receive Buffer, Printer
6128HDump To Disk
614AHThe Command Keys
61F3HEXIT
621CHON and OFF
6242HThe Second Key
6276HCLS
6280HThe Menu
6306HThe Free Memory
632DHRES
6335HEmpty a Buffer
634BHRES of a File Device
6362HREWND and PEOF
6371HID
63A7HTake a Line; File Already Open; the Switch Helpers
63C7HThe Device Steps of the Main Loop
63D7HThe Line Task
6405HSend One Character to the Line
6434HOne Key from the Keyboard
6475HThe Printer Task
648FHPut a Byte into a Buffer
64B4HTake a Byte from a Buffer
64D4HTake a Page from the Free List
6503HCMD: a DOS Command
6528HThe Texts of the Commands and the Menu
6694HThe Menu Table
66D0HThe Texts of the Menu's Last Line and the Messages
674BHThe Control Blocks and the Buffers
6804HThe File Room Test and the Buffer Calls
6C00HThe Start-up: the Device and the Parameters
6C3EHThe Free List and the Six Buffers
6CB3HThe Tasks, the Line Driver and the Parameters
6D05HThe Start-up Errors
6D1AHThe Texts of the Start-up
6E23HThe Parameter Table and the Values

Memory LCOMM/CMD Uses

AddressContents
0000HThe byte F3H at ROM 0000H: its bit 7 lets ON through for a device with no file control block (Register Pair DE = 0000H, 626EH).
0013H, 001BH, 0023HROM: @GET, @PUT and @CTL on the device or file whose control block is at Register Pair DE (the line 674BH, the files 676BH and 678BH, the printer 4025H).
002BH, 0033H, 003BH, 0040H, 0049HROM: keyboard scan, display a character, print a character, take a line, wait for a key (the same in ROM 3.1 and ROM 1.3).
0060HROM: the delay loop of Register Pair BC, the length of the modem break (JP 01FBH in ROM 3.1, other bytes in ROM 1.3).
4025HThe printer's device control block, for the status request of the printer task.
402DH, 4030H@EXIT at the end, @ABORT after a start-up error.
403DH, 4040H@ADTSK and @RMTSK: task slots 8 and 9.
4289HDFLAG$: bit 4 is set while KI/DVR is active.
428AH@LOGOT: the start-up errors.
4293H, 429CH@FNAME (the names of the open files in the menu) and @CMNDR (the CMD function).
4409H@ERROR: the errors of the files and of the device's @OPEN.
4411HHIGH$: the end of the buffer pages.
441CH, 4454H@FSPEC and @PARAM: the device and the parameters, the names of ID.
4420H, 4424H, 4428H, 443FH, 4448H@INIT, @OPEN, @CLOSE, @REW and @PEOF on the FS and FR files.
4467H@DSPLY: the texts.
4758HBit 4 is set during @CMNDR: SYS1/SYS loads no program.
4D87HSYS0/SYS: Register A as two hex digits at Register Pair HL.
6900H-6BFFHThe page table and the two sector buffers.
6C00H up to HIGH$The buffer pages, the start-up among them.

Variables

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

Entry Points

AddressContents
6C00HThe start of LCOMM/CMD, the transfer address of the file.
6000HThe main loop.
60FAHShow the character in Register C, put it into the receive file and printer buffers, one step of DTD.
6128HOne step of DTD.
614AHA command key (bit 7 set) in Register A.
6242H, 6247HTake the second key; take Register A as the second key.
6335HEmpty the buffer whose control block is at Register Pair BC.
63A7HTake a line at Register Pair HL of up to Register B characters.
63B8H, 63BDH, 63C2HSwitch FS, FR, DTD off.
63C7HThe device steps of the main loop.
63D9H, 63DFHThe line task; take a character from the line.
6405HSend one character to the line.
6434HTake one key.
6477HThe printer task.
648FH, 64B4HPut Register A into, take Register A from, the buffer at Index Register IX.
64D4H, 64ECHTake a free page and link it after page Register H; give page Register H back.
6812H, 6818HPut and take with the interrupts off.

Data in the File

Address
Size
Contents
63D7H-63D8H
2 bytes
DEFW 63D9H
63D7H-63D8H: the task block of slot 8 (6CB3H): its first word is the address of the routine the clock interrupt runs, 63D9H.
6475H-6476H
2 bytes
DEFW 6477H
6475H-6476H: the task block of slot 9 (6CBBH): its first word is the address of the routine the clock interrupt runs, 6477H.
6528H
1 byte
DEFB 7BH
6528H: the brace {, the start of the hex display of a received control character (6082H).
6529H-652AH
2 bytes
DEFB 20H x 2
6529H-652AH: two spaces, the places where 607FH writes the two hex digits of the control character.
652BH-652CH
2 bytes
DEFB 7DH, 03H
652BH-652CH: the brace } and 03H, the end of the text: the cursor stays after it.
652DH-652EH
2 bytes
DEFB 0AH, 0AH
652DH-652EH: two new lines before the prompt of the CMD function (6503H).
652FH-653CH
14 bytes
DEFM "Enter command:"
652FH-653CH: the prompt of CLEAR SHIFT 0; the command is typed on the next line.
653DH
1 byte
DEFB 0DH
653DH: 0DH, the end of the prompt and a new line for the command.
653EH
1 byte
DEFB 0AH
653EH: 0AH, a new line before the text displayed after the command (6522H).
653FH-654FH
17 bytes
DEFM "Command completed"
653FH-654FH: the text displayed when @CMNDR has come back.
6550H
1 byte
DEFB 0DH
6550H: 0DH, the end of the text Command completed.
6551H-6552H
2 bytes
DEFB 1DH, 0AH
6551H-6552H: 1DH, the cursor to the start of the line, and 0AH, a new line, before the ID prompt (637CH).
6553H-655DH
11 bytes
DEFM "File name: "
6553H-655DH: the prompt of ID; the file specification is typed after it.
655EH
1 byte
DEFB 03H
655EH: 03H, the end of the prompt: the cursor stays after it.
655FH-6560H
2 bytes
DEFB 1DH, 0AH
655FH-6560H: 1DH, the cursor to the start of the line, and 0AH, a new line, before the text of 63B2H.
6561H-6571H
17 bytes
DEFM "File already open"
6561H-6571H: the text of ID for a file device whose file is open.
6572H
1 byte
DEFB 0DH
6572H: 0DH, the end of the text File already open.
6573H
1 byte
DEFB 0AH
6573H: 0AH, the new line that starts the menu displayed by 62BDH.
6574H-65ACH
57 bytes
DEFB 20H x 57
6574H-65ACH: the first line of the menu, 57 spaces: an asterisk above each shifted function that is on; 65ABH-65ACH get the pause character in hex.
65ADH
1 byte
DEFB 0AH
65ADH: 0AH, the end of the first line of the menu.
65AEH-65EBH
62 bytes
DEFM "DUPLX ECHO ECOLF ACCLF REWND PEOF DCC CLS 8-B CMD HNDSH EXIT"
65AEH-65EBH: the labels of the shifted functions, above the keys 1 to 9, 0, : and - that give them with CLEAR and SHIFT.
65ECH
1 byte
DEFB 0AH
65ECH: 0AH, the end of the second line of the menu.
65EDH-662BH
63 bytes
DEFM "==1== ==2== ==3== ==4== ==5== ==6== =7= =8= =9= =0= ==:== ==-=="
65EDH-662BH: the keys of the top row, in the order of the keyboard.
662CH
1 byte
DEFB 0AH
662CH: 0AH, the end of the third line of the menu.
662DH-666AH
62 bytes
DEFM " *KI *DO *PR *CL *FS *FR DTD ??? ID RES ON OFF"
662DH-666AH: the labels of the keys with CLEAR alone: the six devices, DTD, the menu, ID, RES, ON and OFF.
666BH
1 byte
DEFB 0AH
666BH: 0AH, the end of the fourth line of the menu.
666CH-6692H
39 bytes
DEFB 20H x 39
666CH-6692H: the last line of the menu, 39 spaces: an asterisk below each device and DTD that is on.
6693H
1 byte
DEFB 0DH
6693H: 0DH, the end of the menu text displayed by 62BDH.
6694H-6697H
4 bytes
DEFW 6443H, 666EH
6694H-6697H: the KI switch 6443H and its place 666EH, below the label KI.
6698H-669BH
4 bytes
DEFW 60FBH, 6674H
6698H-669BH: the DO switch 60FBH and its place 6674H, below the label DO.
669CH-669FH
4 bytes
DEFW 611CH, 667AH
669CH-669FH: the PR switch 611CH and its place 667AH, below the label PR.
66A0H-66A3H
4 bytes
DEFW 6406H, 667FH
66A0H-66A3H: the send switch 6406H and its place 667FH, the first of the two below the label CL.
66A4H-66A7H
4 bytes
DEFW 63E0H, 6681H
66A4H-66A7H: the line switch 63E0H and its place 6681H, the second below the label CL.
66A8H-66ABH
4 bytes
DEFW 601EH, 6686H
66A8H-66ABH: the FS switch 601EH and its place 6686H, below the label FS.
66ACH-66AFH
4 bytes
DEFW 610FH, 668CH
66ACH-66AFH: the FR switch 610FH and its place 668CH, below the label FR.
66B0H-66B3H
4 bytes
DEFW 6129H, 6691H
66B0H-66B3H: the DTD switch 6129H and its place 6691H, below the label DTD.
66B4H-66B7H
4 bytes
DEFW 603EH, 6576H
66B4H-66B7H: the DUPLX switch 603EH and its place 6576H, above the label DUPLX.
66B8H-66BBH
4 bytes
DEFW 60B9H, 657CH
66B8H-66BBH: the ECHO switch 60B9H and its place 657CH, above the label ECHO.
66BCH-66BFH
4 bytes
DEFW 6058H, 6582H
66BCH-66BFH: the ECOLF switch 6058H and its place 6582H, above the label ECOLF.
66C0H-66C3H
4 bytes
DEFW 60CCH, 6588H
66C0H-66C3H: the ACCLF switch 60CCH and its place 6588H, above the label ACCLF.
66C4H-66C7H
4 bytes
DEFW 6072H, 6599H
66C4H-66C7H: the DCC switch 6072H and its place 6599H, above the label DCC.
66C8H-66CBH
4 bytes
DEFW 608AH, 65A1H
66C8H-66CBH: the 8-B switch 608AH and its place 65A1H, above the label 8-B.
66CCH-66CFH
4 bytes
DEFW 6093H, 65A9H
66CCH-66CFH: the HNDSH switch 6093H and its place 65A9H, above the label HNDSH; the last entry.
66D0H-66D8H
9 bytes
DEFM "FS-Spec: "
66D0H-66D8H: the text before the name of the open FS file (62D9H).
66D9H
1 byte
DEFB 03H
66D9H: 03H, the end of the text: the name follows on the same line.
66DAH-66E4H
11 bytes
DEFM " FR-Spec: "
66DAH-66E4H: the text before the name of the open FR file (62FCH).
66E5H
1 byte
DEFB 03H
66E5H: 03H, the end of the text: the name follows on the same line.
66E6H-66EFH
10 bytes
DEFM " Memory: "
66E6H-66EFH: the text of the free memory (6327H).
66F0H-66F1H
2 bytes
DEFB 20H x 2
66F0H-66F1H: the two places of the free memory in K, written by 6321H and 6326H.
66F2H
1 byte
DEFM "K"
66F2H: the letter K after the number of the free memory.
66F3H
1 byte
DEFB 0DH
66F3H: 0DH, the end of the line after the menu (FS, FR, Memory).
66F4H-6711H
30 bytes
DEFM "Unacceptable command sequence!"
66F4H-6711H: the text of 6265H, for a key with bit 7 set or a second key that LCOMM does not take.
6712H
1 byte
DEFB 0DH
6712H: 0DH, the end of the text Unacceptable command sequence!.
6713H-6749H
55 bytes
DEFM "Warning! Less than 2K of buffer left! X-OFF transmitted"
6713H-6749H: the text of 6005H when a buffer has left seven or fewer free pages.
674AH
1 byte
DEFB 0DH
674AH: 0DH, the end of the warning; the code of 6000H shows it.
67EBH-67EEH
4 bytes
DEFB 00H x 4
67EBH-67EEH: the control block of the keyboard buffer (put place, take place), filled by 6C5BH.
67EFH-67F2H
4 bytes
DEFB 00H x 4
67EFH-67F2H: the control block of the printer buffer, filled by 6C62H.
67F3H-67F6H
4 bytes
DEFB 00H x 4
67F3H-67F6H: the control block of the receive buffer, filled by 6C69H.
67F7H-67FAH
4 bytes
DEFB 00H x 4
67F7H-67FAH: the control block of the send buffer, filled by 6C70H.
67FBH-67FEH
4 bytes
DEFB 00H x 4
67FBH-67FEH: the control block of the FS buffer, filled by 6C77H; no other instruction uses it, so its page stays taken.
67FFH-6802H
4 bytes
DEFB 00H x 4
67FFH-6802H: the control block of the receive file buffer, filled by 6C7EH, emptied to the FR file by DTD.
6D1AH
1 byte
DEFB 0AH
6D1AH: 0AH, a new line: the start of the banner displayed by 6C04H.
6D1BH-6D51H
55 bytes
DEFM "LCOMM - Terminal Communications Package - Version 5.3.1"
6D1BH-6D51H: the name of the program, what it is and its version.
6D52H
1 byte
DEFB 0AH
6D52H: 0AH, a new line: the copyright goes on the next line.
6D53H-6D83H
49 bytes
DEFM "Copyright 1991 MISOSYS, Inc., All rights reserved"
6D53H-6D83H: the copyright line, the same text as the copyright record of the file.
6D84H-6D85H
2 bytes
DEFB 0AH, 0DH
6D84H-6D85H: 0AH, a new line, and 0DH, the end of the banner.
6D86H-6D9BH
22 bytes
DEFM "Use <CLEAR-8> for menu"
6D86H-6D9BH: the hint displayed by 6C34H after the device is open.
6D9CH-6D9DH
2 bytes
DEFB 0AH, 0DH
6D9CH-6D9DH: 0AH, a new line, and 0DH, the end of the hint.
6D9EH-6DA7H
10 bytes
DEFB 0AH x 10
6D9EH-6DA7H: ten new lines, displayed by 6CD2H: the screen scrolls, the cursor ends at the bottom.
6DA8H-6DA9H
2 bytes
DEFB 0EH, 03H
6DA8H-6DA9H: 0EH, the cursor on, and 03H, the end of the text.
6DAAH-6DC6H
29 bytes
DEFM "LCOMM requires KI/DVR active!"
6DAAH-6DC6H: the text of 6D05H, when bit 4 of DFLAG$ is clear.
6DC7H
1 byte
DEFB 0DH
6DC7H: 0DH, the end of the text LCOMM requires KI/DVR active!.
6DC8H-6DE6H
31 bytes
DEFM "Comm Line driver not specified!"
6DC8H-6DE6H: the text of 6D11H, when the command names no device.
6DE7H
1 byte
DEFB 0DH
6DE7H: 0DH, the end of the text Comm Line driver not specified!.
6DE8H-6DF7H
16 bytes
DEFM "Parameter error!"
6DE8H-6DF7H: the text of 6D0DH, when @PARAM refuses a parameter.
6DF8H
1 byte
DEFB 0DH
6DF8H: 0DH, the end of the text Parameter error! of 6D0DH.
6DF9H-6E21H
41 bytes
DEFM "Insufficient memory to establish buffers!"
6DF9H-6E21H: the text of 6D09H, when the six buffers do not each get a page.
6E22H
1 byte
DEFB 0DH
6E22H: 0DH, the end of the text Insufficient memory to establish buffers!.
6E23H-6E2AH
8 bytes
DEFM "XLATES" / DEFW 6E66H
6E23H-6E2AH: the parameter XLATES, its value stored at 6E66H-6E67H: X'fftt' translates the character ff sent into tt.
6E2BH-6E32H
8 bytes
DEFM "XS " / DEFW 6E66H
6E2BH-6E32H: the parameter XS, the short name of XLATES, stored at the same place 6E66H.
6E33H-6E3AH
8 bytes
DEFM "XLATER" / DEFW 6E68H
6E33H-6E3AH: the parameter XLATER, its value stored at 6E68H-6E69H: X'fftt' translates the character ff received into tt.
6E3BH-6E42H
8 bytes
DEFM "XR " / DEFW 6E68H
6E3BH-6E42H: the parameter XR, the short name of XLATER, stored at the same place 6E68H.
6E43H-6E4AH
8 bytes
DEFM "NULL " / DEFW 6E65H
6E43H-6E4AH: the parameter NULL, its value stored at 6E65H-6E66H, which no instruction reads but 6CDBH reads 6E66H for XS.
6E4BH-6E52H
8 bytes
DEFM "N " / DEFW 6E65H
6E4BH-6E52H: the parameter N, the short name of NULL, stored at the same place 6E65H.
6E53H-6E5AH
8 bytes
DEFM "XON " / DEFW 6E6AH
6E53H-6E5AH: the parameter XON, its value stored at 6E6AH-6E6BH: the character that lets the sending go on.
6E5BH-6E62H
8 bytes
DEFM "XOFF " / DEFW 6E6CH
6E5BH-6E62H: the parameter XOFF, its value stored at 6E6CH-6E6DH: the character that stops the sending.
6E63H
1 byte
DEFB 00H
6E63H: 00H, the end of the parameter table for @PARAM.
6E64H
1 byte
DEFB FFH
6E64H: FFH, the null switch the start-up copies to 63F5H (6CEDH); no parameter reaches this byte.
6E65H
1 byte
DEFB FFH
6E65H: FFH, the low byte of the NULL value; no instruction reads it.
6E66H-6E67H
2 bytes
DEFW 0000H
6E66H-6E67H: the XS value X'fftt': 6E66H tt (also the high byte of the NULL value), 6E67H ff; 0000H translates a null into a null.
6E68H-6E69H
2 bytes
DEFW 0000H
6E68H-6E69H: the XR value X'fftt': 6E68H tt, 6E69H ff; 0000H translates a received null into a null.
6E6AH-6E6BH
2 bytes
DEFW 0011H
6E6AH-6E6BH: the XON value, 11H (DC1) by default; only the low byte is used (6CF3H).
6E6CH-6E6DH
2 bytes
DEFW 0013H
6E6CH-6E6DH: the XOFF value, 13H (DC3) by default; only the low byte is used (6CF9H).

Switches and Operands Changed While It Runs

Address
Size
Contents
6001H
1 byte
The buffer warning: 07H from 64AAH, 00H again from 6011H.
600CH
1 byte
The XOFF sent with the warning: the XOFF parameter (6CFFH).
601EH
1 byte
FS: the file is being sent. 621FH (CLEAR 5), 63B9H, 635CH.
6038H
1 byte
XS ff: the character sent that is translated (6CD8H).
603CH
1 byte
XS tt: the character sent instead (6CDEH).
603EH
1 byte
DUPLX (CLEAR SHIFT !), 00H at the start.
6058H
1 byte
ECOLF (CLEAR SHIFT #), 00H at the start.
6072H
1 byte
DCC (CLEAR SHIFT apostrophe), 00H at the start.
608AH
1 byte
8-B (CLEAR SHIFT )), 00H at the start.
6093H
1 byte
HNDSH (CLEAR SHIFT asterisk): FFH from 6236H or ON, 00H from OFF.
6099H
1 byte
XON: the XON parameter (6CF6H).
609DH
1 byte
XOFF: the XOFF parameter (6CFCH).
60B9H
1 byte
ECHO (CLEAR SHIFT quote), 00H at the start.
60CCH
1 byte
ACCLF (CLEAR SHIFT $), 00H at the start.
60E8H
1 byte
The line feed switch: 00H after a carriage return without ACCLF (60CDH), 0AH after a line feed (60E9H).
60FBH
1 byte
DO (CLEAR 2), FFH at the start.
610FH
1 byte
FR (CLEAR 6), 00H at the start; DC2 and DC4 (60B3H), 63BEH, 635CH.
611CH
1 byte
PR (CLEAR 3), 00H at the start.
6129H
1 byte
DTD (CLEAR 7), FFH at the start; 6356H, 63C3H.
63E0H
1 byte
CL, the line (CLEAR 4), FFH at the start.
63ECH
1 byte
XR ff: the character received that is translated (6CE4H).
63F0H
1 byte
XR tt: the character received instead (6CEAH).
63F5H
1 byte
The null switch: FFH from 6E64H (6CF0H).
6406H
1 byte
The send switch: 00H after XOFF or the pause character (60A3H, 6430H), FFH after XON or CL ON (60A3H, 6227H).
6412H
1 byte
The one character slot: the XOFF of the warning (600DH), cleared when sent (6414H).
642BH
1 byte
The pause character of HNDSH (6233H, 623EH).
6443H
1 byte
KI (CLEAR 1), FFH at the start.
6529H-652AH, 65ABH-65ACH, 66F0H-66F1HThe hex places and the number of the free memory (607FH, 62B7H, 6321H).
6574H-65ACH, 666CH-6692HThe asterisk lines of the menu (6280H).
67EBH-6802H
24 bytes
The six buffer control blocks.
6900H-69FFHThe page table.

Cells Outside the File That LCOMM/CMD Uses

Address
Size
Contents
674BH-676AH
32 bytes
DEFS 32
674BH-676AH: not in the file. The control block of the line device: @FSPEC (6C13H) and @OPEN (6C2BH) of the device named in the command, used by @GET, @PUT and @CTL.
676BH-678AH
32 bytes
DEFS 32
676BH-678AH: not in the file. The file control block of the FS file: 6C38H clears its first byte, ID opens it with @OPEN (6399H).
678BH-67AAH
32 bytes
DEFS 32
678BH-67AAH: not in the file. The file control block of the FR file: 6C3BH clears its first byte, ID opens it with @INIT (639EH).
67ABH-67EAH
64 bytes
DEFS 64
67ABH-67EAH: not in the file. The line buffer of the CMD function (650BH) and the copy of a control block for @FNAME (62C7H, 62EAH).
6803H
1 byte
DEFS 1
6803H: not in the file. The count of free pages, counted by 6C85H, kept by 64A5H and 64F0H, shown in K by the menu.
681EH-68FFH
226 bytes
DEFS 226
681EH-68FFH: not in the file and not used by LCOMM.
6900H-69FFH
256 bytes
DEFS 256
6900H-69FFH: not in the file. The page table: 6900H the first free page, 6901H the last free page, 69nnH the page after page nn (6C47H, 64D4H, 64ECH).
6A00H-6AFFH
256 bytes
DEFS 256
6A00H-6AFFH: not in the file. The sector buffer of the FS file, and the name typed at its ID (61B7H, 6382H).
6B00H-6BFFH
256 bytes
DEFS 256
6B00H-6BFFH: not in the file. The sector buffer of the FR file, and the name typed at its ID (61C8H, 6382H).

Disassembly

6000H - The Main Loop: the Buffer Warning and the Keyboard Buffer

After the start-up (6C00H) LCOMM runs this loop until EXIT. Each pass takes one character to send, from the keyboard buffer 67EBH or else from the file being sent, then one character from the receive buffer 67F3H, and ends with the device steps of 63C7H (one character to the line, one key, one character to the printer, one character written to the receive file). Many switches of LCOMM are the operands of the instructions that test them: LD A,nn / OR A and LD B,nn / INC B / DEC B load the switch and set the Z FLAG when it is 00H. The first one, the operand 6001H, is set to 07H by 64AAH when fewer than eight free pages (2K) are left: the warning is displayed and the XOFF character is put in the one character slot 6412H of the send routine.

6000
LD A,00H 3E 00
Load Register A with 00H, the buffer warning switch at 6001H: 64AAH stores 07H there when a buffer takes a page and fewer than eight are left.
6002
OR A B7
OR Register A with itself to set the Z FLAG when the warning switch 6001H is 00H (no warning waiting).
6003
If the Z FLAG is set (no warning), JUMP to 6014H to look in the keyboard buffer for a character to send.
6005
LD HL,6713H 21 13 67
Point Register Pair HL to 6713H, the text Warning! Less than 2K of buffer left! X-OFF transmitted, ended by 0DH.
6008
GOSUB to 4467H, @DSPLY, to display the text at Register Pair HL (6713H) on the video.
600B
LD A,13H 3E 13
Load Register A with 13H, the XOFF character: 6CFFH stores the XOFF parameter (6E6CH) in this operand at 600CH.
600D
LD (6412H),A 32 12 64
Store Register A (the XOFF character) at 6412H, the operand of LD C,00H at 6411H: the next character the send routine 6405H gives the line.
6010
XOR A AF
Clear Register A (XOR A) to 00H, to switch the warning off again after it was shown once.
6011
LD (6001H),A 32 01 60
Store Register A (00H) at 6001H, the operand of LD A,00H at 6000H: the warning waits for the next page taken.
6014
LD IX,67EBH DD 21 EB 67
Point Index Register IX to 67EBH, the control block of the keyboard buffer, where 6434H puts every key that is not a command.
6018
GOSUB to 6818H to take the next character of the buffer at Index Register IX into Register A with the interrupts off: the NZ FLAG when there is one.
601B
If the NZ FLAG is set (a key from the keyboard buffer), JUMP to 6036H to send it.
601D
LD A,00H 3E 00
Load Register A with 00H, the FS switch at 601EH: FFH while the file of the FS device is being sent (CLEAR 5 then CLEAR :).
601F
OR A B7
OR Register A with itself to set the Z FLAG when the FS switch 601EH is 00H (no file being sent).
6020
If the Z FLAG is set (FS off), JUMP to 6060H with nothing to send this pass, to the received characters.
6022
JUMP to 6804H to read the next character of the file only while at least 18 free pages are left, so that the receive buffers keep room.
6025
GOSUB to 0013H, the ROM's @GET, to read the next byte of the file whose control block is at Register Pair DE (676BH, from 680CH).
6028
If the Z FLAG is set (a byte read, in Register A), JUMP to 6036H to send it like a key.
602A
CP 1CH FE 1C
Compare Register A (the error) against 1CH, the end of the file: the file has been sent to its last byte.
602C
If the Z FLAG is set (the end of the file), JUMP to 6033H to switch the FS device off without a message.
602E
OR C0H F6 C0
OR C0H into Register A (the error): bit 7, @ERROR returns to the caller, and bit 6, the short message.
6030
GOSUB to 4409H, @ERROR, to display the short message of the error in Register A; with bit 7 set it returns here.
6033
GOSUB to 63B8H to switch the FS device off (601EH = 00H); 63B8H leaves Register A at 00H, so a null goes on as the character.

6036H - A Character to Send

The character in Register C is first translated by the XS parameter (603CH replaces 6038H). With DUPLX on (half duplex) it is shown and written like a received character by 60FAH. When the line is on (63E0H) it goes into the send buffer 67F7H; with ECOLF on a carriage return also gets a line feed.

6036
LD C,A 4F
Copy Register A (the character to send) into Register C, where the rest of the loop keeps it.
6037
CP 00H FE 00
Compare Register A against 00H, the character to translate: 6CD8H stores the first byte (ff) of the XS parameter in this operand at 6038H.
6039
If the NZ FLAG is set (not the character ff), JUMP to 603DH to send Register C as it is.
603B
LD C,00H 0E 00
Load Register C with 00H, the character it becomes: 6CDEH stores the second byte (tt) of the XS parameter in this operand at 603CH.
603D
LD B,00H 06 00
Load Register B with 00H, the DUPLX switch at 603EH: FFH for half duplex, set by CLEAR SHIFT ! (A1H) and the ON or OFF key.
603F
INC B 04
INCrement Register B, the first half of the test of Register B for 00H that leaves Register A alone.
6040
DEC B 05
DECrement Register B back to the switch: the Z FLAG is set when the DUPLX switch (603EH) is 00H.
6041
If the NZ FLAG is set (half duplex), GOSUB to 60FAH to show the character in Register C and write it to the printer and receive buffers.
6044
LD A,(63E0H) 3A E0 63
Fetch the line switch from 63E0H, the operand of LD A,FFH at 63DFH, into Register A: 00H when the line is off (CLEAR 4 then CLEAR -).
6047
OR A B7
OR Register A with itself to set the Z FLAG when the line switch is 00H.
6048
If the Z FLAG is set (the line off), JUMP to 6060H: the character is not sent.
604A
LD IX,67F7H DD 21 F7 67
Point Index Register IX to 67F7H, the control block of the send buffer, which 6405H empties into the line.
604E
LD A,C 79
Copy Register C (the character) into Register A for the buffer routine.
604F
GOSUB to 6812H to put Register A into the buffer at Index Register IX (67F7H) with the interrupts off.
6052
LD A,C 79
Copy Register C (the character) into Register A to test it for a carriage return.
6053
CP 0DH FE 0D
Compare Register A against 0DH, the carriage return, which gets a line feed after it when ECOLF is on.
6055
If the NZ FLAG is set (not a carriage return), JUMP to 6060H to the received characters.
6057
LD B,00H 06 00
Load Register B with 00H, the ECOLF switch at 6058H: FFH when a line feed follows every carriage return (CLEAR SHIFT #, A3H).
6059
INC B 04
INCrement Register B, the first half of the test of Register B for 00H.
605A
DEC B 05
DECrement Register B back to the switch: the Z FLAG is set when the ECOLF switch (6058H) is 00H.
605B
LD A,0AH 3E 0A
Load Register A with 0AH, the line feed; LD leaves the flags of the DEC B.
605D
If the NZ FLAG is set (ECOLF on), GOSUB to 6812H to put Register A (0AH) into the send buffer at Index Register IX (67F7H) too.

6060H - A Received Character

When the line is on, the next character of the receive buffer 67F3H, filled by the task 63DFH, is taken. With DCC on a control character is shown as two hex digits between braces before it is used. Bit 7 is cleared unless 8-B is on. With HNDSH on the XON and XOFF characters (6099H, 609DH, the parameters, by default 11H and 13H) start and stop the sending (6406H), and DC2 (12H) and DC4 (14H) switch the FR device on and off; these four are not shown.

6060
LD A,(63E0H) 3A E0 63
Fetch the line switch from 63E0H into Register A: the received characters are taken only while the line is on.
6063
OR A B7
OR Register A with itself to set the Z FLAG when the line switch (63E0H) is 00H.
6064
If the Z FLAG is set (the line off), JUMP to 60F4H to the device steps of the loop.
6067
LD IX,67F3H DD 21 F3 67
Point Index Register IX to 67F3H, the control block of the receive buffer, filled by the task 63DFH.
606B
GOSUB to 6818H to take the next received character into Register A with the interrupts off: the Z FLAG when there is none.
606E
If the Z FLAG is set (nothing received), JUMP to 60F4H to the device steps of the loop.
6071
LD B,00H 06 00
Load Register B with 00H, the DCC switch at 6072H: FFH when control characters are shown in hex (CLEAR SHIFT apostrophe, A7H).
6073
INC B 04
INCrement Register B, the first half of the test of Register B for 00H.
6074
DEC B 05
DECrement Register B back to the switch: the Z FLAG is set when the DCC switch (6072H) is 00H.
6075
If the Z FLAG is set (DCC off), JUMP to 6089H with the character in Register A.
6077
CP 20H FE 20
Compare Register A (the character) against 20H, the space: the CARRY FLAG for a control character 00H-1FH.
6079
If the NO CARRY FLAG is set (20H or above), JUMP to 6089H: only control characters are shown in hex.
607B
PUSH AF F5
Save Register Pair AF (Register A = the character) to the stack across the display.
607C
LD HL,6529H 21 29 65
Point Register Pair HL to 6529H, the two places between the braces of the text { } at 6528H.
607F
GOSUB to 4D87H, SYS0/SYS's hex routine, to write Register A as two hex digits at Register Pair HL (6529H-652AH).
6082
LD HL,6528H 21 28 65
Point Register Pair HL to 6528H, the text {xx} ended by 03H, with the hex digits written in.
6085
GOSUB to 4467H, @DSPLY, to display the text at Register Pair HL (6528H) on the video, without a new line.
6088
POP AF F1
Restore Register Pair AF from the stack: Register A = the received character again; it is used as well.
6089
LD B,00H 06 00
Load Register B with 00H, the 8-B switch at 608AH: FFH when all eight bits of a received character count (CLEAR SHIFT ), A9H).
608B
INC B 04
INCrement Register B, the first half of the test of Register B for 00H.
608C
DEC B 05
DECrement Register B back to the switch: the NZ FLAG is set when the 8-B switch (608AH) is on.
608D
If the NZ FLAG is set (8-B on), JUMP to 6091H to keep bit 7 of Register A.
608F
AND 7FH E6 7F
AND Register A with 7FH: bit 7 of the received character is cleared.
6091
LD C,A 4F
Copy Register A (the received character) into Register C, where the rest of the loop keeps it.
6092
LD B,00H 06 00
Load Register B with 00H, the HNDSH switch at 6093H: FFH when handshake is on (CLEAR SHIFT asterisk, AAH, 622BH).
6094
INC B 04
INCrement Register B, the first half of the test of Register B for 00H.
6095
DEC B 05
DECrement Register B back to the switch: the Z FLAG is set when the HNDSH switch (6093H) is 00H.
6096
If the Z FLAG is set (handshake off), JUMP to 60B8H: no received character starts or stops anything.
6098
CP 11H FE 11
Compare Register A against 11H, the XON character: 6CF6H stores the XON parameter (6E6AH) in this operand at 6099H.
609A
If the Z FLAG is set (XON), JUMP to 60A2H to store Register B (FFH) at 6406H: the sending goes on.
609C
CP 13H FE 13
Compare Register A against 13H, the XOFF character: 6CFCH stores the XOFF parameter (6E6CH) in this operand at 609DH.
609E
If the NZ FLAG is set (neither XON nor XOFF), JUMP to 60A8H to test for DC2 and DC4.
60A0
LD B,00H 06 00
Load Register B with 00H, the value that stops the sending, for the XOFF just received.
60A2
LD A,B 78
Copy Register B (FFH for XON, 00H for XOFF) into Register A for the store.
60A3
LD (6406H),A 32 06 64
Store Register A at 6406H, the send switch, the operand of LD A,FFH at 6405H: 00H stops the sending until an XON.
60A6
JUMP to 60F4H: the XON or XOFF character is not shown.
60A8
CP 12H FE 12
Compare Register A against 12H, DC2, which switches the FR device on when handshake is on.
60AA
If the Z FLAG is set (DC2), JUMP to 60B2H to store Register B (FFH) at 610FH, the FR switch.
60AC
CP 14H FE 14
Compare Register A against 14H, DC4, which switches the FR device off when handshake is on.
60AE
If the NZ FLAG is set (no handshake character), JUMP to 60B8H to use the character.
60B0
LD B,00H 06 00
Load Register B with 00H, the value that switches the FR device off, for the DC4 just received.
60B2
LD A,B 78
Copy Register B (FFH for DC2, 00H for DC4) into Register A for the store.
60B3
LD (610FH),A 32 0F 61
Store Register A at 610FH, the FR switch, the operand of LD A,00H at 610EH: the received characters go into the buffer 67FFH or not.
60B6
JUMP to 60F4H: the DC2 or DC4 character is not shown.

60B8H - Echo, Line Ends and the Output

With ECHO on the received character goes back into the send buffer, and a carriage return gets a line feed too when ECOLF is on. The first line feed after a carriage return is dropped unless ACCLF is on: the operand 60E8H is set at each carriage return to the ACCLF switch and at each line feed to 0AH. DEL (7FH) is dropped; every other character goes to the video, the printer and the receive buffer through 60FAH.

60B8
LD B,00H 06 00
Load Register B with 00H, the ECHO switch at 60B9H: FFH when every received character is sent back (CLEAR SHIFT quote, A2H).
60BA
INC B 04
INCrement Register B, the first half of the test of Register B for 00H.
60BB
DEC B 05
DECrement Register B back to the switch: the Z FLAG is set when the ECHO switch (60B9H) is 00H.
60BC
If the Z FLAG is set (ECHO off), JUMP to 60C6H to test for a carriage return.
60BE
LD A,C 79
Copy Register C (the received character) into Register A to send it back.
60BF
LD IX,67F7H DD 21 F7 67
Point Index Register IX to 67F7H, the control block of the send buffer.
60C3
GOSUB to 6812H to put Register A into the send buffer at Index Register IX (67F7H) with the interrupts off.
60C6
LD A,C 79
Copy Register C (the received character) into Register A to test it for a carriage return.
60C7
CP 0DH FE 0D
Compare Register A against 0DH, the carriage return.
60C9
If the NZ FLAG is set (not a carriage return), JUMP to 60DDH to test for DEL and the line feed.
60CB
LD A,00H 3E 00
Load Register A with 00H, the ACCLF switch at 60CCH: FFH when every line feed is accepted (CLEAR SHIFT $, A4H).
60CD
LD (60E8H),A 32 E8 60
Store Register A (the ACCLF switch) at 60E8H, the operand of LD B,FFH at 60E7H: 00H drops the next line feed.
60D0
LD A,(6058H) 3A 58 60
Fetch the ECOLF switch from 6058H, the operand of LD B,00H at 6057H, into Register A.
60D3
OR A B7
OR Register A with itself to set the Z FLAG when the ECOLF switch (6058H) is 00H.
60D4
LD A,0AH 3E 0A
Load Register A with 0AH, the line feed; LD leaves the flags of the OR.
60D6
LD IX,67F7H DD 21 F7 67
Point Index Register IX to 67F7H, the control block of the send buffer.
60DA
If the NZ FLAG is set (ECOLF on), GOSUB to 6812H to put Register A (0AH) into the send buffer at Index Register IX (67F7H).
60DD
LD A,C 79
Copy Register C (the received character) into Register A to test it for DEL.
60DE
CP 7FH FE 7F
Compare Register A against 7FH, DEL, which LCOMM never shows.
60E0
If the Z FLAG is set (DEL), JUMP to 60F4H to drop the character.
60E2
LD A,C 79
Copy Register C (the received character) into Register A to test it for a line feed.
60E3
CP 0AH FE 0A
Compare Register A against 0AH, the line feed.
60E5
If the NZ FLAG is set (not a line feed), JUMP to 60F0H to show the character in Register C.
60E7
LD B,FFH 06 FF
Load Register B with FFH, the line feed switch at 60E8H: 00H straight after a carriage return when ACCLF is off.
60E9
LD (60E8H),A 32 E8 60
Store Register A (0AH) at 60E8H: the next line feed is taken, until the next carriage return stores the ACCLF switch.
60EC
INC B 04
INCrement Register B, the first half of the test of Register B for 00H.
60ED
DEC B 05
DECrement Register B back to the switch: the Z FLAG is set when the line feed comes straight after a carriage return.
60EE
If the Z FLAG is set (the first line feed after a carriage return), JUMP to 60F4H to drop it.
60F0
LD A,C 79
Copy Register C (the received character) into Register A for the output routine.
60F1
GOSUB to 60FAH to show the character in Register C and put it into the printer and receive buffers.
60F4
GOSUB to 63C7H for the device steps: one character to the line, one key, one character to the printer, one byte to the receive file.
60F7
JUMP to 6000H for the next pass of the main loop.

60FAH - The Output of a Character: Video, Receive Buffer, Printer

The character in Register C goes to the video when DO is on (a form feed 0CH clears the screen), into the receive file buffer 67FFH when FR is on, and into the printer buffer 67EFH when PR is on. The routine then runs on into 6128H, one step of DTD.

60FA
LD A,FFH 3E FF
Load Register A with FFH, the DO switch at 60FBH: 00H when the video is off (CLEAR 2 then CLEAR -).
60FC
OR A B7
OR Register A with itself to set the Z FLAG when the DO switch (60FBH) is 00H.
60FD
If the Z FLAG is set (the video off), JUMP to 610EH to the receive file buffer.
60FF
LD A,C 79
Copy Register C (the character) into Register A to test it for a form feed.
6100
CP 0CH FE 0C
Compare Register A against 0CH, the form feed, which LCOMM shows as a cleared screen.
6102
If the NZ FLAG is set (not a form feed), JUMP to 610BH to display the character in Register A.
6104
LD A,1CH 3E 1C
Load Register A with 1CH, cursor home, the first of the two codes that clear the screen.
6106
GOSUB to 0033H, the ROM's display of the character in Register A (1CH) on the video.
6109
LD A,1FH 3E 1F
Load Register A with 1FH, clear to the end of the screen, the second code of the form feed.
610B
GOSUB to 0033H, the ROM's display of the character in Register A on the video (the character, or 1FH).
610E
LD A,00H 3E 00
Load Register A with 00H, the FR switch at 610FH: FFH while the received characters go into the receive file buffer (CLEAR 6 then CLEAR :).
6110
OR A B7
OR Register A with itself to set the Z FLAG when the FR switch (610FH) is 00H.
6111
If the Z FLAG is set (FR off), JUMP to 611BH to the printer buffer.
6113
LD A,C 79
Copy Register C (the character) into Register A for the buffer routine.
6114
LD IX,67FFH DD 21 FF 67
Point Index Register IX to 67FFH, the control block of the receive file buffer, which DTD (6128H) writes to the file.
6118
GOSUB to 6812H to put Register A into the buffer at Index Register IX (67FFH) with the interrupts off.
611B
LD A,00H 3E 00
Load Register A with 00H, the PR switch at 611CH: FFH while the characters are printed (CLEAR 3 then CLEAR :).
611D
OR A B7
OR Register A with itself to set the Z FLAG when the PR switch (611CH) is 00H.
611E
If the Z FLAG is set (PR off), JUMP to 6128H for one step of DTD.
6120
LD A,C 79
Copy Register C (the character) into Register A for the buffer routine.
6121
LD IX,67EFH DD 21 EF 67
Point Index Register IX to 67EFH, the control block of the printer buffer, which the task 6477H empties.
6125
GOSUB to 6812H to put Register A into the buffer at Index Register IX (67EFH) with the interrupts off.

6128H - Dump To Disk

With DTD on, one character of the receive file buffer is written to the FR file each time this runs (from 60FAH and at the end of every pass, 63D4H). A character is taken from the buffer even when no FR file is open, and is then lost. A write error is shown and switches DTD and FR off.

6128
LD A,FFH 3E FF
Load Register A with FFH, the DTD switch at 6129H: 00H when the buffer 67FFH is not written to the file (CLEAR 7 then CLEAR -).
612A
OR A B7
OR Register A with itself to set the Z FLAG when the DTD switch (6129H) is 00H.
612B
RET Z C8
If the Z FLAG is set (DTD off), RETurn: the received characters stay in the buffer.
612C
LD IX,67FFH DD 21 FF 67
Point Index Register IX to 67FFH, the control block of the receive file buffer.
6130
GOSUB to 6818H to take the next character of the buffer at Index Register IX into Register A: the Z FLAG when it is empty.
6133
RET Z C8
If the Z FLAG is set (nothing to write), RETurn to the caller.
6134
LD HL,678BH 21 8B 67
Point Register Pair HL to 678BH, the file control block of the FR file.
6137
BIT 7,(HL) CB 7E
Test bit 7 of the byte at Register Pair HL (678BH), set while the file is open: the Z FLAG when no FR file is open.
6139
RET Z C8
If the Z FLAG is set (no FR file), RETurn: the character taken at 6130H is lost.
613A
EX DE,HL EB
EXchange Register Pairs DE and HL: Register Pair DE = 678BH, the control block for the ROM's @PUT.
613B
GOSUB to 001BH, the ROM's @PUT, to write Register A to the file whose control block is at Register Pair DE (678BH).
613E
RET Z C8
If the Z FLAG is set (written), RETurn to the caller.
613F
OR C0H F6 C0
OR C0H into Register A (the error): bit 7, @ERROR returns to the caller, and bit 6, the short message.
6141
GOSUB to 4409H, @ERROR, to display the short message of the error in Register A; with bit 7 set it returns here.
6144
GOSUB to 63C2H to switch DTD off (6129H = 00H) after the write error.
6147
JUMP to 63BDH to switch FR off (610FH = 00H); it returns to the caller.

614AH - The Command Keys

A key with bit 7 set (KI/DVR gives CLEAR with a key as the key plus 80H) comes here from 643EH. Each command loads Register Pair HL with the address of its switch (an operand of the main loop), Register Pair BC with the control block of the device's buffer (0000H when it has none), Register Pair DE with the device's file control block (0000H for the devices that are not files) and Index Register IX with the sector buffer of a file, then 621CH takes the second key. CLEAR SHIFT ! to CLEAR SHIFT ) are DUPLX, ECHO, ECOLF, ACCLF, DCC, CLS and 8-B, CLEAR SHIFT asterisk is HNDSH, CLEAR SHIFT 0 (A0H) a DOS command, CLEAR SHIFT = (BDH) EXIT; CLEAR 1 to CLEAR 7 are KI, DO, PR, CL, FS, FR and DTD, CLEAR 8 the menu. REWND (CLEAR SHIFT %), PEOF (CLEAR SHIFT ampersand), ID (CLEAR 9) and RES (CLEAR 0) count only as the second key.

614A
LD BC,0000H 01 00 00
Load Register Pair BC with 0000H: the commands before 6188H have no buffer, so RES after them is refused (632DH).
614D
LD DE,0000H 11 00 00
Load Register Pair DE with 0000H: no file control block, so ON is always taken and ID, REWND and PEOF are refused.
6150
LD HL,6072H 21 72 60
Point Register Pair HL to 6072H, the DCC switch, the operand of LD B,00H at 6071H.
6153
CP A7H FE A7
Compare Register A (the key) against A7H, CLEAR SHIFT apostrophe, DCC: show received control characters in hex.
6155
If the Z FLAG is set (DCC), JUMP to 621CH to take the second key and store the switch at Register Pair HL (6072H).
6158
LD HL,603EH 21 3E 60
Point Register Pair HL to 603EH, the DUPLX switch, the operand of LD B,00H at 603DH.
615B
CP A1H FE A1
Compare Register A (the key) against A1H, CLEAR SHIFT !, DUPLX: half duplex, the characters sent are shown too.
615D
If the Z FLAG is set (DUPLX), JUMP to 621CH to take the second key and store the switch at Register Pair HL (603EH).
6160
LD HL,60B9H 21 B9 60
Point Register Pair HL to 60B9H, the ECHO switch, the operand of LD B,00H at 60B8H.
6163
CP A2H FE A2
Compare Register A (the key) against A2H, CLEAR SHIFT quote, ECHO: send every received character back.
6165
If the Z FLAG is set (ECHO), JUMP to 621CH to take the second key and store the switch at Register Pair HL (60B9H).
6168
LD HL,6093H 21 93 60
Point Register Pair HL to 6093H, the HNDSH switch, the operand of LD B,00H at 6092H.
616B
CP AAH FE AA
Compare Register A (the key) against AAH, CLEAR SHIFT asterisk, HNDSH: handshake, with ON, OFF or a pause character.
616D
If the Z FLAG is set (HNDSH), JUMP to 622BH, which also takes any key that is not a command as the pause character.
6170
LD HL,6058H 21 58 60
Point Register Pair HL to 6058H, the ECOLF switch, the operand of LD B,00H at 6057H.
6173
CP A3H FE A3
Compare Register A (the key) against A3H, CLEAR SHIFT #, ECOLF: a line feed after every carriage return sent or echoed.
6175
If the Z FLAG is set (ECOLF), JUMP to 621CH to take the second key and store the switch at Register Pair HL (6058H).
6178
LD HL,60CCH 21 CC 60
Point Register Pair HL to 60CCH, the ACCLF switch, the operand of LD A,00H at 60CBH.
617B
CP A4H FE A4
Compare Register A (the key) against A4H, CLEAR SHIFT $, ACCLF: accept the line feed after a carriage return.
617D
If the Z FLAG is set (ACCLF), JUMP to 621CH to take the second key and store the switch at Register Pair HL (60CCH).
6180
LD HL,608AH 21 8A 60
Point Register Pair HL to 608AH, the 8-B switch, the operand of LD B,00H at 6089H.
6183
CP A9H FE A9
Compare Register A (the key) against A9H, CLEAR SHIFT ), 8-B: keep bit 7 of the received characters.
6185
If the Z FLAG is set (8-B), JUMP to 621CH to take the second key and store the switch at Register Pair HL (608AH).
6188
LD BC,67EBH 01 EB 67
Load Register Pair BC with 67EBH, the control block of the keyboard buffer, emptied by RES.
618B
LD HL,6443H 21 43 64
Point Register Pair HL to 6443H, the KI switch, the operand of LD A,FFH at 6442H.
618E
CP B1H FE B1
Compare Register A (the key) against B1H, CLEAR 1, the KI device: the keyboard.
6190
If the Z FLAG is set (KI), JUMP to 621CH to take the second key and store the switch at Register Pair HL (6443H).
6193
LD BC,0000H 01 00 00
Load Register Pair BC with 0000H: the video has no buffer, so RES after CLEAR 2 is refused.
6196
LD HL,60FBH 21 FB 60
Point Register Pair HL to 60FBH, the DO switch, the operand of LD A,FFH at 60FAH.
6199
CP B2H FE B2
Compare Register A (the key) against B2H, CLEAR 2, the DO device: the video.
619B
If the Z FLAG is set (DO), JUMP to 621CH to take the second key and store the switch at Register Pair HL (60FBH).
619D
LD BC,67EFH 01 EF 67
Load Register Pair BC with 67EFH, the control block of the printer buffer, emptied by RES.
61A0
LD HL,611CH 21 1C 61
Point Register Pair HL to 611CH, the PR switch, the operand of LD A,00H at 611BH.
61A3
CP B3H FE B3
Compare Register A (the key) against B3H, CLEAR 3, the PR device: the printer.
61A5
If the Z FLAG is set (PR), JUMP to 621CH to take the second key and store the switch at Register Pair HL (611CH).
61A7
LD BC,67F7H 01 F7 67
Load Register Pair BC with 67F7H, the control block of the send buffer, emptied by RES.
61AA
LD HL,63E0H 21 E0 63
Point Register Pair HL to 63E0H, the line switch, the operand of LD A,FFH at 63DFH.
61AD
CP B4H FE B4
Compare Register A (the key) against B4H, CLEAR 4, the CL device: the communications line.
61AF
If the Z FLAG is set (CL), JUMP to 6221H, which also switches the sending on (6406H) with the line.
61B1
LD BC,67FBH 01 FB 67
Load Register Pair BC with 67FBH, the control block of the FS buffer (not used by the code: the file is read a byte at a time at 6025H).
61B4
LD DE,676BH 11 6B 67
Point Register Pair DE to 676BH, the file control block of the FS file, for ID, REWND, PEOF and RES.
61B7
LD IX,6A00H DD 21 00 6A
Point Index Register IX to 6A00H, the sector buffer of the FS file, given to @OPEN by ID (6379H).
61BB
LD HL,601EH 21 1E 60
Point Register Pair HL to 601EH, the FS switch, the operand of LD A,00H at 601DH.
61BE
CP B5H FE B5
Compare Register A (the key) against B5H, CLEAR 5, the FS device: the file sent.
61C0
If the Z FLAG is set (FS), JUMP to 621CH to take the second key and store the switch at Register Pair HL (601EH).
61C2
LD BC,67FFH 01 FF 67
Load Register Pair BC with 67FFH, the control block of the receive file buffer.
61C5
LD DE,678BH 11 8B 67
Point Register Pair DE to 678BH, the file control block of the FR file, for ID, REWND, PEOF and RES.
61C8
LD IX,6B00H DD 21 00 6B
Point Index Register IX to 6B00H, the sector buffer of the FR file, given to @INIT by ID (6379H).
61CC
LD HL,610FH 21 0F 61
Point Register Pair HL to 610FH, the FR switch, the operand of LD A,00H at 610EH.
61CF
CP B6H FE B6
Compare Register A (the key) against B6H, CLEAR 6, the FR device: the file received.
61D1
If the Z FLAG is set (FR), JUMP to 621CH to take the second key and store the switch at Register Pair HL (610FH).
61D3
LD HL,6129H 21 29 61
Point Register Pair HL to 6129H, the DTD switch, the operand of LD A,FFH at 6128H; Register Pair BC stays 67FFH.
61D6
LD DE,0000H 11 00 00
Load Register Pair DE with 0000H: DTD has no file of its own, so ON is always taken; RES empties the buffer 67FFH.
61D9
CP B7H FE B7
Compare Register A (the key) against B7H, CLEAR 7, DTD: dump the receive file buffer to the file.
61DB
If the Z FLAG is set (DTD), JUMP to 621CH to take the second key and store the switch at Register Pair HL (6129H).
61DD
CP A0H FE A0
Compare Register A (the key) against A0H, CLEAR SHIFT 0, CMD: a DOS library command.
61DF
If the Z FLAG is set (CMD), JUMP to 6503H to ask Enter command: and carry the command out.
61E2
CP BDH FE BD
Compare Register A (the key) against BDH, CLEAR SHIFT =, EXIT: back to LDOS.
61E4
If the Z FLAG is set (EXIT), JUMP to 61F3H to remove the tasks, close the FR file and end LCOMM.
61E6
CP B8H FE B8
Compare Register A (the key) against B8H, CLEAR 8, the menu.
61E8
If the Z FLAG is set (the menu), JUMP to 6280H to display the menu with the switches and the free memory.
61EB
CP A8H FE A8
Compare Register A (the key) against A8H, CLEAR SHIFT (, CLS: clear the screen without sending anything.
61ED
If the Z FLAG is set (CLS), JUMP to 6276H to clear the screen.
61F0
JUMP to 6265H to display Unacceptable command sequence! for any other key with bit 7 set.

61F3H - EXIT

The two tasks are removed, the line driver gets the control request 58H, FR is switched off and an open FR file is closed. LCOMM ends at @EXIT, or at @ERROR when the close fails. The FS file is not closed and the printer buffer is not emptied.

61F3
LD A,08H 3E 08
Load Register A with 08H, the task slot of the line task 63D9H (the spooler's slot, as the manual warns).
61F5
GOSUB to 4040H, @RMTSK, to remove the task in slot Register A (08H): the line is no longer read or written.
61F8
LD A,09H 3E 09
Load Register A with 09H, the task slot of the printer task 6477H.
61FA
GOSUB to 4040H, @RMTSK, to remove the task in slot Register A (09H): the printer buffer is no longer emptied.
61FD
LD DE,674BH 11 4B 67
Point Register Pair DE to 674BH, the control block of the line device opened at 6C2BH.
6200
LD A,58H 3E 58
Load Register A with 58H, the control request LCOMM gives the line driver at the end (57H at the start, 6CCAH).
6202
GOSUB to 0023H, the ROM's @CTL, with Register A (58H) as the request to the device at Register Pair DE (674BH).
6205
GOSUB to 63BDH to switch FR off (610FH = 00H) before the file is closed.
6208
LD DE,678BH 11 8B 67
Point Register Pair DE to 678BH, the file control block of the FR file.
620B
LD A,(DE) 1A
Fetch the first byte of the control block at Register Pair DE (678BH) into Register A: bit 7 is set while the file is open.
620C
BIT 7,A CB 7F
Test bit 7 of Register A: the Z FLAG when no FR file is open.
620E
If the Z FLAG is set (no FR file), JUMP to 402DH, @EXIT, to end LCOMM.
6211
GOSUB to 4428H, @CLOSE, to close the FR file whose control block is at Register Pair DE (678BH).
6214
If the Z FLAG is set (closed), JUMP to 402DH, @EXIT, to end LCOMM.
6217
OR 40H F6 40
OR 40H into Register A (the error): bit 6, the short message; bit 7 is clear, so @ERROR does not return.
6219
JUMP to 4409H, @ERROR, to display the short message of the error in Register A and end LCOMM.

621CH - ON and OFF

After a device or switch key the second key decides (6242H): CLEAR - stores 00H, CLEAR : stores FFH at Register Pair HL. ON is taken for a file device only while its file is open. For the CL device ON also lets the sending go on (6406H), as the manual says ON overrides an XOFF. HNDSH takes ON or OFF the same way; any key that is not a command makes it the pause character: the sending stops after that character until an XON comes (6427H).

621C
GOSUB to 6242H to take the second key: Register A = 00H for OFF, FFH for ON; other second keys do not come back here.
621F
LD (HL),A 77
Store Register A (00H or FFH) at Register Pair HL, the switch of the device or function.
6220
RET C9
RETurn to 63CFH in the device steps: 614AH is reached by the jump at 643EH, inside the call of 6434H from 63CCH.
6221
GOSUB to 6242H to take the second key for the CL device: Register A = 00H for OFF, FFH for ON.
6224
LD (HL),A 77
Store Register A at Register Pair HL (63E0H), the line switch.
6225
OR A B7
OR Register A with itself to set the Z FLAG for OFF (00H).
6226
RET Z C8
If the Z FLAG is set (OFF), RETurn: the send switch 6406H is left as it is.
6227
LD (6406H),A 32 06 64
Store Register A (FFH) at 6406H, the send switch: CL ON ends a pause of XOFF or of the pause character.
622A
RET C9
RETurn to 63CFH in the device steps: 614AH is reached by the jump at 643EH, inside the call of 6434H from 63CCH.
622B
PUSH DE D5
Save Register Pair DE (0000H) to the stack across the key wait.
622C
GOSUB to 0049H, the ROM's wait for a key, which returns the key in Register A and the M FLAG for bit 7 set.
622F
POP DE D1
Restore Register Pair DE (0000H) from the stack.
6230
If the M FLAG is set (a command key), JUMP to 6239H to take ON or OFF.
6233
LD (642BH),A 32 2B 64
Store Register A (the key) at 642BH, the operand of LD A,00H at 642AH: the pause character of the send routine.
6236
LD (HL),FFH 36 FF
Store FFH at Register Pair HL (6093H), the HNDSH switch: handshake is on with the pause character.
6238
RET C9
RETurn to 63CFH in the device steps: 614AH is reached by the jump at 643EH, inside the call of 6434H from 63CCH.
6239
GOSUB to 6247H to take Register A as the second key: 00H for OFF, FFH for ON.
623C
LD (HL),A 77
Store Register A (00H or FFH) at Register Pair HL (6093H), the HNDSH switch.
623D
XOR A AF
Clear Register A (XOR A) to 00H, for no pause character.
623E
LD (642BH),A 32 2B 64
Store Register A (00H) at 642BH, the pause character of the send routine: none.
6241
RET C9
RETurn to 63CFH in the device steps: 614AH is reached by the jump at 643EH, inside the call of 6434H from 63CCH.

6242H - The Second Key

6242H waits for the key after a device or switch key. CLEAR - (ADH) returns 00H, OFF. CLEAR : (BAH) returns FFH, ON, when Register Pair DE is 0000H (the byte at ROM 0000H, F3H, has bit 7 set) or points to an open file; ON for a file device without an open file is refused like an unknown key. Every other second key drops the return address of the caller (624FH), so that the store of the switch is skipped: CLEAR 9 is ID, CLEAR 0 RES, CLEAR SHIFT % REWND and CLEAR SHIFT ampersand PEOF; any other key displays Unacceptable command sequence!.

6242
PUSH DE D5
Save Register Pair DE (the file control block or 0000H) to the stack across the key wait.
6243
GOSUB to 0049H, the ROM's wait for a key, which returns the key in Register A.
6246
POP DE D1
Restore Register Pair DE (the file control block or 0000H) from the stack.
6247
CP ADH FE AD
Compare Register A (the second key) against ADH, CLEAR -, OFF.
6249
If the Z FLAG is set (OFF), JUMP to 626BH to return Register A = 00H.
624B
CP BAH FE BA
Compare Register A (the second key) against BAH, CLEAR :, ON.
624D
If the Z FLAG is set (ON), JUMP to 626DH to return FFH if the device may be switched on.
624F
EX (SP),HL E3
EXchange Register Pair HL with the top of the stack (Stack Pointer): Register Pair HL = the return address, the switch address on the stack.
6250
POP HL E1
Restore Register Pair HL from the stack: the switch address again; the return address to the store is dropped.
6251
CP B9H FE B9
Compare Register A (the second key) against B9H, CLEAR 9, ID: name and open the file of the device.
6253
If the Z FLAG is set (ID), JUMP to 6371H to ask File name: and open the file at Register Pair DE.
6256
CP B0H FE B0
Compare Register A (the second key) against B0H, CLEAR 0, RES: empty the buffer or close the file.
6258
If the Z FLAG is set (RES), JUMP to 632DH to reset the device with Register Pairs BC and DE.
625B
CP A5H FE A5
Compare Register A (the second key) against A5H, CLEAR SHIFT %, REWND: back to the start of the file.
625D
If the Z FLAG is set (REWND), JUMP to 6362H to rewind the file at Register Pair DE.
6260
CP A6H FE A6
Compare Register A (the second key) against A6H, CLEAR SHIFT ampersand, PEOF: to the end of the file.
6262
If the Z FLAG is set (PEOF), JUMP to 636AH to position the file at Register Pair DE to its end.
6265
LD HL,66F4H 21 F4 66
Point Register Pair HL to 66F4H, the text Unacceptable command sequence!, ended by 0DH.
6268
JUMP to 4467H, @DSPLY, to display the text at Register Pair HL (66F4H); it returns to the caller.
626B
XOR A AF
Clear Register A (XOR A) to 00H, the value of OFF.
626C
RET C9
RETurn with Register A = 00H to the store of the switch.
626D
EX DE,HL EB
EXchange Register Pairs DE and HL: Register Pair HL = the file control block, or 0000H for a device that is not a file.
626E
BIT 7,(HL) CB 7E
Test bit 7 of the byte at Register Pair HL: set for an open file, and set in ROM 0000H (F3H) for 0000H.
6270
EX DE,HL EB
EXchange Register Pairs DE and HL back: Register Pair HL = the switch address again.
6271
LD A,FFH 3E FF
Load Register A with FFH, the value of ON; LD leaves the flags of the BIT.
6273
RET NZ C0
If the NZ FLAG is set (no file, or an open file), RETurn with Register A = FFH to the store of the switch.
6274
JUMP to 624FH: ON for a file device without an open file goes on as an unknown second key and is refused.

6276H - CLS

CLEAR SHIFT ( clears the screen and puts the cursor at the top left; nothing is sent to the line.

6276
LD A,1CH 3E 1C
Load Register A with 1CH, cursor home, the first of the two codes that clear the screen.
6278
GOSUB to 0033H, the ROM's display of the character in Register A (1CH) on the video.
627B
LD A,1FH 3E 1F
Load Register A with 1FH, clear to the end of the screen.
627D
JUMP to 0033H, the ROM's display of the character in Register A (1FH); it returns to the caller.

6280H - The Menu

CLEAR 8 displays the menu 6573H, five lines in the order of the keys: the shifted functions with an asterisk above each that is on, the labels, the keys, the device labels and an asterisk below each device that is on. The two asterisk lines are cleared and the table 6694H (15 entries of a switch address and a place in the text) puts an asterisk where the switch is not 00H; the CL device gets two, for the send switch 6406H and the line switch 63E0H. With HNDSH on, the pause character is shown in hex at the end of the first line (00H when none). The names of the open FS and FR files follow, then the free memory in K (6306H).

6280
LD HL,6574H 21 74 65
Point Register Pair HL to 6574H, the first place of the line of asterisks above the labels.
6283
LD DE,6575H 11 75 65
Point Register Pair DE to 6575H, one place further: the LDIR copies the space at 6574H along the line.
6286
LD BC,0038H 01 38 00
Load Register Pair BC with 0038H, the count for the 56 places 6575H-65ACH after the first.
6289
LDIR ED B0
LDIR: copy Register Pair BC bytes from Register Pair HL to Register Pair DE: the line 6574H-65ACH is all spaces again.
628B
LD HL,666CH 21 6C 66
Point Register Pair HL to 666CH, the first place of the line of asterisks below the device labels.
628E
LD DE,666DH 11 6D 66
Point Register Pair DE to 666DH, one place further: the LDIR copies the space at 666CH along the line.
6291
LD C,26H 0E 26
Load Register C with 26H; Register B is 00H after the LDIR: Register Pair BC = 0026H, the 38 places 666DH-6692H.
6293
LDIR ED B0
LDIR: copy Register Pair BC bytes from Register Pair HL to Register Pair DE: the line 666CH-6692H is all spaces again.
6295
LD B,0FH 06 0F
Load Register B with 0FH, the count of the 15 entries of the table 6694H.
6297
LD HL,6694H 21 94 66
Point Register Pair HL to 6694H, the menu table: the address of each switch, then its place in the menu text.
629A
LD E,(HL) 5E
Fetch the low byte of the switch address at Register Pair HL into Register E.
629B
INC HL 23
INCrement Register Pair HL to the high byte of the switch address.
629C
LD D,(HL) 56
Fetch the high byte of the switch address at Register Pair HL into Register D: Register Pair DE = the switch.
629D
INC HL 23
INCrement Register Pair HL to the low byte of the place in the text.
629E
LD A,(HL) 7E
Fetch the low byte of the place at Register Pair HL into Register A.
629F
INC HL 23
INCrement Register Pair HL to the high byte of the place in the text.
62A0
PUSH HL E5
Save Register Pair HL (in the table) to the stack across the store.
62A1
LD H,(HL) 66
Fetch the high byte of the place at Register Pair HL into Register H.
62A2
LD L,A 6F
Copy Register A (the low byte) into Register L: Register Pair HL = the place of the asterisk in the menu text.
62A3
LD A,(DE) 1A
Fetch the switch at Register Pair DE into Register A.
62A4
OR A B7
OR Register A with itself to set the Z FLAG when the switch is 00H (off).
62A5
If the Z FLAG is set (off), JUMP to 62A9H to leave a space at the place.
62A7
LD (HL),2AH 36 2A
Store 2AH, the asterisk, at Register Pair HL, the place of the switch in the menu text: the switch is on.
62A9
POP HL E1
Restore Register Pair HL from the stack: the high byte of the place of the entry.
62AA
INC HL 23
INCrement Register Pair HL to the next entry of the table.
62AB
DECrement Register B and, if it is not zero, JUMP back to 629AH for the next entry.
62AD
LD A,(DE) 1A
Fetch the switch of the last entry at Register Pair DE (6093H, HNDSH) into Register A.
62AE
OR A B7
OR Register A with itself to set the Z FLAG when the HNDSH switch is 00H.
62AF
If the Z FLAG is set (handshake off), JUMP to 62BAH to display the menu.
62B1
LD A,(642BH) 3A 2B 64
Fetch the pause character from 642BH, the operand of LD A,00H at 642AH, into Register A (00H when none).
62B4
LD HL,65ABH 21 AB 65
Point Register Pair HL to 65ABH, the last two places of the line of asterisks.
62B7
GOSUB to 4D87H, SYS0/SYS's hex routine, to write Register A as two hex digits at Register Pair HL (65ABH-65ACH).
62BA
LD HL,6573H 21 73 65
Point Register Pair HL to 6573H, the menu text: a new line and the five lines, ended by 0DH.
62BD
GOSUB to 4467H, @DSPLY, to display the text at Register Pair HL (6573H) on the video.
62C0
LD HL,676BH 21 6B 67
Point Register Pair HL to 676BH, the file control block of the FS file.
62C3
BIT 7,(HL) CB 7E
Test bit 7 of the byte at Register Pair HL (676BH): the Z FLAG when no FS file is open.
62C5
If the Z FLAG is set (no FS file), JUMP to 62E3H to the FR file.
62C7
LD DE,67ABH 11 AB 67
Point Register Pair DE to 67ABH, the line buffer, for a copy of the control block.
62CA
PUSH DE D5
Save Register Pair DE (67ABH) to the stack, for the @FNAME that follows.
62CB
LD BC,0020H 01 20 00
Load Register Pair BC with 0020H, the 32 bytes of the file control block.
62CE
LDIR ED B0
LDIR: copy Register Pair BC bytes from Register Pair HL (676BH) to Register Pair DE (67ABH).
62D0
POP DE D1
Restore Register Pair DE from the stack: 67ABH, the copy, where @FNAME writes the name.
62D1
LD BC,(67B1H) ED 4B B1 67
Fetch the word at 67B1H-67B2H into Register Pair BC: bytes 06H and 07H of the copy, the drive and the directory record of the file.
62D5
PUSH DE D5
Save Register Pair DE (67ABH) to the stack, for the display of the name.
62D6
GOSUB to 4293H, @FNAME, to write the file specification of directory record Register B on drive Register C at Register Pair DE (67ABH).
62D9
LD HL,66D0H 21 D0 66
Point Register Pair HL to 66D0H, the text FS-Spec: , ended by 03H.
62DC
GOSUB to 4467H, @DSPLY, to display the text at Register Pair HL (66D0H) on the video.
62DF
POP HL E1
Restore Register Pair HL from the stack: 67ABH, the file specification written by @FNAME.
62E0
GOSUB to 4467H, @DSPLY, to display the name at Register Pair HL (67ABH) after FS-Spec: .
62E3
LD HL,678BH 21 8B 67
Point Register Pair HL to 678BH, the file control block of the FR file.
62E6
BIT 7,(HL) CB 7E
Test bit 7 of the byte at Register Pair HL (678BH): the Z FLAG when no FR file is open.
62E8
If the Z FLAG is set (no FR file), JUMP to 6306H to show the free memory.
62EA
LD DE,67ABH 11 AB 67
Point Register Pair DE to 67ABH, the line buffer, for a copy of the control block.
62ED
PUSH DE D5
Save Register Pair DE (67ABH) to the stack, for the @FNAME that follows.
62EE
LD BC,0020H 01 20 00
Load Register Pair BC with 0020H, the 32 bytes of the file control block.
62F1
LDIR ED B0
LDIR: copy Register Pair BC bytes from Register Pair HL (678BH) to Register Pair DE (67ABH).
62F3
POP DE D1
Restore Register Pair DE from the stack: 67ABH, the copy, where @FNAME writes the name.
62F4
LD BC,(67B1H) ED 4B B1 67
Fetch the word at 67B1H-67B2H into Register Pair BC: bytes 06H and 07H of the copy, the drive and the directory record of the file.
62F8
PUSH DE D5
Save Register Pair DE (67ABH) to the stack, for the display of the name.
62F9
GOSUB to 4293H, @FNAME, to write the file specification of directory record Register B on drive Register C at Register Pair DE (67ABH).
62FC
LD HL,66DAH 21 DA 66
Point Register Pair HL to 66DAH, the text FR-Spec: after two spaces, ended by 03H.
62FF
GOSUB to 4467H, @DSPLY, to display the text at Register Pair HL (66DAH) on the video.
6302
POP HL E1
Restore Register Pair HL from the stack: 67ABH, the file specification written by @FNAME.
6303
GOSUB to 4467H, @DSPLY, to display the name at Register Pair HL (67ABH) after FR-Spec: .

6306H - The Free Memory

The count of free pages at 6803H, divided by four, is the free memory in K: two decimal places, the first a space below 10K, are written at 66F0H-66F1H and the line Memory: nnK is displayed.

6306
LD A,(6803H) 3A 03 68
Fetch the count of free pages from 6803H into Register A: pages of 256 bytes that a buffer can still take.
6309
RRCA 0F
Rotate Register A right (RRCA), the first of two rotations that divide the count by four.
630A
RRCA 0F
Rotate Register A right (RRCA) again: bits 7-2 of the count are now in bits 5-0.
630B
AND 3FH E6 3F
AND Register A with 3FH: Register A = the count divided by four, the free memory in K (four pages a K).
630D
LD HL,66F0H 21 F0 66
Point Register Pair HL to 66F0H, the two places of the number in the text Memory: K.
6310
LD B,FFH 06 FF
Load Register B with FFH, the count of tens less one: the first INC makes it 00H.
6312
INC B 04
INCrement Register B, the count of tens taken from Register A.
6313
SUB 0AH D6 0A
Subtract 0AH from Register A, one ten: the CARRY FLAG when Register A was below 10.
6315
If the NO CARRY FLAG is set (a ten taken), JUMP back to 6312H to count the next ten.
6317
PUSH AF F5
Save Register Pair AF (Register A = the units less 10) to the stack across the tens digit.
6318
LD A,B 78
Copy Register B (the count of tens) into Register A for the test of no tens.
6319
OR A B7
OR Register A with itself to set the Z FLAG when there are no tens.
631A
LD B,20H 06 20
Load Register B with 20H, the space for no tens; LD leaves the flags of the OR.
631C
If the Z FLAG is set (below 10K), JUMP to 6320H to store the space.
631E
LD B,30H 06 30
Load Register B with 30H, the character 0, the base of the tens digit.
6320
ADD A,B 80
ADD Register B to Register A: the space (00H + 20H) or the tens digit (n + 30H).
6321
LD (HL),A 77
Store Register A (the space or the tens digit) at Register Pair HL (66F0H).
6322
INC HL 23
INCrement Register Pair HL to 66F1H, the place of the units.
6323
POP AF F1
Restore Register Pair AF from the stack: Register A = the units less 10.
6324
ADD A,3AH C6 3A
ADD 3AH to Register A: the units + 30H, the units digit.
6326
LD (HL),A 77
Store Register A (the units digit) at Register Pair HL (66F1H).
6327
LD HL,66E6H 21 E6 66
Point Register Pair HL to 66E6H, the text Memory: nnK after two spaces, ended by 0DH.
632A
JUMP to 4467H, @DSPLY, to display the text at Register Pair HL (66E6H); it returns to the caller.

632DH - RES

CLEAR 0 after a device key. With no buffer (Register Pair BC = 0000H: DO and the switches) it is refused. For KI, PR, CL and DTD the buffer at Register Pair BC is emptied (6335H), its pages given back. For FS the switch is cleared and the file closed; for FR the FR and DTD switches are cleared and the file closed. A file's buffer is not emptied: characters received for the FR file and not yet written are lost to it and stay in 67FFH for the next file.

632D
LD A,B 78
Copy Register B (the high byte of the buffer control block) into Register A.
632E
OR C B1
OR Register C into Register A: the Z FLAG when Register Pair BC is 0000H, a device with no buffer.
632F
If the Z FLAG is set (no buffer), JUMP to 6364H, which takes the Z FLAG to the text Unacceptable command sequence!.
6331
LD A,D 7A
Copy Register D (the high byte of the file control block) into Register A.
6332
OR E B3
OR Register E into Register A: the Z FLAG when Register Pair DE is 0000H, a device that is not a file.
6333
If the NZ FLAG is set (FS or FR), JUMP to 634BH to switch it off and close the file.

6335H - Empty a Buffer

Register Pair BC points to the control block of a buffer: +00H-+01H the place where the next byte is put (low byte, page), +02H-+03H the place where the next byte is taken. The take place is set to the put place, and every page from the old take page up to the put page is given back to the free list by 64ECH, which also returns the next page of the buffer's chain.

6335
DI F3
Disable interrupts: the tasks must not use a buffer while its control block is changed.
6336
LD H,B 60
Copy Register B into Register H: Register Pair HL is the control block of the buffer.
6337
LD L,C 69
Copy Register C into Register L: Register Pair HL = the control block (Register Pair BC).
6338
LD C,(HL) 4E
Fetch byte +00H of the control block at Register Pair HL, the low byte of the put place, into Register C.
6339
INC HL 23
INCrement Register Pair HL to byte +01H of the control block.
633A
LD B,(HL) 46
Fetch byte +01H at Register Pair HL, the page of the put place, into Register B.
633B
INC HL 23
INCrement Register Pair HL to byte +02H of the control block.
633C
LD (HL),C 71
Store Register C (the low byte of the put place) at Register Pair HL, byte +02H: the take place gets it.
633D
INC HL 23
INCrement Register Pair HL to byte +03H of the control block.
633E
LD A,(HL) 7E
Fetch byte +03H at Register Pair HL, the old take page, into Register A.
633F
LD (HL),B 70
Store Register B (the put page) at Register Pair HL, byte +03H: the buffer is now empty.
6340
CP B B8
Compare Register A (the page reached) against Register B (the put page): the Z FLAG when the pages are all given back.
6341
If the Z FLAG is set (at the put page), JUMP to 6349H to switch the interrupts on again.
6343
LD H,A 67
Copy Register A (the page) into Register H, the page that 64ECH gives back.
6344
GOSUB to 64ECH to give the page in Register H back to the free list: Register A returns the next page of the chain.
6347
JUMP back to 6340H to compare the next page with the put page in Register B.
6349
EI FB
Enable interrupts again: the buffer is empty.
634A
RET C9
RETurn to the caller with the buffer empty and its pages free.

634BH - RES of a File Device

FS: the FS switch 601EH is cleared. FR: DTD (6129H) and FR (610FH) are cleared. Then the file is closed with @CLOSE; an error is shown by 63A1H.

634B
LD HL,678BH 21 8B 67
Point Register Pair HL to 678BH, the file control block of the FR file, to tell FS from FR.
634E
XOR A AF
Clear Register A (XOR A) to 00H, which also clears the CARRY FLAG for the SBC; 00H is the value stored below.
634F
SBC HL,DE ED 52
Subtract Register Pair DE from Register Pair HL (678BH): the Z FLAG when Register Pair DE is the FR file's control block.
6351
LD HL,601EH 21 1E 60
Point Register Pair HL to 601EH, the FS switch; LD leaves the flags of the SBC.
6354
If the NZ FLAG is set (FS), JUMP to 635CH to clear the FS switch at Register Pair HL.
6356
LD (6129H),A 32 29 61
Store Register A (00H) at 6129H, the DTD switch: the FR file is no longer written.
6359
LD HL,610FH 21 0F 61
Point Register Pair HL to 610FH, the FR switch.
635C
LD (HL),A 77
Store Register A (00H) at Register Pair HL, the FS switch (601EH) or the FR switch (610FH).
635D
GOSUB to 4428H, @CLOSE, to close the file whose control block is at Register Pair DE.
6360
JUMP to 63A1H to return, or to show the error of the close.

6362H - REWND and PEOF

CLEAR SHIFT % and CLEAR SHIFT ampersand after FS or FR: @REW or @PEOF on the file; for a device that is not a file the text Unacceptable command sequence! is shown. Their errors (for @PEOF also the end of file error it returns) are not shown.

6362
LD A,D 7A
Copy Register D (the high byte of the file control block) into Register A.
6363
OR E B3
OR Register E into Register A: the Z FLAG when Register Pair DE is 0000H, a device that is not a file.
6364
If the Z FLAG is set (no file, or no buffer from 632FH), JUMP to 6265H to display Unacceptable command sequence!.
6367
JUMP to 443FH, @REW, to rewind the file at Register Pair DE to its first record; it returns to the caller.
636A
LD A,D 7A
Copy Register D (the high byte of the file control block) into Register A.
636B
OR E B3
OR Register E into Register A: the Z FLAG when Register Pair DE is 0000H, a device that is not a file.
636C
If the Z FLAG is set (no file), JUMP to 6364H to display Unacceptable command sequence!.
636E
JUMP to 4448H, @PEOF, to position the file at Register Pair DE to its end; it returns to the caller.

6371H - ID

CLEAR 9 after FS or FR: File name: is asked, the answer (31 characters) is taken into the file's own sector buffer (Index Register IX, 6A00H or 6B00H) and given to @FSPEC; the FS file is opened with @OPEN, the FR file with @INIT (an existing file is opened, a new one created), both with that sector buffer and records of 256 bytes. A file already open gives File already open. The result of @FSPEC is not tested: a bad name reaches @OPEN or @INIT, whose error is shown.

6371
LD A,D 7A
Copy Register D (the high byte of the file control block) into Register A.
6372
OR E B3
OR Register E into Register A: the Z FLAG when Register Pair DE is 0000H, a device that is not a file.
6373
If the Z FLAG is set (no file), JUMP to 6364H to display Unacceptable command sequence!.
6375
LD A,(DE) 1A
Fetch the first byte of the file control block at Register Pair DE into Register A: bit 7 set while the file is open.
6376
RLCA 07
Rotate Register A left (RLCA): bit 7 goes into the CARRY FLAG.
6377
If the CARRY FLAG is set (the file is open), JUMP to 63B2H to display File already open.
6379
PUSH DE D5
Save Register Pair DE (the file control block) to the stack across the prompt and the input.
637A
PUSH IX DD E5
Save Index Register IX (the sector buffer of the file) to the stack, to take it into Register Pair HL.
637C
LD HL,6551H 21 51 65
Point Register Pair HL to 6551H, the text File name: on a new line, ended by 03H.
637F
GOSUB to 4467H, @DSPLY, to display the text at Register Pair HL (6551H) on the video.
6382
POP HL E1
Restore Register Pair HL from the stack: the sector buffer of the file (6A00H or 6B00H), where the name is typed.
6383
LD B,1FH 06 1F
Load Register B with 1FH, the longest answer, 31 characters.
6385
GOSUB to 63A7H to take a line of up to Register B characters at Register Pair HL: the CARRY FLAG after BREAK.
6388
POP DE D1
Restore Register Pair DE from the stack: the file control block.
6389
RET C D8
If the CARRY FLAG is set (BREAK), RETurn without opening the file.
638A
PUSH HL E5
Save Register Pair HL (the sector buffer with the name) to the stack across @FSPEC.
638B
GOSUB to 441CH, @FSPEC, to take the file specification at Register Pair HL into the control block at Register Pair DE.
638E
LD HL,676BH 21 6B 67
Point Register Pair HL to 676BH, the file control block of the FS file, to tell FS from FR.
6391
XOR A AF
Clear Register A (XOR A), which clears the CARRY FLAG for the SBC; the Z FLAG of @FSPEC is lost.
6392
SBC HL,DE ED 52
Subtract Register Pair DE from Register Pair HL (676BH): the Z FLAG when Register Pair DE is the FS file's control block.
6394
POP HL E1
Restore Register Pair HL from the stack: the sector buffer for @OPEN or @INIT.
6395
LD B,00H 06 00
Load Register B with 00H, the record length 256.
6397
If the NZ FLAG is set (FR), JUMP to 639EH to open or create the file with @INIT.
6399
GOSUB to 4424H, @OPEN, to open the existing file at Register Pair DE (676BH) with the buffer at Register Pair HL.
639C
JUMP to 63A1H to test the result of @OPEN and show its error.
639E
GOSUB to 4420H, @INIT, to open or create the file at Register Pair DE (678BH) with the buffer at Register Pair HL.
63A1
RET Z C8
If the Z FLAG is set (no error), RETurn to the caller.
63A2
OR C0H F6 C0
OR C0H into Register A (the error): bit 7, @ERROR returns to the caller, and bit 6, the short message.
63A4
JUMP to 4409H, @ERROR, to display the short message of the error in Register A; it returns to the caller.

63A7H - Take a Line; File Already Open; the Switch Helpers

63A7H takes a line at Register Pair HL with ROM 0040H and turns the cursor on again; 63B2H displays File already open. 63B8H, 63BDH and 63C2H switch FS, FR and DTD off.

63A7
GOSUB to 0040H, the ROM's line input at Register Pair HL of up to Register B characters: the CARRY FLAG after BREAK, Register B the count.
63AA
PUSH AF F5
Save Register Pair AF (the CARRY FLAG of the input) to the stack across the display.
63AB
LD A,0EH 3E 0E
Load Register A with 0EH, the code that turns the cursor on (ROM 0040H turns it off at the end).
63AD
GOSUB to 0033H, the ROM's display of the character in Register A (0EH).
63B0
POP AF F1
Restore Register Pair AF from the stack: the CARRY FLAG of the input.
63B1
RET C9
RETurn to the caller with the CARRY FLAG for BREAK and Register B the count of characters typed.
63B2
LD HL,655FH 21 5F 65
Point Register Pair HL to 655FH, the text File already open on a new line, ended by 0DH.
63B5
JUMP to 4467H, @DSPLY, to display the text at Register Pair HL (655FH); it returns to the caller.
63B8
XOR A AF
Clear Register A (XOR A) to 00H, the value of a switch that is off.
63B9
LD (601EH),A 32 1E 60
Store Register A (00H) at 601EH, the FS switch: the file is no longer sent.
63BC
RET C9
RETurn to the caller with Register A = 00H and FS switched off.
63BD
XOR A AF
Clear Register A (XOR A) to 00H, the value of a switch that is off.
63BE
LD (610FH),A 32 0F 61
Store Register A (00H) at 610FH, the FR switch: received characters no longer go into the buffer 67FFH.
63C1
RET C9
RETurn to the caller with Register A = 00H and FR switched off.
63C2
XOR A AF
Clear Register A (XOR A) to 00H, the value of a switch that is off.
63C3
LD (6129H),A 32 29 61
Store Register A (00H) at 6129H, the DTD switch: the buffer 67FFH is no longer written to the file.
63C6
RET C9
RETurn to the caller with Register A = 00H and DTD switched off.

63C7H - The Device Steps of the Main Loop

Each pass of the main loop sends one character to the line (6405H) and writes one to the printer (6477H) with the interrupts off, as the tasks do on every clock tick, takes one key (6434H) and writes one byte of the receive buffer to the FR file (6128H).

63C7
DI F3
Disable interrupts: the task 63D9H also sends through 6405H and must not run in the middle of it.
63C8
GOSUB to 6405H to send one character of the send buffer (or the one character slot) to the line.
63CB
EI FB
Enable interrupts again after the character was sent to the line.
63CC
GOSUB to 6434H to take one key from the keyboard; a command key is carried out from there.
63CF
DI F3
Disable interrupts: the task 6477H also prints through 6477H.
63D0
GOSUB to 6477H to print one character of the printer buffer when the printer is ready.
63D3
EI FB
Enable interrupts again after the printer step.
63D4
JUMP to 6128H for one step of DTD; it returns to 60F7H, the end of the pass.

63D7H - The Line Task

6CB3H adds the block 63D7H as task 8, which the clock interrupt runs on every tick (30 a second): its routine 63D9H takes a character from the line into the receive buffer 67F3H (63DFH) and sends one from the send buffer (6405H). A received character is translated by the XR parameter (63F0H replaces 63ECH); a null is kept only when the operand 63F5H is not 00H. 6CF0H fills that operand from 6E64H, a byte that the parameter table does not reach: NULL stores its value at 6E65H-6E66H, so NULL=OFF does not drop the nulls.

63D7-63D8
DEFW 63D9H D9 63
63D7H-63D8H: the task block of slot 8 (6CB3H): its first word is the address of the routine the clock interrupt runs, 63D9H.
63D9
GOSUB to 63DFH to take a character from the line, if there is one, into the receive buffer 67F3H.
63DC
JUMP to 6405H to send one character to the line; it returns to the clock interrupt.
63DF
LD A,FFH 3E FF
Load Register A with FFH, the line switch at 63E0H: 00H when the line is off (CLEAR 4 then CLEAR -).
63E1
OR A B7
OR Register A with itself to set the Z FLAG when the line switch (63E0H) is 00H.
63E2
RET Z C8
If the Z FLAG is set (the line off), RETurn: nothing is read from the line.
63E3
LD A,C 79
Copy Register C into Register A; the ROM's @GET that follows copies Register A into Register C and returns the byte in Register A.
63E4
LD DE,674BH 11 4B 67
Point Register Pair DE to 674BH, the control block of the line device.
63E7
GOSUB to 0013H, the ROM's @GET, to take a character from the device at Register Pair DE (674BH): the NZ FLAG and the character when one has come.
63EA
RET Z C8
If the Z FLAG is set (no character), RETurn to the task.
63EB
CP 00H FE 00
Compare Register A (the character) against 00H, the character to translate: 6CE4H stores the first byte (ff) of the XR parameter in this operand at 63ECH.
63ED
If the NZ FLAG is set (not the character ff), JUMP to 63F1H to keep it.
63EF
LD A,00H 3E 00
Load Register A with 00H, the character it becomes: 6CEAH stores the second byte (tt) of the XR parameter in this operand at 63F0H.
63F1
OR A B7
OR Register A with itself to set the Z FLAG for a null (00H).
63F2
If the NZ FLAG is set (not a null), JUMP to 63F9H to put the character into the receive buffer.
63F4
LD B,FFH 06 FF
Load Register B with FFH, the null switch at 63F5H, filled by 6CF0H from 6E64H: 00H drops received nulls.
63F6
INC B 04
INCrement Register B, the first half of the test of Register B for 00H.
63F7
DEC B 05
DECrement Register B back to the switch: the Z FLAG is set when the null switch (63F5H) is 00H.
63F8
RET Z C8
If the Z FLAG is set (nulls dropped), RETurn without keeping the null.
63F9
PUSH IX DD E5
Save Index Register IX (the task block 63D7H) to the stack across the buffer routine.
63FB
LD IX,67F3H DD 21 F3 67
Point Index Register IX to 67F3H, the control block of the receive buffer.
63FF
GOSUB to 648FH to put Register A into the buffer at Index Register IX (67F3H); the interrupts are already off in a task.
6402
POP IX DD E1
Restore Index Register IX from the stack: the task block 63D7H again.
6404
RET C9
RETurn to the caller, 63DCH of the task, which goes on to the send.

6405H - Send One Character to the Line

Nothing is sent while the send switch 6406H is 00H (after an XOFF or the pause character) or while the driver answers the status request 00H with the NZ FLAG (not ready). The one character slot 6412H (the XOFF of the warning) goes first, else the next character of the send buffer 67F7H. When the character sent is the pause character of HNDSH (642BH), the send switch is cleared.

6405
LD A,FFH 3E FF
Load Register A with FFH, the send switch at 6406H: 00H after an XOFF, or after the pause character, until an XON or CL ON.
6407
OR A B7
OR Register A with itself to set the Z FLAG when the send switch (6406H) is 00H.
6408
RET Z C8
If the Z FLAG is set (sending stopped), RETurn without sending.
6409
XOR A AF
Clear Register A (XOR A) to 00H, the status request of the control call.
640A
LD DE,674BH 11 4B 67
Point Register Pair DE to 674BH, the control block of the line device.
640D
GOSUB to 0023H, the ROM's @CTL, with Register A = 00H, the status request, to the device at Register Pair DE (674BH).
6410
RET NZ C0
If the NZ FLAG is set (the line cannot take a character now), RETurn without sending.
6411
LD C,00H 0E 00
Load Register C with 00H, the one character slot at 6412H: 600DH puts the XOFF character there with the warning.
6413
XOR A AF
Clear Register A (XOR A) to 00H, to empty the one character slot.
6414
LD (6412H),A 32 12 64
Store Register A (00H) at 6412H: the slot is sent only once.
6417
OR C B1
OR Register C into Register A: the Z FLAG when the slot held no character.
6418
If the NZ FLAG is set (a character in the slot), JUMP to 6427H to send Register A.
641A
PUSH IX DD E5
Save Index Register IX (the task block or the caller's) to the stack across the buffer routine.
641C
LD IX,67F7H DD 21 F7 67
Point Index Register IX to 67F7H, the control block of the send buffer.
6420
GOSUB to 64B4H to take the next character of the buffer at Index Register IX into Register A: the Z FLAG when it is empty.
6423
POP IX DD E1
Restore Index Register IX from the stack: the caller's value again.
6425
RET Z C8
If the Z FLAG is set (nothing to send), RETurn to the caller.
6426
LD C,A 4F
Copy Register A (the character) into Register C, for the test of the pause character.
6427
GOSUB to 001BH, the ROM's @PUT, to send Register A to the device at Register Pair DE (674BH).
642A
LD A,00H 3E 00
Load Register A with 00H, the pause character at 642BH: 6233H stores the key given after HNDSH, 623EH clears it.
642C
OR A B7
OR Register A with itself to set the Z FLAG when there is no pause character (642BH is 00H).
642D
RET Z C8
If the Z FLAG is set (no pause character), RETurn to the caller.
642E
SUB C 91
Subtract Register C (the character sent) from Register A (the pause character): the Z FLAG and 00H when they are the same.
642F
RET NZ C0
If the NZ FLAG is set (another character), RETurn to the caller.
6430
LD (6406H),A 32 06 64
Store Register A (00H) at 6406H, the send switch: the sending pauses until an XON or CL ON.
6433
RET C9
RETurn to the caller with the sending paused.

6434H - One Key from the Keyboard

ROM 002BH takes a key. A key with bit 7 set and the NO CARRY FLAG is a command (614AH). With KI on, every other key goes into the keyboard buffer 67EBH; BREAK (01H) without the CARRY FLAG sends a modem break instead: the control request 01H, the send buffer emptied, FS switched off, a wait of about 0.12 second (ROM 0060H with Register Pair BC = 2000H), and a null into the keyboard buffer; the driver ends the break when it sends that null. A key with the CARRY FLAG from the keyboard driver is taken as a character.

6434
GOSUB to 002BH, the ROM's keyboard scan: the key in Register A and the NZ FLAG, or the Z FLAG when no key is pressed.
6437
RET Z C8
If the Z FLAG is set (no key), RETurn to the device steps.
6438
LD D,01H 16 01
Load Register D with 01H, the mark for a key that came with the CARRY FLAG; LD leaves the flags.
643A
If the CARRY FLAG is set (from the keyboard driver), JUMP to 6441H to take the key as a character with Register D = 01H.
643C
LD D,00H 16 00
Load Register D with 00H: the key came without the CARRY FLAG.
643E
If the M FLAG is set (bit 7 of the key: CLEAR with a key), JUMP to 614AH to carry the command out.
6441
LD C,A 4F
Copy Register A (the key) into Register C, where the routine keeps it.
6442
LD A,FFH 3E FF
Load Register A with FFH, the KI switch at 6443H: 00H when the keyboard is off (CLEAR 1 then CLEAR -); the commands still work.
6444
OR A B7
OR Register A with itself to set the Z FLAG when the KI switch (6443H) is 00H.
6445
RET Z C8
If the Z FLAG is set (the keyboard off), RETurn: the key is dropped.
6446
LD A,C 79
Copy Register C (the key) into Register A to test it for BREAK.
6447
CP 01H FE 01
Compare Register A against 01H, the code of BREAK.
6449
If the NZ FLAG is set (not BREAK), JUMP to 6468H to put the key into the keyboard buffer.
644B
BIT 0,D CB 42
Test bit 0 of Register D, the mark of 6438H: set when BREAK came with the CARRY FLAG.
644D
If the NZ FLAG is set (01H with the CARRY FLAG), JUMP to 6468H to send 01H as a character.
644F
DI F3
Disable interrupts: the line task must not use the line during the control call.
6450
LD DE,674BH 11 4B 67
Point Register Pair DE to 674BH, the control block of the line device.
6453
GOSUB to 0023H, the ROM's @CTL, with Register A = 01H, the request that starts a break on the line at Register Pair DE (674BH).
6456
EI FB
Enable interrupts again after the control call.
6457
LD BC,67F7H 01 F7 67
Load Register Pair BC with 67F7H, the control block of the send buffer, to throw away what waits to be sent.
645A
GOSUB to 6335H to empty the buffer at Register Pair BC (67F7H).
645D
GOSUB to 63B8H to switch the FS device off (601EH = 00H): the file being sent stops.
6460
LD BC,2000H 01 00 20
Load Register Pair BC with 2000H, the count of the ROM's delay loop: the length of the break.
6463
GOSUB to 0060H, the ROM's delay of Register Pair BC (2000H) loops.
6466
LD C,00H 0E 00
Load Register C with 00H, the null that ends the break when it is sent.
6468
PUSH IX DD E5
Save Index Register IX (the caller's) to the stack across the buffer routine.
646A
LD IX,67EBH DD 21 EB 67
Point Index Register IX to 67EBH, the control block of the keyboard buffer.
646E
LD A,C 79
Copy Register C (the key, or 00H after a break) into Register A for the buffer routine.
646F
GOSUB to 6812H to put Register A into the buffer at Index Register IX (67EBH) with the interrupts off.
6472
POP IX DD E1
Restore Index Register IX from the stack: the caller's value again.
6474
RET C9
RETurn to the device steps, 63CFH, which goes on to the printer.

6475H - The Printer Task

6CBBH adds the block 6475H as task 9, run on every clock tick; the main loop also calls its routine (63D0H). When the printer is ready (the ROM's @CTL with the request 00H to the printer's control block 4025H returns the Z FLAG), one character of the printer buffer 67EFH is printed.

6475-6476
DEFW 6477H 77 64
6475H-6476H: the task block of slot 9 (6CBBH): its first word is the address of the routine the clock interrupt runs, 6477H.
6477
XOR A AF
Clear Register A (XOR A) to 00H, the status request of the control call.
6478
LD DE,4025H 11 25 40
Point Register Pair DE to 4025H, the printer's device control block.
647B
GOSUB to 0023H, the ROM's @CTL, with Register A = 00H, the status request, to the printer at Register Pair DE (4025H).
647E
RET NZ C0
If the NZ FLAG is set (the printer busy), RETurn without printing.
647F
PUSH IX DD E5
Save Index Register IX (the task block or the caller's) to the stack across the buffer routine.
6481
LD IX,67EFH DD 21 EF 67
Point Index Register IX to 67EFH, the control block of the printer buffer.
6485
GOSUB to 64B4H to take the next character of the buffer at Index Register IX into Register A: the Z FLAG when it is empty.
6488
POP IX DD E1
Restore Index Register IX from the stack: the caller's value again.
648A
RET Z C8
If the Z FLAG is set (nothing to print), RETurn to the caller.
648B
GOSUB to 003BH, the ROM's print of the character in Register A (through the control block 4025H).
648E
RET C9
RETurn to the caller, the clock interrupt or 63D3H.

648FH - Put a Byte into a Buffer

Each of the six buffers is a chain of pages of 256 bytes, taken from the free list in the page table 6900H as it grows and given back as it is emptied; its control block holds the put place (+00H low byte, +01H page) and the take place (+02H, +03H). When the put place reaches the end of a page, a new page is linked to it (64D4H) and the count of free pages 6803H goes down; with seven or fewer left (below 2K), the warning switch 6001H is set. When no page is left, the put place stays on the last byte, so the next byte overwrites it.

648F
LD L,(IX+00H) DD 6E 00
Fetch byte +00H of the control block at Index Register IX, the low byte of the put place, into Register L.
6492
LD H,(IX+01H) DD 66 01
Fetch byte +01H of the control block at Index Register IX, the page of the put place, into Register H.
6495
LD (HL),A 77
Store Register A (the byte) at Register Pair HL, the put place of the buffer.
6496
INC (IX+00H) DD 34 00
INCrement byte +00H of the control block at Index Register IX, the low byte of the put place: the Z FLAG at the end of the page.
6499
RET NZ C0
If the NZ FLAG is set (still in the page), RETurn with the byte stored.
649A
GOSUB to 64D4H to link a free page after page Register H: Register A = the new page, or the Z FLAG when none is left.
649D
If the Z FLAG is set (no free page), JUMP to 64AFH to keep the put place on the last byte.
649F
LD (IX+01H),A DD 77 01
Store Register A (the new page) at byte +01H of the control block at Index Register IX: the put place moves to it.
64A2
LD HL,6803H 21 03 68
Point Register Pair HL to 6803H, the count of free pages.
64A5
DEC (HL) 35
DECrement the count of free pages at Register Pair HL (6803H): one page more is used.
64A6
LD A,07H 3E 07
Load Register A with 07H, the most free pages that give the warning (seven pages, 1792 bytes, below 2K).
64A8
CP (HL) BE
Compare Register A (07H) against the count at Register Pair HL: the CARRY FLAG when more than seven pages are free.
64A9
RET C D8
If the CARRY FLAG is set (enough room), RETurn with the NZ FLAG.
64AA
LD (6001H),A 32 01 60
Store Register A (07H) at 6001H, the operand of LD A,00H at 6000H: the main loop shows the warning and sends XOFF.
64AD
OR A B7
OR Register A with itself to set the NZ FLAG: the byte was stored.
64AE
RET C9
RETurn to the caller with the NZ FLAG: the byte is in the buffer.
64AF
DEC (IX+00H) DD 35 00
DECrement byte +00H of the control block at Index Register IX: the put place goes back to the last byte of the page.
64B2
XOR A AF
Clear Register A (XOR A) to 00H, which sets the Z FLAG: no room left.
64B3
RET C9
RETurn to the caller with the Z FLAG; the byte stays at the put place until the next one overwrites it.

64B4H - Take a Byte from a Buffer

The take place (+02H, +03H) equal to the put place means an empty buffer (the Z FLAG). Otherwise the byte is returned with the NZ FLAG; when the take place passes the end of a page, the page is given back to the free list and the take place moves to the next page of the chain.

64B4
LD L,(IX+02H) DD 6E 02
Fetch byte +02H of the control block at Index Register IX, the low byte of the take place, into Register L.
64B7
LD H,(IX+03H) DD 66 03
Fetch byte +03H of the control block at Index Register IX, the page of the take place, into Register H.
64BA
LD A,L 7D
Copy Register L (the low byte of the take place) into Register A.
64BB
CP (IX+00H) DD BE 00
Compare Register A against byte +00H of the control block at Index Register IX, the low byte of the put place.
64BE
If the NZ FLAG is set (not the same place), JUMP to 64C5H to take the byte.
64C0
LD A,H 7C
Copy Register H (the page of the take place) into Register A.
64C1
CP (IX+01H) DD BE 01
Compare Register A against byte +01H of the control block at Index Register IX, the page of the put place.
64C4
RET Z C8
If the Z FLAG is set (take place = put place), RETurn with the Z FLAG: the buffer is empty.
64C5
LD A,(HL) 7E
Fetch the byte at Register Pair HL, the take place, into Register A.
64C6
INC (IX+02H) DD 34 02
INCrement byte +02H of the control block at Index Register IX: the Z FLAG when the take place passes the end of the page.
64C9
RET NZ C0
If the NZ FLAG is set (still in the page), RETurn with the byte in Register A and the NZ FLAG.
64CA
PUSH AF F5
Save Register Pair AF (Register A = the byte) to the stack across the page change.
64CB
GOSUB to 64ECH to give the page in Register H back to the free list: Register A returns the next page of the chain.
64CE
LD (IX+03H),A DD 77 03
Store Register A (the next page) at byte +03H of the control block at Index Register IX: the take place moves to it.
64D1
POP AF F1
Restore Register Pair AF from the stack: Register A = the byte.
64D2
DEC H 25
DECrement Register H (69H from 64ECH) to 68H: the NZ FLAG for the caller, the byte is in Register A.
64D3
RET C9
RETurn to the caller with the byte and the NZ FLAG.

64D4H - Take a Page from the Free List

The page table 6900H holds at 69nnH the page that follows page nn in its chain (00H for the last). 6900H is the first page of the free list, 6901H its last. 64D4H unlinks the first free page and links it after page Register H; the last free page is never given out, so the call fails (the Z FLAG) when only one is left. 64ECH gives page Register H back at the end of the free list and returns the page that followed it.

64D4
LD L,H 6C
Copy Register H (the page to link from) into Register L.
64D5
LD H,69H 26 69
Load Register H with 69H: Register Pair HL = 69nnH, the link of that page in the page table.
64D7
LD A,(6900H) 3A 00 69
Fetch the first page of the free list from 6900H into Register A.
64DA
PUSH HL E5
Save Register Pair HL (the link of the page to link from) to the stack.
64DB
LD L,A 6F
Copy Register A (the first free page) into Register L: Register Pair HL = its link in the page table.
64DC
LD A,(HL) 7E
Fetch the link at Register Pair HL, the second free page, into Register A.
64DD
OR A B7
OR Register A with itself to set the Z FLAG when the first free page is the last one.
64DE
If the NZ FLAG is set (two or more free pages), JUMP to 64E2H to take the first one.
64E0
POP HL E1
Restore Register Pair HL from the stack (the link of the page to link from).
64E1
RET C9
RETurn with the Z FLAG and Register A = 00H: no page to give.
64E2
LD (6900H),A 32 00 69
Store Register A (the second free page) at 6900H: it is now the first page of the free list.
64E5
LD A,L 7D
Copy Register L (the page taken) into Register A.
64E6
POP HL E1
Restore Register Pair HL from the stack: the link of the page to link from.
64E7
LD (HL),A 77
Store Register A (the page taken) at Register Pair HL: the page taken follows that page in its chain.
64E8
LD L,A 6F
Copy Register A (the page taken) into Register L: Register Pair HL = the link of the page taken.
64E9
LD (HL),00H 36 00
Store 00H at Register Pair HL, the link of the page taken: it is the last page of its chain.
64EB
RET C9
RETurn with Register A = the page taken and the NZ FLAG of 64DDH.
64EC
LD A,(6803H) 3A 03 68
Fetch the count of free pages from 6803H into Register A.
64EF
INC A 3C
INCrement Register A, the count of free pages: one page more is free.
64F0
LD (6803H),A 32 03 68
Store Register A (the new count) at 6803H, the count of free pages.
64F3
LD A,(6901H) 3A 01 69
Fetch the last page of the free list from 6901H into Register A.
64F6
LD L,A 6F
Copy Register A (the last free page) into Register L.
64F7
LD A,H 7C
Copy Register H (the page given back) into Register A.
64F8
LD H,69H 26 69
Load Register H with 69H: Register Pair HL = the link of the last free page in the page table.
64FA
LD (HL),A 77
Store Register A (the page given back) at Register Pair HL: it follows the last free page.
64FB
LD (6901H),A 32 01 69
Store Register A (the page given back) at 6901H: it is now the last page of the free list.
64FE
LD L,A 6F
Copy Register A (the page given back) into Register L: Register Pair HL = its link in the page table.
64FF
LD A,(HL) 7E
Fetch the link at Register Pair HL, the next page of the chain it came from, into Register A.
6500
LD (HL),00H 36 00
Store 00H at Register Pair HL, the link of the page given back: the end of the free list.
6502
RET C9
RETurn with Register A = the page that followed the page given back.

6503H - CMD: a DOS Command

CLEAR SHIFT 0 asks Enter command: and takes up to 64 characters at 67ABH. With bit 4 of 4758H set (the only file that sets it), SYS1/SYS carries the command out through @CMNDR (429CH) and returns without loading a program, which would overwrite LCOMM; the tasks go on buffering the line meanwhile. Command completed is displayed afterwards.

6503
LD HL,652DH 21 2D 65
Point Register Pair HL to 652DH, two new lines and the prompt Enter command:, ended by 0DH.
6506
GOSUB to 4467H, @DSPLY, to display the text at Register Pair HL (652DH) on the video.
6509
LD B,40H 06 40
Load Register B with 40H, the longest command line, 64 characters.
650B
LD HL,67ABH 21 AB 67
Point Register Pair HL to 67ABH, the line buffer for the command.
650E
GOSUB to 63A7H to take a line of up to Register B characters at Register Pair HL: the CARRY FLAG after BREAK.
6511
RET C D8
If the CARRY FLAG is set (BREAK), RETurn without a command.
6512
INC B 04
INCrement Register B (the count of characters typed), the first half of the test for 00H.
6513
DEC B 05
DECrement Register B back to the count: the Z FLAG when ENTER alone was typed.
6514
RET Z C8
If the Z FLAG is set (nothing typed), RETurn without a command.
6515
PUSH HL E5
Save Register Pair HL (67ABH, the command) to the stack.
6516
LD HL,4758H 21 58 47
Point Register Pair HL to 4758H, the status byte of SYS1/SYS's command interpreter.
6519
SET 4,(HL) CB E6
Set bit 4 of the byte at Register Pair HL (4758H): SYS1/SYS does not load a program, it returns (4E9AH).
651B
EX (SP),HL E3
EXchange Register Pair HL with the top of the stack (Stack Pointer): Register Pair HL = 67ABH, 4758H kept on the stack.
651C
GOSUB to 429CH, @CMNDR, to carry out the command line at Register Pair HL (67ABH) and return here.
651F
POP HL E1
Restore Register Pair HL from the stack: 4758H.
6520
RES 4,(HL) CB A6
Reset bit 4 of the byte at Register Pair HL (4758H): later commands run as usual.
6522
LD HL,653EH 21 3E 65
Point Register Pair HL to 653EH, a new line and the text Command completed, ended by 0DH.
6525
JUMP to 4467H, @DSPLY, to display the text at Register Pair HL (653EH); it returns to the caller.

6528H - The Texts of the Commands and the Menu

The texts end with 0DH (a new line after them) or 03H (the cursor stays after them). 1DH puts the cursor at the start of its line. The menu text 6573H-6693H has five lines; the asterisks are written into the first and the last line by 6280H, at the places that the table 6694H gives.

6528
DEFB 7BH 7B
6528H: the brace {, the start of the hex display of a received control character (6082H).
6529-652A
DEFB 20H x 2 20 x 2
6529H-652AH: two spaces, the places where 607FH writes the two hex digits of the control character.
652B-652C
DEFB 7DH, 03H 7D 03
652BH-652CH: the brace } and 03H, the end of the text: the cursor stays after it.
652D-652E
DEFB 0AH, 0AH 0A 0A
652DH-652EH: two new lines before the prompt of the CMD function (6503H).
652F-653C
DEFM "Enter command:" 45 6E 74 65 72 20 63 6F 6D 6D 61 6E 64 3A
652FH-653CH: the prompt of CLEAR SHIFT 0; the command is typed on the next line.
653D
DEFB 0DH 0D
653DH: 0DH, the end of the prompt and a new line for the command.
653E
DEFB 0AH 0A
653EH: 0AH, a new line before the text displayed after the command (6522H).
653F-654F
DEFM "Command completed" 43 6F 6D 6D 61 6E 64 20 63 6F 6D 70 6C 65 74 65 64
653FH-654FH: the text displayed when @CMNDR has come back.
6550
DEFB 0DH 0D
6550H: 0DH, the end of the text Command completed.
6551-6552
DEFB 1DH, 0AH 1D 0A
6551H-6552H: 1DH, the cursor to the start of the line, and 0AH, a new line, before the ID prompt (637CH).
6553-655D
DEFM "File name: " 46 69 6C 65 20 6E 61 6D 65 3A 20
6553H-655DH: the prompt of ID; the file specification is typed after it.
655E
DEFB 03H 03
655EH: 03H, the end of the prompt: the cursor stays after it.
655F-6560
DEFB 1DH, 0AH 1D 0A
655FH-6560H: 1DH, the cursor to the start of the line, and 0AH, a new line, before the text of 63B2H.
6561-6571
DEFM "File already open" 46 69 6C 65 20 61 6C 72 65 61 64 79 20 6F 70 65 6E
6561H-6571H: the text of ID for a file device whose file is open.
6572
DEFB 0DH 0D
6572H: 0DH, the end of the text File already open.
6573
DEFB 0AH 0A
6573H: 0AH, the new line that starts the menu displayed by 62BDH.
6574-65AC
DEFB 20H x 57 20 x 57
6574H-65ACH: the first line of the menu, 57 spaces: an asterisk above each shifted function that is on; 65ABH-65ACH get the pause character in hex.
65AD
DEFB 0AH 0A
65ADH: 0AH, the end of the first line of the menu.
65AE-65EB
DEFM "DUPLX ECHO ECOLF ACCLF REWND PEOF DCC CLS 8-B CMD HNDSH EXIT" 44 55 50 4C 58 20 45 43 48 4F 20 20 45 43 4F 4C 46 20 41 43 43 4C 46 20 52 45 57 4E 44 20 50 45 4F 46 20 20 44 43 43 20 43 4C 53 20 38 2D 42 20 43 4D 44 20 48 4E 44 53 48 20 45 58 49 54
65AEH-65EBH: the labels of the shifted functions, above the keys 1 to 9, 0, : and - that give them with CLEAR and SHIFT.
65EC
DEFB 0AH 0A
65ECH: 0AH, the end of the second line of the menu.
65ED-662B
DEFM "==1== ==2== ==3== ==4== ==5== ==6== =7= =8= =9= =0= ==:== ==-==" 3D 3D 31 3D 3D 20 3D 3D 32 3D 3D 20 3D 3D 33 3D 3D 20 3D 3D 34 3D 3D 20 3D 3D 35 3D 3D 20 3D 3D 36 3D 3D 20 3D 37 3D 20 3D 38 3D 20 3D 39 3D 20 3D 30 3D 20 3D 3D 3A 3D 3D 20 3D 3D 2D 3D 3D
65EDH-662BH: the keys of the top row, in the order of the keyboard.
662C
DEFB 0AH 0A
662CH: 0AH, the end of the third line of the menu.
662D-666A
DEFM " *KI *DO *PR *CL *FS *FR DTD ??? ID RES ON OFF" 20 2A 4B 49 20 20 20 2A 44 4F 20 20 20 2A 50 52 20 20 20 2A 43 4C 20 20 20 2A 46 53 20 20 20 2A 46 52 20 20 44 54 44 20 3F 3F 3F 20 49 44 20 20 52 45 53 20 20 4F 4E 20 20 20 20 4F 46 46
662DH-666AH: the labels of the keys with CLEAR alone: the six devices, DTD, the menu, ID, RES, ON and OFF.
666B
DEFB 0AH 0A
666BH: 0AH, the end of the fourth line of the menu.
666C-6692
DEFB 20H x 39 20 x 39
666CH-6692H: the last line of the menu, 39 spaces: an asterisk below each device and DTD that is on.
6693
DEFB 0DH 0D
6693H: 0DH, the end of the menu text displayed by 62BDH.

6694H - The Menu Table

15 entries of two words: the address of a switch and the place of its asterisk in the menu text (6280H). The last entry must be HNDSH: 62ADH reads its switch after the loop.

6694-6697
DEFW 6443H, 666EH 43 64 6E 66
6694H-6697H: the KI switch 6443H and its place 666EH, below the label KI.
6698-669B
DEFW 60FBH, 6674H FB 60 74 66
6698H-669BH: the DO switch 60FBH and its place 6674H, below the label DO.
669C-669F
DEFW 611CH, 667AH 1C 61 7A 66
669CH-669FH: the PR switch 611CH and its place 667AH, below the label PR.
66A0-66A3
DEFW 6406H, 667FH 06 64 7F 66
66A0H-66A3H: the send switch 6406H and its place 667FH, the first of the two below the label CL.
66A4-66A7
DEFW 63E0H, 6681H E0 63 81 66
66A4H-66A7H: the line switch 63E0H and its place 6681H, the second below the label CL.
66A8-66AB
DEFW 601EH, 6686H 1E 60 86 66
66A8H-66ABH: the FS switch 601EH and its place 6686H, below the label FS.
66AC-66AF
DEFW 610FH, 668CH 0F 61 8C 66
66ACH-66AFH: the FR switch 610FH and its place 668CH, below the label FR.
66B0-66B3
DEFW 6129H, 6691H 29 61 91 66
66B0H-66B3H: the DTD switch 6129H and its place 6691H, below the label DTD.
66B4-66B7
DEFW 603EH, 6576H 3E 60 76 65
66B4H-66B7H: the DUPLX switch 603EH and its place 6576H, above the label DUPLX.
66B8-66BB
DEFW 60B9H, 657CH B9 60 7C 65
66B8H-66BBH: the ECHO switch 60B9H and its place 657CH, above the label ECHO.
66BC-66BF
DEFW 6058H, 6582H 58 60 82 65
66BCH-66BFH: the ECOLF switch 6058H and its place 6582H, above the label ECOLF.
66C0-66C3
DEFW 60CCH, 6588H CC 60 88 65
66C0H-66C3H: the ACCLF switch 60CCH and its place 6588H, above the label ACCLF.
66C4-66C7
DEFW 6072H, 6599H 72 60 99 65
66C4H-66C7H: the DCC switch 6072H and its place 6599H, above the label DCC.
66C8-66CB
DEFW 608AH, 65A1H 8A 60 A1 65
66C8H-66CBH: the 8-B switch 608AH and its place 65A1H, above the label 8-B.
66CC-66CF
DEFW 6093H, 65A9H 93 60 A9 65
66CCH-66CFH: the HNDSH switch 6093H and its place 65A9H, above the label HNDSH; the last entry.

66D0H - The Texts of the Menu's Last Line and the Messages

FS-Spec:, FR-Spec: and Memory: follow one another on the line after the menu; the two warnings end with a new line.

66D0-66D8
DEFM "FS-Spec: " 46 53 2D 53 70 65 63 3A 20
66D0H-66D8H: the text before the name of the open FS file (62D9H).
66D9
DEFB 03H 03
66D9H: 03H, the end of the text: the name follows on the same line.
66DA-66E4
DEFM " FR-Spec: " 20 20 46 52 2D 53 70 65 63 3A 20
66DAH-66E4H: the text before the name of the open FR file (62FCH).
66E5
DEFB 03H 03
66E5H: 03H, the end of the text: the name follows on the same line.
66E6-66EF
DEFM " Memory: " 20 20 4D 65 6D 6F 72 79 3A 20
66E6H-66EFH: the text of the free memory (6327H).
66F0-66F1
DEFB 20H x 2 20 x 2
66F0H-66F1H: the two places of the free memory in K, written by 6321H and 6326H.
66F2
DEFM "K" 4B
66F2H: the letter K after the number of the free memory.
66F3
DEFB 0DH 0D
66F3H: 0DH, the end of the line after the menu (FS, FR, Memory).
66F4-6711
DEFM "Unacceptable command sequence!" 55 6E 61 63 63 65 70 74 61 62 6C 65 20 63 6F 6D 6D 61 6E 64 20 73 65 71 75 65 6E 63 65 21
66F4H-6711H: the text of 6265H, for a key with bit 7 set or a second key that LCOMM does not take.
6712
DEFB 0DH 0D
6712H: 0DH, the end of the text Unacceptable command sequence!.
6713-6749
DEFM "Warning! Less than 2K of buffer left! X-OFF transmitted" 57 61 72 6E 69 6E 67 21 20 4C 65 73 73 20 74 68 61 6E 20 32 4B 20 6F 66 20 62 75 66 66 65 72 20 6C 65 66 74 21 20 58 2D 4F 46 46 20 74 72 61 6E 73 6D 69 74 74 65 64
6713H-6749H: the text of 6005H when a buffer has left seven or fewer free pages.
674A
DEFB 0DH 0D
674AH: 0DH, the end of the warning; the code of 6000H shows it.

674BH - The Control Blocks and the Buffers

674BH-67EAH are not in the file: the control block of the line device, the file control blocks of the FS and FR files (their first bytes cleared by the start-up) and the line buffer. 67EBH-6802H are the six buffer control blocks, set up by the start-up; 6803H, not in the file, counts the free pages. Above the routines at 6804H-681DH, 681EH-68FFH are not used; the page table is at 6900H, the sector buffers of the two files at 6A00H and 6B00H, and the buffer pages from 6C00H, over the start-up, up to HIGH$.

674B-676A
DEFS 32
674BH-676AH: not in the file. The control block of the line device: @FSPEC (6C13H) and @OPEN (6C2BH) of the device named in the command, used by @GET, @PUT and @CTL.
676B-678A
DEFS 32
676BH-678AH: not in the file. The file control block of the FS file: 6C38H clears its first byte, ID opens it with @OPEN (6399H).
678B-67AA
DEFS 32
678BH-67AAH: not in the file. The file control block of the FR file: 6C3BH clears its first byte, ID opens it with @INIT (639EH).
67AB-67EA
DEFS 64
67ABH-67EAH: not in the file. The line buffer of the CMD function (650BH) and the copy of a control block for @FNAME (62C7H, 62EAH).
67EB-67EE
DEFB 00H x 4 00 x 4
67EBH-67EEH: the control block of the keyboard buffer (put place, take place), filled by 6C5BH.
67EF-67F2
DEFB 00H x 4 00 x 4
67EFH-67F2H: the control block of the printer buffer, filled by 6C62H.
67F3-67F6
DEFB 00H x 4 00 x 4
67F3H-67F6H: the control block of the receive buffer, filled by 6C69H.
67F7-67FA
DEFB 00H x 4 00 x 4
67F7H-67FAH: the control block of the send buffer, filled by 6C70H.
67FB-67FE
DEFB 00H x 4 00 x 4
67FBH-67FEH: the control block of the FS buffer, filled by 6C77H; no other instruction uses it, so its page stays taken.
67FF-6802
DEFB 00H x 4 00 x 4
67FFH-6802H: the control block of the receive file buffer, filled by 6C7EH, emptied to the FR file by DTD.
6803
DEFS 1
6803H: not in the file. The count of free pages, counted by 6C85H, kept by 64A5H and 64F0H, shown in K by the menu.

6804H - The File Room Test and the Buffer Calls

The FS file is read only while at least 18 pages are free (6022H). 6812H and 6818H call the put and take routines with the interrupts off, since the tasks use the same buffers and the page table.

6804
LD A,(6803H) 3A 03 68
Fetch the count of free pages from 6803H into Register A.
6807
CP 12H FE 12
Compare Register A (the free pages) against 12H, 18 pages (4.5K): the CARRY FLAG when fewer are free.
6809
If the CARRY FLAG is set (fewer than 18 free pages), JUMP to 6060H: the file waits, the receive buffers keep their room.
680C
LD DE,676BH 11 6B 67
Point Register Pair DE to 676BH, the file control block of the FS file.
680F
JUMP to 6025H to read the next byte of the FS file with the ROM's @GET.
6812
DI F3
Disable interrupts: the tasks must not change a buffer or the page table during the put.
6813
GOSUB to 648FH to put Register A into the buffer at Index Register IX.
6816
EI FB
Enable interrupts again after the put into the buffer at Index Register IX.
6817
RET C9
RETurn to the caller; the flags of 648FH are kept.
6818
DI F3
Disable interrupts: the tasks must not change a buffer or the page table during the take.
6819
GOSUB to 64B4H to take the next byte of the buffer at Index Register IX into Register A: the Z FLAG when it is empty.
681C
EI FB
Enable interrupts again after the take from the buffer at Index Register IX.
681D
RET C9
RETurn to the caller with the byte in Register A and the flags of 64B4H.
681E-68FF
DEFS 226
681EH-68FFH: not in the file and not used by LCOMM.
6900-69FF
DEFS 256
6900H-69FFH: not in the file. The page table: 6900H the first free page, 6901H the last free page, 69nnH the page after page nn (6C47H, 64D4H, 64ECH).
6A00-6AFF
DEFS 256
6A00H-6AFFH: not in the file. The sector buffer of the FS file, and the name typed at its ID (61B7H, 6382H).
6B00-6BFF
DEFS 256
6B00H-6BFFH: not in the file. The sector buffer of the FR file, and the name typed at its ID (61C8H, 6382H).

6C00H - The Start-up: the Device and the Parameters

LDOS Ready loads LCOMM/CMD at 6000H-6E6DH and jumps to 6C00H, the transfer address, with Register Pair HL at the rest of the command line. The command is LCOMM devspec (parameters) (M-40-060): XLATES or XS=X'fftt' and XLATER or XR=X'fftt' translate one character sent and received, NULL or N keeps or drops received nulls, XON and XOFF set the handshake characters. KI/DVR must be active (bit 4 of DFLAG$). The device specification must start with an asterisk and is opened as a device; its errors end LCOMM through @ERROR.

6C00
PUSH HL E5
Save Register Pair HL (the command line after LCOMM) to the stack across the banner.
6C01
LD HL,6D1AH 21 1A 6D
Point Register Pair HL to 6D1AH, the banner: a new line, the name and version, the copyright, ended by 0DH.
6C04
GOSUB to 4467H, @DSPLY, to display the text at Register Pair HL (6D1AH) on the video.
6C07
LD A,(4289H) 3A 89 42
Fetch DFLAG$, the device flags, from 4289H into Register A: KI/DVR sets bit 4 when it is installed.
6C0A
BIT 4,A CB 67
Test bit 4 of Register A (KI/DVR active): LCOMM needs its CLEAR key codes and its control characters.
6C0C
POP HL E1
Restore Register Pair HL from the stack: the command line after LCOMM.
6C0D
If the Z FLAG is set (no KI/DVR), JUMP to 6D05H to display LCOMM requires KI/DVR active! and abort.
6C10
LD DE,674BH 11 4B 67
Point Register Pair DE to 674BH, the control block of the line device.
6C13
GOSUB to 441CH, @FSPEC, to take the specification at Register Pair HL into the control block at Register Pair DE (674BH).
6C16
If the NZ FLAG is set (no specification), JUMP to 6D11H, inside the LD IX at 6D10H, to display Comm Line driver not specified!.
6C19
LD A,(DE) 1A
Fetch the first character of the specification at Register Pair DE (674BH) into Register A.
6C1A
CP 2AH FE 2A
Compare Register A against 2AH, the asterisk that starts a device specification such as the CL device.
6C1C
If the NZ FLAG is set (a file name, not a device), JUMP to 6D11H to display Comm Line driver not specified!.
6C1F
LD DE,6E23H 11 23 6E
Point Register Pair DE to 6E23H, the parameter table: XLATES, XS, XLATER, XR, NULL, N, XON and XOFF.
6C22
GOSUB to 4454H, @PARAM, to take the parameters at Register Pair HL and store each value at its address in the table (Register Pair DE).
6C25
If the NZ FLAG is set (a bad parameter), JUMP to 6D0DH, inside the LD IX at 6D0CH, to display Parameter error!.
6C28
LD DE,674BH 11 4B 67
Point Register Pair DE to 674BH, the control block of the line device.
6C2B
GOSUB to 4424H, @OPEN, to open the device named in the control block at Register Pair DE (674BH).
6C2E
If the NZ FLAG is set (the device cannot be opened), JUMP to 4409H, @ERROR: the long message, then the abort.
6C31
LD HL,6D86H 21 86 6D
Point Register Pair HL to 6D86H, the text Use <CLEAR-8> for menu, ended by 0DH.
6C34
GOSUB to 4467H, @DSPLY, to display the text at Register Pair HL (6D86H) on the video.
6C37
XOR A AF
Clear Register A (XOR A) to 00H, the first byte of a file control block that is not open.
6C38
LD (676BH),A 32 6B 67
Store Register A (00H) at 676BH, the first byte of the FS file's control block: no FS file is open.
6C3B
LD (678BH),A 32 8B 67
Store Register A (00H) at 678BH, the first byte of the FR file's control block: no FR file is open.

6C3EH - The Free List and the Six Buffers

The pages from 6C00H, where the start-up itself lies, up to the last whole page below HIGH$ are chained into the free list of the page table 6900H. Each of the six buffers gets its first page (6C9BH) and an empty control block; the free pages left, less the last one, are counted into 6803H.

6C3E
LD HL,(4411H) 2A 11 44
Fetch HIGH$, the highest address free for programs, from 4411H into Register Pair HL.
6C41
INC HL 23
INCrement Register Pair HL to the first address above the free memory.
6C42
DEC H 25
DECrement Register H: Register H = the page below that address, the last whole page that LCOMM may use.
6C43
LD B,H 44
Copy Register H (the last page) into Register B, the end of the free list.
6C44
LD HL,6900H 21 00 69
Point Register Pair HL to 6900H, the page table.
6C47
LD A,6CH 3E 6C
Load Register A with 6CH, the first page of the free list: 6C00H, the page of this start-up code.
6C49
LD (HL),A 77
Store Register A (6CH) at Register Pair HL (6900H), the first page of the free list.
6C4A
INC L 2C
INCrement Register L to 6901H, the last page of the free list.
6C4B
LD (HL),B 70
Store Register B (the last page) at Register Pair HL (6901H).
6C4C
INC L 2C
INCrement Register L to 6902H, the link of page 02H, which LCOMM does not use.
6C4D
LD (HL),A 77
Store Register A (6CH) at Register Pair HL (6902H); nothing reads 6902H.
6C4E
INC L 2C
INCrement Register L to 6903H, the link of page 03H, which LCOMM does not use.
6C4F
LD (HL),B 70
Store Register B (the last page) at Register Pair HL (6903H); nothing reads 6903H.
6C50
LD L,A 6F
Copy Register A (the page) into Register L: Register Pair HL = its link in the page table.
6C51
INC A 3C
INCrement Register A to the next page, the one that follows page Register L.
6C52
LD (HL),A 77
Store Register A (the next page) at Register Pair HL: page Register L is followed by page Register A.
6C53
CP B B8
Compare Register A (the page linked) against Register B (the last page).
6C54
If the NZ FLAG is set (not yet the last page), JUMP back to 6C50H to link the next one.
6C56
LD L,A 6F
Copy Register A (the last page) into Register L: Register Pair HL = its link in the page table.
6C57
LD (HL),00H 36 00
Store 00H at Register Pair HL, the link of the last page: the end of the free list.
6C59
LD H,04H 26 04
Load Register H with 04H, the page that the first buffer's page is linked from: 6904H-6909H are links of pages that do not exist.
6C5B
LD IX,67EBH DD 21 EB 67
Point Index Register IX to 67EBH, the control block of the keyboard buffer.
6C5F
GOSUB to 6C9BH to give the buffer at Index Register IX its first page.
6C62
LD IX,67EFH DD 21 EF 67
Point Index Register IX to 67EFH, the control block of the printer buffer.
6C66
GOSUB to 6C9BH to give the buffer at Index Register IX its first page.
6C69
LD IX,67F3H DD 21 F3 67
Point Index Register IX to 67F3H, the control block of the receive buffer.
6C6D
GOSUB to 6C9BH to give the buffer at Index Register IX its first page.
6C70
LD IX,67F7H DD 21 F7 67
Point Index Register IX to 67F7H, the control block of the send buffer.
6C74
GOSUB to 6C9BH to give the buffer at Index Register IX its first page.
6C77
LD IX,67FBH DD 21 FB 67
Point Index Register IX to 67FBH, the control block of the FS buffer.
6C7B
GOSUB to 6C9BH to give the buffer at Index Register IX its first page.
6C7E
LD IX,67FFH DD 21 FF 67
Point Index Register IX to 67FFH, the control block of the receive file buffer.
6C82
GOSUB to 6C9BH to give the buffer at Index Register IX its first page.
6C85
LD H,69H 26 69
Load Register H with 69H, the page of the page table, for the count of the free pages.
6C87
LD B,00H 06 00
Load Register B with 00H, the count of the free pages that can be given.
6C89
LD A,(6900H) 3A 00 69
Fetch the first page of the free list from 6900H into Register A.
6C8C
LD L,A 6F
Copy Register A (the page) into Register L: Register Pair HL = its link in the page table.
6C8D
LD A,(HL) 7E
Fetch the link at Register Pair HL, the next free page, into Register A.
6C8E
OR A B7
OR Register A with itself to set the Z FLAG at the end of the free list.
6C8F
If the Z FLAG is set (the last free page), JUMP to 6C95H: the last page is not counted, it is never given out.
6C91
INC B 04
INCrement Register B, the count of the free pages.
6C92
LD L,A 6F
Copy Register A (the next page) into Register L.
6C93
JUMP back to 6C8DH to follow the link of the next page.
6C95
LD A,B 78
Copy Register B (the count of the free pages) into Register A for the store.
6C96
LD (6803H),A 32 03 68
Store Register A (the count of free pages) at 6803H.
6C99
JUMP to 6CB3H to add the tasks and take over the line.
6C9B
LD (IX+00H),00H DD 36 00 00
Store 00H at byte +00H of the control block at Index Register IX, the low byte of the put place.
6C9F
LD (IX+02H),00H DD 36 02 00
Store 00H at byte +02H of the control block at Index Register IX, the low byte of the take place.
6CA3
PUSH HL E5
Save Register Pair HL (Register H, the page to link from) to the stack.
6CA4
GOSUB to 64D4H to take a free page and link it after page Register H: Register A = the page, the Z FLAG when none is left.
6CA7
If the Z FLAG is set (no free page), JUMP to 6D09H, inside the LD IX at 6D08H, to display Insufficient memory to establish buffers!.
6CAA
POP HL E1
Restore Register Pair HL from the stack: Register H, the page linked from.
6CAB
LD (IX+01H),A DD 77 01
Store Register A (the page) at byte +01H of the control block at Index Register IX, the page of the put place.
6CAE
LD (IX+03H),A DD 77 03
Store Register A (the page) at byte +03H of the control block at Index Register IX, the page of the take place: the buffer is empty.
6CB1
INC H 24
INCrement Register H to the page that the next buffer's page is linked from.
6CB2
RET C9
RETurn to the start-up with the buffer at Index Register IX ready.

6CB3H - The Tasks, the Line Driver and the Parameters

The line task (63D7H) goes into task slot 8 and the printer task (6475H) into slot 9; both run on every clock tick. The line driver gets the control request 57H with Index Register IY at the receive routine 63DFH. The screen scrolls by ten lines, the cursor is turned on, the parameter values are stored in the operands of the code that uses them, and the main loop starts.

6CB3
LD DE,63D7H 11 D7 63
Point Register Pair DE to 63D7H, the block of the line task, whose first word is 63D9H.
6CB6
LD A,08H 3E 08
Load Register A with 08H, task slot 8, one of the four slots that run on every tick.
6CB8
GOSUB to 403DH, @ADTSK, to add the task block at Register Pair DE (63D7H) in slot Register A (08H).
6CBB
LD DE,6475H 11 75 64
Point Register Pair DE to 6475H, the block of the printer task, whose first word is 6477H.
6CBE
LD A,09H 3E 09
Load Register A with 09H, task slot 9, one of the four slots that run on every tick.
6CC0
GOSUB to 403DH, @ADTSK, to add the task block at Register Pair DE (6475H) in slot Register A (09H).
6CC3
LD DE,674BH 11 4B 67
Point Register Pair DE to 674BH, the control block of the line device.
6CC6
LD IY,63DFH FD 21 DF 63
Point Index Register IY to 63DFH, the routine that takes a character from the line into the receive buffer.
6CCA
LD A,57H 3E 57
Load Register A with 57H, the control request LCOMM gives the line driver at the start (58H at EXIT, 6200H).
6CCC
GOSUB to 0023H, the ROM's @CTL, with Register A (57H) as the request to the device at Register Pair DE (674BH).
6CCF
LD HL,6D9EH 21 9E 6D
Point Register Pair HL to 6D9EH, ten new lines, 0EH (cursor on) and 03H.
6CD2
GOSUB to 4467H, @DSPLY, to display the text at Register Pair HL (6D9EH) on the video.
6CD5
LD A,(6E67H) 3A 67 6E
Fetch the first byte of the XS parameter, ff (the high byte of X'fftt'), from 6E67H into Register A.
6CD8
LD (6038H),A 32 38 60
Store Register A at 6038H, the operand of CP 00H at 6037H: the character sent that is translated.
6CDB
LD A,(6E66H) 3A 66 6E
Fetch the second byte of the XS parameter, tt (the low byte), from 6E66H into Register A.
6CDE
LD (603CH),A 32 3C 60
Store Register A at 603CH, the operand of LD C,00H at 603BH: the character sent instead.
6CE1
LD A,(6E69H) 3A 69 6E
Fetch the first byte of the XR parameter, ff (the high byte), from 6E69H into Register A.
6CE4
LD (63ECH),A 32 EC 63
Store Register A at 63ECH, the operand of CP 00H at 63EBH: the character received that is translated.
6CE7
LD A,(6E68H) 3A 68 6E
Fetch the second byte of the XR parameter, tt (the low byte), from 6E68H into Register A.
6CEA
LD (63F0H),A 32 F0 63
Store Register A at 63F0H, the operand of LD A,00H at 63EFH: the character received instead.
6CED
LD A,(6E64H) 3A 64 6E
Fetch the byte at 6E64H into Register A: FFH, which no parameter changes; NULL is stored at 6E65H-6E66H.
6CF0
LD (63F5H),A 32 F5 63
Store Register A (FFH) at 63F5H, the null switch, the operand of LD B,FFH at 63F4H: received nulls are always kept.
6CF3
LD A,(6E6AH) 3A 6A 6E
Fetch the low byte of the XON parameter from 6E6AH into Register A (11H, DC1, by default).
6CF6
LD (6099H),A 32 99 60
Store Register A at 6099H, the operand of CP 11H at 6098H: the character that lets the sending go on.
6CF9
LD A,(6E6CH) 3A 6C 6E
Fetch the low byte of the XOFF parameter from 6E6CH into Register A (13H, DC3, by default).
6CFC
LD (609DH),A 32 9D 60
Store Register A at 609DH, the operand of CP 13H at 609CH: the character that stops the sending.
6CFF
LD (600CH),A 32 0C 60
Store Register A (the XOFF character) at 600CH, the operand of LD A,13H at 600BH: the XOFF sent with the warning.
6D02
JUMP to 6000H, the main loop; from now on the pages from 6C00H are buffer room.

6D05H - The Start-up Errors

Four texts, displayed by @LOGOT before @ABORT. The entries 6D09H, 6D0DH and 6D11H lie inside LD IX instructions: each DD byte makes the LD HL before it a part of an LD IX, which loads Index Register IX and changes nothing that counts.

6D05
LD HL,6DAAH 21 AA 6D
Point Register Pair HL to 6DAAH, the text LCOMM requires KI/DVR active!, ended by 0DH.
6D08
LD IX,6DF9H DD 21 F9 6D
Load Index Register IX with 6DF9H. Nothing uses Index Register IX here: 6CA7H enters at 6D09H, LD HL,6DF9H, the text Insufficient memory to establish buffers!.
6D0C
LD IX,6DE8H DD 21 E8 6D
Load Index Register IX with 6DE8H. Nothing uses Index Register IX here: 6C25H enters at 6D0DH, LD HL,6DE8H, the text Parameter error!.
6D10
LD IX,6DC8H DD 21 C8 6D
Load Index Register IX with 6DC8H. Nothing uses Index Register IX here: 6C16H and 6C1CH enter at 6D11H, LD HL,6DC8H, the text Comm Line driver not specified!.
6D14
GOSUB to 428AH, @LOGOT, to display the text at Register Pair HL and write it to the job log.
6D17
JUMP to 4030H, @ABORT: LCOMM ends with an error (a JCL job is ended too).

6D1AH - The Texts of the Start-up

The banner, the menu hint, the lines that scroll the screen and the four error texts. They lie in the page 6D00H, which becomes buffer room once the main loop runs.

6D1A
DEFB 0AH 0A
6D1AH: 0AH, a new line: the start of the banner displayed by 6C04H.
6D1B-6D51
DEFM "LCOMM - Terminal Communications Package - Version 5.3.1" 4C 43 4F 4D 4D 20 2D 20 54 65 72 6D 69 6E 61 6C 20 43 6F 6D 6D 75 6E 69 63 61 74 69 6F 6E 73 20 50 61 63 6B 61 67 65 20 2D 20 56 65 72 73 69 6F 6E 20 35 2E 33 2E 31
6D1BH-6D51H: the name of the program, what it is and its version.
6D52
DEFB 0AH 0A
6D52H: 0AH, a new line: the copyright goes on the next line.
6D53-6D83
DEFM "Copyright 1991 MISOSYS, Inc., All rights reserved" 43 6F 70 79 72 69 67 68 74 20 31 39 39 31 20 4D 49 53 4F 53 59 53 2C 20 49 6E 63 2E 2C 20 41 6C 6C 20 72 69 67 68 74 73 20 72 65 73 65 72 76 65 64
6D53H-6D83H: the copyright line, the same text as the copyright record of the file.
6D84-6D85
DEFB 0AH, 0DH 0A 0D
6D84H-6D85H: 0AH, a new line, and 0DH, the end of the banner.
6D86-6D9B
DEFM "Use <CLEAR-8> for menu" 55 73 65 20 3C 43 4C 45 41 52 2D 38 3E 20 66 6F 72 20 6D 65 6E 75
6D86H-6D9BH: the hint displayed by 6C34H after the device is open.
6D9C-6D9D
DEFB 0AH, 0DH 0A 0D
6D9CH-6D9DH: 0AH, a new line, and 0DH, the end of the hint.
6D9E-6DA7
DEFB 0AH x 10 0A x 10
6D9EH-6DA7H: ten new lines, displayed by 6CD2H: the screen scrolls, the cursor ends at the bottom.
6DA8-6DA9
DEFB 0EH, 03H 0E 03
6DA8H-6DA9H: 0EH, the cursor on, and 03H, the end of the text.
6DAA-6DC6
DEFM "LCOMM requires KI/DVR active!" 4C 43 4F 4D 4D 20 72 65 71 75 69 72 65 73 20 4B 49 2F 44 56 52 20 61 63 74 69 76 65 21
6DAAH-6DC6H: the text of 6D05H, when bit 4 of DFLAG$ is clear.
6DC7
DEFB 0DH 0D
6DC7H: 0DH, the end of the text LCOMM requires KI/DVR active!.
6DC8-6DE6
DEFM "Comm Line driver not specified!" 43 6F 6D 6D 20 4C 69 6E 65 20 64 72 69 76 65 72 20 6E 6F 74 20 73 70 65 63 69 66 69 65 64 21
6DC8H-6DE6H: the text of 6D11H, when the command names no device.
6DE7
DEFB 0DH 0D
6DE7H: 0DH, the end of the text Comm Line driver not specified!.
6DE8-6DF7
DEFM "Parameter error!" 50 61 72 61 6D 65 74 65 72 20 65 72 72 6F 72 21
6DE8H-6DF7H: the text of 6D0DH, when @PARAM refuses a parameter.
6DF8
DEFB 0DH 0D
6DF8H: 0DH, the end of the text Parameter error! of 6D0DH.
6DF9-6E21
DEFM "Insufficient memory to establish buffers!" 49 6E 73 75 66 66 69 63 69 65 6E 74 20 6D 65 6D 6F 72 79 20 74 6F 20 65 73 74 61 62 6C 69 73 68 20 62 75 66 66 65 72 73 21
6DF9H-6E21H: the text of 6D09H, when the six buffers do not each get a page.
6E22
DEFB 0DH 0D
6E22H: 0DH, the end of the text Insufficient memory to establish buffers!.

6E23H - The Parameter Table and the Values

The table of @PARAM: eight entries of a name of six characters and the address where the value goes (a word: FFFFH for ON or a name alone, 0000H for OFF, else the number), ended by 00H. XLATES and XS store at 6E66H-6E67H, XLATER and XR at 6E68H-6E69H, NULL and N at 6E65H-6E66H, XON at 6E6AH-6E6BH, XOFF at 6E6CH-6E6DH. NULL's word overlaps the low byte of XS: NULL alone, NULL=ON or N stores FFH at 6E66H, so that LCOMM then sends FFH for a null; NULL=OFF stores 00H there. The start-up reads the null switch from 6E64H instead, so no NULL parameter keeps the nulls out.

6E23-6E2A
DEFM "XLATES" / DEFW 6E66H 58 4C 41 54 45 53 66 6E
6E23H-6E2AH: the parameter XLATES, its value stored at 6E66H-6E67H: X'fftt' translates the character ff sent into tt.
6E2B-6E32
DEFM "XS " / DEFW 6E66H 58 53 20 20 20 20 66 6E
6E2BH-6E32H: the parameter XS, the short name of XLATES, stored at the same place 6E66H.
6E33-6E3A
DEFM "XLATER" / DEFW 6E68H 58 4C 41 54 45 52 68 6E
6E33H-6E3AH: the parameter XLATER, its value stored at 6E68H-6E69H: X'fftt' translates the character ff received into tt.
6E3B-6E42
DEFM "XR " / DEFW 6E68H 58 52 20 20 20 20 68 6E
6E3BH-6E42H: the parameter XR, the short name of XLATER, stored at the same place 6E68H.
6E43-6E4A
DEFM "NULL " / DEFW 6E65H 4E 55 4C 4C 20 20 65 6E
6E43H-6E4AH: the parameter NULL, its value stored at 6E65H-6E66H, which no instruction reads but 6CDBH reads 6E66H for XS.
6E4B-6E52
DEFM "N " / DEFW 6E65H 4E 20 20 20 20 20 65 6E
6E4BH-6E52H: the parameter N, the short name of NULL, stored at the same place 6E65H.
6E53-6E5A
DEFM "XON " / DEFW 6E6AH 58 4F 4E 20 20 20 6A 6E
6E53H-6E5AH: the parameter XON, its value stored at 6E6AH-6E6BH: the character that lets the sending go on.
6E5B-6E62
DEFM "XOFF " / DEFW 6E6CH 58 4F 46 46 20 20 6C 6E
6E5BH-6E62H: the parameter XOFF, its value stored at 6E6CH-6E6DH: the character that stops the sending.
6E63
DEFB 00H 00
6E63H: 00H, the end of the parameter table for @PARAM.
6E64
DEFB FFH FF
6E64H: FFH, the null switch the start-up copies to 63F5H (6CEDH); no parameter reaches this byte.
6E65
DEFB FFH FF
6E65H: FFH, the low byte of the NULL value; no instruction reads it.
6E66-6E67
DEFW 0000H 00 00
6E66H-6E67H: the XS value X'fftt': 6E66H tt (also the high byte of the NULL value), 6E67H ff; 0000H translates a null into a null.
6E68-6E69
DEFW 0000H 00 00
6E68H-6E69H: the XR value X'fftt': 6E68H tt, 6E69H ff; 0000H translates a received null into a null.
6E6A-6E6B
DEFW 0011H 11 00
6E6AH-6E6BH: the XON value, 11H (DC1) by default; only the low byte is used (6CF3H).
6E6C-6E6D
DEFW 0013H 13 00
6E6CH-6E6DH: the XOFF value, 13H (DC3) by default; only the low byte is used (6CF9H).