LDOS 5.3.1 for the Model III - BASIC/OV3 Disassembled

Page Customization

Introduction/Summary

LDOS 5.3.1 BASIC/OV3 Disassembly - the Error Messages, CMD"O", RUN With V and the M and C Commands (Model III)

BASIC/OV3 is the overlay BASIC/CMD calls back into while BASIC runs: it holds the texts of the BASIC errors, turns LDOS errors into BASIC errors, sorts a string array for CMD"O", parks the variables for a RUN with V, and moves or copies a program line for the M and C commands at READY. BASIC/CMD's 54DEH loads it at 4E00H, the overlay area of LDOS, and calls it with the number of a function in Register A'; once loaded it stays until a system file is loaded there, and 4414H (OVRLY$) holds 01H while it is there (4E00H).

The file is a load module of 1229 bytes: a copyright record, the code and data 4E00H-5281H in five load blocks, and the transfer address 4E00H. The last 130 bytes, 5200H-5281H, load over the start of BASIC/CMD's image, its banner and the messages of its start, which BASIC/CMD uses only when it starts.

The Functions

A'Called fromWhat it does
01H5A76HRegister L = the E value of a BASIC error: the text of its message is built at 543CH and Register Pair HL points to it (4E1BH).
02H6467HRegister L = an LDOS error code: it is kept at 660BH for CMD"E" and the ROM's error handler is entered with the E value of the BASIC error it stands for (4E6BH).
03H585BHCMD"O",count,array$(first): a Shell sort of count elements from the one named, in ascending order (4E80H).
04H5EC4HRUN"file",V: the strings of the program are copied into string space, DEF FN functions are undefined, and the variables and arrays are moved up below the stack, for BASIC/CMD's 5F70H to bring back after the load (4F19H).
05H6578HM old,new at READY: the old line is copied to the new number, then deleted (4FD6H, 501AH).
06H6578HC old,new at READY: the old line is copied to the new number (4FD6H). Any number other than 01H-05H does the same.

The Messages

The texts are kept as words: a dictionary of 78 words (50D6H), each ended by bit 7 on its last character, and 49 messages (5057H), each a list of word numbers ended by bit 7. The E values of the ROM's errors, 00H-2EH, give messages 2-25; the E values of the disk errors, 64H-90H, give messages 26-48; every other even E value gives message 21, Unprintable error. The words are copied with a space after each, 00H after the last space, and the first letter made upper case. The LDOS error codes 01H-29H have a table of their own (502EH): most of them give Disk I/O error, and every code from 29H up gives Internal error.

About This Page

The Model III file is the Model I file of the same release with the same code at the same addresses; its 13 different bytes are operands: OVRLY$ 4414H (4E02H; Model I 430EH) and the cells of BASIC/CMD it changes, which are at other addresses in the Model III BASIC/CMD: 543CH (4E3EH; Model I 5414H), 660BH (4E6CH; 65F7H), the operands 5F72H, 5F85H, 5F79H, 5F92H, 5F98H (4F9CH-4FC9H; Model I 5F5EH, 5F71H, 5F65H, 5F7EH, 5F84H), the run state 6608H (4FD2H; 65F4H) and the line input 5BDFH (501AH; 5BD1H).

\n\t\t\t\t\t\t\t\t

Every byte of the file is shown at its address. The ROM routines named are those of the Model III ROM, version 3.1, at the same addresses as in the Level II ROM of the Model I, version 1.3; jumps into the ROM link to its page, except the jump into DELETE at 2BCAH, which has no id there. Found in the code: after M, the line input vector 41AFH points at 501AH until the ROM next asks for a line, so when the new line cannot be stored (Out of memory, say) the next line input still deletes the old line (4FD6H); the sort tests neither that the variable is a string array nor that the elements stay inside it, and it exchanges two elements that are the same (4E80H); messages 0 and 1 and word 0 are never used, and the first LD HL,5057H at 4E1CH is loaded again before it is read; the entry for LDOS code 00H is the last byte of the JP at 502BH.

Memory Map

Load Blocks

The file starts with a copyright record (type 1FH), then 5 load blocks with 1154 bytes, 4E00H-5281H, and the transfer address 4E00H.

AddressContents
4E00H-4EFFH256 bytes
4F00H-4FFFH256 bytes
5000H-50FFH256 bytes
5100H-51FFH256 bytes
5200H-5281H130 bytes

The Parts of the File

AddressContents
4E00H-4E7FHThe entry, the text of a BASIC error (01H) and an LDOS error as a BASIC error (02H).
4E80H-4F18HCMD"O", the sort (03H).
4F19H-4FD5HRUN with V: the variables parked (04H).
4FD6H-502DHM and C, a line moved or copied (05H, 06H).
502EH-5056HThe BASIC errors of the LDOS error codes 01H-29H.
5057H-50D5HThe 49 messages.
50D6H-5281HThe dictionary of 78 words; from 5200H over the start of BASIC/CMD.
543CH-545AHIn BASIC/CMD's image: the text of a message (4E3EH), at most 30 characters and its 00H.

Sections of the Disassembly

AddressContents
4E00HThe Entry: the Function in Register A'
4E1BHFunction 01H: the Text of a BASIC Error
4E6BHFunction 02H: an LDOS Error Becomes a BASIC Error
4E80HFunction 03H: CMD"O", Sort a String Array
4E95HThe Next Round: Halve the Gap
4EADHThe Next Position: Compare Two Elements
4EE9HExchange the Two Descriptors
4F04HIn Order: the Next Position
4F19HFunction 04H: Park the Variables for a RUN With V
4F23HThe Simple Variables
4F3FHThe Arrays
4F6AHMove a String Out of the Program
4F99HPark the Block
4FD6HFunctions 05H and 06H: M and C, Move or Copy a Line
501AHM: Delete the Old Line
502EHThe LDOS Errors as BASIC Errors
5057HThe Messages
50D6HThe Dictionary

Memory BASIC/OV3 Uses

AddressContents
1997H, 197AH, 19A2H, 1E4AH, 1ED9HThe ROM: Syntax error, Out of memory, the error handler (Register E = the E value), Illegal function call, Undefined line number.
1B2CH, 1E46H, 1E4FH, 260DH, 28BFHThe ROM: FNDLIN (the line whose number is in Register Pair DE), an integer, a line number, PTRGET (a variable), GETSPA (string space).
2B7EH, 2BCAH, 2FEBHThe ROM: BUFLIN (a line back to text in the input buffer), DELETE after its line numbers, the EDIT exit (the buffer stored as a line).
40A0H-40A1HThe start of string space: set below the parked variables (4FCCH), kept in 5F98H.
40A4H-40A5HThe start of the program text (4F79H).
40A7H-40A8HThe input buffer of the ROM, where BUFLIN puts the old line (5008H).
40D6H-40D7HThe next free byte of string space, kept in 5F92H.
40F9H-40FAH, 40FBH-40FCH, 40FDH-40FEHThe start of the simple variables, of the arrays, and the end of the arrays.
41AFH-41B1HThe line input vector, JP 5BDFH (BASIC/CMD): its operand is 501AH after M until 501AH puts 5BDFH back.
4414HOVRLY$: 01H while BASIC/OV3 is at 4E00H (4E02H).
5F72H, 5F79H, 5F85H, 5F92H, 5F98HOperands in BASIC/CMD for 5F70H: the old 40F9H, the old 40FBH, the length of the parked block, the old 40D6H, the old 40A0H (4F99H).
6608H, 660BHIn BASIC/CMD: the run state (D6H for a RUN with V, 4FD2H) and the last LDOS error (4E6CH).

Variables

The tables of the file, then the operands BASIC/OV3 changes while it runs.

Data in the File

