LDOS 5.3.1 for the Model III - BASIC/OV4 Disassembled

Page Customization

Introduction/Summary

LDOS 5.3.1 BASIC/OV4 Disassembly - CMD"V", the Variables of a BASIC Program (Model III)

BASIC/OV4 lists the variables and arrays of the BASIC program in memory with their values, and the functions made by DEF FN with their definitions: CMD"V [*DO or *PR] [-S] [-A] [=letter]". BASIC/CMD runs it with @RUN when CMD is given a V (its 547CH and 5490H); the file loads over BASIC/CMD at 5200H, and when it is done it runs BASIC/CMD again with an asterisk, back to the program in memory with its variables (5217H). It reads only the tables of the variables, so it can be given while a program is stopped.

The file is a load module of 960 bytes: a copyright record, the code and data 5200H-5569H and 5574H-557EH in five load blocks, and the transfer address 5200H. 556AH-5573H, the counters of the subscripts, is not in the file.

The Parameters

ParameterCellMeaning in the code
*DO, *PR5569HFirst only: the video (the default) or the printer. Another device gives Invalid output device!.
-S5212HOnly the simple variables: the operand that lets the arrays be listed becomes 00H.
-A520CHOnly the arrays: the operand that lets the simple variables be listed becomes 00H.
=letter5574HOnly the names that start with the letter (A-Z, upper or lower case).

Anything else is Parameter error!; both messages are shown with @LOGOT and BASIC/CMD is run again (544AH).

How It Works

BASIC/OV4 does not turn the values into text itself. For each variable it builds a line at 557BH that is the items of a PRINT statement: a quoted text with three spaces, the name and an equals sign, then the name again, as in " A$ = "A$, and has the ROM run it from 2069H, inside LPRINT, with the device in Register A (5405H). The elements of an array are counted through with one counter for each subscript, from 0 up to the number of elements of the dimension, the rightmost fastest (52F9H). A DEF FN function is shown as its definition turned back into text by the ROM's BUFLIN (5237H). After every variable, SHIFT @ waits and BREAK ends the listing (5420H).

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 6 different bytes are operands that name the Model III resident area: CFCB$ 4485H (521AH; Model I 4480H), INBUF$ 4225H (5224H; Model I 4318H), @DIV 4451H (53F6H; Model I 44C4H) and @LOGOT 428AH (54ABH; Model I 447BH). The ROM call at 5273H goes to 2B85H as on the Model I, where the Model III ROM has JP 069AH: 069AH clears 409FH, loads Register D with FFH and goes on at 2B8DH in the same listing routine.

\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. Found in the code: the banner at 54C0H is never shown (5200H); the text after an array of 6 or more dimensions ends with a right parenthesis that has no left one before it (5388H); the copy of <User Def Func> runs on through the two messages after it, since that text ends with 0DH (5237H); the LD IX,5550H at 54A7H loads a value nothing reads.

Memory Map

Load Blocks

The file starts with a copyright record (type 1FH), then 5 load blocks with 885 bytes, 5200H-5569H and 5574H-557EH, and the transfer address 5200H.

AddressContents
5200H-52FFH256 bytes
5300H-53FFH256 bytes
5400H-54FFH256 bytes
5500H-5569H106 bytes
5574H-557EH11 bytes

The Parts of the File

AddressContents
5200H-5236HThe start, the way back to BASIC and the name BASIC/CMD.
5237H-52A9HThe simple variables and the functions made by DEF FN.
52AAH-53A8HThe arrays and their elements.
53A9H-5449HThe name, the copy of a text, the digits of a subscript, the PRINT of a line, the keyboard, the output.
544AH-54BFHThe parameters and their errors.
54C0H-5569HThe banner, the headings, the texts, the messages and three cells.
556AH-5573HNot in the file: the counters of the subscripts.
5574H-557EHThe letter of =letter, the digits, and the start of the line.
557FH-577EHNot in the file: the rest of the line, and the copy of a DEF FN definition.

Sections of the Disassembly

AddressContents
5200HThe Start: the Parameters and the Two Dumps
5217HBack to BASIC
5237HThe Simple Variables
52AAHThe Arrays
52F9HThe Next Element
5354HPrint the Element
536CHA Subscript Used Up
5388HToo Many Subscripts
5391HThe Next Array
53A9HThe Name and Its Type Character
53D6HCopy a Text
53EFHA Number as Five Digits
5405HPrint the Line
5419HCompare IX and DE
5420HThe Keyboard: SHIFT @ and BREAK
5439HSend a Text
544AHThe Parameters
54A4HThe Errors
54B1HPass Over Spaces
54BBHThe Next Character in Upper Case
54C0HThe Texts and the Work Cells

Memory BASIC/OV4 Uses

AddressContents
002BH, 0049HThe ROM: the scan of the keyboard, the wait for a key.
2069HThe ROM: inside LPRINT after its LD A,01H: Register A to 409CH, then the PRINT items at Register Pair HL.
2B85HThe ROM: inside BUFLIN after its load of Register Pair BC: tokens at Register Pair HL back to text at Register Pair BC.
409CHThe output device of the ROM's PRINT, set from Register A at 2069H: 00H the video, 01H the printer.
40F9H-40FAH, 40FBH-40FCH, 40FDH-40FEHThe start of the simple variables, of the arrays, and the end of the arrays.
4225HINBUF$: the text after V (from BASIC/CMD); 2AH is written at 4225H for BASIC/CMD.
4433H, 4467H, 446AH, 428AH, 4451H@RUN, @DSPLY, @PRINT, @LOGOT, @DIV.
4485HCFCB$: the control block with BASIC/CMD for @RUN.

Variables

The data of the file and the cells and the buffers above it, then the operands BASIC/OV4 changes while it runs.

Data in the File and the Memory Above It