Address
Size
Contents
502EH
1 byte
DEFB 72H
502EH: LDOS error 01H (parity error during header read): the E value 72H, Disk I/O error.
502FH
1 byte
DEFB 72H
502FH: LDOS error 02H (seek error during read): the E value 72H, Disk I/O error.
5030H
1 byte
DEFB 72H
5030H: LDOS error 03H (lost data during read): the E value 72H, Disk I/O error.
5031H
1 byte
DEFB 72H
5031H: LDOS error 04H (parity error during read): the E value 72H, Disk I/O error.
5032H
1 byte
DEFB 72H
5032H: LDOS error 05H (data record not found during read): the E value 72H, Disk I/O error.
5033H
1 byte
DEFB 72H
5033H: LDOS error 06H (attempted to read system data record): the E value 72H, Disk I/O error.
5034H
1 byte
DEFB 72H
5034H: LDOS error 07H (attempted to read locked/deleted data record): the E value 72H, Disk I/O error.
5035H
1 byte
DEFB 80H
5035H: LDOS error 08H (device not available): the E value 80H, Bad file name.
5036H
1 byte
DEFB 72H
5036H: LDOS error 09H (parity error during header write): the E value 72H, Disk I/O error.
5037H
1 byte
DEFB 72H
5037H: LDOS error 0AH (seek error during write): the E value 72H, Disk I/O error.
5038H
1 byte
DEFB 72H
5038H: LDOS error 0BH (lost data during write): the E value 72H, Disk I/O error.
5039H
1 byte
DEFB 72H
5039H: LDOS error 0CH (parity error during write): the E value 72H, Disk I/O error.
503AH
1 byte
DEFB 72H
503AH: LDOS error 0DH (data record not found during write): the E value 72H, Disk I/O error.
503BH
1 byte
DEFB 72H
503BH: LDOS error 0EH (write fault on disk drive): the E value 72H, Disk I/O error.
503CH
1 byte
DEFB 88H
503CH: LDOS error 0FH (write protected disk): the E value 88H, Disk write protection.
503DH
1 byte
DEFB 66H
503DH: LDOS error 10H (illegal logical file number): the E value 66H, Internal error.
503EH
1 byte
DEFB 72H
503EH: LDOS error 11H (directory read error): the E value 72H, Disk I/O error.
503FH
1 byte
DEFB 72H
503FH: LDOS error 12H (directory write error): the E value 72H, Disk I/O error.
5040H
1 byte
DEFB 80H
5040H: LDOS error 13H (illegal file name): the E value 80H, Bad file name.
5041H
1 byte
DEFB 72H
5041H: LDOS error 14H (GAT read error): the E value 72H, Disk I/O error.
5042H
1 byte
DEFB 72H
5042H: LDOS error 15H (GAT write error): the E value 72H, Disk I/O error.
5043H
1 byte
DEFB 72H
5043H: LDOS error 16H (HIT read error): the E value 72H, Disk I/O error.
5044H
1 byte
DEFB 72H
5044H: LDOS error 17H (HIT write error): the E value 72H, Disk I/O error.
5045H
1 byte
DEFB 6AH
5045H: LDOS error 18H (file not in directory): the E value 6AH, File not found.
5046H
1 byte
DEFB 8AH
5046H: LDOS error 19H (file access denied): the E value 8AH, File access denied.
5047H
1 byte
DEFB 88H
5047H: LDOS error 1AH (full or write protected disk): the E value 88H, Disk write protection.
5048H
1 byte
DEFB 7AH
5048H: LDOS error 1BH (disk space full): the E value 7AH, Disk full.
5049H
1 byte
DEFB 66H
5049H: LDOS error 1CH (end of file encountered): the E value 66H, Internal error.
504AH
1 byte
DEFB 66H
504AH: LDOS error 1DH (record number out of range): the E value 66H, Internal error.
504BH
1 byte
DEFB 7AH
504BH: LDOS error 1EH (directory full, can't extend file): the E value 7AH, Disk full.
504CH
1 byte
DEFB 6AH
504CH: LDOS error 1FH (program not found): the E value 6AH, File not found.
504DH
1 byte
DEFB 80H
504DH: LDOS error 20H (illegal drive number): the E value 80H, Bad file name.
504EH
1 byte
DEFB 66H
504EH: LDOS error 21H (no device space available): the E value 66H, Internal error.
504FH
1 byte
DEFB 66H
504FH: LDOS error 22H (load file format error): the E value 66H, Internal error.
5050H
1 byte
DEFB 66H
5050H: LDOS error 23H (memory fault): the E value 66H, Internal error.
5051H
1 byte
DEFB 66H
5051H: LDOS error 24H (attempted to load read only memory): the E value 66H, Internal error.
5052H
1 byte
DEFB 8AH
5052H: LDOS error 25H (illegal access attempted to protected file): the E value 8AH, File access denied.
5053H
1 byte
DEFB 66H
5053H: LDOS error 26H (file not open): the E value 66H, Internal error.
5054H
1 byte
DEFB 8AH
5054H: LDOS error 27H (device in use): the E value 8AH, File access denied.
5055H
1 byte
DEFB 8AH
5055H: LDOS error 28H (protected system device): the E value 8AH, File access denied.
5056H
1 byte
DEFB 66H
5056H: LDOS error 29H (unknown error code and every code above it): the E value 66H, Internal error.
5057H
1 byte
DEFB D2H
5057H: message 0, the byte D2H: bit 7 makes it a message of one word, number 52H, past the dictionary; it marks the start of the table and is never chosen.
5058H-5059H
2 bytes
DEFB 25H,85H
5058H-5059H: message 1, never chosen: words 37 no, 5 error, bit 7 on the last byte: No error.
505AH-505CH
3 bytes
DEFB 01H,02H,83H
505AH-505CH: message 2, for the E value 00H: words 1 next, 2 without, 3 for, bit 7 on the last byte: Next without for.
505DH-505EH
2 bytes
DEFB 04H,85H
505DH-505EH: message 3, for the E value 02H: words 4 syntax, 5 error, bit 7 on the last byte: Syntax error.
505FH-5061H
3 bytes
DEFB 06H,02H,87H
505FH-5061H: message 4, for the E value 04H: words 6 return, 2 without, 7 GOSUB, bit 7 on the last byte: Return without GOSUB.
5062H-5064H
3 bytes
DEFB 08H,09H,8AH
5062H-5064H: message 5, for the E value 06H: words 8 out, 9 of, 10 data, bit 7 on the last byte: Out of data.
5065H-5067H
3 bytes
DEFB 0BH,0CH,8DH
5065H-5067H: message 6, for the E value 08H: words 11 illegal, 12 function, 13 call, bit 7 on the last byte: Illegal function call.
5068H
1 byte
DEFB 8EH
5068H: message 7, for the E value 0AH: word 14 overflow, bit 7 on the last byte: Overflow.
5069H-506BH
3 bytes
DEFB 08H,09H,8FH
5069H-506BH: message 8, for the E value 0CH: words 8 out, 9 of, 15 memory, bit 7 on the last byte: Out of memory.
506CH-506EH
3 bytes
DEFB 10H,11H,92H
506CH-506EH: message 9, for the E value 0EH: words 16 undefined, 17 line, 18 number, bit 7 on the last byte: Undefined line number.
506FH-5072H
4 bytes
DEFB 13H,08H,09H,94H
506FH-5072H: message 10, for the E value 10H: words 19 subscript, 8 out, 9 of, 20 range, bit 7 on the last byte: Subscript out of range.
5073H-5074H
2 bytes
DEFB 15H,96H
5073H-5074H: message 11, for the E value 12H: words 21 redimensioned, 22 array, bit 7 on the last byte: Redimensioned array.
5075H-5077H
3 bytes
DEFB 17H,18H,99H
5075H-5077H: message 12, for the E value 14H: words 23 division, 24 by, 25 zero, bit 7 on the last byte: Division by zero.
5078H-5079H
2 bytes
DEFB 0BH,9AH
5078H-5079H: message 13, for the E value 16H: words 11 illegal, 26 direct, bit 7 on the last byte: Illegal direct.
507AH-507BH
2 bytes
DEFB 1BH,9CH
507AH-507BH: message 14, for the E value 18H: words 27 type, 28 mismatch, bit 7 on the last byte: Type mismatch.
507CH-507FH
4 bytes
DEFB 08H,09H,1DH,9EH
507CH-507FH: message 15, for the E value 1AH: words 8 out, 9 of, 29 string, 30 space, bit 7 on the last byte: Out of string space.
5080H-5082H
3 bytes
DEFB 1DH,1FH,A0H
5080H-5082H: message 16, for the E value 1CH: words 29 string, 31 too, 32 long, bit 7 on the last byte: String too long.
5083H-5086H
4 bytes
DEFB 1DH,21H,1FH,A2H
5083H-5086H: message 17, for the E value 1EH: words 29 string, 33 formula, 31 too, 34 complex, bit 7 on the last byte: String formula too complex.
5087H-5088H
2 bytes
DEFB 23H,A4H
5087H-5088H: message 18, for the E value 20H: words 35 can't, 36 continue, bit 7 on the last byte: Can't continue.
5089H-508AH
2 bytes
DEFB 25H,A6H
5089H-508AH: message 19, for the E value 22H: words 37 no, 38 RESUME, bit 7 on the last byte: No RESUME.
508BH-508DH
3 bytes
DEFB 26H,02H,85H
508BH-508DH: message 20, for the E value 24H: words 38 RESUME, 2 without, 5 error, bit 7 on the last byte: RESUME without error.
508EH-508FH
2 bytes
DEFB 27H,85H
508EH-508FH: message 21, for the E value 26H and every E value from 2FH to 62H and from 91H up (4E2BH): words 39 unprintable, 5 error, bit 7 on the last byte: Unprintable error.
5090H-5091H
2 bytes
DEFB 28H,A9H
5090H-5091H: message 22, for the E value 28H: words 40 missing, 41 operand, bit 7 on the last byte: Missing operand.
5092H-5094H
3 bytes
DEFB 2AH,2BH,8AH
5092H-5094H: message 23, for the E value 2AH: words 42 bad, 43 cassette, 10 data, bit 7 on the last byte: Bad cassette data.
5095H
1 byte
DEFB ACH
5095H: message 24, for the E value 2CH: word 44 ?, bit 7 on the last byte: ?.
5096H-5098H
3 bytes
DEFB 2DH,2EH,8CH
5096H-5098H: message 25, for the E value 2EH: words 45 undefined, 46 user, 12 function, bit 7 on the last byte: Undefined user function.
5099H-509AH
2 bytes
DEFB 2FH,8EH
5099H-509AH: message 26, for the E value 64H: words 47 FIELD, 14 overflow, bit 7 on the last byte: FIELD overflow.
509BH-509CH
2 bytes
DEFB 30H,85H
509BH-509CH: message 27, for the E value 66H: words 48 internal, 5 error, bit 7 on the last byte: Internal error.
509DH-509FH
3 bytes
DEFB 2AH,31H,92H
509DH-509FH: message 28, for the E value 68H: words 42 bad, 49 file, 18 number, bit 7 on the last byte: Bad file number.
50A0H-50A2H
3 bytes
DEFB 31H,32H,B3H
50A0H-50A2H: message 29, for the E value 6AH: words 49 file, 50 not, 51 found, bit 7 on the last byte: File not found.
50A3H-50A5H
3 bytes
DEFB 2AH,31H,B4H
50A3H-50A5H: message 30, for the E value 6CH: words 42 bad, 49 file, 52 mode, bit 7 on the last byte: Bad file mode.
50A6H-50A8H
3 bytes
DEFB 31H,35H,B6H
50A6H-50A8H: message 31, for the E value 6EH: words 49 file, 53 already, 54 open, bit 7 on the last byte: File already open.
50A9H
1 byte
DEFB ACH
50A9H: message 32, for the E value 70H: word 44 ?, bit 7 on the last byte: ?.
50AAH-50ACH
3 bytes
DEFB 37H,38H,85H
50AAH-50ACH: message 33, for the E value 72H: words 55 disk, 56 I/O, 5 error, bit 7 on the last byte: Disk I/O error.
50ADH-50AFH
3 bytes
DEFB 31H,35H,B9H
50ADH-50AFH: message 34, for the E value 74H: words 49 file, 53 already, 57 exists, bit 7 on the last byte: File already exists.
50B0H
1 byte
DEFB ACH
50B0H: message 35, for the E value 76H: word 44 ?, bit 7 on the last byte: ?.
50B1H
1 byte
DEFB ACH
50B1H: message 36, for the E value 78H: word 44 ?, bit 7 on the last byte: ?.
50B2H-50B3H
2 bytes
DEFB 37H,BAH
50B2H-50B3H: message 37, for the E value 7AH: words 55 disk, 58 full, bit 7 on the last byte: Disk full.
50B4H-50B6H
3 bytes
DEFB 3BH,3CH,BDH
50B4H-50B6H: message 38, for the E value 7CH: words 59 input, 60 past, 61 end, bit 7 on the last byte: Input past end.
50B7H-50B9H
3 bytes
DEFB 2AH,3EH,92H
50B7H-50B9H: message 39, for the E value 7EH: words 42 bad, 62 record, 18 number, bit 7 on the last byte: Bad record number.
50BAH-50BCH
3 bytes
DEFB 2AH,31H,BFH
50BAH-50BCH: message 40, for the E value 80H: words 42 bad, 49 file, 63 name, bit 7 on the last byte: Bad file name.
50BDH-50BEH
2 bytes
DEFB 34H,9CH
50BDH-50BEH: message 41, for the E value 82H: words 52 mode, 28 mismatch, bit 7 on the last byte: Mode mismatch.
50BFH-50C2H
4 bytes
DEFB 1AH,40H,41H,B1H
50BFH-50C2H: message 42, for the E value 84H: words 26 direct, 64 statement, 65 in, 49 file, bit 7 on the last byte: Direct statement in file.
50C3H-50C5H
3 bytes
DEFB 1FH,42H,C3H
50C3H-50C5H: message 43, for the E value 86H: words 31 too, 66 many, 67 files, bit 7 on the last byte: Too many files.
50C6H-50C8H
3 bytes
DEFB 37H,44H,C5H
50C6H-50C8H: message 44, for the E value 88H: words 55 disk, 68 write, 69 protection, bit 7 on the last byte: Disk write protection.
50C9H-50CBH
3 bytes
DEFB 31H,46H,C7H
50C9H-50CBH: message 45, for the E value 8AH: words 49 file, 70 access, 71 denied, bit 7 on the last byte: File access denied.
50CCH-50CEH
3 bytes
DEFB 48H,31H,85H
50CCH-50CEH: message 46, for the E value 8CH: words 72 blocked, 49 file, 5 error, bit 7 on the last byte: Blocked file error.
50CFH-50D1H
3 bytes
DEFB 49H,4AH,CBH
50CFH-50D1H: message 47, for the E value 8EH: words 73 system, 74 command, 75 aborted, bit 7 on the last byte: System command aborted.
50D2H-50D5H
4 bytes
DEFB 45H,4CH,4DH,8FH
50D2H-50D5H: message 48, for the E value 90H: words 69 protection, 76 has, 77 cleared, 15 memory, bit 7 on the last byte: Protection has cleared memory.
50D6H
1 byte
DEFB D2H
50D6H: word 0, D2H (R with bit 7 set): the start mark of the dictionary, used by no message.
50D7H-50DAH
4 bytes
DEFM "nex" / DEFB F4H
50D7H-50DAH: word 1, next (the last character t with bit 7 set, F4H): used by message 2.
50DBH-50E1H
7 bytes
DEFM "withou" / DEFB F4H
50DBH-50E1H: word 2, without (the last character t with bit 7 set, F4H): used by messages 2, 4, 20.
50E2H-50E4H
3 bytes
DEFM "fo" / DEFB F2H
50E2H-50E4H: word 3, for (the last character r with bit 7 set, F2H): used by message 2.
50E5H-50EAH
6 bytes
DEFM "synta" / DEFB F8H
50E5H-50EAH: word 4, syntax (the last character x with bit 7 set, F8H): used by message 3.
50EBH-50EFH
5 bytes
DEFM "erro" / DEFB F2H
50EBH-50EFH: word 5, error (the last character r with bit 7 set, F2H): used by messages 1, 3, 20, 21, 27, 33, 46.
50F0H-50F5H
6 bytes
DEFM "retur" / DEFB EEH
50F0H-50F5H: word 6, return (the last character n with bit 7 set, EEH): used by message 4.
50F6H-50FAH
5 bytes
DEFM "GOSU" / DEFB C2H
50F6H-50FAH: word 7, GOSUB (the last character B with bit 7 set, C2H): used by message 4.
50FBH-50FDH
3 bytes
DEFM "ou" / DEFB F4H
50FBH-50FDH: word 8, out (the last character t with bit 7 set, F4H): used by messages 5, 8, 10, 15.
50FEH-50FFH
2 bytes
DEFM "o" / DEFB E6H
50FEH-50FFH: word 9, of (the last character f with bit 7 set, E6H): used by messages 5, 8, 10, 15.
5100H-5103H
4 bytes
DEFM "dat" / DEFB E1H
5100H-5103H: word 10, data (the last character a with bit 7 set, E1H): used by messages 5, 23.
5104H-510AH
7 bytes
DEFM "illega" / DEFB ECH
5104H-510AH: word 11, illegal (the last character l with bit 7 set, ECH): used by messages 6, 13.
510BH-5112H
8 bytes
DEFM "functio" / DEFB EEH
510BH-5112H: word 12, function (the last character n with bit 7 set, EEH): used by messages 6, 25.
5113H-5116H
4 bytes
DEFM "cal" / DEFB ECH
5113H-5116H: word 13, call (the last character l with bit 7 set, ECH): used by message 6.
5117H-511EH
8 bytes
DEFM "overflo" / DEFB F7H
5117H-511EH: word 14, overflow (the last character w with bit 7 set, F7H): used by messages 7, 26.
511FH-5124H
6 bytes
DEFM "memor" / DEFB F9H
511FH-5124H: word 15, memory (the last character y with bit 7 set, F9H): used by messages 8, 48.
5125H-512DH
9 bytes
DEFM "undefine" / DEFB E4H
5125H-512DH: word 16, undefined (the last character d with bit 7 set, E4H): used by message 9.
512EH-5131H
4 bytes
DEFM "lin" / DEFB E5H
512EH-5131H: word 17, line (the last character e with bit 7 set, E5H): used by message 9.
5132H-5137H
6 bytes
DEFM "numbe" / DEFB F2H
5132H-5137H: word 18, number (the last character r with bit 7 set, F2H): used by messages 9, 28, 39.
5138H-5140H
9 bytes
DEFM "subscrip" / DEFB F4H
5138H-5140H: word 19, subscript (the last character t with bit 7 set, F4H): used by message 10.
5141H-5145H
5 bytes
DEFM "rang" / DEFB E5H
5141H-5145H: word 20, range (the last character e with bit 7 set, E5H): used by message 10.
5146H-5152H
13 bytes
DEFM "redimensione" / DEFB E4H
5146H-5152H: word 21, redimensioned (the last character d with bit 7 set, E4H): used by message 11.
5153H-5157H
5 bytes
DEFM "arra" / DEFB F9H
5153H-5157H: word 22, array (the last character y with bit 7 set, F9H): used by message 11.
5158H-515FH
8 bytes
DEFM "divisio" / DEFB EEH
5158H-515FH: word 23, division (the last character n with bit 7 set, EEH): used by message 12.
5160H-5161H
2 bytes
DEFM "b" / DEFB F9H
5160H-5161H: word 24, by (the last character y with bit 7 set, F9H): used by message 12.
5162H-5165H
4 bytes
DEFM "zer" / DEFB EFH
5162H-5165H: word 25, zero (the last character o with bit 7 set, EFH): used by message 12.
5166H-516BH
6 bytes
DEFM "direc" / DEFB F4H
5166H-516BH: word 26, direct (the last character t with bit 7 set, F4H): used by messages 13, 42.
516CH-516FH
4 bytes
DEFM "typ" / DEFB E5H
516CH-516FH: word 27, type (the last character e with bit 7 set, E5H): used by message 14.
5170H-5177H
8 bytes
DEFM "mismatc" / DEFB E8H
5170H-5177H: word 28, mismatch (the last character h with bit 7 set, E8H): used by messages 14, 41.
5178H-517DH
6 bytes
DEFM "strin" / DEFB E7H
5178H-517DH: word 29, string (the last character g with bit 7 set, E7H): used by messages 15, 16, 17.
517EH-5182H
5 bytes
DEFM "spac" / DEFB E5H
517EH-5182H: word 30, space (the last character e with bit 7 set, E5H): used by message 15.
5183H-5185H
3 bytes
DEFM "to" / DEFB EFH
5183H-5185H: word 31, too (the last character o with bit 7 set, EFH): used by messages 16, 17, 43.
5186H-5189H
4 bytes
DEFM "lon" / DEFB E7H
5186H-5189H: word 32, long (the last character g with bit 7 set, E7H): used by message 16.
518AH-5190H
7 bytes
DEFM "formul" / DEFB E1H
518AH-5190H: word 33, formula (the last character a with bit 7 set, E1H): used by message 17.
5191H-5197H
7 bytes
DEFM "comple" / DEFB F8H
5191H-5197H: word 34, complex (the last character x with bit 7 set, F8H): used by message 17.
5198H-519CH
5 bytes
DEFM "can'" / DEFB F4H
5198H-519CH: word 35, can't (the last character t with bit 7 set, F4H): used by message 18.
519DH-51A4H
8 bytes
DEFM "continu" / DEFB E5H
519DH-51A4H: word 36, continue (the last character e with bit 7 set, E5H): used by message 18.
51A5H-51A6H
2 bytes
DEFM "n" / DEFB EFH
51A5H-51A6H: word 37, no (the last character o with bit 7 set, EFH): used by messages 1, 19.
51A7H-51ACH
6 bytes
DEFM "RESUM" / DEFB C5H
51A7H-51ACH: word 38, RESUME (the last character E with bit 7 set, C5H): used by messages 19, 20.
51ADH-51B7H
11 bytes
DEFM "unprintabl" / DEFB E5H
51ADH-51B7H: word 39, unprintable (the last character e with bit 7 set, E5H): used by message 21.
51B8H-51BEH
7 bytes
DEFM "missin" / DEFB E7H
51B8H-51BEH: word 40, missing (the last character g with bit 7 set, E7H): used by message 22.
51BFH-51C5H
7 bytes
DEFM "operan" / DEFB E4H
51BFH-51C5H: word 41, operand (the last character d with bit 7 set, E4H): used by message 22.
51C6H-51C8H
3 bytes
DEFM "ba" / DEFB E4H
51C6H-51C8H: word 42, bad (the last character d with bit 7 set, E4H): used by messages 23, 28, 30, 39, 40.
51C9H-51D0H
8 bytes
DEFM "cassett" / DEFB E5H
51C9H-51D0H: word 43, cassette (the last character e with bit 7 set, E5H): used by message 23.
51D1H
1 byte
DEFB BFH
51D1H: word 44, ? (the last character ? with bit 7 set, BFH): used by messages 24, 32, 35, 36.
51D2H-51DAH
9 bytes
DEFM "undefine" / DEFB E4H
51D2H-51DAH: word 45, undefined (the last character d with bit 7 set, E4H): used by message 25.
51DBH-51DEH
4 bytes
DEFM "use" / DEFB F2H
51DBH-51DEH: word 46, user (the last character r with bit 7 set, F2H): used by message 25.
51DFH-51E3H
5 bytes
DEFM "FIEL" / DEFB C4H
51DFH-51E3H: word 47, FIELD (the last character D with bit 7 set, C4H): used by message 26.
51E4H-51EBH
8 bytes
DEFM "interna" / DEFB ECH
51E4H-51EBH: word 48, internal (the last character l with bit 7 set, ECH): used by message 27.
51ECH-51EFH
4 bytes
DEFM "fil" / DEFB E5H
51ECH-51EFH: word 49, file (the last character e with bit 7 set, E5H): used by messages 28, 29, 30, 31, 34, 40, 42, 45, 46.
51F0H-51F2H
3 bytes
DEFM "no" / DEFB F4H
51F0H-51F2H: word 50, not (the last character t with bit 7 set, F4H): used by message 29.
51F3H-51F7H
5 bytes
DEFM "foun" / DEFB E4H
51F3H-51F7H: word 51, found (the last character d with bit 7 set, E4H): used by message 29.
51F8H-51FBH
4 bytes
DEFM "mod" / DEFB E5H
51F8H-51FBH: word 52, mode (the last character e with bit 7 set, E5H): used by messages 30, 41.
51FCH-5202H
7 bytes
DEFM "alread" / DEFB F9H
51FCH-5202H: word 53, already (the last character y with bit 7 set, F9H): used by messages 31, 34.
5203H-5206H
4 bytes
DEFM "ope" / DEFB EEH
5203H-5206H: word 54, open (the last character n with bit 7 set, EEH): used by message 31.
5207H-520AH
4 bytes
DEFM "dis" / DEFB EBH
5207H-520AH: word 55, disk (the last character k with bit 7 set, EBH): used by messages 33, 37, 44.
520BH-520DH
3 bytes
DEFM "I/" / DEFB CFH
520BH-520DH: word 56, I/O (the last character O with bit 7 set, CFH): used by message 33.
520EH-5213H
6 bytes
DEFM "exist" / DEFB F3H
520EH-5213H: word 57, exists (the last character s with bit 7 set, F3H): used by message 34.
5214H-5217H
4 bytes
DEFM "ful" / DEFB ECH
5214H-5217H: word 58, full (the last character l with bit 7 set, ECH): used by message 37.
5218H-521CH
5 bytes
DEFM "inpu" / DEFB F4H
5218H-521CH: word 59, input (the last character t with bit 7 set, F4H): used by message 38.
521DH-5220H
4 bytes
DEFM "pas" / DEFB F4H
521DH-5220H: word 60, past (the last character t with bit 7 set, F4H): used by message 38.
5221H-5223H
3 bytes
DEFM "en" / DEFB E4H
5221H-5223H: word 61, end (the last character d with bit 7 set, E4H): used by message 38.
5224H-5229H
6 bytes
DEFM "recor" / DEFB E4H
5224H-5229H: word 62, record (the last character d with bit 7 set, E4H): used by message 39.
522AH-522DH
4 bytes
DEFM "nam" / DEFB E5H
522AH-522DH: word 63, name (the last character e with bit 7 set, E5H): used by message 40.
522EH-5236H
9 bytes
DEFM "statemen" / DEFB F4H
522EH-5236H: word 64, statement (the last character t with bit 7 set, F4H): used by message 42.
5237H-5238H
2 bytes
DEFM "i" / DEFB EEH
5237H-5238H: word 65, in (the last character n with bit 7 set, EEH): used by message 42.
5239H-523CH
4 bytes
DEFM "man" / DEFB F9H
5239H-523CH: word 66, many (the last character y with bit 7 set, F9H): used by message 43.
523DH-5241H
5 bytes
DEFM "file" / DEFB F3H
523DH-5241H: word 67, files (the last character s with bit 7 set, F3H): used by message 43.
5242H-5246H
5 bytes
DEFM "writ" / DEFB E5H
5242H-5246H: word 68, write (the last character e with bit 7 set, E5H): used by message 44.
5247H-5250H
10 bytes
DEFM "protectio" / DEFB EEH
5247H-5250H: word 69, protection (the last character n with bit 7 set, EEH): used by messages 44, 48.
5251H-5256H
6 bytes
DEFM "acces" / DEFB F3H
5251H-5256H: word 70, access (the last character s with bit 7 set, F3H): used by message 45.
5257H-525CH
6 bytes
DEFM "denie" / DEFB E4H
5257H-525CH: word 71, denied (the last character d with bit 7 set, E4H): used by message 45.
525DH-5263H
7 bytes
DEFM "blocke" / DEFB E4H
525DH-5263H: word 72, blocked (the last character d with bit 7 set, E4H): used by message 46.
5264H-5269H
6 bytes
DEFM "syste" / DEFB EDH
5264H-5269H: word 73, system (the last character m with bit 7 set, EDH): used by message 47.
526AH-5270H
7 bytes
DEFM "comman" / DEFB E4H
526AH-5270H: word 74, command (the last character d with bit 7 set, E4H): used by message 47.
5271H-5277H
7 bytes
DEFM "aborte" / DEFB E4H
5271H-5277H: word 75, aborted (the last character d with bit 7 set, E4H): used by message 47.
5278H-527AH
3 bytes
DEFM "ha" / DEFB F3H
5278H-527AH: word 76, has (the last character s with bit 7 set, F3H): used by message 48.
527BH-5281H
7 bytes
DEFM "cleare" / DEFB E4H
527BH-5281H: word 77, cleared (the last character d with bit 7 set, E4H): used by message 48.

Operands Changed While It Runs

Address
Size
Contents
4EA0H-4EA1H
2 bytes
The count of elements of CMD"O" (4E85H). 0000H in the file.
4EAEH-4EAFH
2 bytes
The position of the round of the sort (4EAAH, 4F0BH). 0000H in the file.
4EB4H-4EB5H
2 bytes
The working position of the sort, stepped back by the gap after an exchange (4EB0H, 4EFDH). 0000H in the file.
4EBBH-4EBCH
2 bytes
The descriptor of the first element to sort (4E8FH). 0000H in the file.
4F0FH-4F10H
2 bytes
The count less the gap: the positions of a round (4EA4H). 0000H in the file.
5023H-5024H
2 bytes
The number of the old line of M or C (4FE3H), deleted by 501AH for M. 0000H in the file.

Disassembly

4E00H - The Entry: the Function in Register A'

The transfer address and the only entry. BASIC/CMD calls BASIC/OV3 through its 54DEH with the number of a function in Register A' (put there by EX AF,AF'): it JUMPs to 4E00H when the file is already in the overlay area, or loads it with @LOAD and RETurns to 4E00H. 4414H, OVRLY$, gets 01H first, the mark BASIC/CMD's 54DEH tests to know the file is still at 4E00H. Function 01H gives the text of a BASIC error, 02H turns an LDOS error into a BASIC error, 03H sorts a string array (CMD"O"), 04H parks the variables for a RUN with V, 05H moves a line (M at READY) and 06H copies one (C); any other number runs the copy too.