Address
Size
Contents
522CH
1 byte
DEFM "L"
522CH: L, the first letter of LBASIC/CMD; 5217H copies from 522DH, so it is never read.
522DH-5235H
9 bytes
DEFM "BASIC/CMD"
522DH-5235H: the file BASIC/CMD, run again at the end (5217H).
5236H
1 byte
DEFB 03H
5236H: 03H, the end of the file specification for @RUN.
54C0H-54C1H
2 bytes
DEFB 1CH,1FH
54C0H-54C1H: the start of the banner: 1CH puts the cursor home, 1FH clears the screen from there. Only 5201H names 54C0H, and that load is not used.
54C2H-54EAH
41 bytes
DEFM "BASIC Active Variable Dump - Version 4.1" / DEFB 0DH
54C2H-54EAH: the text of the banner and its 0DH; never shown.
54EBH-54FDH
19 bytes
DEFB 0AH / DEFM "Simple Variables:" / DEFB 0DH
54EBH-54FDH: the heading of the simple variables (5237H): 0AH, a line feed, the text and 0DH.
54FEH-550FH
18 bytes
DEFB 0AH / DEFM "Array Variables:" / DEFB 0DH
54FEH-550FH: the heading of the arrays (52AAH): 0AH, the text and 0DH.
5510H-5528H
25 bytes
DEFM "* Too many subscripts *)" / DEFB 00H
5510H-5528H: the text put after the name of an array of 6 or more dimensions (5388H), and 00H.
5529H-552DH
5 bytes
DEFM " = " / DEFB 22H,00H
5529H-552DH: a space, an equals sign, a space, the end quote of the text for PRINT, and 00H (5286H, 5357H).
552EH-553EH
17 bytes
DEFM " <User Def Func>" / DEFB 0DH
552EH-553EH: the text after a DEF FN definition (5278H) and its 0DH, which ends the line for @DSPLY or @PRINT.
553FH-554FH
17 bytes
DEFM "Parameter error!" / DEFB 0DH
553FH-554FH: the message of 54A4H and its 0DH.
5550H-5566H
23 bytes
DEFM "Invalid output device!" / DEFB 0DH
5550H-5566H: the message of 54A8H and its 0DH.
5567H
1 byte
DEFB 00H
5567H: the subscript being worked on: 1 the leftmost, up to the count of dimensions, 0 when the array is done (52F6H, 5348H, 5380H); 00H in the file, which ends the copy at 527BH.
5568H
1 byte
DEFB 00H
5568H: the count of dimensions of the array being listed (52CFH), read at 5332H.
5569H
1 byte
DEFB 00H
5569H: the device: 00H the video, 01H the printer after the parameter PR (546FH); read at 5439H and 540EH, and given to the ROM as the value of 409CH.
556AH-5573H
10 bytes
DEFS 10
556AH-5573H: not in the file. Five counters of 2 bytes, the next value of each subscript, the leftmost first; set to 0 at 52E5H, walked by Index Register IY.
5574H
1 byte
DEFB 00H
5574H: the letter of =letter, 00H for every name (5499H); read at 5249H and 52BCH.
5575H-5579H
5 bytes
DEFM " "
5575H-5579H: five spaces in the file: the five digits of a subscript, made by 53EFH.
557AH
1 byte
DEFB 00H
557AH: 00H, the end of the five digits for the copy at 532BH; also the byte before the line, where the ROM's PRINT starts its reading (it steps back one byte before its first character).
557BH
1 byte
DEFB 22H
557BH: a quote, the start of the line for the ROM's PRINT (540BH).
557CH-557EH
3 bytes
DEFM " "
557CH-557EH: three spaces, the indent of each line; a DEF FN line is sent from 557CH, without the quote (527EH).
557FH-567EH
256 bytes
DEFS 256
557FH-567EH: not in the file. The rest of the line: the name and its type character (53A9H), then the subscripts, the equals sign, the end quote and the name again; or for a DEF FN the definition as text and <User Def Func>.
567FH-577EH
256 bytes
DEFS 256
567FH-577EH: not in the file. The copy of a DEF FN definition from the program, up to its 00H or colon, for BUFLIN (5266H).

Operands Changed While It Runs

Address
Size
Contents
520CH
1 byte
01H in the file: the simple variables are listed; 00H after -A (5491H).
5212H
1 byte
01H in the file: the arrays are listed; 00H after -S (5487H).

Disassembly

5200H - The Start: the Parameters and the Two Dumps

The transfer address. BASIC/CMD runs this file with @RUN for CMD"V text" (its 547CH, and 5490H for CMD"V" alone): the file loads over BASIC/CMD at 5200H and is entered with Register Pair HL at 4226H, the text after the V, which BASIC/CMD copied there with a 0DH after it. 544AH reads the parameters (a device, -S, -A, =letter): the device is an asterisk and DO or PR; 5439H sends the 0DH that ends them, a new line on the chosen device. The simple variables are listed when the operand at 520CH is 01H, the arrays when the operand at 5212H is 01H; -A clears the first and -S the second. Then BASIC/CMD is run again.

5200
PUSH HL E5
Save Register Pair HL (4226H, the parameters) to the stack.
5201
LD HL,54C0H 21 C0 54
Point Register Pair HL to 54C0H, the banner. Not used: the POP HL next takes the parameters back, and no other code names 54C0H, so the banner is never shown.
5204
POP HL E1
Restore Register Pair HL (the parameters) from the stack.
5205
GOSUB to 544AH to read the parameters at Register Pair HL: it RETurns with Register Pair HL at the 0DH that ends them, or does not RETurn on an error.
5208
GOSUB to 5439H to send the text at Register Pair HL, only the 0DH, to the video or the printer: a new line.
520B
LD A,01H 3E 01
Load Register A with 01H, the operand at 520CH: 00H after -A (5491H), which leaves out the simple variables.
520D
OR A B7
OR Register A with itself: the NZ FLAG for 01H.
520E
If the NZ FLAG is set, GOSUB to 5237H to list the simple variables.
5211
LD A,01H 3E 01
Load Register A with 01H, the operand at 5212H: 00H after -S (5487H), which leaves out the arrays.
5213
OR A B7
OR Register A with itself: the NZ FLAG for 01H.
5214
If the NZ FLAG is set, GOSUB to 52AAH to list the arrays.

5217H - Back to BASIC

Also the way out after BREAK (52A4H, 534EH, 53A3H) and after an error in the parameters (54AEH). The 11 bytes at 522DH, BASIC/CMD, 03H and the byte 21H after it, go to 4485H (CFCB$), an asterisk to 4225H, and @RUN runs BASIC/CMD with 4225H as its command line: the asterisk, then the rest of the old parameters and their 0DH, which BASIC/CMD does not read after the asterisk; it goes back to the program in memory with its variables.

5217
LD HL,522DH 21 2D 52
Point Register Pair HL to 522DH, the name BASIC/CMD.
521A
LD DE,4485H 11 85 44
Point Register Pair DE to 4485H, CFCB$, the control block for @RUN.
521D
PUSH DE D5
Save Register Pair DE (4485H, the control block) to the stack, for @RUN.
521E
LD BC,000BH 01 0B 00
Load Register Pair BC with 000BH, 11 bytes: BASIC/CMD, the 03H at 5236H that ends the name, and the byte 21H at 5237H.
5221
LDIR ED B0
Copy Register Pair BC (11) bytes from Register Pair HL (522DH) to Register Pair DE (4485H) (LDIR).
5223
POP DE D1
Restore Register Pair DE (4485H, the control block) from the stack.
5224
LD HL,4225H 21 25 42
Point Register Pair HL to 4225H, INBUF$, the command line of LDOS.
5227
LD (HL),2AH 36 2A
Store 2AH, an asterisk, at Register Pair HL (4225H), over the V: BASIC/CMD with an asterisk goes back to the program in memory; the old parameters after it stay in INBUF$.
5229
JUMP to 4433H, @RUN, to load and run BASIC/CMD from the control block at Register Pair DE with its command line at Register Pair HL.
522C
DEFM "L" 4C
522CH: L, the first letter of LBASIC/CMD; 5217H copies from 522DH, so it is never read.
522D-5235
DEFM "BASIC/CMD" 42 41 53 49 43 2F 43 4D 44
522DH-5235H: the file BASIC/CMD, run again at the end (5217H).
5236
DEFB 03H 03
5236H: 03H, the end of the file specification for @RUN.