4E00
LD A,01H 3E 01
Load Register A with 01H, the mark of BASIC/OV3 for OVRLY$.
4E02
LD (4414H),A 32 14 44
Store Register A (01H) at 4414H, OVRLY$, the code of the file in the overlay area at 4E00H: BASIC/CMD's 54DEH finds 01H there and JUMPs straight to 4E00H the next time. A system file loaded at 4E00H puts its own code there.
4E05
EX AF,AF' 08
Exchange Register Pair AF with Register Pair AF': Register A = the function number BASIC/CMD put in Register A'.
4E06
DEC A 3D
DECrement Register A (the function): the Z FLAG for function 01H.
4E07
If the Z FLAG is set (function 01H), JUMP to 4E1BH for the text of the BASIC error whose E value is in Register L.
4E09
DEC A 3D
DECrement Register A: the Z FLAG for function 02H.
4E0A
If the Z FLAG is set (function 02H), JUMP to 4E6BH to turn the LDOS error in Register L into a BASIC error.
4E0C
DEC A 3D
DECrement Register A: the Z FLAG for function 03H.
4E0D
If the Z FLAG is set (function 03H), JUMP to 4E80H to sort a string array for CMD"O".
4E10
DEC A 3D
DECrement Register A: the Z FLAG for function 04H.
4E11
If the Z FLAG is set (function 04H), JUMP to 4F19H to park the variables for a RUN with V.
4E14
DEC A 3D
DECrement Register A: the Z FLAG for function 05H.
4E15
If the Z FLAG is set (function 05H), JUMP to 4FD6H to move a line (M).
4E18
JUMP to 4FD7H to copy a line (C): function 06H, and any other number.

4E1BH - Function 01H: the Text of a BASIC Error

BASIC/CMD's 5A72H (the error vector 41A6H) calls it with Register L = the error's E value from the ROM's error handler. The E value picks one of the messages of the table at 5057H: E values 00H-2EH give messages 2-25 (E / 2 + 2), 64H-90H give messages 26-48 (the disk errors), any other even value message 21, Unprintable error; an odd value (only the 19H of LDOS code 00H) has bit 7 set by the RRCA and sends the search past the end of the table. Each message is a list of word numbers from the dictionary at 50D6H, bit 7 set on the last; the words are copied to 543CH (in BASIC/CMD's image) with a space after each and 00H at the end, and the first letter is made upper case. It RETurns with Register Pair HL = 543CH.

4E1B
LD A,L 7D
Copy Register L (the error's E value) into Register A.
4E1C
LD HL,5057H 21 57 50
Point Register Pair HL to 5057H, the table of messages. Not used: 4E32H loads Register Pair HL again before it is read.
4E1F
CP 91H FE 91
Compare Register A (the E value) against 91H: the NO CARRY FLAG for 91H and above, past the last disk error.
4E21
If the NO CARRY FLAG is set (91H or above), JUMP to 4E2BH: the message Unprintable error.
4E23
CP 63H FE 63
Compare Register A (the E value) against 63H: the NO CARRY FLAG for 63H-90H, the disk errors.
4E25
If the NO CARRY FLAG is set (a disk error), JUMP to 4E2DH to take 34H off the E value: 64H becomes 30H.
4E27
CP 2FH FE 2F
Compare Register A (the E value) against 2FH: the CARRY FLAG for 00H-2EH, the errors of the ROM.
4E29
If the CARRY FLAG is set (00H-2EH), JUMP to 4E2FH with the E value as it is.
4E2B
LD A,5AH 3E 5A
Load Register A with 5AH: the E values 2FH-62H and 91H-FFH get the number that gives Unprintable error (5AH less 34H is 26H, message 21).
4E2D
SUB 34H D6 34
SUBtract 34H from Register A: a disk error's E value 64H-90H becomes 30H-5CH, next after the errors of the ROM.
4E2F
RRCA 0F
Rotate Register A right (RRCA): an even E value is halved.
4E30
INC A 3C
INCrement Register A (the halved E value) by one.
4E31
INC A 3C
INCrement Register A again: Register A = E / 2 + 2, the number of the message (2 for E value 00H).
4E32
LD HL,5057H 21 57 50
Point Register Pair HL to 5057H, the table of messages: message 0 is its first byte.
4E35
LD B,A 47
Copy Register A (the number of the message) into Register B, the count of messages to pass over.
4E36
LD A,(HL) 7E
Load Register A with the byte of the message table at Register Pair HL, a word number.
4E37
RLCA 07
Rotate Register A left (RLCA): bit 7, the mark of the last word of a message, goes into the CARRY FLAG.
4E38
INC HL 23
INCrement Register Pair HL to the next byte of the message table.
4E39
If the NO CARRY FLAG is set (not the last word of the message), LOOP BACK to 4E36H.
4E3B
DEC B 05
DECrement Register B (the messages still to pass over): the Z FLAG when Register Pair HL is at the message wanted.
4E3C
If the NZ FLAG is set, LOOP BACK to 4E36H to pass over the next message.
4E3E
LD DE,543CH 11 3C 54
Point Register Pair DE to 543CH, in BASIC/CMD's image: the buffer for the text (that code runs only at BASIC's start, and 62B5H uses the same bytes for a file specification).
4E41
PUSH DE D5
Save Register Pair DE (543CH, the start of the text) to the stack, for the RETurn.
4E42
LD A,(HL) 7E
Load Register A with the byte of the message at Register Pair HL: the number of a word in bits 6-0, bit 7 set for the last word.
4E43
AND 7FH E6 7F
Mask Register A to bits 6-0 (AND 7FH): the number of the word.
4E45
LD B,A 47
Copy Register A (the number of the word) into Register B, the count of words to pass over in the dictionary.
4E46
PUSH HL E5
Save Register Pair HL (the place in the message) to the stack.
4E47
LD HL,50D6H 21 D6 50
Point Register Pair HL to 50D6H, the dictionary: word 0 is its first byte.
4E4A
LD A,(HL) 7E
Load Register A with the character of the dictionary at Register Pair HL.
4E4B
RLCA 07
Rotate Register A left (RLCA): bit 7, the mark of the last letter of a word, goes into the CARRY FLAG.
4E4C
INC HL 23
INCrement Register Pair HL to the next character of the dictionary.
4E4D
If the NO CARRY FLAG is set (not the last letter of the word), LOOP BACK to 4E4AH.
4E4F
DEC B 05
DECrement Register B (the words still to pass over): the Z FLAG when Register Pair HL is at the word wanted.
4E50
If the NZ FLAG is set, LOOP BACK to 4E4AH to pass over the next word.
4E52
LD A,(HL) 7E
Load Register A with the letter of the word at Register Pair HL.
4E53
RLCA 07
Rotate Register A left (RLCA): bit 7, the mark of the last letter, goes into the CARRY FLAG and into bit 0.
4E54
SRL A CB 3F
Shift Register A right (SRL A): the letter comes back without bit 7, and bit 0 goes out into the CARRY FLAG again, so the CARRY FLAG is still the mark of the last letter.
4E56
LD (DE),A 12
Store Register A (the letter) at Register Pair DE, in the text at 543CH.
4E57
INC HL 23
INCrement Register Pair HL to the next letter of the dictionary. INC does not change the CARRY FLAG.
4E58
INC DE 13
INCrement Register Pair DE to the next byte of the text.
4E59
If the NO CARRY FLAG is set (not the last letter), LOOP BACK to 4E52H for the next letter.
4E5B
LD A,20H 3E 20
Load Register A with 20H, a space, to follow the word.
4E5D
LD (DE),A 12
Store Register A (a space) at Register Pair DE, after the word.
4E5E
INC DE 13
INCrement Register Pair DE to the next byte of the text.
4E5F
POP HL E1
Restore Register Pair HL (the place in the message) from the stack.
4E60
LD A,(HL) 7E
Load Register A with the byte of the message at Register Pair HL, the number of the word just copied.
4E61
INC HL 23
INCrement Register Pair HL to the next byte of the message.
4E62
RLCA 07
Rotate Register A left (RLCA): bit 7, the mark of the last word, goes into the CARRY FLAG.
4E63
If the NO CARRY FLAG is set (more words), LOOP BACK to 4E42H for the next word of the message.
4E65
XOR A AF
Load Register A with 00H (XOR A), the end of the text.
4E66
LD (DE),A 12
Store Register A (00H) at Register Pair DE, after the space that follows the last word.
4E67
POP HL E1
Restore Register Pair HL from the stack: 543CH, the start of the text.
4E68
RES 5,(HL) CB AE
Clear bit 5 of the first letter at Register Pair HL: a lower case letter becomes upper case (next becomes Next).
4E6A
RET C9
RETurn to BASIC/CMD with Register Pair HL = 543CH, the text of the message ended by 00H.

4E6BH - Function 02H: an LDOS Error Becomes a BASIC Error

BASIC/CMD's 6463H calls it with Register L = the error code an LDOS service returned. The code is kept at 660BH for CMD"E"; codes from 29H up are taken as 29H; the table at 502DH gives the E value of the BASIC error, and the ROM's error handler is entered with it. It does not RETurn.

4E6B
LD A,L 7D
Copy Register L (the LDOS error code) into Register A.
4E6C
LD (660BH),A 32 0B 66
Store Register A (the LDOS error code) at 660BH, in BASIC/CMD's image: CMD"E" (its 586EH) shows the LDOS message of this code.
4E6F
LD HL,502DH 21 2D 50
Point Register Pair HL to 502DH, the table of E values: the entry for code 00H is the last byte of the JP at 502BH.
4E72
CP 29H FE 29
Compare Register A (the LDOS error code) against 29H: the CARRY FLAG for codes below 29H.
4E74
If the CARRY FLAG is set (below 29H), JUMP to 4E78H with the code as it is.
4E76
LD A,29H 3E 29
Load Register A with 29H: every code from 29H up uses the last entry, 5056H.
4E78
LD C,A 4F
Copy Register A (the code, 00H-29H) into Register C.
4E79
LD B,00H 06 00
Load Register B with 00H: Register Pair BC = the code.
4E7B
ADD HL,BC 09
ADD Register Pair BC (the code) to Register Pair HL (502DH): the entry for the code.
4E7C
LD E,(HL) 5E
Load Register E with the entry at Register Pair HL: the E value of the BASIC error.
4E7D
JUMP to 19A2H, the ROM's error handler, with Register E = the E value: it calls the error vector 41A6H, which runs function 01H for the text.

4E80H - Function 03H: CMD"O", Sort a String Array

BASIC/CMD's 5858H calls it for CMD"O",count,array$(first) with Register Pair HL at the text after "O". The count goes into the operand at 4EA0H, the address of the first element (from the ROM's PTRGET) into the operand at 4EBBH. The elements are sorted in ascending order by a Shell sort: the gap starts at half the count and is halved after each round until it is 0. Only the 3 byte string descriptors (length, address) are exchanged, never the text. Nothing tests that the variable is a string array or that the elements stay inside the array. It RETurns to BASIC/CMD with Register Pair HL after the array name.