5237H - The Simple Variables

The heading, then every entry from 40F9H up to 40FBH. Each entry: +00H the type, which is also the size of the value (02H integer, 03H string, 04H single, 08H double), +01H the second character of the name (00H when the name has only one character), +02H the first character (bit 7 set for a function made by DEF FN), +03H the value. With =letter only names starting with it are listed. An ordinary variable is printed by the ROM's PRINT from a line built at 557BH: a quoted text with the name and an equals sign, then the name again, so the ROM prints its value. A DEF FN function is listed as the name and its definition turned back into text, with <User Def Func>.

5237
LD HL,54EBH 21 EB 54
Point Register Pair HL to 54EBH, the heading: 0AH, Simple Variables: and 0DH.
523A
GOSUB to 5439H to send the heading at Register Pair HL to the video or the printer.
523D
LD IX,(40F9H) DD 2A F9 40
Load Index Register IX with 40F9H-40FAH, the start of the simple variables: the first entry.
5241
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.
5245
GOSUB to 5419H to compare Index Register IX (the entry) against Register Pair DE (the end): the Z FLAG at the end.
5248
RET Z C8
If the Z FLAG is set (no more simple variables), RETurn to 5211H.
5249
LD A,(5574H) 3A 74 55
Load Register A with the letter of =letter from 5574H (00H when none was given).
524C
OR A B7
OR Register A with itself: the Z FLAG for 00H, every name.
524D
If the Z FLAG is set (no letter), JUMP to 5256H to list the entry.
524F
XOR (IX+02H) DD AE 02
XOR Register A (the letter) with the first character of the name at Index Register IX+02H: 00H when they are the same.
5252
AND 7FH E6 7F
Mask Register A to bits 6-0 (AND 7FH): bit 7, the mark of DEF FN, does not count; the NZ FLAG for another letter.
5254
If the NZ FLAG is set (the name starts with another letter), JUMP to 5297H for the next entry.
5256
GOSUB to 53A9H to put the name and its type character at 557FH; Register Pair HL after them.
5259
BIT 7,(IX+02H) DD CB 02 7E
Test bit 7 of the first character of the name at Index Register IX+02H: set for a function made by DEF FN.
525D
If the Z FLAG is set (an ordinary variable), JUMP to 5286H.
525F
PUSH HL E5
Save Register Pair HL (the byte after the name) to the stack.
5260
LD E,(IX+03H) DD 5E 03
Load Register E with the low byte of the function's pointer into the program, at Index Register IX+03H.
5263
LD D,(IX+04H) DD 56 04
Load Register D with the high byte at Index Register IX+04H: Register Pair DE = the text of the definition in the program.
5266
LD HL,567FH 21 7F 56
Point Register Pair HL to 567FH, a buffer above the file for the definition.
5269
PUSH HL E5
Save Register Pair HL (567FH, the start of the copy) to the stack, for BUFLIN.
526A
LD B,3AH 06 3A
Load Register B with 3AH, a colon: the definition ends at a colon outside quotes.
526C
GOSUB to 53D8H to copy the definition from Register Pair DE to Register Pair HL up to its 00H, or up to a colon outside quotes, which is stored; Register Pair HL ends at the 00H or the colon.
526F
LD (HL),00H 36 00
Store 00H at Register Pair HL, over the colon: the end of the copy for BUFLIN.
5271
POP HL E1
Restore Register Pair HL from the stack: 567FH, the copy of the definition.
5272
POP BC C1
Restore Register Pair BC from the stack: the byte after the name at 557FH, where the text goes.
5273
GOSUB to 2B85H, inside the ROM's BUFLIN after its own load of Register Pair BC (in the Model III ROM 2B85H is JP 069AH, which clears 409FH, loads Register D with FFH and goes on at 2B8DH): the tokens at Register Pair HL are turned back into text at Register Pair BC, up to the 00H, which is stored; Register Pair BC ends at that 00H.
5276
PUSH BC C5
Save Register Pair BC (the 00H after the text) to the stack.
5277
POP HL E1
Restore it into Register Pair HL: the end of the line.
5278
LD DE,552EH 11 2E 55
Point Register Pair DE to 552EH, the text <User Def Func> and its 0DH.
527B
GOSUB to 53D6H to copy the text at Register Pair DE to Register Pair HL up to a 00H. The text ends with 0DH, not 00H, so the copy goes on through the two messages after it to the 00H at 5567H (the arrays are listed later, so it is still 00H): 57 bytes above the line; only the bytes up to the first 0DH are shown.
527E
LD HL,557CH 21 7C 55
Point Register Pair HL to 557CH, the line without its quote: three spaces, the name, the definition, <User Def Func> and 0DH.
5281
GOSUB to 5439H to send the text at Register Pair HL up to its 0DH to the video or the printer.
5284
JUMP to 5297H to step Index Register IX to the next entry.
5286
LD DE,5529H 11 29 55
Point Register Pair DE to 5529H, the text: a space, an equals sign, a space and a quote.
5289
GOSUB to 53D6H to copy the text at Register Pair DE to Register Pair HL, after the name, up to its 00H.
528C
LD B,3DH 06 3D
Load Register B with 3DH, an equals sign: the copy below stops at it.
528E
LD DE,557FH 11 7F 55
Point Register Pair DE to 557FH, the name at the start of the line.
5291
GOSUB to 53D8H to copy the name, its type character, the space and the equals sign from Register Pair DE to Register Pair HL, after the quote: Register Pair HL ends at the copied equals sign.
5294
GOSUB to 5405H to put 00H over that equals sign and have the ROM's PRINT run the line at 557BH: the quoted text, then the value of the variable named after it.
5297
LD A,(IX+00H) DD 7E 00
Load Register A with the type of the entry at Index Register IX+00H, the size of its value.
529A
ADD A,03H C6 03
ADD 03H to Register A: the type, the two characters of the name and the value.
529C
LD C,A 4F
Copy Register A (the size of the entry) into Register C.
529D
LD B,00H 06 00
Load Register B with 00H: Register Pair BC = the size of the entry.
529F
ADD IX,BC DD 09
ADD Register Pair BC to Index Register IX: the next entry.
52A1
GOSUB to 5420H to look at the keyboard: SHIFT @ waits; the Z FLAG for BREAK.
52A4
If the Z FLAG is set (BREAK), JUMP to 5217H, back to BASIC.
52A7
JUMP to 5241H for the next entry, with Index Register IX at it.

52AAH - The Arrays

The heading, then every array from 40FBH up to 40FDH. Each array: +00H the type, +01H the second character of the name, +02H the first, +03H-+04H the length of the rest (from +05H to the end), +05H the count of dimensions, then a word for each dimension, the number of its elements, the last dimension first, then the elements. With =letter only names starting with it are listed. An array of 6 or more dimensions gets the text Too many subscripts (5510H) instead. Every element is printed, its subscripts counted from 0 in the counters at 556AH (one word for each dimension, the leftmost first): the line is the name, the subscripts in parentheses, an equals sign, then the same element again for the ROM's PRINT.

52AA
LD HL,54FEH 21 FE 54
Point Register Pair HL to 54FEH, the heading: 0AH, Array Variables: and 0DH.
52AD
GOSUB to 5439H to send the heading at Register Pair HL to the video or the printer.
52B0
LD IX,(40FBH) DD 2A FB 40
Load Index Register IX with 40FBH-40FCH, the start of the arrays: the first array.
52B4
LD DE,(40FDH) ED 5B FD 40
Load Register Pair DE with 40FDH-40FEH, the end of the arrays.
52B8
GOSUB to 5419H to compare Index Register IX (the array) against Register Pair DE (the end): the Z FLAG at the end.
52BB
RET Z C8
If the Z FLAG is set (no more arrays), RETurn to 5217H.
52BC
LD A,(5574H) 3A 74 55
Load Register A with the letter of =letter from 5574H (00H when none was given).
52BF
OR A B7
OR Register A with itself: the Z FLAG for 00H, every name.
52C0
If the Z FLAG is set (no letter), JUMP to 52C9H to list the array.
52C3
CP (IX+02H) DD BE 02
Compare Register A (the letter) against the first character of the name at Index Register IX+02H: the NZ FLAG for another letter.
52C6
If the NZ FLAG is set (the name starts with another letter), JUMP to 5393H for the next array.
52C9
GOSUB to 53A9H to put the name and its type character at 557FH; Register Pair HL after them.
52CC
LD A,(IX+05H) DD 7E 05
Load Register A with the count of dimensions at Index Register IX+05H.
52CF
LD (5568H),A 32 68 55
Store Register A (the count of dimensions) at 5568H.
52D2
CP 06H FE 06
Compare Register A against 06H: the NO CARRY FLAG for 6 dimensions or more, more than the 5 counters at 556AH.
52D4
PUSH IX DD E5
Save Index Register IX (the start of the array) to the stack: 5391H takes it back. PUSH does not change the flags.
52D6
If the NO CARRY FLAG is set (6 or more), JUMP to 5388H for the text Too many subscripts (5510H).
52D9
ADD A,A 87
ADD Register A to itself: twice the count of dimensions, the bytes of their words.
52DA
LD B,A 47
Copy Register A into Register B, the count of steps.
52DB
INC IX DD 23
INCrement Index Register IX (in the header of the array) by one.
52DD
DECrement Register B and LOOP BACK to 52DBH while it is not 0: Index Register IX is up by twice the count of dimensions, so IX+04H-IX+05H is the last word of the dimensions, that of the leftmost subscript.
52DF
LD IY,556AH FD 21 6A 55
Point Index Register IY to 556AH, the counters of the subscripts.
52E3
LD B,0AH 06 0A
Load Register B with 0AH, the 10 bytes of the five counters.
52E5
LD (IY+00H),00H FD 36 00 00
Store 00H at Index Register IY+00H, a byte of the counters.
52E9
INC IY FD 23
INCrement Index Register IY to the next byte.
52EB
DECrement Register B and LOOP BACK to 52E5H while it is not 0: every counter is 0.
52ED
LD (HL),28H 36 28
Store 28H, a left parenthesis, at Register Pair HL, after the name.
52EF
INC HL 23
INCrement Register Pair HL to the place of the first subscript.
52F0
LD IY,556AH FD 21 6A 55
Point Index Register IY to 556AH, the counter of the leftmost subscript.
52F4
LD A,01H 3E 01
Load Register A with 01H, the leftmost subscript.
52F6
LD (5567H),A 32 67 55
Store Register A (01H) at 5567H, the subscript being worked on: 1 the leftmost, up to the count of dimensions; 0 when the array is done.

52F9H - The Next Element

The stack holds the place in the line of each subscript from the leftmost to the one being worked on (5567H); Index Register IY points at its counter and IX+04H-IX+05H at its number of elements. While the counter is below that number, the counter is written as text at its place and goes up by one; the next subscript is then worked on, from its place after a comma; after the last one the element is printed. A counter that reaches its number of elements goes back to 0 and the subscript before it is worked on (536CH); when the leftmost does, the array is done.

52F9
PUSH HL E5
Save Register Pair HL (the place in the line for the subscript being worked on) to the stack.
52FA
LD A,(5567H) 3A 67 55
Load Register A with the subscript being worked on from 5567H.
52FD
OR A B7
OR Register A with itself: the Z FLAG for 0, the array done.
52FE
If the Z FLAG is set (done), JUMP to 5391H: the start of the array is back on top of the stack.
5301
LD L,(IX+04H) DD 6E 04
Load Register L with the low byte of the number of elements of the subscript, at Index Register IX+04H.
5304
LD H,(IX+05H) DD 66 05
Load Register H with the high byte at Index Register IX+05H: Register Pair HL = the number of elements.
5307
LD E,(IY+00H) FD 5E 00
Load Register E with the low byte of the subscript's counter at Index Register IY+00H.
530A
LD D,(IY+01H) FD 56 01
Load Register D with the high byte at Index Register IY+01H: Register Pair DE = the counter.
530D
OR A B7
Clear the CARRY FLAG (OR A) for the SBC; Register A is not changed.
530E
SBC HL,DE ED 52
SUBtract Register Pair DE (the counter) from Register Pair HL (the number of elements): the Z FLAG when the counter has reached it.
5310
If the Z FLAG is set (every value of the subscript was used), JUMP to 536CH.
5313
PUSH DE D5
Save Register Pair DE (the counter) to the stack.
5314
POP HL E1
Restore it into Register Pair HL: the value of the subscript, for 53EFH.
5315
INC DE 13
INCrement Register Pair DE: the counter for the next element.
5316
LD (IY+00H),E FD 73 00
Store Register E (the low byte of the counter) at Index Register IY+00H.
5319
LD (IY+01H),D FD 72 01
Store Register D (the high byte) at Index Register IY+01H.
531C
GOSUB to 53EFH to turn Register Pair HL (the subscript) into five digits at 5575H-5579H: Register Pair DE = 5575H.
531F
LD B,04H 06 04
Load Register B with 04H: at most four zeros are dropped, so 0 keeps one digit.
5321
LD A,(DE) 1A
Load Register A with the digit at Register Pair DE.
5322
CP 30H FE 30
Compare Register A against 30H, the digit 0: the NZ FLAG for another digit.
5324
If the NZ FLAG is set (not a zero), JUMP to 5329H: the number starts here.
5326
INC DE 13
INCrement Register Pair DE past the leading zero.
5327
DECrement Register B and LOOP BACK to 5321H while it is not 0.
5329
POP HL E1
Restore Register Pair HL from the stack: the place in the line for this subscript.
532A
PUSH HL E5
Save Register Pair HL (the place) to the stack again, for the next value of the subscript.
532B
GOSUB to 53D6H to copy the digits from Register Pair DE to Register Pair HL up to the 00H at 557AH; Register Pair HL after them.
532E
LD A,(5567H) 3A 67 55
Load Register A with the subscript being worked on from 5567H.
5331
LD C,A 4F
Copy Register A (the subscript being worked on) into Register C.
5332
LD A,(5568H) 3A 68 55
Load Register A with the count of dimensions from 5568H.
5335
SUB C 91
SUBtract Register C (the subscript being worked on) from Register A: the Z FLAG for the last subscript.
5336
If the Z FLAG is set (the last subscript), JUMP to 5354H to print the element.
5339
LD (HL),2CH 36 2C
Store 2CH, a comma, at Register Pair HL, after the subscript.
533B
INC HL 23
INCrement Register Pair HL to the place of the next subscript.
533C
DEC IX DD 2B
DECrement Index Register IX (in the header of the array) by one.
533E
DEC IX DD 2B
DECrement Index Register IX again: IX+04H-IX+05H is now the number of elements of the next subscript.
5340
INC IY FD 23
INCrement Index Register IY (in the counters) by one.
5342
INC IY FD 23
INCrement Index Register IY again: the counter of the next subscript.
5344
LD A,(5567H) 3A 67 55
Load Register A with the subscript being worked on from 5567H.
5347
INC A 3C
INCrement Register A (the subscript being worked on): the next subscript.
5348
LD (5567H),A 32 67 55
Store Register A (the next subscript) at 5567H.
534B
GOSUB to 5420H to look at the keyboard: SHIFT @ waits; the Z FLAG for BREAK.
534E
If the Z FLAG is set (BREAK), JUMP to 5217H, back to BASIC.
5351
JUMP to 52F9H to save the place of the next subscript and write its value.