4E80
RST 08H => 2CH CF 2C
RST 08H with 2CH: the character at Register Pair HL must be a comma (else Syntax error); Register Pair HL moves to the next character.
4E82
GOSUB to 1E46H, the ROM's INTID2, to evaluate the expression at Register Pair HL as an integer: Register Pair DE = the count of elements to sort.
4E85
LD (4EA0H),DE ED 53 A0 4E
Store Register Pair DE (the count) at 4EA0H-4EA1H, the operand of LD HL at 4E9FH.
4E89
PUSH DE D5
Save Register Pair DE (the count) to the stack.
4E8A
RST 08H => 2CH CF 2C
RST 08H with 2CH: the character at Register Pair HL must be a comma; Register Pair HL moves past it.
4E8C
GOSUB to 260DH, the ROM's PTRGET, to find the variable at Register Pair HL: Register Pair DE = the address of the element named (its descriptor: length, then the address of the text), Register Pair HL after the name.
4E8F
LD (4EBBH),DE ED 53 BB 4E
Store Register Pair DE (the first element's descriptor) at 4EBBH-4EBCH, the operand of LD DE at 4EBAH.
4E93
POP BC C1
Restore Register Pair BC from the stack: the count, the gap before its first halving.
4E94
PUSH HL E5
Save Register Pair HL (the text pointer after the array name) to the stack, for the RETurn.

4E95H - The Next Round: Halve the Gap

Register Pair BC = the gap of the round before (the count at the start). It is halved; at 0 the sort is done. 4F0FH gets the count less the gap, the number of comparisons of the round, and the position at 4EAEH starts again at 0.

4E95
SRL B CB 38
Shift Register B right (SRL B): the high byte of the gap halved, its low bit into the CARRY FLAG.
4E97
RR C CB 19
Rotate Register C right through the CARRY FLAG (RR C): Register Pair BC = the gap halved.
4E99
LD A,B 78
Copy Register B (the high byte of the gap) into Register A.
4E9A
OR C B1
OR Register C into Register A: the Z FLAG when the gap is 0; OR clears the CARRY FLAG for the SBC.
4E9B
If the NZ FLAG is set (a gap of 1 or more), JUMP to 4E9FH for a round.
4E9D
POP HL E1
Restore Register Pair HL (the text pointer after the array name) from the stack.
4E9E
RET C9
RETurn to BASIC/CMD's CMD statement with the array sorted and Register Pair HL at the text after it.
4E9F
LD HL,0000H 21 00 00
Load Register Pair HL with the count of elements, the operand at 4EA0H stored by 4E85H (0000H in the file).
4EA2
SBC HL,BC ED 42
SUBtract Register Pair BC (the gap) from Register Pair HL: the count less the gap, the number of positions of the round.
4EA4
LD (4F0FH),HL 22 0F 4F
Store Register Pair HL (the count less the gap) at 4F0FH-4F10H, the operand of LD DE at 4F0EH.
4EA7
LD HL,0000H 21 00 00
Load Register Pair HL with 0000H, the first position of the round.
4EAA
LD (4EAEH),HL 22 AE 4E
Store Register Pair HL (0000H) at 4EAEH-4EAFH, the operand of LD HL at 4EADH: the position of the round.

4EADH - The Next Position: Compare Two Elements

The element at the position (4EAEH, copied to 4EB4H as the working position) is compared with the element one gap after it. Each element is 3 bytes from the first one (4EBBH). The shorter length is compared character by character; when the shorter string is the same as the start of the longer one, the shorter goes first. An element above its partner (or the same) is exchanged with it, and the working position steps back by the gap to compare again.

4EAD
LD HL,0000H 21 00 00
Load Register Pair HL with the position of the round, the operand at 4EAEH (0000H in the file).
4EB0
LD (4EB4H),HL 22 B4 4E
Store Register Pair HL (the position) at 4EB4H-4EB5H, the operand of LD HL at 4EB3H: the working position.
4EB3
LD HL,0000H 21 00 00
Load Register Pair HL with the working position, the operand at 4EB4H (0000H in the file).
4EB6
LD D,H 54
Copy Register H (the high byte of the working position) into Register D.
4EB7
LD E,L 5D
Copy Register L (the low byte of the working position) into Register E: Register Pair DE = the working position.
4EB8
ADD HL,DE 19
ADD Register Pair DE (the working position) to Register Pair HL: twice the position.
4EB9
ADD HL,DE 19
ADD Register Pair DE to Register Pair HL again: 3 times the position, the offset of the element.
4EBA
LD DE,0000H 11 00 00
Load Register Pair DE with the address of the first element's descriptor, the operand at 4EBBH stored by 4E8FH (0000H in the file).
4EBD
ADD HL,DE 19
ADD Register Pair DE (the first element) to Register Pair HL: the descriptor of the element at the working position.
4EBE
LD D,H 54
Copy Register H (the high byte of the element's descriptor) into Register D.
4EBF
LD E,L 5D
Copy Register L into Register E: Register Pair DE = the descriptor of the element at the working position.
4EC0
ADD HL,BC 09
ADD Register Pair BC (the gap) to Register Pair HL.
4EC1
ADD HL,BC 09
ADD Register Pair BC to Register Pair HL again.
4EC2
ADD HL,BC 09
ADD Register Pair BC to Register Pair HL a third time: Register Pair HL = the descriptor of the element one gap after it.
4EC3
PUSH BC C5
Save Register Pair BC (the gap) to the stack.
4EC4
PUSH HL E5
Save Register Pair HL (the later element's descriptor) to the stack.
4EC5
PUSH DE D5
Save Register Pair DE (the earlier element's descriptor) to the stack.
4EC6
LD A,(DE) 1A
Load Register A with the length of the earlier element, the first byte of its descriptor at Register Pair DE.
4EC7
CP (HL) BE
Compare Register A against the length of the later element at Register Pair HL: the CARRY FLAG when the earlier one is shorter.
4EC8
If the CARRY FLAG is set (the earlier is shorter), JUMP to 4ECBH with its length in Register A.
4ECA
LD A,(HL) 7E
Load Register A with the length of the later element at Register Pair HL, the shorter or the same: LD does not change the CARRY FLAG.
4ECB
PUSH AF F5
Save Register Pair AF (Register A = the shorter length, the flags of the compare) to the stack.
4ECC
POP BC C1
Restore Register Pair BC from the stack: Register B = the shorter length, the count of characters to compare; Register C = the flags, bit 0 the CARRY FLAG of the compare (set when the earlier element is the shorter).
4ECD
AND A A7
Test Register A (the shorter length) with AND A: the Z FLAG for an empty string.
4ECE
If the Z FLAG is set (one of the strings is empty), JUMP to 4EE5H: the lengths decide.
4ED0
INC DE 13
INCrement Register Pair DE to the address of the earlier element's text in its descriptor.
4ED1
INC HL 23
INCrement Register Pair HL to the address of the later element's text in its descriptor.
4ED2
LD A,(HL) 7E
Load Register A with the low byte of the later element's text address at Register Pair HL.
4ED3
INC HL 23
INCrement Register Pair HL to the high byte of the later element's text address.
4ED4
LD H,(HL) 66
Load Register H with the high byte of the later element's text address at Register Pair HL.
4ED5
LD L,A 6F
Copy Register A into Register L: Register Pair HL = the text of the later element.
4ED6
EX DE,HL EB
Exchange Register Pairs DE and HL: Register Pair DE = the text of the later element, Register Pair HL = the address field of the earlier one's descriptor.
4ED7
LD A,(HL) 7E
Load Register A with the low byte of the earlier element's text address at Register Pair HL.
4ED8
INC HL 23
INCrement Register Pair HL to the high byte of the earlier element's text address.
4ED9
LD H,(HL) 66
Load Register H with the high byte of the earlier element's text address at Register Pair HL.
4EDA
LD L,A 6F
Copy Register A into Register L: Register Pair HL = the text of the earlier element.
4EDB
LD A,(DE) 1A
Load Register A with the character of the later element at Register Pair DE.
4EDC
SUB (HL) 96
SUBtract the character of the earlier element at Register Pair HL from Register A: the CARRY FLAG when the later character is lower, the Z FLAG when they are the same.
4EDD
If the CARRY FLAG is set (the later element is lower), JUMP to 4EE9H to exchange the two.
4EDF
If the NZ FLAG is set (the later element is higher), JUMP to 4F04H: the two are in order.
4EE1
INC DE 13
INCrement Register Pair DE to the next character of the later element.
4EE2
INC HL 23
INCrement Register Pair HL to the next character of the earlier element.
4EE3
DECrement Register B (the characters left) and LOOP BACK to 4EDBH while it is not 0.
4EE5
BIT 0,C CB 41
Test bit 0 of Register C, the CARRY FLAG of the length compare at 4EC7H: set when the earlier element is the shorter.
4EE7
If the NZ FLAG is set (the earlier element is shorter and the same as the start of the later one), JUMP to 4F04H: they are in order. Two elements that are the same go on to the exchange.

4EE9H - Exchange the Two Descriptors

The 3 bytes of the two descriptors are exchanged, so the lower element moves one gap down; the working position (4EB4H) steps back by the gap and the compare is made again while it is 0 or more.

4EE9
POP DE D1
Restore Register Pair DE (the earlier element's descriptor) from the stack.
4EEA
POP HL E1
Restore Register Pair HL (the later element's descriptor) from the stack.
4EEB
LD B,03H 06 03
Load Register B with 03H, the bytes of a descriptor.
4EED
LD C,(HL) 4E
Load Register C with the byte of the later descriptor at Register Pair HL.
4EEE
LD A,(DE) 1A
Load Register A with the byte of the earlier descriptor at Register Pair DE.
4EEF
LD (HL),A 77
Store Register A (the earlier element's byte) at Register Pair HL, in the later descriptor.
4EF0
LD A,C 79
Copy Register C (the later element's byte) into Register A.
4EF1
LD (DE),A 12
Store Register A (the later element's byte) at Register Pair DE, in the earlier descriptor.
4EF2
INC HL 23
INCrement Register Pair HL to the next byte of the later descriptor.
4EF3
INC DE 13
INCrement Register Pair DE to the next byte of the earlier descriptor.
4EF4
DECrement Register B (the bytes left) and LOOP BACK to 4EEDH while it is not 0.
4EF6
LD HL,(4EB4H) 2A B4 4E
Load Register Pair HL with the working position from 4EB4H-4EB5H.
4EF9
XOR A AF
Load Register A with 00H (XOR A), which clears the CARRY FLAG for the SBC.
4EFA
POP BC C1
Restore Register Pair BC (the gap) from the stack.
4EFB
SBC HL,BC ED 42
SUBtract Register Pair BC (the gap) from Register Pair HL (the working position): the CARRY FLAG when it goes below 0.
4EFD
LD (4EB4H),HL 22 B4 4E
Store Register Pair HL (the working position less the gap) at 4EB4H-4EB5H.
4F00
If the NO CARRY FLAG is set (a position of 0 or more), LOOP BACK to 4EB3H to compare the element there with the one a gap after it.
4F02
JUMP to 4F07H for the next position of the round.

4F04H - In Order: the Next Position

The two elements are in order: the three words saved at 4EC3H-4EC5H are taken back, and the position of the round (4EAEH) goes up by one. While it is below the count less the gap (4F0FH) the next position is compared, else the next round begins with half the gap.

4F04
POP DE D1
Restore Register Pair DE (the earlier element's descriptor) from the stack, not used again.
4F05
POP HL E1
Restore Register Pair HL (the later element's descriptor) from the stack, not used again.
4F06
POP BC C1
Restore Register Pair BC (the gap) from the stack.
4F07
LD HL,(4EAEH) 2A AE 4E
Load Register Pair HL with the position of the round from 4EAEH-4EAFH.
4F0A
INC HL 23
INCrement Register Pair HL (the position) by one.
4F0B
LD (4EAEH),HL 22 AE 4E
Store Register Pair HL (the next position) at 4EAEH-4EAFH.
4F0E
LD DE,0000H 11 00 00
Load Register Pair DE with the count less the gap, the operand at 4F0FH stored by 4EA4H (0000H in the file).
4F11
XOR A AF
Load Register A with 00H (XOR A), which clears the CARRY FLAG for the SBC.
4F12
SBC HL,DE ED 52
SUBtract Register Pair DE from Register Pair HL (the position): the CARRY FLAG while the position is below the count less the gap.
4F14
If the CARRY FLAG is set (positions left), LOOP BACK to 4EADH for the next position.
4F16
JUMP to 4E95H for the next round with half the gap in Register Pair BC.

4F19H - Function 04H: Park the Variables for a RUN With V

BASIC/CMD's 5EC1H calls it for RUN"file",V before the ROM's NEW. The simple variables (40F9H-40FAH up to 40FBH) are walked first: each entry is a type byte (the size of the value: 02H, 03H, 04H, 08H), two name bytes and the value. A DEF FN entry (bit 7 of its second name byte) gets its pointer into the program set to 0000H, since the program goes away. A string's text that lies in the program (a constant) is copied into string space (4F6AH). The arrays (40FBH up to 40FDH) come next, every element of a string array the same way. Then 4F99H moves the whole block up below the stack and keeps the pointers for BASIC/CMD's 5F70H.

4F19
LD HL,(40F9H) 2A F9 40
Load Register Pair HL with 40F9H-40FAH, the start of the simple variables (the end of the program).
4F1C
LD DE,(40FBH) ED 5B FB 40
Load Register Pair DE with 40FBH-40FCH, the start of the arrays: the end of the simple variables.
4F20
LD BC,0000H 01 00 00
Load Register Pair BC with 0000H: Register B = 00H for the stores at 4F2FH, Register C = 00H, the size of the first step.

4F23H - The Simple Variables

Register Pair HL steps over each entry by Register C, the size of its value; DE = the end of the simple variables.

4F23
ADD HL,BC 09
ADD Register Pair BC (Register C = the size of the value just passed, Register B = 00H) to Register Pair HL: the next entry.
4F24
RST 18H DF
RST 18H: compare Register Pair HL (the entry) against Register Pair DE (the start of the arrays): the Z FLAG at the end of the simple variables.
4F25
If the Z FLAG is set (no more simple variables), JUMP to 4F3FH for the arrays.
4F27
LD C,(HL) 4E
Load Register C with the type byte of the entry at Register Pair HL: the size of its value (02H integer, 03H string, 04H single, 08H double).
4F28
INC HL 23
INCrement Register Pair HL past the type byte to the first name byte.
4F29
INC HL 23
INCrement Register Pair HL to the second name byte.
4F2A
BIT 7,(HL) CB 7E
Test bit 7 of the second name byte at Register Pair HL: set for a function made by DEF FN.
4F2C
INC HL 23
INCrement Register Pair HL to the value of the entry. INC does not change the flags.
4F2D
If the Z FLAG is set (an ordinary variable), JUMP to 4F35H.
4F2F
LD (HL),B 70
Store Register B (00H) at Register Pair HL, the low byte of the function's pointer into the program text.
4F30
INC HL 23
INCrement Register Pair HL to the high byte of the pointer.
4F31
LD (HL),B 70
Store Register B (00H) at Register Pair HL: the pointer is 0000H, the function is no longer defined.
4F32
DEC HL 2B
DECrement Register Pair HL back to the start of the value.
4F33
LOOP BACK to 4F23H to step over the value by Register C.
4F35
LD A,C 79
Copy Register C (the size of the value) into Register A.
4F36
CP 03H FE 03
Compare Register A against 03H: the Z FLAG for a string.
4F38
If the NZ FLAG is set (a number), LOOP BACK to 4F23H to step over the value.
4F3A
GOSUB to 4F6AH to copy the string's text into string space when it lies in the program; Register Pair HL comes back after its 3 byte descriptor.
4F3D
LOOP BACK to 4F24H: Register Pair HL is already at the next entry.

4F3FH - The Arrays

Each array is a type byte, two name bytes, the length of the rest (2 bytes, from the count of dimensions to the end), the count of dimensions and 2 bytes for each dimension, then the elements. A number array is passed over in one step; in a string array every 3 byte descriptor goes to 4F6AH.

4F3F
LD DE,(40FDH) ED 5B FD 40
Load Register Pair DE with 40FDH-40FEH, the end of the arrays.
4F43
RST 18H DF
RST 18H: compare Register Pair HL (the array) against Register Pair DE (the end of the arrays): the Z FLAG at the end.
4F44
If the Z FLAG is set (no more arrays), JUMP to 4F99H to park the block.
4F46
LD A,(HL) 7E
Load Register A with the type byte of the array at Register Pair HL (03H for a string array).
4F47
INC HL 23
INCrement Register Pair HL to the first name byte.
4F48
INC HL 23
INCrement Register Pair HL to the second name byte.
4F49
INC HL 23
INCrement Register Pair HL to the length of the array.
4F4A
LD C,(HL) 4E
Load Register C with the low byte of the length at Register Pair HL.
4F4B
INC HL 23
INCrement Register Pair HL to the high byte of the length of the array.
4F4C
LD B,(HL) 46
Load Register B with the high byte of the length at Register Pair HL: Register Pair BC = the bytes from the count of dimensions to the end of the array.
4F4D
INC HL 23
INCrement Register Pair HL to the count of dimensions.
4F4E
CP 03H FE 03
Compare Register A (the type) against 03H: the Z FLAG for a string array.
4F50
If the Z FLAG is set (a string array), JUMP to 4F55H to go through its elements.
4F52
ADD HL,BC 09
ADD Register Pair BC (the length) to Register Pair HL: the next array.
4F53
LOOP BACK to 4F43H for the next array, with Register Pair HL at its type byte.
4F55
LD A,(HL) 7E
Load Register A with the count of dimensions at Register Pair HL.
4F56
PUSH DE D5
Save Register Pair DE (the end of the arrays) to the stack.
4F57
PUSH HL E5
Save Register Pair HL (the count of dimensions) to the stack.
4F58
ADD HL,BC 09
ADD Register Pair BC (the length) to Register Pair HL: the end of this array.
4F59
EX DE,HL EB
Exchange Register Pairs DE and HL: Register Pair DE = the end of this array.
4F5A
POP HL E1
Restore Register Pair HL (the count of dimensions) from the stack.
4F5B
INC HL 23
INCrement Register Pair HL to the sizes of the dimensions.
4F5C
RLCA 07
Rotate Register A left (RLCA): twice the count of dimensions, the bytes of their sizes.
4F5D
LD C,A 4F
Copy Register A (twice the count of dimensions) into Register C.
4F5E
LD B,00H 06 00
Load Register B with 00H: Register Pair BC = the bytes of the sizes.
4F60
ADD HL,BC 09
ADD Register Pair BC to Register Pair HL: the first element's descriptor.
4F61
GOSUB to 4F6AH to copy the element's text into string space when it lies in the program; Register Pair HL comes back after the descriptor.
4F64
RST 18H DF
RST 18H: compare Register Pair HL against Register Pair DE (the end of this array): the Z FLAG after its last element.
4F65
If the NZ FLAG is set (more elements), LOOP BACK to 4F61H.
4F67
POP DE D1
Restore Register Pair DE (the end of the arrays) from the stack.
4F68
LOOP BACK to 4F43H for the next array, with Register Pair HL at its type byte (the end of this one).

4F6AH - Move a String Out of the Program

Register Pair HL = a string descriptor (length, address of the text), Register Pair DE = the end of the area being walked (the start of the arrays, or the end of the array). A text at or above Register Pair DE (in string space) or below 40A4H is left alone; a text between them is in the program, and goes to new string space from the ROM's GETSPA (28BFH), the descriptor then pointing at the copy. It RETurns with Register Pair HL 3 bytes on and Register Pair DE as it was.

4F6A
PUSH DE D5
Save Register Pair DE (the end of the area) to the stack.
4F6B
LD A,(HL) 7E
Load Register A with the length of the string at Register Pair HL.
4F6C
INC HL 23
INCrement Register Pair HL to the address of its text in the descriptor.
4F6D
PUSH HL E5
Save Register Pair HL (the address field of the descriptor) to the stack.
4F6E
AND A A7
Test Register A (the length) with AND A: the Z FLAG for an empty string.
4F6F
If the Z FLAG is set (an empty string), JUMP to 4F94H: there is nothing to copy.
4F71
LD C,A 4F
Copy Register A (the length) into Register C.
4F72
LD A,(HL) 7E
Load Register A with the low byte of the text's address at Register Pair HL.
4F73
INC HL 23
INCrement Register Pair HL to the high byte of the text's address in the descriptor.
4F74
LD H,(HL) 66
Load Register H with the high byte of the text's address at Register Pair HL.
4F75
LD L,A 6F
Copy Register A into Register L: Register Pair HL = the text of the string.
4F76
RST 18H DF
RST 18H: compare Register Pair HL (the text) against Register Pair DE (the end of the area): the CARRY FLAG when the text lies below it.
4F77
If the NO CARRY FLAG is set (the text lies at or above the end of the area, in string space), JUMP to 4F94H to leave it.
4F79
LD DE,(40A4H) ED 5B A4 40
Load Register Pair DE with 40A4H-40A5H, the start of the program text.
4F7D
RST 18H DF
RST 18H: compare Register Pair HL (the text) against Register Pair DE (the start of the program): the CARRY FLAG when the text lies below it.
4F7E
If the CARRY FLAG is set (below the program), JUMP to 4F94H to leave it.
4F80
LD A,C 79
Copy Register C (the length) into Register A for GETSPA.
4F81
PUSH HL E5
Save Register Pair HL (the text in the program) to the stack.
4F82
GOSUB to 28BFH, the ROM's GETSPA, to reserve Register A bytes of string space: Register Pair DE = the new place.
4F85
LD C,A 4F
Copy Register A (the length, kept by GETSPA) into Register C.
4F86
LD B,00H 06 00
Load Register B with 00H: Register Pair BC = the length.
4F88
POP HL E1
Restore Register Pair HL (the text in the program) from the stack.
4F89
PUSH DE D5
Save Register Pair DE (the new place) to the stack.
4F8A
LDIR ED B0
Copy Register Pair BC bytes from Register Pair HL to Register Pair DE (LDIR): the text into string space.
4F8C
POP DE D1
Restore Register Pair DE (the new place) from the stack.
4F8D
POP HL E1
Restore Register Pair HL (the address field of the descriptor) from the stack.
4F8E
LD (HL),E 73
Store Register E (the low byte of the new place) at Register Pair HL.
4F8F
INC HL 23
INCrement Register Pair HL to the high byte of the descriptor's address field.
4F90
LD (HL),D 72
Store Register D (the high byte of the new place) at Register Pair HL: the descriptor points at the copy.
4F91
INC HL 23
INCrement Register Pair HL past the descriptor.
4F92
POP DE D1
Restore Register Pair DE (the end of the area) from the stack.
4F93
RET C9
RETurn with Register Pair HL after the descriptor.
4F94
POP HL E1
Restore Register Pair HL (the address field of the descriptor) from the stack.
4F95
INC HL 23
INCrement Register Pair HL to the high byte of the address.
4F96
INC HL 23
INCrement Register Pair HL past the descriptor.
4F97
POP DE D1
Restore Register Pair DE (the end of the area) from the stack.
4F98
RET C9
RETurn with Register Pair HL after the descriptor.

4F99H - Park the Block

The variables and arrays (40F9H up to 40FDH) are moved up to end 128 bytes below the Stack Pointer, with LDDR; when the block already reaches that place it is Out of memory. The start of string space (40A0H) is set just below the parked block, so the ROM's NEW puts the stack under it. The old values go into BASIC/CMD's operands for 5F70H: 5F72H the old 40F9H, 5F85H the length, 5F79H the old 40FBH, 5F92H the old 40D6H, 5F98H the old 40A0H; 6608H gets D6H.

4F99
LD HL,(40F9H) 2A F9 40
Load Register Pair HL with 40F9H-40FAH, the start of the simple variables.
4F9C
LD (5F72H),HL 22 72 5F
Store Register Pair HL at 5F72H-5F73H, in BASIC/CMD's image: the operand of LD DE at 5F71H, the old end of the program.
4F9F
EX DE,HL EB
Exchange Register Pairs DE and HL: Register Pair HL = the end of the arrays (from 4F3FH), Register Pair DE = the start of the simple variables.
4FA0
XOR A AF
Load Register A with 00H (XOR A), which clears the CARRY FLAG for the SBC.
4FA1
PUSH HL E5
Save Register Pair HL (the end of the arrays) to the stack.
4FA2
SBC HL,DE ED 52
SUBtract Register Pair DE (the start of the variables) from Register Pair HL: the length of the block.
4FA4
LD (5F85H),HL 22 85 5F
Store Register Pair HL (the length) at 5F85H-5F86H, in BASIC/CMD's image: the operand of LD BC at 5F84H.
4FA7
LD B,H 44
Copy Register H (the high byte of the length) into Register B.
4FA8
LD C,L 4D
Copy Register L into Register C: Register Pair BC = the length of the block.
4FA9
LD HL,FF80H 21 80 FF
Load Register Pair HL with FF80H, minus 128, to find a place below the Stack Pointer.
4FAC
ADD HL,SP 39
ADD the Stack Pointer to Register Pair HL: 128 bytes below the stack.
4FAD
EX DE,HL EB
Exchange Register Pairs DE and HL: Register Pair DE = the place for the last byte of the block.
4FAE
POP HL E1
Restore Register Pair HL (the end of the arrays) from the stack.
4FAF
DEC HL 2B
DECrement Register Pair HL to the last byte of the block.
4FB0
RST 18H DF
RST 18H: compare Register Pair HL (the last byte of the block) against Register Pair DE (the place for it): the NO CARRY FLAG when the block already reaches it.
4FB1
If the NO CARRY FLAG is set (no room to move it up), JUMP to 197AH, the ROM's Out of memory error.
4FB4
LD A,B 78
Copy Register B (the high byte of the length) into Register A.
4FB5
OR C B1
OR Register C into Register A: the Z FLAG for a length of 0 (no variables).
4FB6
If the Z FLAG is set (nothing to move), JUMP to 4FBAH.
4FB8
LDDR ED B8
Copy Register Pair BC bytes down from Register Pair HL to Register Pair DE (LDDR): the block, from its last byte; Register Pair DE ends one byte below the parked block.
4FBA
LD HL,(40FBH) 2A FB 40
Load Register Pair HL with 40FBH-40FCH, the start of the arrays.
4FBD
LD (5F79H),HL 22 79 5F
Store Register Pair HL at 5F79H-5F7AH, in BASIC/CMD's image: the operand of LD HL at 5F78H, the old start of the arrays.
4FC0
LD HL,(40D6H) 2A D6 40
Load Register Pair HL with 40D6H-40D7H, the next free byte of string space.
4FC3
LD (5F92H),HL 22 92 5F
Store Register Pair HL at 5F92H-5F93H, in BASIC/CMD's image: the operand of LD HL at 5F91H.
4FC6
LD HL,(40A0H) 2A A0 40
Load Register Pair HL with 40A0H-40A1H, the start of string space.
4FC9
LD (5F98H),HL 22 98 5F
Store Register Pair HL at 5F98H-5F99H, in BASIC/CMD's image: the operand of LD HL at 5F97H.
4FCC
LD (40A0H),DE ED 53 A0 40
Store Register Pair DE (the byte below the parked block) at 40A0H-40A1H, the start of string space: NEW sets the stack below it, and BASIC/CMD's 5F80H finds the block at 40A0H plus one.
4FD0
LD A,D6H 3E D6
Load Register A with D6H, the mark of a RUN with V whose variables are parked.
4FD2
LD (6608H),A 32 08 66
Store Register A (D6H) at 6608H, BASIC/CMD's run state: 5F61H brings the variables back after the load; after an error 5A67H only puts back 40A0H and the stack (5F97H), clears 6608H and starts the program, and the parked block is not brought back.
4FD5
RET C9
RETurn to BASIC/CMD's 5EC7H with the variables parked and Register A = D6H.

4FD6H - Functions 05H and 06H: M and C, Move or Copy a Line

BASIC/CMD's 6578H calls it for a line typed at READY that is M or C with two line numbers, M old,new or C old,new; Register Pair HL = the line, its letter replaced by the function number and 00H after it. 4FD6H (M) is OR AFH, which leaves the NZ FLAG; 4FD7H (C) is the AFH alone, XOR A, which leaves the Z FLAG. The old line must exist (Undefined line number) and the new one must not (Illegal function call); a missing line number, a line number of 0 (either one) or more text after the second number is a Syntax error. The old line's text is turned back into characters in the input buffer, and the ROM's EDIT exit (2FEBH) takes it in as the new line, as if typed; for C no READY is shown. For M the line input vector (41AFH) is pointed at 501AH, so that when the ROM next asks for a line the old line is deleted.

4FD6
OR AFH F6 AF
OR Register A with AFH: the NZ FLAG, the mark of M. Entered at 4FD7H, the byte AFH is XOR A: Register A = 00H and the Z FLAG, the mark of C.
4FD8
PUSH AF F5
Save Register Pair AF (the Z FLAG for C, the NZ FLAG for M) to the stack, for 500CH.
4FD9
RST 10H D7
RST 10H: Register Pair HL moves past the function number to the next character that is not a space, in Register A; the Z FLAG at the end of the line.
4FDA
If the Z FLAG is set (no line number), JUMP to 502BH for a Syntax error.
4FDC
GOSUB to 1E4FH, the ROM's line number reader (a period means the current line, 40ECH): Register Pair DE = the old line's number.
4FDF
LD A,D 7A
Copy Register D (the high byte of the old number) into Register A.
4FE0
OR E B3
OR Register E into Register A: the Z FLAG for line 0, no number.
4FE1
If the Z FLAG is set (0), JUMP to 502BH for a Syntax error.
4FE3
LD (5023H),DE ED 53 23 50
Store Register Pair DE (the old line's number) at 5023H-5024H, the operand of LD DE at 5022H, for the delete of M.
4FE7
PUSH HL E5
Save Register Pair HL (the text pointer after the old number) to the stack.
4FE8
GOSUB to 1B2CH, the ROM's FNDLIN, to find the line whose number is in Register Pair DE: the CARRY FLAG when it exists, Register Pair BC = the line.
4FEB
If the NO CARRY FLAG is set (no such line), JUMP to 1ED9H, the ROM's Undefined line number error.
4FEE
LD H,B 60
Copy Register B (the high byte of the line's address) into Register H.
4FEF
LD L,C 69
Copy Register C into Register L: Register Pair HL = the old line (its link word).
4FF0
INC HL 23
INCrement Register Pair HL past the low byte of the link.
4FF1
INC HL 23
INCrement Register Pair HL past the high byte of the link.
4FF2
INC HL 23
INCrement Register Pair HL past the low byte of the line number.
4FF3
INC HL 23
INCrement Register Pair HL past the high byte of the line number: Register Pair HL = the text of the old line.
4FF4
EX (SP),HL E3
Exchange Register Pair HL with the top of the stack at the Stack Pointer: the text of the old line is kept there, Register Pair HL = the text pointer after the old number.
4FF5
RST 08H => 2CH CF 2C
RST 08H with 2CH: the character at Register Pair HL must be a comma (else Syntax error); Register Pair HL moves past it.
4FF7
GOSUB to 1E4FH, the ROM's line number reader: Register Pair DE = the new line's number; the NZ FLAG when more text follows it.
4FFA
If the NZ FLAG is set (more text after the number), JUMP to 502BH for a Syntax error.
4FFC
LD A,D 7A
Copy Register D (the high byte of the new number) into Register A.
4FFD
OR E B3
OR Register E into Register A: the Z FLAG for line 0.
4FFE
If the Z FLAG is set (0), JUMP to 502BH for a Syntax error.
5000
GOSUB to 1B2CH, the ROM's FNDLIN, to look for the new line's number in Register Pair DE: the CARRY FLAG when it already exists.
5003
POP HL E1
Restore Register Pair HL (the text of the old line) from the stack. POP does not change the flags.
5004
If the CARRY FLAG is set (the new line exists), JUMP to 1E4AH, the ROM's Illegal function call error.
5007
PUSH DE D5
Save Register Pair DE (the new line's number) to the stack.
5008
GOSUB to 2B7EH, the ROM's BUFLIN, to turn the text of the old line at Register Pair HL back into characters in the input buffer (40A7H).
500B
POP DE D1
Restore Register Pair DE (the new line's number) from the stack.
500C
POP AF F1
Restore Register Pair AF from the stack: the Z FLAG for C, the NZ FLAG for M (4FD8H).
500D
If the Z FLAG is set (C, a copy), JUMP to 5015H.
500F
LD HL,501AH 21 1A 50
Point Register Pair HL to 501AH, the second half of M.
5012
LD (41B0H),HL 22 B0 41
Store Register Pair HL (501AH) at 41B0H-41B1H, the operand of the JP at 41AFH, the line input vector (5BDFH in BASIC/CMD): the ROM's next request for a line comes to 501AH.
5015
OR FFH F6 FF
Load Register A with FFH (OR FFH): the NZ FLAG, which the ROM's 2FEFH needs to go on.
5017
JUMP to 2FEBH, the ROM's EDIT exit, with Register Pair DE = the new line's number and its text in the input buffer: the line goes into the program as if typed, and the ROM goes on to its command loop (1A33H) for the next line, with no READY shown.

501AH - M: Delete the Old Line

Reached through the line input vector (41AFH) from the ROM's 0368H, when the ROM asks for a line after the new one went in. The vector gets back BASIC/CMD's 5BDFH, the two return addresses (from 0368H and from 1A7BH) are dropped, and the old line (its number at 5023H) is deleted by the ROM's DELETE from 2BCAH, which shows READY and goes back to the command loop.

501A
LD HL,5BDFH 21 DF 5B
Point Register Pair HL to 5BDFH, BASIC/CMD's line input from a file.
501D
LD (41B0H),HL 22 B0 41
Store Register Pair HL (5BDFH) at 41B0H-41B1H, the operand of the line input vector at 41AFH: back to BASIC/CMD's code.
5020
POP HL E1
Discard the return address 036BH of the CALL 41AFH at the ROM's 0368H (POP HL into Register Pair HL).
5021
POP HL E1
Discard the return address 1A7EH of the CALL 0361H at the ROM's 1A7BH (POP HL into Register Pair HL).
5022
LD DE,0000H 11 00 00
Load Register Pair DE with the old line's number, the operand at 5023H stored by 4FE3H (0000H in the file).
5025
GOSUB to 1B2CH, the ROM's FNDLIN, to find the old line: Register Pair BC = the line; Register Pair DE keeps its number.
5028
JP 2BCAH C3 CA 2B
JUMP to 2BCAH, in the ROM's DELETE after it read its line numbers, with Register Pair BC = the first line to delete and Register Pair DE = the number of the last, the same line: the line is deleted, READY is shown and the ROM goes on at 1AE8H. 2BCAH has no id on the ROM page, so the JUMP is not linked.
502B
JUMP to 1997H, the ROM's Syntax error. Its last byte, 19H at 502DH, is also the entry for LDOS error code 00H of the table at 502DH (4E6FH).

502EH - The LDOS Errors as BASIC Errors

One byte for each LDOS error code from 01H to 29H (4E6BH): the E value of the BASIC error it becomes. The entry for code 00H is 19H, the last byte of the JP at 502BH; codes from 29H up use the entry of 29H. Each row names the LDOS error and the BASIC message its E value gives (4E1BH).

502E
DEFB 72H 72
502EH: LDOS error 01H (parity error during header read): the E value 72H, Disk I/O error.
502F
DEFB 72H 72
502FH: LDOS error 02H (seek error during read): the E value 72H, Disk I/O error.
5030
DEFB 72H 72
5030H: LDOS error 03H (lost data during read): the E value 72H, Disk I/O error.
5031
DEFB 72H 72
5031H: LDOS error 04H (parity error during read): the E value 72H, Disk I/O error.
5032
DEFB 72H 72
5032H: LDOS error 05H (data record not found during read): the E value 72H, Disk I/O error.
5033
DEFB 72H 72
5033H: LDOS error 06H (attempted to read system data record): the E value 72H, Disk I/O error.
5034
DEFB 72H 72
5034H: LDOS error 07H (attempted to read locked/deleted data record): the E value 72H, Disk I/O error.
5035
DEFB 80H 80
5035H: LDOS error 08H (device not available): the E value 80H, Bad file name.
5036
DEFB 72H 72
5036H: LDOS error 09H (parity error during header write): the E value 72H, Disk I/O error.
5037
DEFB 72H 72
5037H: LDOS error 0AH (seek error during write): the E value 72H, Disk I/O error.
5038
DEFB 72H 72
5038H: LDOS error 0BH (lost data during write): the E value 72H, Disk I/O error.
5039
DEFB 72H 72
5039H: LDOS error 0CH (parity error during write): the E value 72H, Disk I/O error.
503A
DEFB 72H 72
503AH: LDOS error 0DH (data record not found during write): the E value 72H, Disk I/O error.
503B
DEFB 72H 72
503BH: LDOS error 0EH (write fault on disk drive): the E value 72H, Disk I/O error.
503C
DEFB 88H 88
503CH: LDOS error 0FH (write protected disk): the E value 88H, Disk write protection.
503D
DEFB 66H 66
503DH: LDOS error 10H (illegal logical file number): the E value 66H, Internal error.
503E
DEFB 72H 72
503EH: LDOS error 11H (directory read error): the E value 72H, Disk I/O error.
503F
DEFB 72H 72
503FH: LDOS error 12H (directory write error): the E value 72H, Disk I/O error.
5040
DEFB 80H 80
5040H: LDOS error 13H (illegal file name): the E value 80H, Bad file name.
5041
DEFB 72H 72
5041H: LDOS error 14H (GAT read error): the E value 72H, Disk I/O error.
5042
DEFB 72H 72
5042H: LDOS error 15H (GAT write error): the E value 72H, Disk I/O error.
5043
DEFB 72H 72
5043H: LDOS error 16H (HIT read error): the E value 72H, Disk I/O error.
5044
DEFB 72H 72
5044H: LDOS error 17H (HIT write error): the E value 72H, Disk I/O error.
5045
DEFB 6AH 6A
5045H: LDOS error 18H (file not in directory): the E value 6AH, File not found.
5046
DEFB 8AH 8A
5046H: LDOS error 19H (file access denied): the E value 8AH, File access denied.
5047
DEFB 88H 88
5047H: LDOS error 1AH (full or write protected disk): the E value 88H, Disk write protection.
5048
DEFB 7AH 7A
5048H: LDOS error 1BH (disk space full): the E value 7AH, Disk full.
5049
DEFB 66H 66
5049H: LDOS error 1CH (end of file encountered): the E value 66H, Internal error.
504A
DEFB 66H 66
504AH: LDOS error 1DH (record number out of range): the E value 66H, Internal error.
504B
DEFB 7AH 7A
504BH: LDOS error 1EH (directory full, can't extend file): the E value 7AH, Disk full.
504C
DEFB 6AH 6A
504CH: LDOS error 1FH (program not found): the E value 6AH, File not found.
504D
DEFB 80H 80
504DH: LDOS error 20H (illegal drive number): the E value 80H, Bad file name.
504E
DEFB 66H 66
504EH: LDOS error 21H (no device space available): the E value 66H, Internal error.
504F
DEFB 66H 66
504FH: LDOS error 22H (load file format error): the E value 66H, Internal error.
5050
DEFB 66H 66
5050H: LDOS error 23H (memory fault): the E value 66H, Internal error.
5051
DEFB 66H 66
5051H: LDOS error 24H (attempted to load read only memory): the E value 66H, Internal error.
5052
DEFB 8AH 8A
5052H: LDOS error 25H (illegal access attempted to protected file): the E value 8AH, File access denied.
5053
DEFB 66H 66
5053H: LDOS error 26H (file not open): the E value 66H, Internal error.
5054
DEFB 8AH 8A
5054H: LDOS error 27H (device in use): the E value 8AH, File access denied.
5055
DEFB 8AH 8A
5055H: LDOS error 28H (protected system device): the E value 8AH, File access denied.
5056
DEFB 66H 66
5056H: LDOS error 29H (unknown error code and every code above it): the E value 66H, Internal error.

5057H - The Messages

49 messages, each a list of word numbers of the dictionary at 50D6H, bit 7 set on the last; function 01H passes over E / 2 + 2 messages (4E35H). Messages 0 and 1 are never chosen: no E value gives a number below 2. Messages 24, 32, 35 and 36 (the E values 2CH, 70H, 76H and 78H) are the word ? alone.

5057
DEFB D2H D2
5057H: message 0, the byte D2H: bit 7 makes it a message of one word, number 52H, past the dictionary; it marks the start of the table and is never chosen.
5058-5059
DEFB 25H,85H 25 85
5058H-5059H: message 1, never chosen: words 37 no, 5 error, bit 7 on the last byte: No error.
505A-505C
DEFB 01H,02H,83H 01 02 83
505AH-505CH: message 2, for the E value 00H: words 1 next, 2 without, 3 for, bit 7 on the last byte: Next without for.
505D-505E
DEFB 04H,85H 04 85
505DH-505EH: message 3, for the E value 02H: words 4 syntax, 5 error, bit 7 on the last byte: Syntax error.
505F-5061
DEFB 06H,02H,87H 06 02 87
505FH-5061H: message 4, for the E value 04H: words 6 return, 2 without, 7 GOSUB, bit 7 on the last byte: Return without GOSUB.
5062-5064
DEFB 08H,09H,8AH 08 09 8A
5062H-5064H: message 5, for the E value 06H: words 8 out, 9 of, 10 data, bit 7 on the last byte: Out of data.
5065-5067
DEFB 0BH,0CH,8DH 0B 0C 8D
5065H-5067H: message 6, for the E value 08H: words 11 illegal, 12 function, 13 call, bit 7 on the last byte: Illegal function call.
5068
DEFB 8EH 8E
5068H: message 7, for the E value 0AH: word 14 overflow, bit 7 on the last byte: Overflow.
5069-506B
DEFB 08H,09H,8FH 08 09 8F
5069H-506BH: message 8, for the E value 0CH: words 8 out, 9 of, 15 memory, bit 7 on the last byte: Out of memory.
506C-506E
DEFB 10H,11H,92H 10 11 92
506CH-506EH: message 9, for the E value 0EH: words 16 undefined, 17 line, 18 number, bit 7 on the last byte: Undefined line number.
506F-5072
DEFB 13H,08H,09H,94H 13 08 09 94
506FH-5072H: message 10, for the E value 10H: words 19 subscript, 8 out, 9 of, 20 range, bit 7 on the last byte: Subscript out of range.
5073-5074
DEFB 15H,96H 15 96
5073H-5074H: message 11, for the E value 12H: words 21 redimensioned, 22 array, bit 7 on the last byte: Redimensioned array.
5075-5077
DEFB 17H,18H,99H 17 18 99
5075H-5077H: message 12, for the E value 14H: words 23 division, 24 by, 25 zero, bit 7 on the last byte: Division by zero.
5078-5079
DEFB 0BH,9AH 0B 9A
5078H-5079H: message 13, for the E value 16H: words 11 illegal, 26 direct, bit 7 on the last byte: Illegal direct.
507A-507B
DEFB 1BH,9CH 1B 9C
507AH-507BH: message 14, for the E value 18H: words 27 type, 28 mismatch, bit 7 on the last byte: Type mismatch.
507C-507F
DEFB 08H,09H,1DH,9EH 08 09 1D 9E
507CH-507FH: message 15, for the E value 1AH: words 8 out, 9 of, 29 string, 30 space, bit 7 on the last byte: Out of string space.
5080-5082
DEFB 1DH,1FH,A0H 1D 1F A0
5080H-5082H: message 16, for the E value 1CH: words 29 string, 31 too, 32 long, bit 7 on the last byte: String too long.
5083-5086
DEFB 1DH,21H,1FH,A2H 1D 21 1F A2
5083H-5086H: message 17, for the E value 1EH: words 29 string, 33 formula, 31 too, 34 complex, bit 7 on the last byte: String formula too complex.
5087-5088
DEFB 23H,A4H 23 A4
5087H-5088H: message 18, for the E value 20H: words 35 can't, 36 continue, bit 7 on the last byte: Can't continue.
5089-508A
DEFB 25H,A6H 25 A6
5089H-508AH: message 19, for the E value 22H: words 37 no, 38 RESUME, bit 7 on the last byte: No RESUME.
508B-508D
DEFB 26H,02H,85H 26 02 85
508BH-508DH: message 20, for the E value 24H: words 38 RESUME, 2 without, 5 error, bit 7 on the last byte: RESUME without error.
508E-508F
DEFB 27H,85H 27 85
508EH-508FH: message 21, for the E value 26H and every E value from 2FH to 62H and from 91H up (4E2BH): words 39 unprintable, 5 error, bit 7 on the last byte: Unprintable error.
5090-5091
DEFB 28H,A9H 28 A9
5090H-5091H: message 22, for the E value 28H: words 40 missing, 41 operand, bit 7 on the last byte: Missing operand.
5092-5094
DEFB 2AH,2BH,8AH 2A 2B 8A
5092H-5094H: message 23, for the E value 2AH: words 42 bad, 43 cassette, 10 data, bit 7 on the last byte: Bad cassette data.
5095
DEFB ACH AC
5095H: message 24, for the E value 2CH: word 44 ?, bit 7 on the last byte: ?.
5096-5098
DEFB 2DH,2EH,8CH 2D 2E 8C
5096H-5098H: message 25, for the E value 2EH: words 45 undefined, 46 user, 12 function, bit 7 on the last byte: Undefined user function.
5099-509A
DEFB 2FH,8EH 2F 8E
5099H-509AH: message 26, for the E value 64H: words 47 FIELD, 14 overflow, bit 7 on the last byte: FIELD overflow.
509B-509C
DEFB 30H,85H 30 85
509BH-509CH: message 27, for the E value 66H: words 48 internal, 5 error, bit 7 on the last byte: Internal error.
509D-509F
DEFB 2AH,31H,92H 2A 31 92
509DH-509FH: message 28, for the E value 68H: words 42 bad, 49 file, 18 number, bit 7 on the last byte: Bad file number.
50A0-50A2
DEFB 31H,32H,B3H 31 32 B3
50A0H-50A2H: message 29, for the E value 6AH: words 49 file, 50 not, 51 found, bit 7 on the last byte: File not found.
50A3-50A5
DEFB 2AH,31H,B4H 2A 31 B4
50A3H-50A5H: message 30, for the E value 6CH: words 42 bad, 49 file, 52 mode, bit 7 on the last byte: Bad file mode.
50A6-50A8
DEFB 31H,35H,B6H 31 35 B6
50A6H-50A8H: message 31, for the E value 6EH: words 49 file, 53 already, 54 open, bit 7 on the last byte: File already open.
50A9
DEFB ACH AC
50A9H: message 32, for the E value 70H: word 44 ?, bit 7 on the last byte: ?.
50AA-50AC
DEFB 37H,38H,85H 37 38 85
50AAH-50ACH: message 33, for the E value 72H: words 55 disk, 56 I/O, 5 error, bit 7 on the last byte: Disk I/O error.
50AD-50AF
DEFB 31H,35H,B9H 31 35 B9
50ADH-50AFH: message 34, for the E value 74H: words 49 file, 53 already, 57 exists, bit 7 on the last byte: File already exists.
50B0
DEFB ACH AC
50B0H: message 35, for the E value 76H: word 44 ?, bit 7 on the last byte: ?.
50B1
DEFB ACH AC
50B1H: message 36, for the E value 78H: word 44 ?, bit 7 on the last byte: ?.
50B2-50B3
DEFB 37H,BAH 37 BA
50B2H-50B3H: message 37, for the E value 7AH: words 55 disk, 58 full, bit 7 on the last byte: Disk full.
50B4-50B6
DEFB 3BH,3CH,BDH 3B 3C BD
50B4H-50B6H: message 38, for the E value 7CH: words 59 input, 60 past, 61 end, bit 7 on the last byte: Input past end.
50B7-50B9
DEFB 2AH,3EH,92H 2A 3E 92
50B7H-50B9H: message 39, for the E value 7EH: words 42 bad, 62 record, 18 number, bit 7 on the last byte: Bad record number.
50BA-50BC
DEFB 2AH,31H,BFH 2A 31 BF
50BAH-50BCH: message 40, for the E value 80H: words 42 bad, 49 file, 63 name, bit 7 on the last byte: Bad file name.
50BD-50BE
DEFB 34H,9CH 34 9C
50BDH-50BEH: message 41, for the E value 82H: words 52 mode, 28 mismatch, bit 7 on the last byte: Mode mismatch.
50BF-50C2
DEFB 1AH,40H,41H,B1H 1A 40 41 B1
50BFH-50C2H: message 42, for the E value 84H: words 26 direct, 64 statement, 65 in, 49 file, bit 7 on the last byte: Direct statement in file.
50C3-50C5
DEFB 1FH,42H,C3H 1F 42 C3
50C3H-50C5H: message 43, for the E value 86H: words 31 too, 66 many, 67 files, bit 7 on the last byte: Too many files.
50C6-50C8
DEFB 37H,44H,C5H 37 44 C5
50C6H-50C8H: message 44, for the E value 88H: words 55 disk, 68 write, 69 protection, bit 7 on the last byte: Disk write protection.
50C9-50CB
DEFB 31H,46H,C7H 31 46 C7
50C9H-50CBH: message 45, for the E value 8AH: words 49 file, 70 access, 71 denied, bit 7 on the last byte: File access denied.
50CC-50CE
DEFB 48H,31H,85H 48 31 85
50CCH-50CEH: message 46, for the E value 8CH: words 72 blocked, 49 file, 5 error, bit 7 on the last byte: Blocked file error.
50CF-50D1
DEFB 49H,4AH,CBH 49 4A CB
50CFH-50D1H: message 47, for the E value 8EH: words 73 system, 74 command, 75 aborted, bit 7 on the last byte: System command aborted.
50D2-50D5
DEFB 45H,4CH,4DH,8FH 45 4C 4D 8F
50D2H-50D5H: message 48, for the E value 90H: words 69 protection, 76 has, 77 cleared, 15 memory, bit 7 on the last byte: Protection has cleared memory.

50D6H - The Dictionary

78 words in lower case unless shown in capitals, each ended by bit 7 set on its last character; word n is reached by passing over n words from 50D6H (4E47H). Word 0 is the byte D2H alone, which only marks the start, so word 1 begins at 50D7H. The first letter of a message is made upper case at 4E68H.

50D6
DEFB D2H D2
50D6H: word 0, D2H (R with bit 7 set): the start mark of the dictionary, used by no message.
50D7-50DA
DEFM "nex" / DEFB F4H 6E 65 78 F4
50D7H-50DAH: word 1, next (the last character t with bit 7 set, F4H): used by message 2.
50DB-50E1
DEFM "withou" / DEFB F4H 77 69 74 68 6F 75 F4
50DBH-50E1H: word 2, without (the last character t with bit 7 set, F4H): used by messages 2, 4, 20.
50E2-50E4
DEFM "fo" / DEFB F2H 66 6F F2
50E2H-50E4H: word 3, for (the last character r with bit 7 set, F2H): used by message 2.
50E5-50EA
DEFM "synta" / DEFB F8H 73 79 6E 74 61 F8
50E5H-50EAH: word 4, syntax (the last character x with bit 7 set, F8H): used by message 3.
50EB-50EF
DEFM "erro" / DEFB F2H 65 72 72 6F F2
50EBH-50EFH: word 5, error (the last character r with bit 7 set, F2H): used by messages 1, 3, 20, 21, 27, 33, 46.
50F0-50F5
DEFM "retur" / DEFB EEH 72 65 74 75 72 EE
50F0H-50F5H: word 6, return (the last character n with bit 7 set, EEH): used by message 4.
50F6-50FA
DEFM "GOSU" / DEFB C2H 47 4F 53 55 C2
50F6H-50FAH: word 7, GOSUB (the last character B with bit 7 set, C2H): used by message 4.
50FB-50FD
DEFM "ou" / DEFB F4H 6F 75 F4
50FBH-50FDH: word 8, out (the last character t with bit 7 set, F4H): used by messages 5, 8, 10, 15.
50FE-50FF
DEFM "o" / DEFB E6H 6F E6
50FEH-50FFH: word 9, of (the last character f with bit 7 set, E6H): used by messages 5, 8, 10, 15.
5100-5103
DEFM "dat" / DEFB E1H 64 61 74 E1
5100H-5103H: word 10, data (the last character a with bit 7 set, E1H): used by messages 5, 23.
5104-510A
DEFM "illega" / DEFB ECH 69 6C 6C 65 67 61 EC
5104H-510AH: word 11, illegal (the last character l with bit 7 set, ECH): used by messages 6, 13.
510B-5112
DEFM "functio" / DEFB EEH 66 75 6E 63 74 69 6F EE
510BH-5112H: word 12, function (the last character n with bit 7 set, EEH): used by messages 6, 25.
5113-5116
DEFM "cal" / DEFB ECH 63 61 6C EC
5113H-5116H: word 13, call (the last character l with bit 7 set, ECH): used by message 6.
5117-511E
DEFM "overflo" / DEFB F7H 6F 76 65 72 66 6C 6F F7
5117H-511EH: word 14, overflow (the last character w with bit 7 set, F7H): used by messages 7, 26.
511F-5124
DEFM "memor" / DEFB F9H 6D 65 6D 6F 72 F9
511FH-5124H: word 15, memory (the last character y with bit 7 set, F9H): used by messages 8, 48.
5125-512D
DEFM "undefine" / DEFB E4H 75 6E 64 65 66 69 6E 65 E4
5125H-512DH: word 16, undefined (the last character d with bit 7 set, E4H): used by message 9.
512E-5131
DEFM "lin" / DEFB E5H 6C 69 6E E5
512EH-5131H: word 17, line (the last character e with bit 7 set, E5H): used by message 9.
5132-5137
DEFM "numbe" / DEFB F2H 6E 75 6D 62 65 F2
5132H-5137H: word 18, number (the last character r with bit 7 set, F2H): used by messages 9, 28, 39.
5138-5140
DEFM "subscrip" / DEFB F4H 73 75 62 73 63 72 69 70 F4
5138H-5140H: word 19, subscript (the last character t with bit 7 set, F4H): used by message 10.
5141-5145
DEFM "rang" / DEFB E5H 72 61 6E 67 E5
5141H-5145H: word 20, range (the last character e with bit 7 set, E5H): used by message 10.
5146-5152
DEFM "redimensione" / DEFB E4H 72 65 64 69 6D 65 6E 73 69 6F 6E 65 E4
5146H-5152H: word 21, redimensioned (the last character d with bit 7 set, E4H): used by message 11.
5153-5157
DEFM "arra" / DEFB F9H 61 72 72 61 F9
5153H-5157H: word 22, array (the last character y with bit 7 set, F9H): used by message 11.
5158-515F
DEFM "divisio" / DEFB EEH 64 69 76 69 73 69 6F EE
5158H-515FH: word 23, division (the last character n with bit 7 set, EEH): used by message 12.
5160-5161
DEFM "b" / DEFB F9H 62 F9
5160H-5161H: word 24, by (the last character y with bit 7 set, F9H): used by message 12.
5162-5165
DEFM "zer" / DEFB EFH 7A 65 72 EF
5162H-5165H: word 25, zero (the last character o with bit 7 set, EFH): used by message 12.
5166-516B
DEFM "direc" / DEFB F4H 64 69 72 65 63 F4
5166H-516BH: word 26, direct (the last character t with bit 7 set, F4H): used by messages 13, 42.
516C-516F
DEFM "typ" / DEFB E5H 74 79 70 E5
516CH-516FH: word 27, type (the last character e with bit 7 set, E5H): used by message 14.
5170-5177
DEFM "mismatc" / DEFB E8H 6D 69 73 6D 61 74 63 E8
5170H-5177H: word 28, mismatch (the last character h with bit 7 set, E8H): used by messages 14, 41.
5178-517D
DEFM "strin" / DEFB E7H 73 74 72 69 6E E7
5178H-517DH: word 29, string (the last character g with bit 7 set, E7H): used by messages 15, 16, 17.
517E-5182
DEFM "spac" / DEFB E5H 73 70 61 63 E5
517EH-5182H: word 30, space (the last character e with bit 7 set, E5H): used by message 15.
5183-5185
DEFM "to" / DEFB EFH 74 6F EF
5183H-5185H: word 31, too (the last character o with bit 7 set, EFH): used by messages 16, 17, 43.
5186-5189
DEFM "lon" / DEFB E7H 6C 6F 6E E7
5186H-5189H: word 32, long (the last character g with bit 7 set, E7H): used by message 16.
518A-5190
DEFM "formul" / DEFB E1H 66 6F 72 6D 75 6C E1
518AH-5190H: word 33, formula (the last character a with bit 7 set, E1H): used by message 17.
5191-5197
DEFM "comple" / DEFB F8H 63 6F 6D 70 6C 65 F8
5191H-5197H: word 34, complex (the last character x with bit 7 set, F8H): used by message 17.
5198-519C
DEFM "can'" / DEFB F4H 63 61 6E 27 F4
5198H-519CH: word 35, can't (the last character t with bit 7 set, F4H): used by message 18.
519D-51A4
DEFM "continu" / DEFB E5H 63 6F 6E 74 69 6E 75 E5
519DH-51A4H: word 36, continue (the last character e with bit 7 set, E5H): used by message 18.
51A5-51A6
DEFM "n" / DEFB EFH 6E EF
51A5H-51A6H: word 37, no (the last character o with bit 7 set, EFH): used by messages 1, 19.
51A7-51AC
DEFM "RESUM" / DEFB C5H 52 45 53 55 4D C5
51A7H-51ACH: word 38, RESUME (the last character E with bit 7 set, C5H): used by messages 19, 20.
51AD-51B7
DEFM "unprintabl" / DEFB E5H 75 6E 70 72 69 6E 74 61 62 6C E5
51ADH-51B7H: word 39, unprintable (the last character e with bit 7 set, E5H): used by message 21.
51B8-51BE
DEFM "missin" / DEFB E7H 6D 69 73 73 69 6E E7
51B8H-51BEH: word 40, missing (the last character g with bit 7 set, E7H): used by message 22.
51BF-51C5
DEFM "operan" / DEFB E4H 6F 70 65 72 61 6E E4
51BFH-51C5H: word 41, operand (the last character d with bit 7 set, E4H): used by message 22.
51C6-51C8
DEFM "ba" / DEFB E4H 62 61 E4
51C6H-51C8H: word 42, bad (the last character d with bit 7 set, E4H): used by messages 23, 28, 30, 39, 40.
51C9-51D0
DEFM "cassett" / DEFB E5H 63 61 73 73 65 74 74 E5
51C9H-51D0H: word 43, cassette (the last character e with bit 7 set, E5H): used by message 23.
51D1
DEFB BFH BF
51D1H: word 44, ? (the last character ? with bit 7 set, BFH): used by messages 24, 32, 35, 36.
51D2-51DA
DEFM "undefine" / DEFB E4H 75 6E 64 65 66 69 6E 65 E4
51D2H-51DAH: word 45, undefined (the last character d with bit 7 set, E4H): used by message 25.
51DB-51DE
DEFM "use" / DEFB F2H 75 73 65 F2
51DBH-51DEH: word 46, user (the last character r with bit 7 set, F2H): used by message 25.
51DF-51E3
DEFM "FIEL" / DEFB C4H 46 49 45 4C C4
51DFH-51E3H: word 47, FIELD (the last character D with bit 7 set, C4H): used by message 26.
51E4-51EB
DEFM "interna" / DEFB ECH 69 6E 74 65 72 6E 61 EC
51E4H-51EBH: word 48, internal (the last character l with bit 7 set, ECH): used by message 27.
51EC-51EF
DEFM "fil" / DEFB E5H 66 69 6C E5
51ECH-51EFH: word 49, file (the last character e with bit 7 set, E5H): used by messages 28, 29, 30, 31, 34, 40, 42, 45, 46.
51F0-51F2
DEFM "no" / DEFB F4H 6E 6F F4
51F0H-51F2H: word 50, not (the last character t with bit 7 set, F4H): used by message 29.
51F3-51F7
DEFM "foun" / DEFB E4H 66 6F 75 6E E4
51F3H-51F7H: word 51, found (the last character d with bit 7 set, E4H): used by message 29.
51F8-51FB
DEFM "mod" / DEFB E5H 6D 6F 64 E5
51F8H-51FBH: word 52, mode (the last character e with bit 7 set, E5H): used by messages 30, 41.
51FC-5202
DEFM "alread" / DEFB F9H 61 6C 72 65 61 64 F9
51FCH-5202H: word 53, already (the last character y with bit 7 set, F9H): used by messages 31, 34.
5203-5206
DEFM "ope" / DEFB EEH 6F 70 65 EE
5203H-5206H: word 54, open (the last character n with bit 7 set, EEH): used by message 31.
5207-520A
DEFM "dis" / DEFB EBH 64 69 73 EB
5207H-520AH: word 55, disk (the last character k with bit 7 set, EBH): used by messages 33, 37, 44.
520B-520D
DEFM "I/" / DEFB CFH 49 2F CF
520BH-520DH: word 56, I/O (the last character O with bit 7 set, CFH): used by message 33.
520E-5213
DEFM "exist" / DEFB F3H 65 78 69 73 74 F3
520EH-5213H: word 57, exists (the last character s with bit 7 set, F3H): used by message 34.
5214-5217
DEFM "ful" / DEFB ECH 66 75 6C EC
5214H-5217H: word 58, full (the last character l with bit 7 set, ECH): used by message 37.
5218-521C
DEFM "inpu" / DEFB F4H 69 6E 70 75 F4
5218H-521CH: word 59, input (the last character t with bit 7 set, F4H): used by message 38.
521D-5220
DEFM "pas" / DEFB F4H 70 61 73 F4
521DH-5220H: word 60, past (the last character t with bit 7 set, F4H): used by message 38.
5221-5223
DEFM "en" / DEFB E4H 65 6E E4
5221H-5223H: word 61, end (the last character d with bit 7 set, E4H): used by message 38.
5224-5229
DEFM "recor" / DEFB E4H 72 65 63 6F 72 E4
5224H-5229H: word 62, record (the last character d with bit 7 set, E4H): used by message 39.
522A-522D
DEFM "nam" / DEFB E5H 6E 61 6D E5
522AH-522DH: word 63, name (the last character e with bit 7 set, E5H): used by message 40.
522E-5236
DEFM "statemen" / DEFB F4H 73 74 61 74 65 6D 65 6E F4
522EH-5236H: word 64, statement (the last character t with bit 7 set, F4H): used by message 42.
5237-5238
DEFM "i" / DEFB EEH 69 EE
5237H-5238H: word 65, in (the last character n with bit 7 set, EEH): used by message 42.
5239-523C
DEFM "man" / DEFB F9H 6D 61 6E F9
5239H-523CH: word 66, many (the last character y with bit 7 set, F9H): used by message 43.
523D-5241
DEFM "file" / DEFB F3H 66 69 6C 65 F3
523DH-5241H: word 67, files (the last character s with bit 7 set, F3H): used by message 43.
5242-5246
DEFM "writ" / DEFB E5H 77 72 69 74 E5
5242H-5246H: word 68, write (the last character e with bit 7 set, E5H): used by message 44.
5247-5250
DEFM "protectio" / DEFB EEH 70 72 6F 74 65 63 74 69 6F EE
5247H-5250H: word 69, protection (the last character n with bit 7 set, EEH): used by messages 44, 48.
5251-5256
DEFM "acces" / DEFB F3H 61 63 63 65 73 F3
5251H-5256H: word 70, access (the last character s with bit 7 set, F3H): used by message 45.
5257-525C
DEFM "denie" / DEFB E4H 64 65 6E 69 65 E4
5257H-525CH: word 71, denied (the last character d with bit 7 set, E4H): used by message 45.
525D-5263
DEFM "blocke" / DEFB E4H 62 6C 6F 63 6B 65 E4
525DH-5263H: word 72, blocked (the last character d with bit 7 set, E4H): used by message 46.
5264-5269
DEFM "syste" / DEFB EDH 73 79 73 74 65 ED
5264H-5269H: word 73, system (the last character m with bit 7 set, EDH): used by message 47.
526A-5270
DEFM "comman" / DEFB E4H 63 6F 6D 6D 61 6E E4
526AH-5270H: word 74, command (the last character d with bit 7 set, E4H): used by message 47.
5271-5277
DEFM "aborte" / DEFB E4H 61 62 6F 72 74 65 E4
5271H-5277H: word 75, aborted (the last character d with bit 7 set, E4H): used by message 47.
5278-527A
DEFM "ha" / DEFB F3H 68 61 F3
5278H-527AH: word 76, has (the last character s with bit 7 set, F3H): used by message 48.
527B-5281
DEFM "cleare" / DEFB E4H 63 6C 65 61 72 65 E4
527BH-5281H: word 77, cleared (the last character d with bit 7 set, E4H): used by message 48.