5354H - Print the Element

The last subscript is written: a right parenthesis, an equals sign and a quote close the text, then the name and the subscripts are copied again after it, and the ROM's PRINT runs the line. The place of the last subscript goes back on the stack for its next value.

5354
LD (HL),29H 36 29
Store 29H, a right parenthesis, at Register Pair HL, after the last subscript.
5356
INC HL 23
INCrement Register Pair HL past the right parenthesis.
5357
LD DE,5529H 11 29 55
Point Register Pair DE to 5529H, the text: a space, an equals sign, a space and a quote.
535A
GOSUB to 53D6H to copy the text at Register Pair DE to Register Pair HL up to its 00H.
535D
LD B,3DH 06 3D
Load Register B with 3DH, an equals sign: the copy below stops at it.
535F
LD DE,557FH 11 7F 55
Point Register Pair DE to 557FH, the name at the start of the line.
5362
GOSUB to 53D8H to copy the name, the subscripts, the space and the equals sign from Register Pair DE to Register Pair HL, after the quote: Register Pair HL ends at the copied equals sign.
5365
GOSUB to 5405H to put 00H over that equals sign and have the ROM's PRINT run the line at 557BH: the quoted text, then the value of the element named after it.
5368
POP HL E1
Restore Register Pair HL from the stack: the place of the last subscript.
5369
JUMP to 52F9H to save it again and write the next value of the last subscript.

536CH - A Subscript Used Up

Its counter goes back to 0, IY and IX move back to the subscript before it, and 5567H goes down by one. Two places come off the stack, this subscript's and the one before's; 52F9H puts the one before's back, so its next value is written from there. When the leftmost subscript was used up, the second POP takes the start of the array, which 52F9H puts back for 5391H.

536C
LD (IY+00H),00H FD 36 00 00
Store 00H at Index Register IY+00H, the low byte of the counter.
5370
LD (IY+01H),00H FD 36 01 00
Store 00H at Index Register IY+01H, the high byte: the counter is 0 for the next round.
5374
DEC IY FD 2B
DECrement Index Register IY (in the counters) by one.
5376
DEC IY FD 2B
DECrement Index Register IY again: the counter of the subscript before.
5378
INC IX DD 23
INCrement Index Register IX (in the header of the array) by one.
537A
INC IX DD 23
INCrement Index Register IX again: IX+04H-IX+05H is the number of elements of the subscript before.
537C
LD A,(5567H) 3A 67 55
Load Register A with the subscript being worked on from 5567H.
537F
DEC A 3D
DECrement Register A: the subscript before (0 after the leftmost).
5380
LD (5567H),A 32 67 55
Store Register A (the subscript before) at 5567H.
5383
POP HL E1
Discard the place of the used up subscript from the stack (POP HL into Register Pair HL).
5384
POP HL E1
Restore Register Pair HL from the stack: the place of the subscript before, or the start of the array after the leftmost.
5385
JUMP to 52F9H to save Register Pair HL again and go on with the subscript before.

5388H - Too Many Subscripts

An array of 6 or more dimensions: the text at 5510H (Too many subscripts between two asterisks, then a right parenthesis) follows the name, with no left parenthesis before it, and the ROM's PRINT shows the line as a quoted text.

5388
LD DE,5510H 11 10 55
Point Register Pair DE to 5510H, the text Too many subscripts with an asterisk before and after it, a right parenthesis and 00H.
538B
GOSUB to 53D6H to copy the text at Register Pair DE to Register Pair HL, after the name, up to its 00H.
538E
GOSUB to 5405H to put 00H after it and have the ROM's PRINT run the line at 557BH: a quote with no end, so the ROM prints the text that follows it.

5391H - The Next Array

The start of the array comes off the stack; the next array is 5 bytes plus the length at +03H-+04H further on.

5391
POP IX DD E1
Restore Index Register IX from the stack: the start of the array (52D4H).
5393
LD E,(IX+03H) DD 5E 03
Load Register E with the low byte of the length of the array at Index Register IX+03H.
5396
LD D,(IX+04H) DD 56 04
Load Register D with the high byte at Index Register IX+04H: Register Pair DE = the bytes from +05H to the end.
5399
LD BC,0005H 01 05 00
Load Register Pair BC with 0005H, the type, the name and the length.
539C
ADD IX,BC DD 09
ADD Register Pair BC (5) to Index Register IX.
539E
ADD IX,DE DD 19
ADD Register Pair DE (the length) to Index Register IX: the next array.
53A0
GOSUB to 5420H to look at the keyboard: SHIFT @ waits; the Z FLAG for BREAK.
53A3
If the Z FLAG is set (BREAK), JUMP to 5217H, back to BASIC.
53A6
JUMP to 52B4H for the next array, with Index Register IX at it.

53A9H - The Name and Its Type Character

The name of the entry at Index Register IX goes to 557FH: the first character (IX+02H, without bit 7), the second (IX+01H) when it is not 00H, then the type character worked out from the type byte at IX+00H: 27H less 02H, 03H, 04H or 06H (for 08H) gives %, $, # or !. It RETurns with Register Pair HL after the type character.

53A9
LD HL,557FH 21 7F 55
Point Register Pair HL to 557FH, the place of the name in the line.
53AC
LD A,(IX+02H) DD 7E 02
Load Register A with the first character of the name at Index Register IX+02H.
53AF
AND 7FH E6 7F
Mask Register A to bits 6-0 (AND 7FH): bit 7, the mark of DEF FN, comes off.
53B1
LD (HL),A 77
Store Register A (the first character) at Register Pair HL.
53B2
INC HL 23
INCrement Register Pair HL to the next byte of the line.
53B3
LD A,(IX+01H) DD 7E 01
Load Register A with the second character of the name at Index Register IX+01H.
53B6
OR A B7
OR Register A with itself: the Z FLAG for 00H, a name of one character.
53B7
If the Z FLAG is set (one character), JUMP to 53BCH.
53BA
LD (HL),A 77
Store Register A (the second character) at Register Pair HL.
53BB
INC HL 23
INCrement Register Pair HL to the next byte of the line.
53BC
LD A,(IX+00H) DD 7E 00
Load Register A with the type byte at Index Register IX+00H: 02H integer, 03H string, 04H single, 08H double.
53BF
CP 08H FE 08
Compare Register A against 08H: the Z FLAG for a double.
53C1
If the NZ FLAG is set (not a double), JUMP to 53C8H.
53C4
RRCA 0F
Rotate Register A right (RRCA): 08H becomes 04H.
53C5
JUMP to 53CFH: Register A = 04H, which gives #.
53C8
CP 04H FE 04
Compare Register A against 04H: the Z FLAG for a single.
53CA
If the NZ FLAG is set (an integer or a string), JUMP to 53CFH with Register A = 02H or 03H.
53CD
INC A 3C
INCrement Register A (04H, a single) by one: 05H.
53CE
INC A 3C
INCrement Register A again: 06H, which gives !.
53CF
LD B,A 47
Copy Register A (02H, 03H, 04H or 06H) into Register B.
53D0
LD A,27H 3E 27
Load Register A with 27H, the base of the type characters.
53D2
SUB B 90
SUBtract Register B from Register A: 25H %, 24H $, 23H # or 21H !.
53D3
LD (HL),A 77
Store Register A (the type character) at Register Pair HL, after the name.
53D4
INC HL 23
INCrement Register Pair HL past the type character.
53D5
RET C9
RETurn with Register Pair HL after the name and its type character.

53D6H - Copy a Text

Copies from Register Pair DE to Register Pair HL until a 00H, which is not copied. Entered at 53D8H with a character in Register B, it also stops at that character outside quotes: the character is stored and Register Pair HL is left on it. Register C is the quote flag, 00H outside quotes and 22H inside, flipped at each quote. Entered at 53D6H, Register B = 00H, so only the 00H ends it. It RETurns with Register Pair HL at the 00H's place or on the stop character, Register Pair DE on it in the source.

53D6
LD B,00H 06 00
Load Register B with 00H: no stop character beyond the 00H.
53D8
LD C,00H 0E 00
Load Register C with 00H, the quote flag: outside quotes.
53DA
LD A,(DE) 1A
Load Register A with the character at Register Pair DE.
53DB
OR A B7
OR Register A with itself: the Z FLAG for 00H, the end.
53DC
RET Z C8
If the Z FLAG is set (the end), RETurn with Register Pair HL where the 00H would go.
53DD
LD (HL),A 77
Store Register A (the character) at Register Pair HL.
53DE
INC C 0C
INCrement Register C (the quote flag) by one.
53DF
DEC C 0D
DECrement Register C back: the Z FLAG when it is 00H, outside quotes; Register A is not changed.
53E0
If the NZ FLAG is set (inside quotes), JUMP to 53E4H: the stop character does not count.
53E2
CP B B8
Compare Register A (the character) against Register B (the stop character): the Z FLAG when it is the same.
53E3
RET Z C8
If the Z FLAG is set (the stop character), RETurn with Register Pair HL on it.
53E4
CP 22H FE 22
Compare Register A (the character) against 22H, a quote.
53E6
If the NZ FLAG is set (not a quote), JUMP to 53EAH.
53E8
XOR C A9
XOR Register A (22H) with Register C (the quote flag): Register C 00H (outside) gives 22H (inside), 22H (inside) gives 00H (outside).
53E9
LD C,A 4F
Copy Register A into Register C, the new quote flag.
53EA
INC DE 13
INCrement Register Pair DE to the next character of the source.
53EB
INC HL 23
INCrement Register Pair HL to the next byte of the destination.
53EC
JUMP to 53DAH for the next character at Register Pair DE.

53EFH - A Number as Five Digits

Register Pair HL = a number (a subscript) is turned into five decimal digits at 5575H-5579H, the last digit first, by @DIV with 10. It RETurns with Register Pair DE = 5575H, the first digit.

53EF
LD DE,5579H 11 79 55
Point Register Pair DE to 5579H, the place of the last digit.
53F2
LD C,05H 0E 05
Load Register C with 05H, the count of digits.
53F4
LD A,0AH 3E 0A
Load Register A with 0AH, 10, the divisor for @DIV.
53F6
GOSUB to 4451H, @DIV, to divide Register Pair HL by Register A: Register Pair HL = the quotient, Register A = the remainder, the next digit.
53F9
ADD A,30H C6 30
ADD 30H to Register A: the digit as a character.
53FB
LD (DE),A 12
Store Register A (the digit) at Register Pair DE.
53FC
DEC DE 1B
DECrement Register Pair DE to the place of the digit before.
53FD
DEC C 0D
DECrement Register C (the digits left): the Z FLAG after the fifth.
53FE
If the NZ FLAG is set (more digits), JUMP to 53F4H.
5401
LD DE,5575H 11 75 55
Point Register Pair DE to 5575H, the first of the five digits.
5404
RET C9
RETurn with Register Pair DE = 5575H, the first of the five digits.

5405H - Print the Line

Register Pair HL = the end of the line: 00H is stored there, and the ROM runs the line from 557BH as the items of a PRINT statement, entered at 2069H, inside LPRINT after its LD A,01H: 409CH gets the device from 5569H (00H the video, 01H the printer). Index Registers IX and IY are kept across it.

5405
LD (HL),00H 36 00
Store 00H at Register Pair HL: the end of the line (over the copied equals sign).
5407
PUSH IY FD E5
Save Index Register IY (the counter of the subscript) to the stack.
5409
PUSH IX DD E5
Save Index Register IX (the entry) to the stack.
540B
LD HL,557BH 21 7B 55
Point Register Pair HL to 557BH, the line: a quote, three spaces, the name and its equals sign, the end quote, then the name again.
540E
LD A,(5569H) 3A 69 55
Load Register A with the device from 5569H: 00H the video, 01H the printer.
5411
GOSUB to 2069H, the ROM's LPRINT after its LD A,01H: Register A is stored at 409CH (the output device) and the PRINT items at Register Pair HL are printed with a new line after them.
5414
POP IX DD E1
Restore Index Register IX (the entry) from the stack.
5416
POP IY FD E1
Restore Index Register IY (the counter of the subscript) from the stack.
5418
RET C9
RETurn to the caller with Index Registers IX and IY as they were.

5419H - Compare IX and DE

The Z FLAG when Index Register IX equals Register Pair DE (the end of a table). Register Pair HL is changed.

5419
PUSH IX DD E5
Save Index Register IX (the entry) to the stack.
541B
POP HL E1
Restore it into Register Pair HL: Register Pair HL = Index Register IX.
541C
OR A B7
Clear the CARRY FLAG (OR A) for the SBC; Register A is not changed.
541D
SBC HL,DE ED 52
SUBtract Register Pair DE from Register Pair HL: the Z FLAG when they are the same.
541F
RET C9
RETurn with the Z FLAG when Index Register IX is at the end.

5420H - The Keyboard: SHIFT @ and BREAK

The keyboard is scanned once: SHIFT @ (60H) waits for another key; the key (none is 00H) is then tested for BREAK (01H). It RETurns with the Z FLAG for BREAK; Index Registers IX and IY are kept.

5420
PUSH IX DD E5
Save Index Register IX (the entry) to the stack.
5422
PUSH IY FD E5
Save Index Register IY (the counter) to the stack.
5424
GOSUB to 002BH, the ROM's scan of the keyboard: Register A = the key pressed, 00H for none.
5427
CP 60H FE 60
Compare Register A against 60H, SHIFT @: the Z FLAG for the pause.
5429
If the NZ FLAG is set (no pause), JUMP to 5432H.
542B
GOSUB to 0049H, the ROM's wait for a key: Register A = the key.
542E
CP 60H FE 60
Compare Register A against 60H, SHIFT @ again.
5430
If the Z FLAG is set (SHIFT @), LOOP BACK to 542BH: the listing waits for another key.
5432
CP 01H FE 01
Compare Register A (the key) against 01H, BREAK: the Z FLAG for BREAK, also after a pause.
5434
POP IY FD E1
Restore Index Register IY from the stack. POP does not change the flags.
5436
POP IX DD E1
Restore Index Register IX (the entry) from the stack.
5438
RET C9
RETurn with the Z FLAG for BREAK and Register A = the key.

5439H - Send a Text

The text at Register Pair HL, up to its 0DH, goes to the video with @DSPLY when 5569H holds 00H, or to the printer with @PRINT when it holds 01H. Index Register IX is kept.

5439
LD A,(5569H) 3A 69 55
Load Register A with the device from 5569H: 00H the video, 01H the printer.
543C
OR A B7
OR Register A with itself: the Z FLAG for the video.
543D
PUSH IX DD E5
Save Index Register IX (the entry) to the stack.
543F
PUSH AF F5
Save Register Pair AF (the Z FLAG for the video) to the stack.
5440
If the Z FLAG is set (the video), GOSUB to 4467H, @DSPLY, to display the text at Register Pair HL up to its 0DH.
5443
POP AF F1
Restore Register Pair AF (the Z FLAG for the video) from the stack.
5444
If the NZ FLAG is set (the printer), GOSUB to 446AH, @PRINT, to print the text at Register Pair HL up to its 0DH.
5447
POP IX DD E1
Restore Index Register IX (the entry) from the stack.
5449
RET C9
RETurn to the caller with Index Register IX as it was.

544AH - The Parameters

Register Pair HL = the text after the V. Spaces are passed over; the first parameter can be a device: an asterisk and DO (the video, as in the file) or PR (the printer: 5569H = 01H); any other device is Invalid output device!. Then any number of =letter (5574H, A-Z), -S (only the simple variables: 5212H = 00H) and -A (only the arrays: 520CH = 00H); anything else is Parameter error!. Letters are taken in upper or lower case. It RETurns at the 0DH with Register Pair HL on it; after an error it shows the message and goes back to BASIC.

544A
GOSUB to 54B2H to pass over spaces: Register A = the first character, the Z FLAG for the 0DH.
544D
RET Z C8
If the Z FLAG is set (no parameters), RETurn with Register Pair HL at the 0DH.
544E
CP 2AH FE 2A
Compare Register A against 2AH, an asterisk: a device.
5450
If the NZ FLAG is set (no device), JUMP to 5473H for the other parameters.
5452
GOSUB to 54BBH for the next character, in upper case, in Register A.
5455
CP 44H FE 44
Compare Register A (the character) against 44H, D.
5457
If the NZ FLAG is set (not D), JUMP to 5462H to test for P.
5459
GOSUB to 54BBH for the next character, in upper case, in Register A.
545C
CP 4FH FE 4F
Compare Register A (the character) against 4FH, O: the asterisk, D and O, the video.
545E
If the Z FLAG is set (DO, the video), JUMP to 5472H for the next parameter; 5569H stays 00H.
5460
JUMP to 54A8H for the message Invalid output device!.
5462
CP 50H FE 50
Compare Register A (the character) against 50H, P.
5464
If the NZ FLAG is set (neither D nor P), JUMP to 54A8H for Invalid output device!.
5466
GOSUB to 54BBH for the next character, in upper case, in Register A.
5469
CP 52H FE 52
Compare Register A (the character) against 52H, R: the asterisk, P and R, the printer.
546B
If the NZ FLAG is set (not R), JUMP to 54A8H for Invalid output device!.
546D
LD A,01H 3E 01
Load Register A with 01H, the code of the printer.
546F
LD (5569H),A 32 69 55
Store Register A (01H) at 5569H, the device: 5439H uses @PRINT and 5405H gives 01H to the ROM's PRINT.
5472
INC HL 23
INCrement Register Pair HL past the last character of the parameter.
5473
GOSUB to 54B2H to pass over spaces: Register A = the next character, the Z FLAG for the 0DH.
5476
RET Z C8
If the Z FLAG is set (the end), RETurn with Register Pair HL at the 0DH.
5477
CP 3DH FE 3D
Compare Register A against 3DH, an equals sign.
5479
If the Z FLAG is set (=), JUMP to 5496H for the letter.
547B
CP 2DH FE 2D
Compare Register A against 2DH, a minus sign.
547D
If the NZ FLAG is set (not a minus sign), JUMP to 54A4H for Parameter error!.
547F
GOSUB to 54BBH for the letter after the minus sign, in upper case, in Register A.
5482
CP 53H FE 53
Compare Register A (the letter) against 53H, S.
5484
If the NZ FLAG is set (not S), JUMP to 548CH to test for A.
5486
XOR A AF
Load Register A with 00H (XOR A) for the operand at 5212H.
5487
LD (5212H),A 32 12 52
Store Register A (00H) at 5212H, the operand of LD A at 5211H: the arrays are not listed.
548A
JUMP to 5472H for the next parameter after the S.
548C
CP 41H FE 41
Compare Register A (the letter) against 41H, A.
548E
If the NZ FLAG is set (neither S nor A), JUMP to 54A4H for Parameter error!.
5490
XOR A AF
Load Register A with 00H (XOR A) for the operand at 520CH.
5491
LD (520CH),A 32 0C 52
Store Register A (00H) at 520CH, the operand of LD A at 520BH: the simple variables are not listed.
5494
JUMP to 5472H for the next parameter after the A.
5496
GOSUB to 54BBH for the character after the equals sign, in upper case, in Register A.
5499
LD (5574H),A 32 74 55
Store Register A (the letter) at 5574H, the first letter of the names to list; it is stored before it is tested.
549C
CP 41H FE 41
Compare Register A against 41H, A: the CARRY FLAG below A.
549E
If the CARRY FLAG is set (not a letter), JUMP to 54A4H for Parameter error!.
54A0
CP 5BH FE 5B
Compare Register A against 5BH, one past Z: the CARRY FLAG for A-Z.
54A2
If the CARRY FLAG is set (a letter), JUMP to 5472H for the next parameter; anything above Z falls into Parameter error!.

54A4H - The Errors

54A4H points Register Pair HL at Parameter error!; its next instruction, LD IX,5550H, holds at 54A8H a second entry, LD HL,5550H, for Invalid output device!. The message is shown with @LOGOT and BASIC/CMD is run again.

54A4
LD HL,553FH 21 3F 55
Point Register Pair HL to 553FH, the text Parameter error! and its 0DH.
54A7
LD IX,5550H DD 21 50 55
Load Index Register IX with 5550H; nothing reads it. Entered at 54A8H, the bytes 21 50 55 are LD HL,5550H, the text Invalid output device! and its 0DH.
54AB
GOSUB to 428AH, @LOGOT, to display the message at Register Pair HL up to its 0DH and put it in the job log.
54AE
JUMP to 5217H, back to BASIC with the message shown.

54B1H - Pass Over Spaces

54B2H RETurns with Register A = the character at Register Pair HL, or the first one after spaces, and the Z FLAG for 0DH; 54B1H steps one character first.

54B1
INC HL 23
INCrement Register Pair HL past the space to the next character.
54B2
LD A,(HL) 7E
Load Register A with the character at Register Pair HL.
54B3
CP 0DH FE 0D
Compare Register A against 0DH, the end of the parameters.
54B5
RET Z C8
If the Z FLAG is set (0DH), RETurn with the Z FLAG.
54B6
CP 20H FE 20
Compare Register A (the character) against 20H, a space.
54B8
RET NZ C0
If the NZ FLAG is set (not a space), RETurn with the character in Register A and the NZ FLAG.
54B9
LOOP BACK to 54B1H to pass over the space at Register Pair HL.

54BBH - The Next Character in Upper Case

Register Pair HL moves on by one; Register A = the character there with bit 5 cleared, so a lower case letter becomes upper case.

54BB
INC HL 23
INCrement Register Pair HL to the next character.
54BC
LD A,(HL) 7E
Load Register A with the character at Register Pair HL.
54BD
RES 5,A CB AF
Clear bit 5 of Register A: a lower case letter becomes upper case.
54BF
RET C9
RETurn with the character in Register A, in upper case.

54C0H - The Texts and the Work Cells

The banner (never shown), the two headings, the texts of the lines and the messages, then the cells of the dump. Texts for 5439H and @LOGOT end with 0DH; texts for the copy at 53D6H end with 00H. 556AH-5573H, the counters, are not in the file; from 557BH on is the line given to the ROM's PRINT.

54C0-54C1
DEFB 1CH,1FH 1C 1F
54C0H-54C1H: the start of the banner: 1CH puts the cursor home, 1FH clears the screen from there. Only 5201H names 54C0H, and that load is not used.
54C2-54EA
DEFM "BASIC Active Variable Dump - Version 4.1" / DEFB 0DH 42 41 53 49 43 20 41 63 74 69 76 65 20 56 61 72 69 61 62 6C 65 20 44 75 6D 70 20 2D 20 56 65 72 73 69 6F 6E 20 34 2E 31 0D
54C2H-54EAH: the text of the banner and its 0DH; never shown.
54EB-54FD
DEFB 0AH / DEFM "Simple Variables:" / DEFB 0DH 0A 53 69 6D 70 6C 65 20 56 61 72 69 61 62 6C 65 73 3A 0D
54EBH-54FDH: the heading of the simple variables (5237H): 0AH, a line feed, the text and 0DH.
54FE-550F
DEFB 0AH / DEFM "Array Variables:" / DEFB 0DH 0A 41 72 72 61 79 20 56 61 72 69 61 62 6C 65 73 3A 0D
54FEH-550FH: the heading of the arrays (52AAH): 0AH, the text and 0DH.
5510-5528
DEFM "* Too many subscripts *)" / DEFB 00H 2A 20 54 6F 6F 20 6D 61 6E 79 20 73 75 62 73 63 72 69 70 74 73 20 2A 29 00
5510H-5528H: the text put after the name of an array of 6 or more dimensions (5388H), and 00H.
5529-552D
DEFM " = " / DEFB 22H,00H 20 3D 20 22 00
5529H-552DH: a space, an equals sign, a space, the end quote of the text for PRINT, and 00H (5286H, 5357H).
552E-553E
DEFM " <User Def Func>" / DEFB 0DH 20 3C 55 73 65 72 20 44 65 66 20 46 75 6E 63 3E 0D
552EH-553EH: the text after a DEF FN definition (5278H) and its 0DH, which ends the line for @DSPLY or @PRINT.
553F-554F
DEFM "Parameter error!" / DEFB 0DH 50 61 72 61 6D 65 74 65 72 20 65 72 72 6F 72 21 0D
553FH-554FH: the message of 54A4H and its 0DH.
5550-5566
DEFM "Invalid output device!" / DEFB 0DH 49 6E 76 61 6C 69 64 20 6F 75 74 70 75 74 20 64 65 76 69 63 65 21 0D
5550H-5566H: the message of 54A8H and its 0DH.
5567
DEFB 00H 00
5567H: the subscript being worked on: 1 the leftmost, up to the count of dimensions, 0 when the array is done (52F6H, 5348H, 5380H); 00H in the file, which ends the copy at 527BH.
5568
DEFB 00H 00
5568H: the count of dimensions of the array being listed (52CFH), read at 5332H.
5569
DEFB 00H 00
5569H: the device: 00H the video, 01H the printer after the parameter PR (546FH); read at 5439H and 540EH, and given to the ROM as the value of 409CH.
556A-5573
DEFS 10
556AH-5573H: not in the file. Five counters of 2 bytes, the next value of each subscript, the leftmost first; set to 0 at 52E5H, walked by Index Register IY.
5574
DEFB 00H 00
5574H: the letter of =letter, 00H for every name (5499H); read at 5249H and 52BCH.
5575-5579
DEFM " " 20 20 20 20 20
5575H-5579H: five spaces in the file: the five digits of a subscript, made by 53EFH.
557A
DEFB 00H 00
557AH: 00H, the end of the five digits for the copy at 532BH; also the byte before the line, where the ROM's PRINT starts its reading (it steps back one byte before its first character).
557B
DEFB 22H 22
557BH: a quote, the start of the line for the ROM's PRINT (540BH).
557C-557E
DEFM " " 20 20 20
557CH-557EH: three spaces, the indent of each line; a DEF FN line is sent from 557CH, without the quote (527EH).
557F-567E
DEFS 256
557FH-567EH: not in the file. The rest of the line: the name and its type character (53A9H), then the subscripts, the equals sign, the end quote and the name again; or for a DEF FN the definition as text and <User Def Func>.
567F-577E
DEFS 256
567FH-577EH: not in the file. The copy of a DEF FN definition from the program, up to its 00H or colon, for BUFLIN (5266H).