LS-DOS 6.3.1 for the Model 4 - SYS6/SYS Disassembled

Page Customization

Introduction/Summary

LS-DOS 6.3.1 SYS6/SYS Disassembly (Model 4)

SYS6/SYS is Library A of LS-DOS 6.3.1: fourteen members, each a separate program that carries out one or more of the commands typed at LS-DOS Ready or passed by a program through @CMNDR. Twenty-one commands are served: MEMORY, DIR and CAT, COPY and APPEND, LIB, CLS, ID and TOF, REMOVE, RENAME, DEVICE, ROUTE, LINK, RESET, SET and FILTER, LIST, DO, and LOAD and RUN. Thirteen members load at 2400H, the first address above the overlay area 1E00H-23FFH; the member of SET and FILTER loads at 2C00H. Only one member is in memory at a time: the next library command reads its own member over it.

The file is 13748 bytes: a module name record (05H) with the name sys6, a copyright record (1FH) with the text (C) 1982-4,6,90 MISOSYS, twenty-one member headers (08H), a record 0AH that ends the headers, then the fourteen members, each one after a record 04H, a last 04H record and a transfer record (02H) for 0000H. A member header holds six bytes: the request byte, the entry address, the record number (a word) and the byte in that record where the member's load blocks begin; a member that serves two or more commands has one header for each, all pointing at the same place with different entry addresses. The members hold 13219 loaded bytes; members 3, 4, 5, 6, 8, 10 and 13 have gaps between their load blocks (bytes they only use as buffers or variables).

The page was built a member at a time, from 19 to 21 November 2026, and now holds all fourteen members: member 1, MEMORY, member 2, DIR and CAT, member 3, COPY and APPEND, member 4, LIB, CLS, ID and TOF, member 5, REMOVE, member 6, RENAME, member 7, DEVICE, member 8, ROUTE, member 9, LINK, member 10, RESET, member 11, FILTER and SET, member 12, LIST, member 13, DO, and member 14, RUN and LOAD. Each member's rows begin at the heading that names it, and the Page Index links each one; the table below gives each command's request byte, member and entry.

Members and Commands

SYS1/SYS looks the command word up in LIBTBL$ (1F24H on the SYS1/SYS page) and finds a word such as 801EH: bits 15-13 give the library (8000H SYS6, A000H SYS7, C000H SYS8) and the low byte the request. It sets @DBGHK to C9H, loads Register B with the request and sends request 88H through RST 28H. The SVC dispatcher of SYS0/SYS reads SYS6 every time (CKMOD@), and the loader looks through the member headers for the one whose request byte equals Register B, positions the file at the record and byte it names, reads the load blocks up to the next 04H and calls the entry address of the header, with Register Pair HL at the text after the command word. The member's RET goes back through the dispatcher: to @EXIT for a typed command, to the program for one sent through @CMNDR. A member returns Register Pair HL = 0000H when all went well, an error number, or FFFFH after a message of its own.

CommandRequestMemberFirst and last byte loadedEntry
MEMORY1EH12400H-2983H2400H
DIR21H22400H-2FCEH2400H
CAT20H22400H-2FCEH2403H
COPY32H32400H-2C57H2400H
APPEND31H32400H-2C57H2403H
LIB19H42400H-251EH2400H
CLS24H42400H-251EH2403H
ID26H42400H-251EH2406H
TOF25H42400H-251EH2409H
REMOVE18H52400H-2552H2400H
RENAME53H62400H-2692H2400H
DEVICE61H72400H-28D0H2400H
ROUTE64H82400H-25E5H2400H
LINK62H92400H-24A9H2400H
RESET63H102400H-25A8H2400H
FILTER66H112C00H-2DACH2C00H
SET65H112C00H-2DACH2C03H
LIST41H122400H-27BAH2400H
DO91H132400H-2E00H2400H
RUN82H142400H-2594H2400H
LOAD81H142400H-2594H2403H

The sources are the files of the LS-DOS 6.3.1 Source Code Restoration Project, whose build gives every member byte for byte: LBMEMORY, LBDIR, LBCOPY, LBLIB, LBREMOVE, LBRENAME, LBDEVICE, LBROUTE, LBLINK, LBRESET, LBSET, LBLIST, LBDO and LBLOAD. In LBMEMORY the parts added in 6.3.1 (the banks and the memory map, from 2599H) carry no comments in the source and their labels are made from the address, such as L2599.

Member 1: MEMORY

MEMORY takes the parameters HIGH, LOW, ADD, WORD, BYTE, GO, CLEAR and PRINT. CLEAR fills memory and returns at once (2420H). ADD shows an address and the two bytes there, WORD or BYTE changes them (2465H). HIGH moves HIGH$ down behind a ten byte module header, so that the reserved block appears in the memory map with the name &nnnn, its first address; LOW sets LOW$, not below 2600H (250CH). Then every MEMORY command shows High = X'hhhh' Low = X'llll', the memory banks (2579H) and a map of the modules in the driver zone and in high memory, a line for each with its name, start, end and length in decimal (25E2H, 2618H). The map stops for a key at the end of each screen (2722H). With PRINT every line also goes to the printer. GO jumps to its address last of all (27ADH).

Against the manual: PRINT is only in the 6.3.1 update notes. The manual says CLEAR fills from 2600H to HIGH$ with 00H; it fills from 2465H, inside MEMORY, takes a fill byte (CLEAR=X'nn' or a one character string), stops at LOW$ for a program's @CMNDR, and ignores every other parameter given with it. WORD may be 0 and BYTE may be X'FF', which the manual forbids; BYTE shows the old and new byte, not a word as in the manual's example; GO can be abbreviated to G, though the manual says it cannot; and HIGH$ is set to the address given less 10, the size of the header, not to the address given; the Note line says only that a header was inserted.

The map reads the end of the driver zone as the word just below the KI device control block, which is DVRHI$ because KIDCB$ is at 0208H and DVRHI$ at 0206H (2681H). It builds its lines in 2400H-2439H, over the first bytes of MEMORY, which have already run, and the carriage return that ends every module line is the one a title line put at 2439H. The length byte of a module header is used whole as the length of the name; @GTMOD keeps only its bits 3-0. Self-modified: the operands that @PARAM fills in (2421H, 248DH, 24D5H, 24E6H, 2520H, 2544H, 2791H, 27B5H), the fill byte (245EH), the old Stack Pointer (2809H), the line count (2772H), the walk's start, end and limit (264CH, 2640H, 2666H) and the title lines' values (267BH, the keyboard driver's address; 269CH and 26A5H, HIGH$).

Bugs (listed on the LS-DOS reference page): B40, HIGH with a value below 10 wraps round, so that HIGH$ is set to FFF6H or above and the ten byte header is written across the top of memory and the first bytes from 0000H (2531H); B41, a program whose stack is just below 8000H or higher gets 01/01 banks whatever memory the machine has, because @BANK refuses to select a bank for it (25A0H); B42, the search for a module after a block without a header takes only names whose every character is 30H to 7AH, so most drivers and filters ($KSM, $FF, $MD) and MEMORY's own reserved blocks (&nnnn) are not found there and are listed as part of the <unknown> block (2701H); B43, a header whose last byte is below its own address, such as a stray 18H that the search accepts because it lets the last byte equal the byte in front of the 18H, makes the walk show the same line for ever, until BREAK at the end of a screen (26EFH, 265BH).

Member 2: DIR and CAT

DIR takes a drive or a range of drives (:d, d, d1-d2, d1- or -d2, all drives 0-7 when none is given), a partspec or a -partspec, and the parameters A, INV, SYS, MOD, N, P, DATE, SORT and O. CAT enters at 2403H, sets the A parameter to off and runs DIR (2403H). The start of the command is at the end of the member (2D9CH): it reads the parameters, parses the drive and partspec (2EDDH) and the DATE string (2F4CH), and is then written over by the variables, the line buffer and, from 2E00H, the GAT, HIT and FXDE buffers. For each drive (2432H) DIR builds the title line from the DCT and the GAT: the name, the cylinders, DDEN, SDEN or Hard, the free space and the size in K (floppies less their locked out cylinders) and the date of the diskette (2482H). It walks the HIT a directory sector at a time, reads each sector once with @DIRRD and tests each entry: in use, not an FXDE, SYS and INV against S and I, MOD, the name against the partspec with $ and trailing spaces matching anything, and the date (2648H). Sorted (the default), the selected entries are copied to a buffer at 3000H and shown after a Shell sort of a table of their addresses (2B14H); otherwise each one is shown as it is found. The brief format puts four names a line, 19 columns each, with the letters ? (open), * (PDS), S, I, P, C (created) and + (modified) (2736H); the full format gives a line a file with the protection, LRL, records, EOF, size, extents, date and, on a diskette with the new style of dating, the time in 12 or 24 hours (2815H), and ends each drive with the line nnn files of nnn selected and the space of the files shown (25D3H).

Against the manual: the screen pauses after 22 lines, not 15, and no screen is cleared (the @CLS of the pause is a NOP, 2ABCH). The title line has no counts of free and total file slots, as the manual's example shows, but the date of the diskette; a hard drive shows Hard for its density. The totals line appears with A only, and its second number counts every live file of the drive, also the system and invisible files not shown. CAT (A) gives the full format, because the A parameter is read after CAT has turned it off. A program's DIR, run through @CMNDR, is never sorted, whatever SORT says, so that the buffer at 3000H is not used (2E66H). Not in the manual: an asterisk in the partspec stands for dollar signs to the end of the name or extension, a period may separate the extension, DIR 8 and DIR 9 are Illegal drive number, and so is a partspec that begins with a digit followed by a letter (2EFDH; a digit, a minus sign and something else gives Illegal file name). DATE alone (or DATE=YES) selects the files of today's date; a numeric value is taken as the address of the string; anything after a single date other than the closing quote or a minus sign makes it a from date; a year 12-79 is taken as 1980 without an error (2F95H). The EOF column shows the offset of the last byte (DIR+3 less 1, 255 for a full sector, 0 for an empty file), and a record count above 65535 shows ten asterisks, unless it reaches 65536 only by the rounding up of a last partial record, which shows 0 (B50). The time shows a or p after the minutes with SYSTEM (AMPM=ON).

The month names are those of MONTBL$ in BOOT/SYS since the Level 1D patch; 21 bytes of DIR's old table (Jun to Dec; the Level 1D code took the place of Jan to May) stay in the member unread (2D85H). In the sorted mode the granule and extent counts are written over DIR+22 to DIR+25 of the entry in the system buffer SBUFF$ before it is copied; nothing writes that buffer back (270BH). The test against 8 at 2E56H is what stops :8: LEGDRV1 returns the Z flag set for the digit 8. Self-modified: the operands that @PARAM fills in (2682H, 2690H, 2698H, 26FCH, 27FCH, 2A2AH, 2AACH, 2E8EH), the Stack Pointer (242CH), the sector in the buffer (2655H) and the buffer's high byte (2669H, 29DDH), the FXDE sector (29E1H), the exclude flag (26C7H), the drive range (262FH, 263AH, 2ED4H), the counts (25DAH, 25F6H, 2601H, 2804H, 2AA0H), the full line's values (2817H, 2858H, 2883H), the sectors per granule (2A44H), the K destination (2A54H), the flag addresses (28F5H, 2A82H, 2ACEH, 2AE3H, 2AE8H), the copy of SFLAG$ (2AB2H), the NOTITLE flag (2AC2H), the BIT instructions of the drive's dating bit (28F8H, 2A85H) and the sort's variables (2B68H, 2B6EH, 2B8AH, 2B90H, 2BEFH).

Bugs (listed on the LS-DOS reference page): B44, the room test before the sort compares the size of the address table with the top of memory instead of its end, so that with HIGH$ set low and 18 files or more the table is written past HIGH$ over high memory (2B39H); B45, a screen pause that comes just after the title of a drive with no file selected shows that title again, with the column heading in the full format (2AC9H); B46, a name of eight and three characters with five or six attribute letters, or one of eleven characters with six, uses up the 19 columns of the brief format and the fill loop then writes 256 or 255 spaces (27F9H); B47, a leap year as the first date of a range raises February's days in the table for the rest of the command, so that the second date accepts 02/29 of any year and 02/30 of a leap year (2F65H); B48, the FXDE buffer at 2F00H is not forgotten when the next drive starts, so that DIR (A) of several drives can count the extents of a file from the extended entry of another drive whose FXDE sector has the same number (29E0H); B49, DIR -8 lists drive 0 instead of giving Illegal drive number (2EE5H); B50, a file of 65535 whole records and a partial one shows 0 records and EOF 0 (2871H).

Member 3: COPY and APPEND

COPY copies a file or a device to a file or a device, with the parameters ECHO, LRL, CLONE (on unless turned off) and X; APPEND adds a file or a device to the end of a file, with STRIP and ECHO. Both store the Stack Pointer of their entry in SAVESP, and every way out (the end of the copy, an error through @ERROR, a message of the member's own, BREAK) returns from there (2403H, 24F4H). The source is read with @FSPEC; a destination that is not a whole specification (:1, /DAT:1, .PW:1) is copied as typed and completed from the source: its name, its extension and its password when they are not given, never its drive (276AH, 2794H). Every open goes through DOSVC, which also writes each name for the line Copying: source to destination; the destination is opened or created with @INIT, refused on a write protected diskette and below UPDATE access, the source opened with no open or LRL checks (2804H, 28ACH).

With a device on either side the bytes go one at a time through @GET and @PUT until the end of file or BREAK, shown too with ECHO (270FH). Two files are copied a sector at a time through memory: a sector of E5H written at the source's last record first takes all the space the copy needs (26EFH), then the source is read into the pages from 2E00H up to a top set below HIGH$, or below LOW$ for a command sent by a program (2905H), written out and read again until its end (263AH). At the end the destination gets the source's end of file offset, is closed, and its directory entry gets the LRL of the source (or of LRL=) and, with CLONE, the source's attributes, flags, date, owner password and time; from an old style diskette to a new style one the time is set to 00:00 (2699H). A destination that is the source file itself gives Destination spec required (261AH). APPEND opens both files, requires the same LRL, and appends byte by byte for a device source, for STRIP (the destination's last byte is written over) or when the destination ends inside a sector; otherwise it takes the space with the same E5H sector and appends whole sectors through COPY's loop (244EH).

COPY (X) copies a file between two diskettes in one drive, the drive of the source's specification (2534H). It keeps the master password's hash, the name and the date of each diskette from its GAT, refuses two diskettes that are alike, and asks for the source and the destination in turn, blinking the prompt until ENTER and asking again until the right diskette is in (2978H, 299AH, 29C7H). SYS2/SYS is read before the first prompt and SYS3/SYS before the close, with the requests 84H and 85H, which only load an overlay (2A34H); the system diskette is asked for only when the drive is 0 (2966H).

Against the manual: the destination of APPEND is completed from the source as in COPY, which the manual does not say. LRL is not checked against 1-256 (LRL=0 gives 256, a larger value its low byte), and ECHO works for a file source too. COPY (X) leaves CLONE on, so the destination gets the source's visibility, protection and owner password, where the manual says it becomes visible with no password unless one is typed; it is refused under DO with Invalid command during <DO> processing, and the drive digit is used for the GAT reads before the open checks it: a drive 8 reads drive 0, is not drive 0 for the system diskette prompt, and the open's error 32 then has SYS4/SYS read from whatever is in drive 0. The conversion of an old style entry (the time set to 00:00) is made only with CLONE, and its year, three bits in the old style, becomes 1980 to 1987; without CLONE the close writes the date and time of the copy. With CLONE off, a password typed for a new destination becomes its owner password, though the manual says a password cannot be changed during a copy. UPDATE access is enough for COPY's destination, though UPDATE may write nothing at the end of file, which is where every write of the copy goes (B61).

STOP (2A28H, Transfer aborted and the system diskette prompt) and OPENDES (2A5FH) are not called by anything, and EXIT (240FH) is reached by no path, as the copy ends at GOHOME. DOINIT reads the directory of drive 0 only to learn that SBUFF$ is at 1D00H (2930H). The top page of the sector copy is the page below the last whole page under HIGH$, so one page that could be used is not; for a command sent through @CMNDR, LOW$ is normally 2FFFH and only the page 2E00H is used, so a long file is copied one sector at a time (with X, one swap of diskettes for each sector). After a disk error the destination is left open, not closed. A plain COPY of two files does not test BREAK while it copies, and a destination typed with X is ignored (FCB1 is copied over FCB2). Self-modified: the Stack Pointer (2423H), the operands that @PARAM fills in (24ACH, 2523H, 25B5H, 26A9H, 2762H), the destination's LRL for APPEND (24A3H), the address of YFLAG$ (25A4H, 260AH) and the BIT instructions of the two drives (25A7H, 260DH), the top page (2659H, 2671H, 2947H), the LRL for the entry (26A6H), the date conversion flag (26C4H), the return code (26EAH), the SVC number (286CH), the place of the drive digit (2892H), the message switch (28B2H), the page of SBUFF$ (28DCH, 28E9H), the drive of COPY (X) (296CH) and the digits of the prompts (2B82H, 2BBCH).

Bugs (listed on the LS-DOS reference page): B51, APPEND opens its destination with @OPEN and checks only the access a source needs, so a destination on a write protected diskette, or one that may only be read, fails at the first write with Illegal access attempted to protected file instead of Write protected disk or File access denied (2872H); B52, any value of LRL is taken and only its low byte used (25B7H); B53, COPY (X) on drive 1 to 7 asks for the destination diskette before the close only when pages are left to write, so for an empty file, one whose sectors fill memory an exact number of times, and every copy sent through @CMNDR it closes the destination and rewrites its directory entry on the source diskette (2689H); B54, a destination left out before a parameter list is taken as the blank before the parenthesis (or the source's last character) and becomes the source's name with no drive, so that COPY overwrites a file of that name on a lower drive and APPEND appends the file to itself (279BH); B55, a LOW$ below 2FFFH under @CMNDR gives a top page that the sector loops meet only after wrapping round, so that they read over the whole of memory and the system (2925H); B56, a BREAK pressed while COPY (X) works, before one of its prompts, keeps FLASH waiting for good with no prompt shown (29D2H); B57, BREAK at a prompt of COPY (X) on drive 0 ends the command without asking for the system diskette, leaves an open destination unclosed, and at the system diskette prompt itself turns an error or a good copy into a return of FFFFH (29F0H); B58, COPY (X) with no drive in the specification prompts for drive 0 but opens and creates on any drive, so that a file of the same name on another drive can be overwritten (2547H); B59, CLONE from a new style to an old style diskette copies the time into what the old style keeps as the user password (26C3H); B60, a refused open in COPY (X) on drive 0 is closed before the system diskette is asked for, so SYS3/SYS is read from the wrong diskette (2878H); B61, a destination opened with UPDATE access passes the check, gets a sector of E5H written into it, and the copy then stops with error 37 (2880H); B62, the swaps of COPY (X) read only the GAT and not the number of sides, so a copy between a one sided and a two sided diskette reads the wrong sectors where an extent crosses a cylinder (2A46H).

Member 4: LIB, CLS, ID and TOF

Member 4 holds 190 bytes in two load blocks (only member 9, LINK, is smaller) and serves four commands that take no parameters; each returns 0000H when it has worked. LIB (2422H) lists the commands of the three libraries. It takes the address of LIBTBL$ from 1E02H, the word after the first jump of SYS1/SYS, which is still at 1E00H because SYS1 sent the library request, and goes through the table three times, once for each library byte (80H, A0H and C0H, the high byte of each entry's word). Each pass shows the heading Library <A>, <B> or <C> and then the names in that library, the first letter a capital and the rest in lower case, 7 to a line after 2 spaces, each in 11 columns (2430H, 2435H, 245FH). After each pass the letter of the heading and the library byte of the test are written over (2477H), and after the first the heading's first byte, 00H, becomes a line feed (242BH).

CLS (241CH) clears the screen with @CLS. TOF (2409H) sends a form feed, 0CH, to the printer with @PRT; when the printer driver gives up waiting, TOF shows the short message Device not available and returns error 8 (2412H). ID (2500H) shows No service contract!, because the 6.3.1 diskette carries no customer service number. In 6.3.0 ID opened SYS0/SYS with its password (the name SYS0/SYS.LSIDOS is kept with each byte XOR 1BH), read the number from it, put its 10 digits at 22F6H-22FFH and called the DOID entry of SYS3/SYS (request B5H), which is a RET in 6.3.1 (SYS3 2136H). The source marks the new ID, and CLS's jump into TOF's return code at L240E (2420H), as changes of 6.3.1.

Against the manual: its table of what LIB shows covers several DOS versions, with Kill and Spool in Library A and Boot and Clock in Library B. The 6.3.1 LIB shows 21 commands in Library A (ID among them, Kill and Spool not), 11 in Library B and 6 in Library C. BOOT is in LIBTBL$ with the word 1F22H, the address of SYS1's own BOOTIT, so it is in no library and LIB never shows it. LIB reads only SYS1's table, so a library whose system file has been deleted, which the manual allows, is still listed. The manual says TOF does nothing when the printer is not available; it waits as long as the printer driver does (as built, 65535 tests of the printer with a short pause after each; SYSTEM (PRTIME) patches the count at 0E29H) and then shows Device not available. CLS returns 0000H even when @CLS returns an error. The 00H at the start of the first heading only toggles the video driver's bit that shows the next control code, which does nothing to the L after it; when the video device is routed to another device, that device gets the 00H instead, and when it is linked, the linked device gets it too. LIB does not look at the results of @DSPLY and @DSP either. Self-modified: the library byte of the test (2441H), the first byte of the heading (2492H) and its letter (249CH); the member is read again for each library command, so LIB always starts from A and 80H.

Bugs (listed on the LS-DOS reference page): B63, LIB ends a line of 7 commands and begins the next one with its 2 spaces before it looks for the end of the table, so Library A, whose 21 commands fill three lines, ends with a line holding only the 2 spaces: two blank lines come before Library <B> and one before Library <C> (246BH).

Member 5: REMOVE

Member 5 holds 324 bytes in three load blocks, 2400H-24FFH, 2500H-2542H and the first byte of its FCB at 2552H, and serves REMOVE, which deletes the files and devices named after it on the command line, separated by spaces. REMOV (242EH) skips the spaces before each word, returns 0000H at the 0DH that ends the line and gives the word to @FSPEC; a word that @FSPEC refuses ends the command with File spec required and FFFFH (241BH). BREAK is tested before each word (2434H). The result of each step comes back to REMOV1 (2430H), and the first error ends the command through IOERR, which shows the short message and returns the error number (2423H): the words after a file that is not found are not looked at, and whatever was removed before it stays removed.

A file is opened with @OPEN (245CH), and the record length error 42 is let through, since REMOVE gives no record length. Only the access levels FULL and REMOVE may delete it; any other gives Illegal access attempted to protected file (2465H), the test SYS10/SYS makes again. On a write protected diskette @OPEN gives every file READ access at best, so REMOVE answers Illegal access attempted to protected file there too, not Write protected disk. MOVSPC (2502H) has copied the name to FILESPC without its password, and when the name has no drive FLOOP adds a colon and the drive on which @OPEN found the file (2474H), so that the line Removing: NAME/EXT:d names the file that goes. Then @REMOVE deletes it (248FH).

A device (249FH) must exist, must not be a system device and must be pointed NIL. REMOVE asks @RENAME to give the device its own name: SYS2/SYS refuses the six DCBs below 0231H (KI, DO, PR, SI, SO and JL) with Protected system device and any other with Illegal file name, the answer REMOVE wants (24B7H). A device that is not NIL gives Device in use (24C0H). The DCB's 8 bytes are then set to 00H, which frees its slot (24CAH), SCNDCB looks for devices routed to it (24CDH), and the Removing: line comes after the removal (24F4H).

Against the manual: the manual names only JL, KI, DO and PR as system devices and gives REMOVE *SI *SO as an example, saying that these two are pointed NIL at power up. In 6.3.1 SI and SO are routed to KI and DO (DCB types 15H and 17H) and their DCBs are below 0231H, so REMOVE refuses them with Protected system device. REMOVE with nothing after it does nothing and returns 0000H without a message. A specification whose extension starts with a digit (B17) is shown without its slash and with the drive typed, while @OPEN looks for the name without the extension on every drive and REMOVE deletes the first it finds: REMOVE REPORT/1A:1 shows Removing: REPORT1A:1 and removes REPORT from the first drive that has it. An exclamation mark at the end of the line (B12) makes @FSPEC return a pointer one byte past the line's 0DH, so that REMOVE goes on with whatever an earlier, longer command line left in the buffer and takes any file specification there as one more to delete. A file refused for its access level is left open, which does no harm as nothing was written. The source marks as changes of 6.3.1 the store of the Stack Pointer before the BREAK test (2400H), BRKABT after the exits (2416H), ERREXIT (2421H) and the letters RS of RENDEV, LS in 6.3.0 (2536H).

Bugs (listed on the LS-DOS reference page): B64, a device routed directly to the device being removed gets its NIL bit but keeps its route bit and its vector to the cleared DCB, and the scan, which starts again from KI after each change, finds it again for ever: REMOVE hangs (24E4H); B65, the scan looks only for routes, so a device linked to the removed one keeps a link to a DCB of 00H bytes, and the next output through the link, the Removing: line itself when the video is linked, jumps to 0000H (24D3H); B66, FILESPC has 15 bytes, one too few for a full name and extension with a drive and an exclamation mark: the 0DH that ends the name falls on the FCB's first byte, so such a REMOVE stops with Illegal file name; typed with no drive and no password, the drive that FLOOP adds does the same to the open FCB, and REMOVE shows the Removing: line and stops with File not open (2483H).

Member 6: RENAME

Member 6 holds 524 bytes in four load blocks, 2400H-24FFH, 2500H-25FFH, the text Renaming: at 263FH-2648H and the word OLD_FIL at 2691H-2692H, and serves RENAME, which gives a file a new name and extension, or a device a new name. RENAM (2434H) gives the old name to @FSPEC twice, into TEMPFCB for an open and into OLDFCB, which keeps the text, and the new name into NEWFCB; @FSPEC passes over a TO between them. A new name that @FSPEC refuses, such as /OLD, is copied as typed, in capitals, by CVRTUC (2538H). With no new name RENAME asks Rename it to what? (2450H); an old name that is not a specification, or a file given with a device, gives Specification error (241CH). Every exit goes through SAVESP, which drops the stack to the depth of the entry (242DH): an error of the DOS is shown by IOERR with its short message and returned as its number (2411H), RENAME's own messages and BREAK return FFFFH.

For a file, the old name is opened with SFLAG$ bit 0 set, so that SYS2/SYS leaves out the access, open bit and record length checks (246CH); with no drive typed the open finds the file on the first drive that has it, and FLOOP adds that drive to OLDFCB (2479H). MATCH (255DH) gives the new name the parts it leaves out: the old filename in front of a new name that does not begin with a letter, then the old extension, drive and password, in that order, each inserted where the new name's own field would be. F2LOOP writes the old drive into the new name (249EH), and the new name is parsed again and opened on that drive: a file found there gives Duplicate file name (24B7H), which is also the answer when the new name with its defaults is the old file's own. REN2 shows Renaming: and both names without their passwords, but for the case of B67 (24BDH, MOVSPC 24E1H), and @RENAME (24DDH) opens the old file again, refuses an access level below RENAME with Illegal access attempted to protected file, writes the new name and extension into its directory entry and the new name's hash into the HIT.

A device (2502H) may be given only a device name. The old device must exist (Device not available), must not be one of the six system devices KI, DO, PR, SI, SO and JL, whose DCBs are 0208H-0237H, the last at 0230H (Protected system device, 251EH), and the new name must not be in use (Device in use, 252DH). @RENAME then writes the new letters into the DCB; routes, links, filters and settings stay as they were.

Against the manual: the manual says a drive given with the new name must be the old one's, or the rename aborts with an error message. F2LOOP writes the old drive over it without a message, so RENAME A/B:0 TO C/D:1 renames A/B on drive 0 to C/D (24A6H). The manual's examples hold: /OLD keeps the filename, REAL keeps the extension /DAT, REAL/ gives no extension (shown as REAL:0), TEST gives Duplicate file name, and the password of DATA/NEW.SECRET:1 is the default too: MATCH puts it after the drive (DATA/OLD:1.SECRET), and passwords never change, as SYS2/SYS copies only the name and extension. A new name that begins with a digit gets the old filename in front of it, so RENAME TEST/DAT TO 2 renames the file TEST2/DAT. A new name typed with a password and then a drive, NEW.PW:1, gets the old drive inserted before the password, and the Renaming: line shows both drives, NEW/DAT:0:1. CVRTUC copies the rest of the line, so words typed after a partial new name appear on the Renaming: line (SYS2/SYS cuts the name at its colon). The Renaming: line is shown before @RENAME runs, so it also comes before a refusal by @RENAME. A new name that exists with NO ACCESS protection is not found by the duplicate check whatever password is typed, since MATCH puts the drive before any password and both the check and SYS2's RENAME stop at the drive (File access denied there), and SYS2's own open of it then gives File access denied after the Renaming: line. When spaces follow an empty field of the new name, CVRTUC copies only the next word: RENAME TEST/DAT TO NEW: X renames the file X/DAT. B17 seen through RENAME: a new extension that starts with a digit is dropped by SYS2's open, so RENAME TEST/DAT TO NEW/1AB shows NEW1AB:0 (MOVSPC drops a slash before a digit), looks for NEW without an extension on every drive in the duplicate check and renames the file NEW; an old name with such an extension renames the file of that name without one. B12: an old name that ends the line with an exclamation mark makes @FSPEC return a pointer past the line's 0DH, so the new name is taken from whatever an earlier, longer command line left in the buffer. B14: a file named TO, ON, OVER or USING cannot be named to RENAME. The 0DH of NEWFCB in the file (25FFH) is never read, and OLD_FIL (2691H) is used by no instruction, in 6.2 and 6.3.0 as in 6.3.1. The source marks as changes of 6.3.1 the store of the Stack Pointer before the BREAK test (2400H), the jump to ABORT on BREAK (2407H) and the label ABORT (242AH); the 6.2 source's change log of 1983 records the Duplicate file name message, the password left out of the Renaming: line, the drive added to a partial new name and the slash of an empty extension left out, the messages moved before the Renaming: line, Device in use for a device name already in use, and the code reorganized with the BREAK clean up.

Bugs (listed on the LS-DOS reference page): B67, a new name typed with a colon and no drive after it, as NEW:, gets the old drive written over the byte after the colon: with no password in the old name that byte is the end mark, and the name runs on into the bytes left in NEWFCB by whatever ran before, which the Renaming: line shows up to the first byte below 20H; with a password in the old name it is the full stop MATCH put there, and the line shows the old password after the drive (RENAME PWF/DAT.PW TO NEW: shows NEW/DAT:0PW). The rename itself is right (24A6H). B68, CVRTUC stores no end mark after an opening parenthesis or after 32 characters, and MATCH's inserts move bytes along until they meet one: when none is left in NEWFCB (so after a DIR, or in cleared memory) the shift reaches OLDFCB and moves the old name, and for a new name that does not begin with a letter MATCH7 then inserts the old name's first letter for ever, filling memory until the system is destroyed: RENAME TEST/DAT TO /OLD(X), or even RENAME TEST/DAT (X), hangs the computer (2557H). B69, nothing cuts a completed field to its length: the old filename put in front of a new name that begins with a digit can make a name longer than 8 characters, and CVRTUC keeps a partial extension as long as it was typed; the duplicate check passes over the extra characters, but SYS2's RENAME takes the 9th character of the name or the 4th of the extension as the end of the specification, so RENAME TESTFIL/DAT TO 23 renames the file TESTFIL2 with no extension and RENAME TEST/DAT TO /TEXT renames it TEST/TEX (24DDH).

Member 7: DEVICE

Member 7 holds 1233 bytes in one run, 2400H-28D0H, and serves DEVICE, which shows the drives, the devices and the options of the system. Each part has a parameter in PRMTBL$ (289EH): DRIVES or D for the drives, on unless it is given as N; BYTEIO or B for the devices, off unless it is given; STATUS, or OPTION, or S or O, for the options and the resident system modules, on unless given as N. PRINT or P sends everything to the printer too. @PARAM does not check the kind of value, so any value other than 0 turns a part on. DEVICE keeps the Stack Pointer of its entry (2409H), and every exit after that goes through SAVESP (27B1H): 0000H when all was shown, FFFFH after BREAK, or the number of a DOS error after its short message (IOERR, 277AH).

The drive part (241DH) takes drives 0 to 7 and leaves out every drive whose DCT entry does not begin with C3H, the JP of an enabled drive. @CKDRV logs each drive on: for a diskette in the drive it reads the GAT and sets the DCT's cylinder count and number of sides. DEVICE then reads the GAT itself with @RDSSC into BUFFER at 2900H for the pack name; a drive with no diskette, or one whose GAT @CKDRV cannot read, shows No Disk in its place and the DCT values of the last diskette it saw. With the release's DCT and a write protected diskette a line reads :0 WP [LSDOS631] 5" Floppy #1, Cyls= 40, Dden, Sides=1, Step= 6ms, Dly=.5s (without the protection four spaces stand between :0 and the bracket): the drive, WP or two spaces (the Carry flag of @CKDRV, or DCT+3 bit 7 for a drive with no diskette), the pack name, the size (DCT+3 bit 5), Floppy or Rigid (bit 3), the low four bits of DCT+4 as a hexadecimal digit (the select bit of a floppy drive), the cylinders, DCT+6 + 1, by @HEXD (24DCH), doubled for a two sided hard drive. A hard drive's line ends with Removable or Fixed (DCT+3 bit 2); a floppy drive's line goes on with the density (DCT+3 bit 6), the sides (DCT+4 bit 5), the step rate from STPRAT$ by DCT+3 bit 5 and bits 1-0 (2526H), and for a 5.25 inch drive the delay after the motor starts, .5 s when DCT+3 bit 2 is set and 1 s when it is clear.

The device part (257BH) goes through the 31 DCBs, 0208H to 02F8H, and builds a line in STRBUF at 2A00H for each whose type byte is not 00H: an asterisk and the name, the I/O symbol of DCBDIR (2675H), made from the type byte as a space, < for input, = (or # for a filter), > for output and a space, and what the device points to. With the DCBs as BOOT/SYS loads them the lines read *KI <=  X'08F0', *DO <=> X'0B88', *PR  => X'0E01', *SI <=  *KI, *SO <=> *DO and *JL  => Nil. A routed device shows the device it is routed to, with that device's symbol, and so on along the chain (25A2H); a route to a file shows <=> and the file's name, extension and drive from @FNAME (2647H). A NIL device shows Nil. A linked device shows its link DCB, a vertical bar, the device it is linked to and an ampersand, and then whatever the link DCB holds, which is the device's old type and vector (25C4H): *DO <=> *L0|*PR & <=> X'0B88' after LINK *DO *PR. A filtered device shows in brackets the name of the filter's DCB, found through the word after the name in the filter module's header, or Inactive when that word points back at the DCB itself, as it does for the DCB that SET made before FILTER attaches it (25E6H). The last item of a line is the vector at +1 and +2, X'nnnn': the driver, or for a filtered device the filter module where its I/O enters first.

The status part (26AFH) shows Options: after an empty line and the name of every bit of DFLAG$ (006DH) that is set: Spooler, Type, Verify, Smooth, Memdisk, Forms, KSM and Graphic, bits 0 to 7, then Fast or Slow from SFLAG$ (007CH) bit 3. When @GTMOD finds the module SYSRES that SYSTEM (SYSRES=) puts in high memory (270EH), the line System modules resident: lists the number of every SYS overlay whose word in its table RESTAB$ has a high byte other than 00H. CKPAWS (2785H) ends each line and tests KFLAG$: BREAK ends DEVICE, the pause key (SHIFT and @) waits for a key, and any key but BREAK and the pause key goes on.

Against the manual (DEVICE, in the text): its syntax lists an N parameter, to set the non stop display, which PRMTBL$ does not have, so DEVICE (N) gives Parameter error; DEVICE never stops by itself at the end of a screen, only at the pause key. It does not list OPTION, another name for STATUS. Its sample display is that of version 5, without pack names, with the options line Options: Type, KI, JKL (KI and JKL are version 5 options that 6.3.1 never shows), and with SI and SO as Nil, which in 6.3.1 are routed to KI and DO. It says that a drive with no diskette keeps its DCT values, which holds; a diskette whose GAT @CKDRV cannot read is shown the same way, as No Disk with the old DCT values. Only when @CKDRV returns Z and DEVICE's own read of the GAT then fails (with B16, @CKDRV's failed read returns Z when the FDC status it saved is 00H) does DEVICE show GAT read error and end, without that drive's line, the drives after it, the devices and the options (244CH); the manual says nothing of this. A two sided hard drive is shown with twice the cylinders of its DCT. The copy of NOPACK$ takes 12 bytes for its 11 (2464H), harmless, as the extra I lands after the 03H. The source marks as changes of 6.3.1 the space routine OUTSP and ADDSPA, the routines GETPTR and GETPTR2 that replace five instructions (GETPTR) and four (GETPTR2, which had INC HL) in each of their places, the cylinder count by @HEXD in place of CVRTDEC, and the WP test that ORs DCT+3 bit 7 into the result of @CKDRV.

Bugs (listed on the LS-DOS reference page): B70, the route chain has no end test: after ROUTE *XX *YY and ROUTE *YY *XX on two NIL devices, DEVICE (B) adds the two names to the line for ever, the line runs on from 2A00H through the rest of memory and the system is destroyed (25B4H); output to either device would hang the system too, so DEVICE meets the loop when neither has been used since, or when one was made NIL before the cycle was closed (B74). B71, GETPTR2 steps with INC L, a 6.3.1 change, so a filter module whose DCB word lies on the last byte of a page (KSM/FLT starting at an address ending in F6H, CLICK/FLT in F5H, FORMS/FLT in F7H) has its DCB read from the wrong place: the filtered device's line (or, before FILTER, the filter's own DCB's) shows a false name in brackets, or a line cut short, in place of the filter's DCB or Inactive (269BH). B72, MOVNAM leaves out a second letter only when it is 00H, but a one letter device name, set by SET, ROUTE or RENAME, has 03H there, and @DSPLY ends the line at it: the device's line shows only its name, without a carriage return, so the next device's line runs on after it; a device routed or linked to it shows its line only up to that name (26AAH). B73, LINOUT tests only the low byte of the PRINT value and BYTOUT the whole word, so P=256 (or any value whose low byte is 00H) prints the single characters and not the strings: the printout has the colons, digits and brackets of the lines but not the texts (275AH). B74, LOGRTE follows the route bit of the device routed to without testing its NIL bit, which @CHNIO tests first, and ROUTE (NIL) keeps the route bit of a routed device: after ROUTE *AA *SI and ROUTE *SI (NIL) the line of AA shows *AA <=  *SI <=  *KI, a route no I/O takes, and after ROUTE *XX *YY, ROUTE *XX (NIL) and ROUTE *YY *XX the I/O stops at the NIL device XX while DEVICE (B) loops as in B70 (25B2H).

Member 8: ROUTE

Member 8 holds 424 bytes in four load blocks, 2400H-24FFH, 2500H-25A5H and the single bytes 25C5H and 25E5H, the first bytes of two FCB areas, and serves ROUTE, which sends the I/O of a device to another device or to a file, or makes it NIL, and makes a new device when the name is not yet in the table. ROUTE1 (242DH) takes the source, which must be a device, and the parameters NIL (or N) and REWIND (or R) of PRMTBL$ (2584H), which @PARAM reads after the source and again after the destination (after the source only when the destination follows the closing parenthesis without a space, or NIL ends the line); NIL is tested before a destination is read (244DH). ROUTE keeps the Stack Pointer of its entry (2400H), and every exit goes through SAVESP (2426H): 0000H when the route was made, FFFFH after Device spec required or No memory space available, or the number of a DOS error after its short message (IOERR, 240EH). Unlike most members of 6.3.1, ROUTE does not test BREAK at its entry.

A device destination (246DH) must exist (Device not available) and must not be the source itself (Device spec required). CKSRC (250DH) finds the source's DCB, or the first spare DCB for a new name, and CLSFILS (2539H) closes the file at the end of the source's old route, if it has one. With the interrupts off, CKDCB1 (2486H) then writes the destination's DCB into the vector at +1 and +2, keeps the low three bits of the type (GET, PUT and CTL) with the route bit 10H, and writes the name into +6 and +7; when the device was not routed before, its old type and vector go into DCB+3 to +5, where RESET finds them. After ROUTE *PR *DO the DCB of PR holds 16H, 0210H (DO's DCB), 06H, 0E01H (the printer driver) and PR, and @CHNIO follows the vector to DO.

A file destination (24ADH) gets a route module in high memory: a header of 14 bytes (RTEDVR, 2597H: a JR to itself, the word of its last byte, the name length 5, the name RTE with the source's two letters, RTEPR for PR, and two words 0000H), the 32 byte FCB after it and a buffer page above, 302 bytes in all, taken below HIGH$ (No memory space available when HIGH$ is frozen), and HIGH$ is set below them (24FAH). A module of the same name that @GTMOD finds in memory is used again in its place, and HIGH$ is left alone. @INIT opens the file, or creates it on the first drive with room, with the LRL 256 (24D9H), and @PEOF moves it to its end unless REWIND was given (24DEH), so the routed data is added to what the file holds. The header and the open FCB are copied into high memory (2503H) and the source is routed to the FCB: @CHNIO sends the I/O of a routed device on to its vector, and that of an open FCB (type bit 7) to @BYTEIO. The file stays open until a RESET of the device, or a later ROUTE of it (CLSFILS), closes it.

ROUTE (NIL), NILDCB (2528H), goes through CKSRC too, so a file the device was routed to is closed, and then only ORs the NIL bit 08H into the type and writes the name: a routed, linked or filtered device keeps its other bits and its vector, which RESET restores later, while @CHNIO, which tests the NIL bit before the route, link and filter bits, throws its output away and answers a request for input at once with Z and the type byte in Register A. A new name becomes a NIL device of type 08H.

Against the manual (ROUTE, in the text): the parameters may follow the source as well as the destination, but after the source a space before the destination gives Device spec required, as @PARAM leaves Register Pair HL after the closing parenthesis and @FSPEC stops at the space (ROUTE *PR (R) TO LOG/TXT fails, ROUTE *PR (R)TO LOG/TXT works); and a NIL given after a destination is read and ignored, so ROUTE *PR *DO (NIL) routes PR to DO. NIL and REWIND may be shortened to N and R, which the manual does not say. @PARAM does not check the kind of value, so NIL=5 counts as NIL, while only a REWIND value whose high byte is FFH (REWIND, R, REWIND=Y) counts as REWIND, and REWIND=1 does not (24E1H). A device routed to itself gives Device spec required; only that direct case is refused, so two devices can be routed to each other (B70, B78). The manual says ROUTE uses again a previously installed but currently unused module of an earlier ROUTE of the same device; it uses one again also while its device is still routed to the module's file (B75), and never for a device with a one letter name (so B75 cannot happen to one), whose module name @GTMOD counts as 4 characters against the 5 of the header (24B3H), so each ROUTE of such a device to a file takes another 302 bytes. Nothing compares the space below HIGH$ with LOW$, and the result of @HIGH$ is not tested (24FDH). CLSFILS closes the file wherever the route chain ends, also when it is another device's route: after ROUTE *DU TO LOG/TXT and ROUTE *PR *DU, ROUTE *PR *DO closes LOG/TXT while DU stays routed to it and goes on writing through its own FCB in high memory, which still shows the file open, since CLSFILS closes a copy (254EH); a RESET *DU closes the file again. An error of @PEOF after @INIT ends ROUTE with the file left open (24ECH), and an error of @CLOSE in CKSRC comes after a new file was opened and its module installed, which stay (B76); NILDCB does not show an error of @CLOSE at all (B77). The response bytes of PRMTBL$ are never read. The source has no change marked for 6.3.1, and 6.2 (whose change log ends in October 1983) and 6.3.0 have the same code.

Bugs (listed on the LS-DOS reference page): B75, INITFCB uses again the module of a device with a two letter name that is still routed to a file: the new file's FCB is copied over the old one's before CLSFILS closes the file at the end of the route, which by then is the new one, so the first file is never closed: after ROUTE *PR TO LOG1/TXT and some printing, ROUTE *PR TO LOG2/TXT leaves LOG1/TXT with the end of file it had before its route, and the last bytes routed to it, still in the buffer, are lost (24B5H). B76, for a file the module is put in high memory and the file opened before CKSRC looks for a DCB; when a new name finds none spare, or the close of the file of the device's old route fails, ROUTE ends with the error and leaves the new file open and the 302 bytes taken (251FH). B77, NILDCB does not test the result of CKSRC, so an error of @CLOSE goes unseen, and when a new name finds no DCB spare it works on 0200H, the address @GTDCB returns with its error, ORs 08H into BUR$, writes the name over DVRHI$, the next free byte of the low memory driver zone, and returns 0000H without a message (252BH). B78, CLSFILS has no end test: once a chain of routes closes on itself, a ROUTE of any device on the cycle or routed into it, (NIL) too, goes round in CLSFILS for ever and hangs the computer (2542H).

Member 9: LINK

Member 9 holds 170 bytes, 2400H-24A9H, in one load block, and serves LINK, which joins two devices: output sent to the first is sent to the second as well, and input asked of the first may come from the second when the first has none. @FSPEC reads both specs (2400H); each must be a device and the two names must differ (Device spec required, FFFFH). @GTDCB then finds a spare DCB for the link (No device space available, error 33), the destination and the source (Device not available, error 8) (2425H); no DCB is written until all three are found. LINK keeps no Stack Pointer, tests no BREAK and returns with RET from every exit: 0000H when the link was made, FFFFH after its own message, or the error number after its short message (IOERR, 2481H). Its source has no 631 change.

With the interrupts off (2448H) the source's vector becomes the spare DCB's address and its type keeps only bits 2-0 (CTL, PUT and GET) with the link bit 20H; the spare DCB becomes the link DCB: the source's old type and vector at +0 to +2, the destination's DCB address at +4 and +5, +3 left for @CHNIO, which keeps the direction of a request there, and a name that a @GTDCB loop finds free, L0 first, then L1 and on (246FH). @CHNIO (0689H) sees the link bit, runs the request through the link DCB, that is through whatever the source was before (a driver, a route, a filter, a file or NIL), and then goes on to the destination's DCB (06B6H): for output only when the first device returned Z (an error ends the request there, so after LINK *PR *DO with the printer off line the video gets nothing), and for input only when the first device returned NZ with no character. LINK takes a link DCB as either device (LINK *DO *L0), so a link DCB can be the destination of another link (B83). After LINK *DO *PR on a system with no other devices, DO's DCB (0210H) holds 27H and 0238H, and the link DCB at 0238H holds 07H, 0B88H (the video driver), 00H, 0218H (PR's DCB) and the name L0; DEVICE (B) shows *DO <=> *L0|*PR & <=> X'0B88'.

Against the manual (LINK, in the text): the manual cautions that several links to the same devices can make endless loops and lock up the system; LINK tests only that the two names differ, so such a cycle is made without a word (B79). Linking a device to a NIL device works for output (the NIL device does nothing; the manual's phantom device is a device routed to a file). For input a NIL device on either side answers: @CHNIO answers an input request to a NIL DCB with Z and the type byte in Register A (06BEH), which the link path takes for a character, so a linked device whose own old type was NIL never asks the destination, and a NIL destination answers whenever the source has no character: after LINK *KI *JL the keyboard returns 0AH, JL's type, again and again while no key is pressed. In 6.3.1 only RESET of a device or a reboot un-links it: there is no global RESET, which the manual's LINK text still names. ROUTE of a linked source keeps only bits 2-0 of its type with the route bit, as for any device, so the link is cut, as the manual says; ROUTE keeps the old type and vector at DCB+3 to +5, and the link DCB stays named and in use.

Bugs (listed on the LS-DOS reference page): B79, LINK compares only the two names, so a device can be linked to one that is already linked or routed back to it, the cycle the manual warns of: after LINK *DO *JL and LINK *JL *DO the line feed that begins LS-DOS Ready goes round DO and JL for ever: the screen scrolls blank lines, the prompt never comes back, and only a reset gets out (2423H). B80, the link names are L and the next free character from the digit 0 up; past L9 come L:, L;, L<, L=, L>, L? and L@, which no command can name, as @FSPEC ends a device spec at a character that is not a letter or digit, so such a link can be undone only by a RESET of its source or a reboot (2476H).

Member 10: RESET

Member 10 holds 394 bytes, 2400H-2588H and the single byte 25A8H, the first byte of an FCB area, and serves RESET, which takes one spec. RESET keeps the Stack Pointer of its entry and tests BREAK (2400H, a 6.3.1 addition); every exit goes through SAVESP (2425H): 0000H when the reset was done, FFFFH after Device spec required or BREAK, or the number of a DOS error after its short message (IOERR, 2411H). RESET1 (242CH) lets @PARAM read the parameters LRL (or L) and DATE (or D) of PRMTBL$ (2562H) when an opening parenthesis is on the line, then reads the spec with @FSPEC: RESET alone gives Device spec required, as 6.3.1 has no global reset.

A device (2450H): CLSFILS (24ECH) follows the device's routes and closes the file at their end, through a copy of its FCB; then, with the interrupts off, FIXDCB (2508H) takes off one route, link or filter after another until none is left: a route by bringing back the type and vector ROUTE kept at DCB+3 to +5, a link by bringing back the link DCB's +0 to +2 and clearing the link DCB, a filter by swapping back the first three bytes of the device's and the filter's DCBs (the filter's DCB is the word after the filter module's name), or, when that DCB is the device's own, by bringing back +3 to +5. An @RENAME of the device to its own name then tells a system device (error 40) from one of the user's (error 19): the user's device becomes NIL with type 08H, keeping its name, so that REMOVE can remove it; a system device loses its NIL bit (247CH), unless its vector is 0000H, so that RESET *SI and RESET *SO make SI and SO NIL devices, not the routes to KI and DO they are at start-up (their DCB+3 to +5 in BOOT/SYS hold 0DH or 0FH and 0000H).

A file (RESFIL, 2480H): @OPEN with SFLAG$ bit 0 set, so that the file's open bit is neither tested nor set; READ or EXEC access gives error 37 (NO ACCESS gives error 25 at @OPEN); on a write protected diskette the test passes and the close or the @DIRWR then gives error 15. With no parameter the file is closed with close authority, which clears its open bit, the ? that DIR shows. LRL=n (6.3.1) writes the low byte of n into DIR+4 (0 for 256); DATE=OFF writes 4296H, the hash of a blank password, into DIR+18 and DIR+19, the old user password field that 6.3 uses for the time and the new style year; DATE=ON also closes the file as written, so that @CLOSE puts in the date, the MOD flag and, on a diskette dated in the new style, the time. The entry is read with @DIRRD and written back with @DIRWR (24B7H, 24EAH); the FCB opened for it is left open, which leaves nothing on the disk.

Against the manual (RESET, and the LS-DOS 6.3.0 to 6.3.1 update): there is no global reset, and RESET *SI or *SO does not restore their start-up routes (above). The parameters may follow a device spec too and are then not used; LRL given as a flag or a string, or DATE as a number, is ignored without a message, and a LRL above 255 is taken modulo 256. With LRL or DATE=OFF the open bit is left as it is. After DATE=OFF on a diskette dated in the new style, DIR, which takes the style from the drive (YFLAG$) and not from the file, shows the file's year as 1982 and its time as 6:50p (18:50 with the 24 hour display), read from the 4296H, for an entry whose date is set. CLSFILS is the routine of ROUTE, with its fault (B81), and it does not follow a link (B82).

Bugs (listed on the LS-DOS reference page): B81, CLSFILS has no end test: once two devices are routed to each other, RESET of either of them, the command meant to undo routes, hangs the computer (24F5H). B82, CLSFILS follows only routes, so after ROUTE *PR TO LOG/TXT and LINK *PR *DO (or a FILTER of PR), RESET *PR finds nothing to close; FIXDCB then brings the route back from the link DCB and takes it off, and LOG/TXT is left open: what was printed to it is lost (24F9H). B83, FIX1 clears the link DCB even when another device is linked or routed to it, whose I/O then jumps to 0000H as in B65 (2533H). B84, RESET file (LRL=n,DATE=ON) sets the date but loses the new LRL: @CLOSE reads the entry from the disk again before the final @DIRWR (24E4H). B85, after a route of a device that LINK has moved into a link DCB, FIXDCB brings back DCB+3 to +5, which a ROUTE after the LINK has overwritten with the linked type and the link DCB's address: after ROUTE *PR *DO, LINK *PR *XX, ROUTE *PR *YY and RESET *PR the printer's DCB ends as 00H and 0000H, and printer output is dropped until a reboot (2536H). B86, FIXDCB finds no bit on a link DCB or on the DCB of an active filter, so RESET of one of them makes it a NIL device, and the device that leads to it loses its I/O: after LINK *DO *PR, RESET *L0 stops the video, and a later RESET *DO leaves DO with type 00H until a reboot (2471H). B87, CLSFILS does not test the NIL bit, so after ROUTE *PR TO LOG/TXT and ROUTE *PR (NIL), which closes the file, RESET *PR closes it a second time through the stale FCB in high memory, putting back its old end of file (24ECH). B88, two filter modules whose DCB words name the same DCB make FIXDCB swap it back and forth for ever with the interrupts off (2560H).

Member 11: FILTER and SET

Member 11 holds 429 bytes, 2C00H-2DACH, and serves FILTER (request 66H, entry 2C00H) and SET (request 65H, entry 2C03H). It is the one member that loads at 2C00H, not 2400H: the source's note says it is put there so that a driver or filter program SET loads at 2400H does not overwrite it. Its three 32 byte spec areas, SAVSPEC, DEVFCB and PGMFCB, follow it at 2DADH-2E0CH and are not in the file, so a program SET loads must keep clear of 2C00H-2E0CH. Neither command keeps its Stack Pointer or acts on BREAK (a BREAK still pending under SET reaches the program: FORMS then refuses with FFFFH); every exit returns from the entry's depth: 0000H after a FILTER (EXIT, 2D35H, clears BREAK), FFFFH after one of the messages, or the number of a DOS error after its short message (IOERR, 2D11H). The source is the same text in 6.3.0, and the 6.2 source differs only in its comments.

SET refuses to work while HIGH$ is frozen (CFLAG$ bit 0: No memory space available), even for a program that would install itself in the low I/O zone (B93), reads a device spec into DEVFCB and a file spec into PGMFCB, keeps a copy of the file spec as typed and gives PGMFCB the extension /FLT when it has none. The device (2C3EH) must be new or a NIL device of the user's: one in the table that is not NIL gives Device in use (error 39), and a NIL one is tried with an @RENAME to its own name, the trick RESET uses, so that a system device gives Protected system device (error 40); a new name takes the first spare DCB, or gives No device space available (error 33). @LOAD then reads the program (2C68H), with SFLAG$ bit 2 set, as @RUN sets it, so that a file of EXEC protection can be loaded; when the /FLT file is not there (Program not found) the copy is tried with /DVR. Only now is the DCB written, with the interrupts off (2C92H): type 08H, 08H at +3 (the source: show RESET as NIL), and the typed name at +6 and +7. SET puts the program's transfer address on the stack, sets CFLAG$ bit 3, the system request bit that the FORMS, KSM and CLICK sources test before they install (else Must install via SET; SYS1's CLEANUP clears it on every @EXIT and @CMNDI), and returns into the program with Register Pair DE = the DCB and Register Pair HL = the parameters after the file spec. The program writes the DCB's type and vector itself and returns to SET's caller with its own return code.

FILTER (2CB2H) takes two device specs, the device to filter and a filter device, a DCB that SET gave a filter module (SET *FF FORMS, then FILTER *PR *FF). The filter's DCB must have the filter bit, bit 6 of its type (else Device is not a filter), and the DCB word of its module, the word after the module's name (the module + 5 + the name's length, as RESET and DEVICE read it), must point back at that DCB (else FILTER module is in use); the test reads the module that the named DCB's vector leads to now (B89). Then the first three bytes of the two DCBs, the type and the vector, are swapped (2D00H): the device's I/O goes into the filter module, and the filter's DCB holds the device's old type and vector, where the module passes the I/O on. RESET of the device swaps them back.

Against the manual (SET and FILTER, written for versions 5 and 6): the manual gives /DVR as SET's default extension; the code tries /FLT first, so with both X/FLT and X/DVR on the disks SET *XX X loads the filter. The manual says that SET destroys any earlier filter, route, link or set of the device and shows SET *KI INKEY and SET *PR RS232x: 6.3.1 sets only a new device or a NIL device of the user's, so both examples give Device in use, and a driver goes on a new name (the manual's Model 4 example, SET *CL COM/DVR). The global reset the manual names does not exist. FILTER's version 5 form, with a filter program file as the second spec, gives Device spec required; FILTER with one spec gives File spec required. A program that refuses to install (FORMS: a BREAK still pending, or Filter already attached to the DCB its resident module serves) leaves the DCB a NIL device with the typed name, which REMOVE or another SET can take. FILTER tests nothing about the device to filter: a routed, linked, NIL or already filtered device is filtered alike, and FILTER *FF *FF swaps a DCB with itself and does nothing. The swap runs with the interrupts on, where SET, ROUTE, LINK and RESET write a DCB under DI; the type-ahead task of BOOT/SYS does not go through a DCB (at KIHOOK, 0B39H, it calls KISCAN at 0983H directly), so this matters only for a background task that does I/O through @CHNIO on that device. Under @CMNDR, CFLAG$ bit 3 stays set after SET until the caller's @EXIT or a @CMNDI, as only SYS1's CLEANUP (1E7CH) clears it; a filter run directly in that time takes the bit for SET's and installs itself on whatever DCB Register Pair DE holds. FILTER of a routed device makes the route unseen by RESET's CLSFILS, so RESET then leaves its file open (B82).

Bugs (listed on the LS-DOS reference page): B89, FILTER's two messages are swapped: once a filter is put on a device that was not filtered before, the filter's DCB holds the device's old type, without the filter bit, so after FILTER *PR *FF the command FILTER *DO *FF gives Device is not a filter, while FILTER *DO *PR, naming the filtered device as the filter, gives FILTER module is in use (2CDBH). B90, when the second load fails, IOERR gets the error number with @LOAD's bits 7 and 6 still set, so SET returns 00DFH for every Program not found (a spec typed with an extension is tried twice as it is) instead of 001FH, and C0H more than the number for any other error of that load; the message shown is the right one, and only a caller through @CMNDR sees the code (2C8FH). B93, SET refuses while HIGH$ is frozen even when the program would install in the low I/O zone, as FORMS can (2C06H; Limit). B94, SET takes any NIL device of the user's, also the DCB of a filter in use whose device was NIL: after FILTER *XX *F1 (XX NIL) and SET *F1 with a second filter, or with the same one again, the filter chain leads back into itself and the first byte sent to XX recurses through @CHNIO until the stack overruns memory, which widens B88 (2C5CH). B95, SET writes 08H over the whole type of the NIL device it reuses, so a link or filter bit that ROUTE (NIL) left in it is lost and its link DCB or filter DCB is orphaned: RESET can no longer undo them, and the filter DCB keeps the device's old type for good (2C97H). B96, FILTER does not test the device to filter, so FILTER *F2 *F1 with two unused filter DCBs leaves each leading into the other's module, and any byte sent to either recurses without end (2CFEH).

Member 12: LIST

Member 12 holds 955 bytes, 2400H-27BAH (its header: request 41H, entry 2400H, record 29H byte 88H, file offset 2988H), and serves LIST, which shows a file on the video or, with P, prints it, as text or in hex. A BREAK pressed before the command ends it at once (2400H); then the Stack Pointer is kept, and every exit goes through SAVESP (2410H), which clears BREAK: 0000H at the end of the file, FFFFH after File spec required or BREAK, or the number of a DOS error after its short message (IOERR, 2417H). The work areas lie after the member: BYTCTR, the column counter (27BBH), LINBUF (27BCH-27CBH), FCB1 and FCB2 (27CCH-280BH) and the file's buffer IOBUFF (2900H-29FFH). The 6.3.1 source marks the page pause and NS as additions; 6.3.0 had neither, and N was short for NUM.

LIST (242DH) lets @PARAM read PRMTBL$ (2773H) when an opening parenthesis is on the line: ASCII8 or A8, LINE, NUM, NS (or N), HEX (or H), REC (or R), LRL (or L), P and TAB (or T). The spec, which may not be a device, is opened with /TXT when it has no extension and, when that file is not in the directory, as typed, so that a name without an extension is looked for with a blank one, as the manual says. The file is opened with record length 256 and SFLAG$ bit 0, so that its open bit is neither tested nor set. The record length used is LRL=n or the file's own, read from DIR+4 of its directory entry with @DIRRD, whose result is not tested (248BH); it goes into FCB+9 with bit 7 of FCB+1 set, for the ASCII listing as well, where it has no effect: only @POSN reads them. LRL uses only the low byte of its value (LRL=300 lists records of 44 bytes). TAB sets the width of the tab stops: TAB=n from 1 to 32 (modulo 256), TAB or TAB=ON 8, TAB=OFF no expansion, and 8 by default; any other width gives Parameter error, with HEX too. P turns PUTOUT's @DSP into @PRT and the page pause off.

The ASCII listing (24EFH) passes over LINE - 1 lines, each ended by a carriage return, numbers the lines with NUM in the form 00001 (CVTDEC's blanking of leading zeros looks at the place before the first digit, 275AH, which holds the carriage return of SPCREQ$, so it never blanks one, and the result is the form the manual shows), clears bit 7 of each byte unless ASCII8 is given (a byte 8DH is then sent as 0DH, but does not end LIST's line: B97), and expands each tab with spaces to the next multiple of the width, counted from BYTCTR, the column of the screen or the printer. At each new line, and after each byte with bit 7 set, CKPAWS (26C7H) tests BREAK and SHIFT-@, the pause: the listing then waits for a key, and BREAK ends it. The end of the file sends one more carriage return, so a file whose last line ends with its own carriage return is followed by an empty line, and returns 0000H. The lines passed over for LINE are read without a BREAK test. NUM's 7 columns count toward the tab stops, and with P the column still wraps at 80, so tab stops after column 80 are counted from column 80.

The hex listing (258DH) positions the file to record REC with @POSN and shows each record by lines of 16 bytes: a space, the record number in 4 hex digits, a colon, the offset in 2, an equals sign, the bytes in hex with an extra space after the eighth, and then the bytes as characters (a full stop for one below 20H or above 7EH) on the same line, 79 columns in all. A blank line (one space) follows each record. A record length of 0 means 256. NUM, LINE, ASCII8 and TAB are not used. A REC at the end of the file gives End of file encountered and one past it Record number out of range, from @POSN, with that error as the return code; at the end of the reading the same two errors are the normal end.

The page pause (2689H, a 6.3.1 addition) sits in PUTOUT, which counts a line each time the column counter comes to 0: after a carriage return or a line feed, and after the 80th column, where the screen line wraps. Unless NS or P put a value other than 0000H into SPARM+1, the listing pauses after 23 lines in the ASCII listing and 17 in the hex one, a record of 256 bytes and its blank line, and @KEY waits: BREAK ends the listing, C or c turns the rest of it to non-stop (the code stores Register Pair DE, which @KEY returns as 0208H, the keyboard's DCB, over the 0000H), and any other key shows the next page; after any key but BREAK the hex listing clears the screen with @CLS (the ASCII listing has turned its RST 28H into a NOP). The carriage returns sent at BREAK and at the end of the file are counted too (B98). A file with a line feed after each carriage return counts two lines for each of its lines, one for each of the two.

Against the manual (LIST, and the LS-DOS 6.3.0 to 6.3.1 update): the manual says the LRL parameter is valid only with HEX, and in effect it is, though LIST puts it into the FCB for the ASCII listing too. Its hex sample is the two line form of version 5; the Model 4 shows the characters on the line of their bytes. The manual gives 16 lines of hex a page; the code counts 17 with the blank line. The update says only ENTER resumes a pause; the manual's key C works too. Findings, not bugs: in the hex listing BYTCTR, after the member, is not set to 0 before the first line, so the first page may count a line too many; after line 99999 INCNUM's carry runs on into SPCREQ$; LINE given as a flag (no value) is 65535.

Bugs (listed on the LS-DOS reference page): B91, LINE=n is counted down after one is taken off, so LINE=0 (or LINE=N, NO, OFF or an empty value, all 0000H) passes over 65535 lines, without a BREAK test: on any shorter file LIST shows End of file encountered instead of the file, and returns error 28; so does a LINE more than one past the last line (24F2H). B92, the hex listing shows the heading of each line before it reads the line's first byte, so a file whose end falls on the end of a hex line (the bytes of its last record a multiple of 16, as in any file of whole 256 byte sectors listed with its LRL of 256) ends with an extra line such as 0000:10 = with no bytes (2634H, 2647H). B97, after a byte with bit 7 set CKPAWS returns with Register A changed, so without ASCII8 a byte 8DH is sent as a carriage return but does not end LIST's line: with NUM the next screen line has no number (2568H). B98, the carriage returns sent at BREAK (GOTBRK) and at the end of the file (GOTERR) go through the page count, so a BREAK on the last line of a page, or a file that ends on it, first waits at a page pause (257AH, 26EDH). B99, the INCNUM after each record (2644H), meant for decimal line numbers, carries over every hex digit 9 to F, so after record 9999H it reaches the space before the record number, which @HEX16 does not write, and the headings read 1999A, 2999B and on (cosmetic).

Member 13: DO

Member 13 holds 1679 bytes in ten load records over five ranges, 2400H-298BH, 29DDH-2ACDH, 2B6EH-2B70H, 2B90H-2B9DH and 2E00H (its header: request 91H, entry 2400H, record 2DH byte 56H, file offset 2D56H), and serves DO. It is the compile half of the Job Control Language: it reads a JCL file, writes the compiled lines into SYSTEM/JCL, and hands that file to SYS11/SYS, which runs it line by line as if the lines were typed. The gaps between the load blocks are its work areas: DOFCB, the token and value buffers and LBLSAV (298CH-29DCH), the five //INCLUDE save areas (2ACEH-2B6DH), the levels of nested //IFs (2B71H-2B8FH), the line buffer JCLBUF1 (2B9EH-2BEDH), and the two file buffers INPBUF and OUTBUF (2C00H-2DFFH). The symbol table begins with the 00H at 2E00H, the member's last byte, and grows upward. The 100 bytes of entry code at 2400H-2463H run once; from then on they are the buffer of the compiled line. The source is ls631rst\DISK2\lbdo.asm; 6.3.0 (ld4630m1\disk4) is the same text without the 6.3.1 lines: the drive search, DOFEXT, DOLDIR and NIOERR, and the Level 1G routine P631G1 with the message Bad JCL format, process aborted (6.3.0: Invalid JCL format, processing aborted).

The entry (2400H) keeps the Stack Pointer for SPSAV (2981H), through which every error returns, and looks at the first character after DO and its spaces. An asterisk (DO *) puts SYSTEM/JCL into JFCB$ (00C0H) and runs it; an equal sign (DO = spec) reads the spec straight into JFCB$ and runs that file without a compile; a dollar sign (DO $ spec) compiles without running. Otherwise the spec is read into DOFCB, given /JCL when it has no extension, and opened with SFLAG$ bit 0, so that the file's open bit is neither tested nor set. The 6.3.1 search then takes the first drive, 0 to 7, that @CKDRV finds ready and not write protected (Can't create SYSTEM/JCL file when there is none), P631G1 (2AACH) writes its digit into the name, SYSTEM/JCL:d, and @INIT opens or creates that file through JFCB$ with the buffer OUTBUF; any error of @INIT shows the same message, its number dropped. After the compile CPLFIN (24BDH) closes SYSTEM/JCL and, for DO $, returns 0000H. CPLFIN1 (24CCH) opens the JCL to run with SFLAG$ bit 0, makes the page of SBUFF$ (1D00H) its buffer, since the member's own buffers are about to be overwritten, and sends request 9DH, SYS11's function 1. SYS11 sets SFLAG$ bit 5, points @EXIT at itself, sets the Stack Pointer to STACK$ (0380H) and runs the first line by @CMNDI: DO never returns, so a program that sends DO through @CMNDR does not get control back, as the manual says of BASIC. SYS11 also does what the manual says of a non zero @EXIT code, the abort of the JCL, which SYS1 does not (section 7.3 of the knowledge file asked where it was).

The parameters (PARSINP, 2464H; PARAM, 250FH) come between parentheses after the spec; spaces and commas between them are passed over, a closing parenthesis may be left out at the end of the line, and more than one group may follow. Each is a token of up to 8 characters, put into the symbol table with an empty value, or a token with an equal sign and a value of up to 32 characters, or a label marked by an at sign, kept in LBLSAV; a token given twice is Multiply defined Parameter error, and a second label Too many Proc labels. A semicolon asks for a continuation line with a question mark, read by @KEYIN into the command buffer (247FH) and parsed the same way, and it may end with another semicolon. With a label TSTLBL (2556H) reads the file's lines until one begins with the at sign and the label's name (FNDPRM compares the names up to the end of the line's label, 8 characters at most) and starts the compile after it; without one the compile starts at the first line. Either way it ends at the next label line or the end of the file, as the manual says.

The compile (CPLJCL, 258CH) reads each line into JCLBUF1 with RDJCL (266FH), which counts it in LINENO and refuses a line of 80 characters with Line too long; the compiled line is built at 2400H. A line that begins with two slashes goes to MACRO (2641H): //IF, //ELSE and //END act in every block, so that nested blocks are counted; //SET, //RESET, //ASSIGN, //INCLUDE and //QUIT act only where the state is true; any other name, an execution macro such as //PAUSE or //STOP, or a //. comment, is compiled as a line. In a line, #token# is replaced by the token's value and ## gives a number sign; %xx gives the byte of two hex digits and %% a percent sign. The compiled line is written to SYSTEM/JCL by WRCPLD when the state of the current //IF level is true (TSTCOND, 26A0H); a //. comment is shown at once and not written. //IF (2718H) evaluates from left to right, a token true when it is in the table: a false term before an ampersand makes the whole false, a true term not followed by an ampersand makes it true, which matches the manual's rules; the new level is the result ORed with the level around it. //ELSE turns the level over and //END drops it; either at the first level is Bad JCL format. //RESET writes a space over the token's first character, which then never matches; //ASSIGN needs an equal sign. //INCLUDE (27B7H) keeps the current file's FCB in one of five save areas, reads the included file with the same buffer, and UNNEST (2492H) takes the outer file back at the included file's end or label line and reads its sector again with @RREAD. //QUIT shows and logs its own line and ends DO. Every format error of the compile shows Line nnnnn, an arrow and the line as read (BADHDR, 262CH), then Bad JCL format, process aborted (Line too long for a line of 80 characters), and returns FFFFH; Symbol string too long, Too many nested INCLUDEs and Too many Proc labels show only their message, and a DOS error of @GET, @PUT or @RREAD shows its short message and returns its number.

The fields are read by PARSER (2837H): the digits, the letters, made capitals, and the full stop, slash and colon; between double quotes any character, the quotes dropped. Any other character ends the field and is passed over; characters past the field's length are read and dropped. FNDPRM, the member's own table search (28E6H), stops comparing at a character of the name that is not a letter or digit, so a name with a full stop, slash or colon finds an earlier entry that ends where that character is (A.B finds A when A is already in the table; otherwise it is a token of its own), and //IF-A tests A, since the minus ends the macro's name and is passed over with it. A value of //ASSIGN or of the DO line may hold a substitution; its letters are made capitals unless quoted, where the manual speaks of upper or lower case. PARSER always returns with Register B = 00H, and XFRSTR calls it again after a separator that is not a space, comma, equal sign, parenthesis or the carriage return, and after a substitution, with Register B as it was left, so the rest of the value is read and dropped: A=1-2 gives 1, and #F#x gives F's value alone (B109). A compile macro takes one separator between its name and its argument: //SET followed by two spaces and A, or //IF or //INCLUDE so written, is Bad JCL format.

Against the manual (DO and the Job Control Language chapter, and the 6.3.0 to 6.3.1 update): the drive search is as the update describes. The manual allows ten nested //INCLUDEs; the code has room for five and gives Too many nested INCLUDEs at the sixth. A //INCLUDE whose file is not found gives Bad JCL format, not File not in directory. DO $ followed by two spaces gives File spec required (only one space is passed over after the dollar sign; any number after the equal sign). As the manual says, a control character typed with no space after DO is ignored, as SYS1's @PARSER passes over it as the name's separator: DO=X and DO$X compile and run X. A semicolon straight after the spec (DO X;) asks for nothing, for the same reason; it works after a space or a closing parenthesis. DO = X (@L) is not refused, though the manual says a label needs the compile: the parameters are never read, and a label line in the file reaches SYS1 as a command. The manual's warning that a file that begins with a label runs the old SYSTEM/JCL holds: a compile that writes no line leaves the file's old end of file, as @CLOSE moves it only after a write. Findings, not bugs: a byte 00H in the JCL file is taken as its end, and a last line without a carriage return is dropped; LINENO counts the lines of included files and of the label search too, and one more at the end of each included file, so an error after an //INCLUDE shows a number above the line's place; a token not given, or given without a value, is left as #token# in the compiled line; substitutions and hex values are checked in false blocks too, except in lines that begin with two slashes, so an error there aborts; an //IF left open at the end is not reported; a %0D in a line ends it at that point for WRCPLD, and the rest is lost; a compiled line longer than 79 characters is cut to 79 when SYS11 reads it with @KEYIN, at least for the first line (GETLINE; the later lines are for the SYS11 pass); FINDLBL's path for an open //INCLUDE (256DH) is never taken.

Bugs (listed on the LS-DOS reference page): B105, DO * opens SYSTEM/JCL with no drive in the name (without the Level 1G change it would always open drive 0's), so @OPEN takes the first in drive order, while the 6.3.1 compile writes it to the first drive that is ready and not write protected: with an old SYSTEM/JCL on a write protected drive 0, DO X compiles to drive 1 and runs the right file, but a later DO * runs the old one on drive 0 (24FEH). B106, the continuation line is read from two bytes before the pointer DO came in with, 0421H after DO X, not from 0420H, the start of INBUF$, so a continuation line of the full 79 characters writes its carriage return over 0470H, the JP of drive 0 in DCT$, and the next access of drive 0, usually in the same DO, runs the table's bytes as code (DEC C, DEC A, LD C,44H, POP BC and on into drive 1's JP 0E3DH, with the stack a word short); each extra space after DO moves the overrun one byte further (2483H). B107, a space or other character after a false //IF term is Bad JCL format, while after a true term the rest of the line is never read, so //IF A comment compiles when A is given and aborts when it is not (2727H). B108, nothing limits the nesting of //IF: the 32nd nested level writes into BADHDR$ and from the 46th into JCLBUF1, which the next line read overwrites with a character, never 00H, so blocks that deep are dropped (273AH). B109, XFRSTR calls PARSER again with Register B as PARSER or the substitution left it: 00H after a dropped separator or a value found, so the rest of the value is lost (A=1-2 gives 1, #F#x gives F's value), and 08H, from FINDSYM, after a token not given, so up to 8 more characters are taken and filled out with up to 7 spaces past them: DO X (@L,A=aaaaaaaaaaaaaaaaaaaaaaaaa#Z#1), with Z not given, blanks LBLSAV's first byte and the label is not found (282FH, 2831H). B110, an at sign anywhere outside quotes is taken as the mark of the label and dropped: two of them anywhere, on the DO line or in any field of the JCL file (//SET A@B and later //SET C@D), are Too many Proc labels, and one inside a value on the DO line makes the next token the label (285FH). B111, the quote flag of PARSER (284BH) is kept from field to field and from line to line, so an unclosed quote leaves every later field of the compile read as quoted, spaces included: //IF KI then reads the name IF KI, finds IF and has no term left, so it is false; //SET, //RESET, //ASSIGN, //INCLUDE and any #token# give Bad JCL format (284CH). B112, CVRTHEX takes : ; < = > ? and @ as the digits 3 to 9, W, X, Y and Z as 0 to 3 and the characters from [ to ` as 4 to 9, as it tests only the ends of its ranges, so %:0 gives 30H with no error (25E8H). B113, the test after PARSVAL in //ASSIGN can never act, as XFRSTR returns only with Z and PARSVAL gives its flags back, so //ASSIGN A= with no value is taken, with length 0, though the manual says a value is required (27B0H). B114, nothing limits the compiled line: a few long substitutions take it past 2491H over the member's own code, UNNEST from 2492H and CKNEST and CPLFIN from 24ACH, so the end of an included file or of the compile then runs whatever the line left there (2607H). B115, the symbol table at 2E00H grows by 41 bytes a token with no test against HIGH$; it takes some 1300 tokens to reach the top of memory, fewer to reach the modules above HIGH$ (Limit, 28ABH). B116, every error of the compile and //QUIT close SYSTEM/JCL with the lines compiled up to that point, so a DO * afterwards runs a part of a compile that was refused, the case //QUIT is there to prevent (2980H). B117, after a substitution in a value XFRSTR loads the next character without passing over it, so a number sign there is taken as ##: //ASSIGN G=#F##E# gives F's value and a number sign and then Bad JCL format; on the DO line such an error goes to BADHDR before any line is read, and shows the line number 0 and whatever JCLBUF1 holds, stale memory up to its first 0DH or 03H (2834H). B118, for the same reason a value on the DO line that ends with a substitution just before the closing parenthesis gives Parameter error, as PARSINP reads the parenthesis again: DO X (B=x,A=#B#) (252FH).

Member 14: RUN and LOAD

Member 14 holds 405 bytes, 2400H-2594H, and serves RUN (request 82H, entry 2400H) and LOAD (request 81H, entry 2403H). Both read the parameter X and the spec in COMMON (24C9H): @PARAM first, so X must come before the spec as the manual writes it (LOAD (X) filespec, RUN (X) filespec (parameters)); an X typed after the spec is passed to RUN's program as its parameter, and LOAD ignores it. The spec, which may not be a device, gets the extension /CMD, and request 84H brings SYS2/SYS into the overlay area, so that the @OPEN of the program finds it there while the source diskette is in the drive. Neither command keeps its Stack Pointer; the last byte, 2594H, is the first byte of the program's FCB (2594H-25B3H). The source is ls631rst\DISK2\lbload.asm, with no 6.3.1 changes.

LOAD without X loads the program with @LOAD and returns 0000H without running it. RUN without X jumps to the SVC dispatcher at 0028H with Register A = 4DH, @RUN (2437H), so that @RUN runs as if RUN's caller had called it: the program may load over the member (not over its FCB, 2594H-25B3H), gets Register Pair HL = its parameters, Register Pair BC = 0420H and Register Pair DE = the FCB, enters the debugger first when DEBUG is on unless the file is EXEC only, and returns to RUN's caller. With X both show Insert SOURCE disk <ENTER> (FLASH, 2463H), load the program with LOADIT (250FH), which sets SFLAG$ bit 2 as @RUN does, so that a file of EXEC protection loads, and then show Insert SYSTEM disk <ENTER> (PMTSYS, 2420H). LOAD (X) then returns 0000H; RUN (X) puts the transfer address on the stack (2443H), and PMTSYS's RET enters the program. FLASH blinks its prompt until ENTER or BREAK; it waits first until no BREAK or ENTER is still noted in KFLAG$, and clears bits 0 to 2 while it waits, so the COPY hang of B56 cannot happen here. After ENTER it empties the type-ahead buffer. BREAK at the source prompt ends the command with Command aborted, without the system prompt (B104).

Against the manual (LOAD and RUN): the manual says a program must load at 3000H or above; nothing tests it, and a program that loads into 2400H-25B3H overwrites the member or the FCB @LOAD is reading through. LOAD without X does not set SFLAG$ bit 2, which LOAD (X) and RUN do, so LOAD of an EXEC-only file fails at its first read with Illegal access attempted to protected file (error 37). An error of @DSPLY or @DSP inside FLASH jumps to IOERR, whose RET then returns into FLASH or to its caller: the video driver does not fail, but with DO routed to a printer that is off the prompt is taken as answered. X=256 (or any multiple) shows the source prompt, as XPARM tests the whole word, but the entries test only the low byte and then load as without X.

Bugs (listed on the LS-DOS reference page): B100, IOERR takes Register A as @LOAD returns it, the error number OR C0H, so LOAD, LOAD (X) and RUN (X) return 00DFH for Program not found and C0H more than the number for any other load error, the same fault as SET's B90; the message is right, and only a caller through @CMNDR sees the code (2414H). B101, PMTSYS does not test FLASH's result, so BREAK at Insert SYSTEM disk <ENTER> ends the prompt as ENTER does: LOAD (X) returns 0000H and RUN (X) runs the program, with the source diskette perhaps still in drive 0; the cursor stays off, as Command aborted, which would turn it on, is not shown, until the next LS-DOS Ready, so all through the program after RUN (X) (2424H). B102, RUN (X) enters the program by PMTSYS's RET, not through @RUN, so the program gets Register Pair BC as FLASH left it (250EH after ENTER), not 0420H, and DE = 0210H, not the FCB; DEBUG does not stop at its first instruction, and as the program runs inside the member's RST28 call, with @DBGHK at C9H, BREAK cannot reach the debugger during it either (2428H). B103, LOADIT sets SFLAG$ bit 2 for LOAD (X) as well as for RUN, so LOAD (X) opens an EXEC-only file with READ access and leaves the program in memory unrun, for DEBUG or any program to read: the protection EXEC is meant to give, which plain LOAD keeps, is lost (2512H). B104, BREAK at Insert SOURCE disk ends the command without the system prompt; SYS2, brought in by request 84H, has replaced SYS1 in the overlay area, so with the source diskette already in drive 0 the return to LS-DOS Ready reads SYS1 from it and fails (Error 07H) until the system diskette is back, the fault of COPY's B57 (2509H).

Variables

Memory Used by Member 1 (MEMORY)

Address
Size
Contents
001EH-001FH
2 bytes
LOW$
Read by GETHILO (27E7H), set through @HIGH$ at 255FH on every command that gets that far.
006AH-0083H
26 bytes
FLGTAB$
ADD="c" shows the flag of letter c, 006AH plus its place in the alphabet (2482H).
006CH
1 byte
CFLAG$ (Index Register IY + 02H)
Bit 0, HIGH$ frozen: No memory available for CLEAR, HIGH and LOW (2429H, 2518H, 253CH). Bit 1, a command run through @CMNDR: CLEAR fills only up to LOW$ (244BH).
0200H
1 byte
BUR$
Tested for each bank by @BANK function 2 for the In use list (25C4H).
0206H-0207H
2 bytes
DVRHI$
The end of the low memory part of the map, read below the KI DCB (2688H, 268AH).
040EH-040FH
2 bytes
HIGH$
Read by GETHILO (27ECH), lowered by HIGH (2578H).
2400H-2439H
58 bytes
The line buffer
Each line of the memory map, written over MEMORY's own first bytes; 2439H keeps the carriage return of the title line (26B2H).
2465H up
to HIGH$
CLEAR's fill
From NEXTPRM in MEMORY itself up to HIGH$, or LOW$ through @CMNDR (2452H).
2984H-2987H
up to 4 bytes
The end of the bank line
The signs of the banks after bank 0, the greater than sign and the carriage return, past the end of the member (25C6H, 25CBH, 25CFH, 25D2H).
new HIGH$ + 1 to + 10
10 bytes
The module header of HIGH
JR, the old HIGH$, the name &nnnn, copied from 27D4H by 2573H.

Routines of Other Files Called

AddressRoutine
0500H@LOGOT (BOOT/SYS), SVC 12: shows a line and writes it to the job log (279EH, 2804H).
0528H@PRINT (BOOT/SYS), SVC 14: sends a line to the printer, with PRINT (2799H).
0545H@CLS (BOOT/SYS), SVC 105: clears the screen for the next page of the map (2782H).
0553H@CKBRKC (BOOT/SYS), SVC 106: tests and clears BREAK (2402H, 280DH).
0628H@KEY (BOOT/SYS), SVC 1: waits for a key at the end of a screen (277AH).
06F6H@HEXDEC (BOOT/SYS), SVC 97: Register Pair HL in decimal, five characters (249CH, 2657H, 26AFH).
07BDH, 07C2H@HEX16 and @HEX8 (BOOT/SYS), SVC 99 and 98: four and two hex digits (2494H, 24A8H and others).
0877H@BANK (BOOT/SYS), SVC 102: select a bank (25A0H, 25A8H), test its in use bit (25C4H).
1948H@HIGH$ (SYS0/SYS), SVC 100: reads and sets HIGH$ and LOW$ (255FH, 2578H, 27E7H, 27ECH).
196AH@FLAGS (SYS0/SYS), SVC 101: Index Register IY = 006AH (241FH).
1987H@PARAM (SYS1/SYS), SVC 17: fills in the parameter table (2413H).
1990H@GTDCB (SYS2/SYS), SVC 82: the device control block of KI (2686H).
19B2H@GTMOD (SYS12/SYS), SVC 83: the address of the module $KI (25E7H).
1B0FH@ERROR (SYS4/SYS), SVC 26: the short error message (27F8H).

Memory Used by Member 2 (DIR and CAT)

Address
Size
Contents
006CH
1 byte
CFLAG$ (Index Register IY + 02H)
Bit 1, a command run through @CMNDR: the list is not sorted (2E66H).
0072H
1 byte
IFLAG$ (Index Register IY + 08H after @FLAGS)
Bit 4, the 24 hour clock of SYSTEM (AMPM=OFF): no 12 hour time and no a or p (2923H, 2D7CH).
0074H
1 byte
KFLAG$
Bit 0 BREAK ends DIR, bit 1 the pause key holds it (2ACDH); bits 1 and 2 cleared at the start and after a pause (2AE2H).
007CH
1 byte
SFLAG$ (Index Register IY + 12H)
Copied at the start (2DCBH): bit 5, a JCL file runs, means no pause at the end of a screen (2AB1H).
0082H
1 byte
YFLAG$
Bit n set when the diskette in drive n uses the new style of dating: the year from DIR+19 and the time (28F4H, 2A81H).
04DCH-04FFH
36 bytes
MONTBL$ (BOOT/SYS)
The month names of the title and of the full format (255CH, 28E1H).
1D00H-1DFFH
256 bytes
SBUFF$
The directory sector read by @DIRRD; in the sorted mode DIR writes the counts of each selected entry over its DIR+22 to DIR+25 there (270BH).
2D9CH-2D9DH
2 bytes
DIRPTR
The next free byte of the sort buffer, 3000H for each drive (2584H, 2721H), then the start of the address table (2B3EH).
2D9EH-2D9FH
2 bytes
MAXMEM
HIGH$ less 33, the limit of the sort buffer (2E7AH, 2725H, 2B35H).
2DA0H-2DA3H
4 bytes
FMPAKD, TOPAKD
The from and to dates of DATE, packed like UNPACK's words (2EADH, 2ECFH).
2DA4H-2DA6H
3 bytes
LILBUF$
The year, day and month of the date being read by PARSDAT (2F9DH).
2DA7H-2DB1H
11 bytes
BLANKS
The partspec: eight characters of name and three of extension, spaces where nothing was given (2DE9H, 2E1EH, 2E37H, 26AAH).
2DB4H-2DECH
57 bytes
PLEVEL
The full format line from the Prot column on, ended by 03H at 2DECH (2DF6H, 2815H-295EH).
2E00H-2EFFH
256 bytes
GAT, HIT
The GAT of the drive (24C1H), then its HIT (259EH), over DIR's start code.
2F00H-2FFFH
256 bytes
BUF2
A directory sector read for an extended entry (2A01H).
3000H up
to MAXMEM
The sort buffer
The selected entries, 32 bytes each (271FH), then the table of their addresses (2B44H).

Routines of Other Files Called by Member 2

AddressRoutine
0500H@LOGOT (BOOT/SYS), SVC 12: shows No memory for SORT or Bad date format (2416H).
052DH@DSPLY (BOOT/SYS), SVC 10: shows every line (2A12H).
0528H@PRINT (BOOT/SYS), SVC 14: prints every line with P (2A1CH).
0553H@CKBRKC (BOOT/SYS), SVC 106: tests and clears BREAK (2430H, 2D9EH).
0628H@KEY (BOOT/SYS), SVC 1: waits for a key at the end of a screen and after the pause key (2AB8H, 2AD8H).
063DH, 0642H@PRT and @DSP (BOOT/SYS), SVC 6 and 2: one character to the printer and the screen (2A31H, 2A26H).
06C9H, 06E3H@MUL16 and @DIV16 (BOOT/SYS), SVC 91 and 94: granules to sectors (2A47H), the record count (298BH).
06F6H, 06F8H@HEXDEC and @HEXD (BOOT/SYS), SVC 97 and 95: numbers in decimal, five characters or Register B (2497H, 25F4H and others).
1420H@DATE (SYS0/SYS), SVC 18: today's date for DATE alone (2E9EH).
18BBH@DIRRD (SYS0/SYS), SVC 87: reads the directory sector of an entry into SBUFF$ (265DH).
18D8H@RDSSC (SYS0/SYS), SVC 85: reads the GAT and the HIT (24C1H, 259EH).
1948H@HIGH$ (SYS0/SYS), SVC 100: reads HIGH$ for MAXMEM (2E75H).
196AH@FLAGS (SYS0/SYS), SVC 101: Index Register IY = 006AH (2DACH, 2D79H).
1987H@PARAM (SYS1/SYS), SVC 17: fills in the parameter table (2DE3H).
1993H@CKDRV (SYS2/SYS), SVC 33: tests the drive for a diskette (2454H).
19F4H@RDSEC (SYS0/SYS), SVC 49: reads the sector of an extended entry (2A01H).
1A1EH@GTDCT (SYS0/SYS), SVC 81: Index Register IY = the DCT of the drive (2451H).
1B0FH@ERROR (SYS4/SYS), SVC 26: the short error message (2426H).

Memory Used by Member 3 (COPY and APPEND)

Address
Size
Contents
001EH-001FH
2 bytes
LOW$
Read through @HIGH$ for a command sent by a program: the top of the sector copy (2923H).
006CH
1 byte
CFLAG$ (Index Register IY + 02H)
Bit 1, a command run through @CMNDR: LOW$ instead of HIGH$ (291AH).
0074H
1 byte
KFLAG$ (Index Register IY + 0AH)
Bits 0 (BREAK) and 2 (ENTER) tested by FLASH (29CDH, 29F3H); bits 1 and 2 cleared by RESKFLG (2A14H).
007CH
1 byte
SFLAG$ (Index Register IY + 12H)
Bit 5, a JCL file runs: no COPY (X) (2537H). Bit 0 set before the source is opened, so that SYS2 makes no checks (2A71H).
0082H
1 byte
YFLAG$
Bit n set when the diskette in drive n uses the new style of dating, read for the source (25A3H) and the destination (2609H).
040EH-040FH
2 bytes
HIGH$
Read through @HIGH$: the top of the sector copy (2923H).
DCT+9
1 byte
The directory cylinder
Of the drive of COPY (X), for the GAT reads (2A4DH); @RDSSC corrects it for a diskette whose directory is elsewhere.
1D00H-1DFFH
256 bytes
SBUFF$
The directory sector of a file just opened: its LRL (28DDH) and the bytes CLONE copies (28F0H); the destination's entry after the close (269BH), changed and written back (26D4H).
2C03H-2C22H
32 bytes
FCB2
The destination's FCB (only 2C03H is loaded, as 00H).
2C23H-2C32H
16 bytes
TEMBUF
Each name as DOSVC makes it for display (2807H).
2C33H-2C56H
36 bytes
FROM, TO, TO2
The source's name, the word to (loaded) and the destination's name of the Copying line (2896H, 289CH).
2C57H-2C76H
32 bytes
FCB1
The source's FCB (only 2C57H is loaded, as 00H).
2C77H-2C9AH
36 bytes
SRCSTR, DSTSTR
GAT+CEH to GAT+DFH of the two diskettes of COPY (X): the master password's hash, the name and the date (258DH, 25DFH).
2C9BH-2CA1H
7 bytes
CLONSAV
DIR+0 to DIR+2 and DIR+16 to DIR+19 of the source's entry (28F0H, 28F9H), for CLONE (26B7H, 26BFH).
2D00H-2DFFH
256 bytes
GAT
The GAT read by RDGAT for COPY (X) (2A52H).
2E00H-2FFFH
512 bytes
BUF1, BUF2
The FCBs' buffers: both FCBs use 2E00H, the destination 2F00H in a byte by byte copy (24CEH, 271CH).
2E00H up
to the top page
The sector copy
The source's sectors, one a page, up to the page DOINIT puts into 2659H, 2671H and 2947H (2640H, 2662H).

Routines of Other Files Called by Member 3

AddressRoutine
0382H@PAUSE (SYS0/SYS), SVC 16: the wait at the start of FLASH (29CCH).
0500H@LOGOT (BOOT/SYS), SVC 12: shows the member's messages (243EH, 2A2DH).
052DH@DSPLY (BOOT/SYS), SVC 10: the Copying line and the prompts (2A23H).
0553H@CKBRKC (BOOT/SYS), SVC 106: tests and clears BREAK (2409H, 24FAH, 2427H, 2964H).
0635H, 0638H@KBD and @GET (BOOT/SYS), SVC 8 and 3: empties the type-ahead (2A02H); a byte from the source (273EH).
0642H, 0645H@DSP and @PUT (BOOT/SYS), SVC 2 and 4: one character to the screen (2A1CH); a byte to the destination (275DH).
145BH, 14ADH@POSN and @BKSP (SYS0/SYS), SVC 66 and 61: to the last record for WRERN (26F8H); one byte back for STRIP (24CCH).
14C2H, 14C9H@REW and @PEOF (SYS0/SYS), SVC 68 and 65: the destination to its start (2639H) or its end (24BDH, 24F0H).
1513H, 1531H@READ and @WRITE (SYS0/SYS), SVC 67 and 75: the sectors of the copy (2648H, 266AH, 2958H) and WRERN's sector (270AH).
1803H, 18BBH@DIRWR and @DIRRD (SYS0/SYS), SVC 88 and 87: the destination's entry after the close (269BH, 26D4H); DOINIT's read (2935H).
18D8H@RDSSC (SYS0/SYS), SVC 85: the GAT for COPY (X) (2A57H).
1948H@HIGH$ (SYS0/SYS), SVC 100: reads HIGH$ or LOW$ (2923H).
196AH@FLAGS (SYS0/SYS), SVC 101: Index Register IY = 006AH (2536H, 2908H, 2A10H, 2A70H).
1981H, 1987H@FSPEC and @PARAM (SYS1/SYS), SVC 78 and 17: the two specifications (2460H, 2469H, 250CH, 2515H) and the parameters (247AH, 251EH).
198AH, 198DH@OPEN and @INIT (SYS2/SYS), SVC 59 and 58: every open, through DOSVC (283BH).
1993H@CKDRV (SYS2/SYS), SVC 33: the write protect test after @INIT (2853H).
1999H@CLOSE (SYS3/SYS), SVC 60: the destination at the end (2695H, 26E2H) and after a refusal (2448H, 2878H).
1A1EH@GTDCT (SYS0/SYS), SVC 81: the DCT of the drive of COPY (X) (2A4CH).
1B0FH@ERROR (SYS4/SYS), SVC 26: the short error message (2421H).
RST 28HRequests 84H and 85H: read SYS2/SYS and SYS3/SYS into the overlay area (2A36H, 2A39H).

Memory Used by Member 4 (LIB, CLS, ID and TOF)

Address
Size
Contents
1E02H-1E03H
2 bytes
The word after SYS1/SYS's first jump
The address of LIBTBL$, 1F24H, read while SYS1/SYS is still at 1E00H (242DH).
1F24H-205CH
313 bytes
LIBTBL$ (SYS1/SYS)
39 entries of 6 characters and a word, ended by 00H at 205CH: the names and the 00H at the end (2437H, 244BH, 2452H) and each entry's library byte at entry + 7 (2442H).
2441H
1 byte
LIBX+1
The library byte of the pass: 80H in the file, raised by 20H after each pass (247BH, 2480H).
2492H
1 byte
LIBMSG
The first byte of the heading: 00H in the file, 0AH after the first heading (242BH).
249CH
1 byte
LIBMSG+10
The heading's letter: A in the file, then B and C (247AH).

Routines of Other Files Called by Member 4

AddressRoutine
052DH@DSPLY (BOOT/SYS), SVC 10: the headings of LIB (242AH) and ID's message (2505H).
0545H@CLS (BOOT/SYS), SVC 105: clears the screen for CLS (241EH).
063DH@PRT (BOOT/SYS), SVC 6: the form feed of TOF (240DH).
0642H@DSP (BOOT/SYS), SVC 2: each character, space and carriage return of LIB's list (244EH, 245CH, 246FH, 2476H, 248EH).
1B0FH@ERROR (the SYS0/SYS stub that loads SYS4/SYS), SVC 26: the short message of a printer error (241AH).

Memory Used by Member 5 (REMOVE)

Address
Size
Contents
0208H-02FFH
248 bytes
The DCBs (BOOT/SYS)
31 device control blocks of 8 bytes: each type byte (24C0H, 24D3H, 24DDH, 24E4H) and route vector at +1 and +2 (24D9H, 24DBH) read by the scan, the removed DCB set to 00H (24CAH); @GTDCB and @RENAME compare the names at +6 and +7.
2410H-2411H
2 bytes
SAVESP+1
The Stack Pointer of the entry, stored at 2400H and loaded by SAVESP (240FH).
2537H-2538H
2 bytes
RENDEV+1
The name of the device to be removed, RS in the file, written by DEV4 (24ADH) for @RENAME.
2543H-2551H
15 bytes
FILESPC
The name shown after Removing:, without its password (2450H), ended by 0DH (2455H), with a colon and the drive added when it has none (2479H-2483H).
2552H-2571H
32 bytes
FCB
Only its first byte, 00H, is in the file. @FSPEC (2446H), @OPEN (245EH) and @REMOVE (2491H) use it; REMOVE reads FCB+0, the first character (2457H), FCB+1, the access level (2465H), FCB+6, the drive (247CH), and for a device FCB+1 and FCB+2, the name (24A2H, 24A5H); SCND4 clears its first 8 bytes after a device (24F1H).

Routines of Other Files Called by Member 5

AddressRoutine
0500H@LOGOT (BOOT/SYS), SVC 12: the message File spec required (2420H).
052DH@DSPLY (BOOT/SYS), SVC 10: the line Removing: and the name (249AH).
0553H@CKBRKC (BOOT/SYS), SVC 106: BREAK at the entry (2406H), before each word (2436H) and cleared at the exit (2414H).
1981H@FSPEC (SYS1/SYS), SVC 78: each word of the command line into the FCB (2446H).
198AH@OPEN (SYS2/SYS), SVC 59: the file to be removed (245EH).
1990H@GTDCB (SYS2/SYS), SVC 82: the DCB of the device (24AAH) and the KI DCB at the start of each scan (24D2H).
1996H@RENAME (SYS2/SYS), SVC 56: the device renamed to its own name, to tell a system device from any other (24B9H).
19A6H@REMOVE (SYS10/SYS, request 9CH), SVC 57: deletes the open file (2491H).
1B0FH@ERROR (the SYS0/SYS stub that loads SYS4/SYS), SVC 26: the short error message (242BH).

Memory Used by Member 6 (RENAME)

Address
Size
Contents
007CH
1 byte
SFLAG$ (Index Register IY + 12H)
Bit 0 set before each @OPEN (246CH, 24AEH), so that SYS2 makes no access, open bit or record length checks; SYS2's open clears it again.
0208H-02FFH
248 bytes
The DCBs (BOOT/SYS)
@GTDCB looks for the old and the new device names at +6 and +7 (2510H, 252DH) and for JL, whose DCB at 0230H ends the system devices (251BH); @RENAME writes the new name into the old device's DCB.
242EH-242FH
2 bytes
SAVESP+1
The Stack Pointer of the entry, stored at 2400H and loaded by SAVESP (242DH).
24A5H
1 byte
OLD_DRV+1
The old name's drive digit, stored by 2485H (the drive @OPEN found) or 2493H (the drive typed), loaded at 24A4H and written into the new name (24A6H).
25FFH-261EH
32 bytes
NEWFCB
Only its first byte, 0DH, is in the file. The new name from @FSPEC (244CH) or CVRTUC (2551H), read at 2450H, 2464H and by DEVREN (2502H, 2528H-252AH), completed by MATCH, given its drive by F2LOOP (24A6H), parsed again (24B4H), copied for the Renaming: line (24CFH) and given to @RENAME as the new name (24DBH).
261FH-263EH
32 bytes
OLDFCB
Not in the file. The old name from @FSPEC (2444H), read at 245EH and by DEVREN (250BH-250DH), given a drive by FLOOP (247EH-2489H), read by MATCH and MOVSPC, and given to @RENAME as the FCB of the old name (24DCH).
2649H-2670H
40 bytes
SPECS$
Not in the file. The two names and " to " for the Renaming: line, built by MOVSPC and the LDIR at 24CBH and ended by 0DH (24D4H).
2671H-2690H
32 bytes
TEMPFCB
Not in the file. The old name from the first @FSPEC (243AH), opened at 2472H, whose drive at +6, 2677H, is read at 2474H; then the new name for the duplicate check (24B4H, 24B7H).
2691H-2692H
2 bytes
OLD_FIL
0000H in the file; no instruction reads or writes it.

Routines of Other Files Called by Member 6

AddressRoutine
0500H@LOGOT (BOOT/SYS), SVC 12: RENAME's messages (2429H) and the Renaming: line (24DAH).
0553H@CKBRKC (BOOT/SYS), SVC 106: BREAK at the entry (2406H) and cleared at the exit (2432H).
196AH@FLAGS (SYS0/SYS), SVC 101: Index Register IY = 006AH (243EH).
1981H@FSPEC (SYS1/SYS), SVC 78: the old name into TEMPFCB (243AH) and OLDFCB (2444H), the new name into NEWFCB (244CH), the completed new name into TEMPFCB (24B4H).
198AH@OPEN (SYS2/SYS), SVC 59: the old file, to learn its drive (2472H), and the new name, to look for a duplicate (24B7H).
1990H@GTDCB (SYS2/SYS), SVC 82: the old device (2510H), JL (251BH) and the new device name (252DH).
1996H@RENAME (SYS2/SYS), SVC 56: renames the file or the device (24DFH).
1B0FH@ERROR (the SYS0/SYS stub that loads SYS4/SYS), SVC 26: the short error message (2419H).

Memory Used by Member 7 (DEVICE)

Address
Size
Contents
006DH
1 byte
DFLAG$ (Index Register IY + 03H)
Bits 0-7, the options Spooler, Type, Verify, Smooth, Memdisk, Forms, KSM and Graphic, read at 26C0H and 2700H.
0074H
1 byte
KFLAG$ (Index Register IY + 0AH)
Bit 0 BREAK and bit 1 the pause key, read by CKPAWS0 (278DH); bits 1 and 2 cleared by RESKFL (27A2H-27A7H) at the entry, after a pause and at BREAK.
007CH
1 byte
SFLAG$ (Index Register IY + 12H)
Bit 3, the fast speed, read by SHOWFS (26F2H) for Fast or Slow.
0208H-02FFH
248 bytes
The DCBs (BOOT/SYS)
Found from KI with @GTDCB (2588H) and walked 8 bytes at a time (263DH): the type byte (258CH, 259AH, 259EH, 25B2H, 25BBH, 25C0H, 25E6H and DCBDIR), the vector at +1 and +2 (GETPTR), a link DCB's +4 and +5 (25D2H, 25D5H) and the name at +6 and +7 (MOVNAM).
0470H-04BFH
80 bytes
DCT$ (BOOT/SYS), Index Register IY from @GTDCT
For each drive +0 (242FH), +3 (247BH, 249FH, 24ACH, 24CFH, 24EAH, 24F0H, 2501H, 2526H, 254AH, 2556H), +4 (24BBH, 24D5H, 2514H), +6 (24C9H) and +9 (2443H); @CKDRV sets +6 and +4 bit 5 of a floppy drive from the GAT, and its read of the GAT corrects +9 when it fails at first.
241EH-241FH
2 bytes
DPARM+1
FFFFH in the file; the value of DRIVES, stored by @PARAM (table word 28B1H), tested at 2420H.
247AH
1 byte
WPTEST+1
00H for each drive (2429H), 80H when @CKDRV reports the diskette write protected (243DH), read by WPTEST (2479H).
257CH-257DH
2 bytes
BPARM+1
0000H in the file; the value of BYTEIO (table word 28A7H), tested at 257EH.
26B0H-26B1H
2 bytes
SPARM+1
FFFFH in the file; the value of STATUS or OPTION (table words 28C4H and 28CEH), tested at 26B2H.
276FH-2770H
2 bytes
PPARM+1
0000H in the file; the value of PRINT (table word 28BAH): the low byte read by LINOUT (275AH), the word by BYTOUT (276EH) (B73).
27B2H-27B3H
2 bytes
SAVESP+1
The Stack Pointer of the entry, stored by DEVICEA (2409H) and loaded by SAVESP (27B1H).
2862H-2864H
3 bytes
COMMA$
Three spaces in the file, written with the number of cylinders by @HEXD at each drive line (24E3H) and shown as part of CYLS$ (24E7H).
28A6H, 28B0H, 28B9H, 28C3H, 28CDH
1 byte each
The response bytes of PRMTBL$
Cleared and set by @PARAM; DEVICE does not read them.
2900H-29FFH
256 bytes
BUFFER
Not in the file. The GAT of each drive with a diskette (2449H); at 29D0H-29DAH the pack name, closing bracket, space and 03H (2452H-2458H), or the copy of NOPACK$ (2467H), shown at 249CH.
2A00H up
a line
STRBUF
Not in the file. Each device line is built here (from 2591H) and shown by DVRB1 (2636H); no length limit, so the endless chain of B70 writes on through memory.
Filter modules
header
The header of each filter module
The name length at +4 (25F9H) and the DCB word after the name (25FCH), read for a filtered device.
SYSRES module
RESTAB$
RESTAB$ of the SYSRES module (SYS8/SYS's SYSTEM puts it in high memory)
The high byte of the word of each SYS overlay 0-15, read by DORES1 (2726H).

Routines of Other Files Called by Member 7

AddressRoutine
052DH@DSPLY (BOOT/SYS), SVC 10: every string of the display (LINOUT, 2757H).
0528H@PRINT (BOOT/SYS), SVC 14: the same strings with PRINT on (2761H).
0553H@CKBRKC (BOOT/SYS), SVC 106: BREAK at the entry (2402H) and cleared at the exit (27B6H).
0628H@KEY (BOOT/SYS), SVC 1: the key that ends a pause (2799H).
063DH@PRT (BOOT/SYS), SVC 6: each single character with PRINT on (2777H).
0642H@DSP (BOOT/SYS), SVC 2: each single character (BYTOUT, 276BH).
06F8H@HEXD (BOOT/SYS), SVC 95: the number of cylinders in three columns (24E3H).
07BDH@HEX16 (BOOT/SYS), SVC 99: the vector of a device as four hexadecimal digits (262AH).
18D8H@RDSSC (SYS0/SYS), SVC 85: the GAT of a drive (2449H).
1987H@PARAM (SYS1/SYS), SVC 17: the parameters (2412H).
1990H@GTDCB (SYS2/SYS), SVC 82: the DCB of KI, the first of the table (2588H).
1993H@CKDRV (SYS2/SYS), SVC 33: each enabled drive, logged on (2439H).
196AH@FLAGS (SYS0/SYS), SVC 101: Index Register IY = 006AH (2418H, 26BFH, 278CH).
199CH@FNAME (SYS3/SYS), SVC 80: the name of a file a device is routed to (265EH).
19B2H@GTMOD (SYS12/SYS), SVC 83: the module SYSRES (2713H).
1A1EH@GTDCT (SYS0/SYS), SVC 81: Index Register IY = the DCT entry of each drive (242EH).
1B0FH@ERROR (the SYS0/SYS stub that loads SYS4/SYS), SVC 26: the short error message (2782H).

Memory Used by Member 8 (ROUTE)

Address
Size
Contents
006CH
1 byte
CFLAG$ (Index Register IY + 02H)
Bit 0, HIGH$ frozen, read by NOTRES (24C3H) before new space is taken.
0200H, 0206H-0207H
3 bytes
BUR$ and DVRHI$ (BOOT/SYS)
Not meant to be touched: NILDCB ORs 08H into BUR$ (252EH) and writes the name into DVRHI$ (2534H, 2536H) when CKSRC found no DCB and @GTDCB left 0200H in Register Pair HL (B77).
0208H-02FFH
248 bytes
The DCBs (BOOT/SYS)
@GTDCB finds the destination (247BH), the source (2514H) or a spare DCB (251CH) by the name at +6 and +7. CKDCB1 reads and writes +0 to +2 and writes +6 and +7, and +3 to +5 for a device not routed before (2489H-24AAH); NILDCB writes +0, +6 and +7 (252EH-2536H); CLSFILS reads the type byte and the vector along the route (2539H-2541H).
040EH-040FH
2 bytes
HIGH$ (BOOT/SYS)
Read by @HIGH$ (24D0H) for the top of a new route module and set below the module (24FDH).
2427H-2428H
2 bytes
SAVESP+1
The Stack Pointer of the entry, stored at 2400H and loaded by SAVESP (2426H).
244EH-244FH
2 bytes
NPARM+1
0000H in the file; the value of NIL (table word 258AH), tested at 2450H.
24DFH-24E0H
2 bytes
RPARM+1
0000H in the file; the value of REWIND (table word 2594H), whose high byte is tested at 24E1H.
24F7H
1 byte
CKIFRES+1
FFH in the file; 00H stored by 24BEH when the route module is found in memory, so that HIGH$ is not set again (24F6H).
2589H, 2593H
1 byte each
The response bytes of PRMTBL$
Cleared and set by @PARAM; ROUTE does not read them.
2597H-25A4H
14 bytes
RTEDVR, the header of the route module
Copied into high memory with FCBDST (2503H); its word at 2599H-259AH is the module's last byte, the top of the buffer (24D1H), and its name RTENAM at 259CH-25A0H gets the source's two letters at 259FH-25A0H (2446H), the name @GTMOD looks for (24AEH).
25A5H-25C4H
32 bytes
FCBDST
Only its first byte, 00H, is in the file. The destination from @FSPEC (245AH), read at 2468H and, for a device, at 246DH; for a file @INIT makes it an open FCB (24DBH), @PEOF positions it (24E6H) and the LDIR copies it into high memory (2503H).
25C5H-25E4H
32 bytes
FCBFIL
Only its first byte, 00H, is in the file. The copy of the FCB at the end of a route, made by CLSFILS (254EH) and closed by @CLOSE (2553H).
25E5H-2604H
32 bytes
FCBSRC
Only its first byte, 00H, the member's last, is in the file. The source from @FSPEC (2432H), read at 2435H; its name at 25E6H-25E7H is read at 2442H, 2471H and 250DH.
High memory
302 bytes a module
The route module
The 14 byte header, the 32 byte FCB of the file and the 256 byte buffer, from the new HIGH$ + 1 up (24D1H-24FDH, 2503H); found again by @GTMOD (24B3H); the FCB is the vector of the routed device (2509H), copied by CLSFILS (254EH).

Routines of Other Files Called by Member 8

AddressRoutine
0500H@LOGOT (BOOT/SYS), SVC 12: ROUTE's messages (2422H).
0553H@CKBRKC (BOOT/SYS), SVC 106: BREAK cleared at the exit (242BH).
14C9H@PEOF (SYS0/SYS), SVC 65: the file moved to its end (24E6H).
1948H@HIGH$ (SYS0/SYS), SVC 100: HIGH$ read (24D0H) and set below the new module (24FDH).
196AH@FLAGS (SYS0/SYS), SVC 101: Index Register IY = 006AH (244CH).
1981H@FSPEC (SYS1/SYS), SVC 78: the source into FCBSRC (2432H) and the destination into FCBDST (245AH).
1987H@PARAM (SYS1/SYS), SVC 17: the parameters after the source (243FH) and after the destination (2464H).
198DH@INIT (SYS2/SYS), SVC 58: opens or creates the file routed to (24DBH).
1990H@GTDCB (SYS2/SYS), SVC 82: the destination device (247BH), the source (2514H) and a spare DCB (251CH).
1999H@CLOSE (SYS3/SYS), SVC 60: the copy of the FCB at the end of the source's old route (2553H).
19B2H@GTMOD (SYS12/SYS), SVC 83: an earlier route module of the same name (24B3H).
1B0FH@ERROR (the SYS0/SYS stub that loads SYS4/SYS), SVC 26: the short error message (2416H).

Memory Used by Member 9 (LINK)

Address
Size
Contents
0208H-02FFH
248 bytes
The DCBs (BOOT/SYS)
@GTDCB finds a spare DCB (242AH), the destination (2438H) and the source (2444H) and tries the link names (2475H) by the name at +6 and +7. LINK reads the source's +0 to +2 (244DH, 2451H, 2455H) and writes its +1, +2 (244EH, 2452H) and +0 (245BH); it writes the link DCB's +0 to +2 (2460H-2464H), +4 and +5 (246AH, 246CH) and +6 and +7 (2479H, 247BH), and leaves its +3.
244AH-244BH
2 bytes
LINKDCB+1
0000H in the file; the spare DCB's address, stored at 242FH and read at 2449H and 245CH.
2468H-2469H
2 bytes
DSTDCB+1
0000H in the file; the destination's DCB address, stored at 243BH and read at 2467H.
24AAH-24ACH
3 bytes
FCB1 (no bytes in the file)
The source spec from @FSPEC (2405H); its first byte is tested at 2408H and its name at 24ABH-24ACH is read at 241AH and 243EH. The 03H after a two letter name falls on 24ADH.
24ADH-24CCH
32 bytes
FCB2 (no bytes in the file)
The destination spec from @FSPEC (2412H); its first byte is tested at 2415H and its name at 24AEH-24AFH is read at 241DH and 2432H.

Routines of Other Files Called by Member 9

AddressRoutine
0500H@LOGOT (BOOT/SYS), SVC 12: Device spec required (2490H).
1981H@FSPEC (SYS1/SYS), SVC 78: the source into FCB1 (2405H) and the destination into FCB2 (2412H).
1990H@GTDCB (SYS2/SYS), SVC 82: a spare DCB (242AH), the destination (2438H), the source (2444H) and the link names (2475H).
1B0FH@ERROR (the SYS0/SYS stub that loads SYS4/SYS), SVC 26: the short error message (2489H).

Memory Used by Member 10 (RESET)

Address
Size
Contents
007CH
1 byte
SFLAG$ (Index Register IY + 12H)
Bit 0 set by RESFIL (2483H) so that @OPEN neither tests nor sets the file's open bit and skips its write protect and LRL tests.
0208H-02FFH
248 bytes
The DCBs (BOOT/SYS)
@GTDCB finds the device by the name at +6 and +7 (2456H). CLSFILS reads the type and vector of each DCB on the route (24ECH-24F4H); FIXDCB reads +0 to +5 and writes +0 to +2 of the device (2508H-2518H, 252CH), clears the 8 bytes of a link DCB (2531H) and swaps +0 to +2 with a filter's DCB (2556H-255DH); 2471H writes 08H into a user's device, 247CH resets bit 3 of a system device.
1D00H-1DFFH
256 bytes
SBUFF$ (SYS0/SYS)
The directory sector that @DIRRD reads (24B7H); Index Register IY points at the file's entry, whose DIR+4 (24C6H) and DIR+18, DIR+19 (24D3H, 24D7H) RESFIL writes before @DIRWR (24EAH).
2426H-2427H
2 bytes
SAVESP+1
The Stack Pointer of the entry, stored at 2400H and loaded by SAVESP (2425H).
24C4H-24C5H
2 bytes
LRLPRM+1
0000H in the file; the value of LRL (table word 2568H), read at 24C3H.
24D1H-24D2H
2 bytes
DATPRM+1
0000H in the file; the value of DATE (table word 2570H): FFFFH for ON, 0000H for OFF, read at 24D0H.
2567H, 256FH
1 byte each
LRLBYT and DATBYT, the response bytes of PRMTBL$
Cleared and set by @PARAM; bit 7 of LRLBYT (a number) is tested at 2497H and 24BCH, bit 6 of DATBYT (a flag) at 249DH and 24C9H.
2588H-25A7H
32 bytes
FCBDEV
Only its first byte, 00H, is in the file. The spec from @FSPEC (2447H): for a device its name at 2589H-258AH (2450H) and the old and new name of @RENAME (2464H); for a file the FCB @OPEN builds (2489H): +0 written at 24A5H and 24E0H, +1 read at 248EH, +6 and +7 read at 24B1H.
25A8H-25C7H
32 bytes
FCBFIL
Only its first byte, 00H, the member's last, is in the file. The copy of the FCB at the end of a route, made by CLSFILS (2501H) and closed by @CLOSE (2506H).
High memory
32 bytes
The FCB of a route to a file
The vector at the end of the device's route chain, copied by CLSFILS (2501H); it keeps its bit 7.

Routines of Other Files Called by Member 10

AddressRoutine
0500H@LOGOT (BOOT/SYS), SVC 12: Device spec required (2421H).
0553H@CKBRKC (BOOT/SYS), SVC 106: BREAK tested at the entry (2406H) and cleared at the exit (242AH).
1803H@DIRWR (SYS0/SYS), SVC 88: the changed directory entry written (24EAH).
18BBH@DIRRD (SYS0/SYS), SVC 87: the file's directory entry read (24B7H).
196AH@FLAGS (SYS0/SYS), SVC 101: Index Register IY = 006AH (2482H).
1981H@FSPEC (SYS1/SYS), SVC 78: the spec into FCBDEV (2447H).
1987H@PARAM (SYS1/SYS), SVC 17: LRL and DATE (243EH).
198AH@OPEN (SYS2/SYS), SVC 59: the file (2489H).
1990H@GTDCB (SYS2/SYS), SVC 82: the device (2456H).
1996H@RENAME (SYS2/SYS), SVC 56: the device to its own name, to tell a system device (246BH).
1999H@CLOSE (SYS3/SYS), SVC 60: the file with close authority (24ABH) and the copy of a route's FCB (2506H).
1B0FH@ERROR (the SYS0/SYS stub that loads SYS4/SYS), SVC 26: the short error message (2419H).

Memory Used by Member 11 (FILTER and SET)

Address
Size
Contents
006CH
1 byte
CFLAG$ (Index Register IY + 02H)
Bit 0, HIGH$ frozen, tested by SET (2C06H); bit 3, the system request bit, set by SET just before it enters the program (2CADH) and cleared by SYS1's CLEANUP at 1E7CH, on every @EXIT and @CMNDI.
007CH
1 byte
SFLAG$ (Index Register IY + 12H)
Bit 2 set before each @LOAD (2C69H, 2C84H), so that a file of EXEC protection is opened with READ access; @OPEN clears it.
0208H-02FFH
248 bytes
The DCBs (BOOT/SYS)
@GTDCB finds a device by the name at +6 and +7 (2C45H, 2CD6H, 2CFAH) or a spare DCB (2C63H); SET tests the NIL bit (2C48H) and writes +0, +3, +6 and +7 (2C97H-2CA9H); FILTER tests the filter DCB's bit 6 (2CD9H), reads its vector (2CE0H, 2CE2H) and swaps +0 to +2 with the device's DCB (2D00H-2D07H).
0420H-046FH
80 bytes
INBUF$ (BOOT/SYS)
The command line, which Register Pair HL points into; the program SET enters gets HL at its parameters (2CACH).
1D00H-1DFFH
256 bytes
SBUFF$ (SYS0/SYS)
The buffer @LOAD reads the program file through (2C72H, 2C8AH).
2400H-2BFFHThe program's load area
Where the source means a driver or filter program to load, below the member; its blocks must stay out of 2C00H-2E0CH.
2DADH-2DCCH
32 bytes
SAVSPEC
After the member, not in the file. The copy of the file spec as typed (2C34H), given /DVR by @FEXT (2C83H) and loaded at 2C8AH.
2DCDH-2DECH
32 bytes
DEVFCB
After the member, not in the file. The device spec from @FSPEC (2C12H, 2CB7H), first character read at 2C16H and 2CBBH; its two letters at 2DCEH-2DCFH are read at 2C3FH, 2CA1H, 2CA6H and 2CF4H; the old and new name of @RENAME (2C56H).
2DEDH-2E0CH
32 bytes
PGMFCB
After the member, not in the file. SET's file spec from @FSPEC (2C21H), its first character read at 2C25H, copied to SAVSPEC (2C34H), given /FLT by @FEXT (2C3CH) and loaded at 2C72H; for FILTER the filter device from @FSPEC (2CC6H), first character read at 2CCAH, whose two letters at 2DEEH-2DEFH are read at 2CD0H.
High memory or the low I/O zoneThe filter module's header
+4 the length of the name, then the name and the DCB word, read by FILTER (2CE8H-2CEDH).

Routines of Other Files Called by Member 11

AddressRoutine
0500H@LOGOT (BOOT/SYS), SVC 12: the five messages (2D30H).
0553H@CKBRKC (BOOT/SYS), SVC 106: BREAK cleared at FILTER's exit (2D3AH).
196AH@FLAGS (SYS0/SYS), SVC 101: Index Register IY = 006AH (2C05H).
1981H@FSPEC (SYS1/SYS), SVC 78: SET's specs (2C12H, 2C21H) and FILTER's (2CB7H, 2CC6H).
1984H@FEXT (SYS1/SYS), SVC 79: /FLT (2C3CH) and /DVR (2C83H).
1990H@GTDCB (SYS2/SYS), SVC 82: the device (2C45H), a spare DCB (2C63H), the filter device (2CD6H) and the device to filter (2CFAH).
1996H@RENAME (SYS2/SYS), SVC 56: the device to its own name, to tell a system device (2C56H).
1B0FH@ERROR (the SYS0/SYS stub that loads SYS4/SYS), SVC 26: the short error message (2D19H).
1B38H@LOAD (SYS0/SYS), SVC 76: the driver or filter program (2C72H, 2C8AH).
Transfer addressThe program SET loaded, entered by the RET at 2CB1H with Register Pair DE = the DCB and Register Pair HL = the parameters.

Memory Used by Member 12 (LIST)

Address
Size
Contents
0074H
1 byte
KFLAG$ (Index Register IY + 0AH)
Bit 1, the pause (SHIFT-@), tested by CKPAWS (26CFH); bits 1 and 2 (pause and ENTER) cleared by RESKFL (26E5H) at the start and after a pause.
007CH
1 byte
SFLAG$ (Index Register IY + 12H)
Bit 0 set by OPEN (273DH) so that @OPEN neither tests nor sets the open bit.
1D00H-1DFFH
256 bytes
SBUFF$ (SYS0/SYS)
The directory sector @DIRRD reads (2496H); DIR+4, the record length, is read at 24A1H.
2411H-2412H
2 bytes
SAVESP+1
The Stack Pointer of the entry, stored at 2409H and loaded by SAVESP (2410H).
24CAH, 24DAH, 24F0H, 251EH, 2533H, 2543H, 258EH, 25ADH, 268AH
2 bytes each
The parameter values, operands of LD instructions that @PARAM writes (PRMTBL$): P, HEX, LINE (0001H in the file), NUM, ASCII8 and A8, TAB (0008H in the file), REC (also the next record, 25A8H), LRL (also the record length from DIR+4, 24A2H) and NS (also written by P at 24D0H and by the key C at 26A6H).
254DH
1 byte
TABEXP+1
The width of a tab stop, stored at 24BEH, read at 254CH.
2530H
1 byte
PUCHAR+1
The first byte of a line, kept at 251AH while the line number is shown.
25B1H
1 byte
DOHEX1+1
The offset of the hex line in its record: 00H at 259AH, plus 16 at 25C5H.
266AH
1 byte
PUTOUT1+1
02H (@DSP) in the file, 06H (@PRT) after P (24D6H).
2690H, 26AEH
1 byte each
L2690 and L26AE, the page counts (6.3.1)
The lines left on the page (268FH, written at 2692H and 26AFH) and the lines of a page (26ADH): 11H in the file, 17 for the hex listing; 17H, 23, stored by 24E9H and 24ECH for the ASCII listing.
26ACH
1 byte
L26AC
The RST 28H (EFH) of @CLS at the pause; 00H, a NOP, for the ASCII listing (24E4H).
275BH-2762H, 2763H-276FHVARDOT, VARCLN and VAREQU
The line number (CVTDEC at 250FH, INCNUM at 252CH) and the hex heading (@HEX16 at 25A6H, @HEX8 at 25B7H, INCNUM at 2644H). The response bytes of the other parameters are set by @PARAM and not read.
27ABH, 27B7H
1 byte each
LRESP and TRESP
The response bytes of LRL (2497H) and TAB (24AFH), set by @PARAM.
27BBH
1 byte
BYTCTR
After the member, not in the file. The column, counted by PUTOUT (2673H-2685H), set to 0 for the ASCII listing (24E1H), read for tabs (2549H) and for the CKPAWS test at each new line (2560H).
27BCH-27CBH
16 bytes
LINBUF
After the member. The bytes of a hex line, stored at 25E0H and shown as characters from 2612H.
27CCH-27EBH
32 bytes
FCB1
After the member. The spec (2453H), given /TXT (246DH), opened (2470H, 2485H) and read; Index Register IX points at it from 248CH: +1 (24ABH), +7 and +6 (248EH, 2491H), +9 (24A8H).
27ECH-280BH
32 bytes
FCB2
After the member. The copy of the spec as typed (2465H), copied back at 2481H.
2900H-29FFH
256 bytes
IOBUFF
After the member, on the next page boundary. The file's buffer for @OPEN (2741H).

Routines of Other Files Called by Member 12

AddressRoutine
0500H@LOGOT (BOOT/SYS), SVC 12: File spec required (2427H).
0545H@CLS (BOOT/SYS), SVC 105: the screen cleared at a pause of the hex listing (26ACH).
0553H@CKBRKC (BOOT/SYS), SVC 106: BREAK at the entry (2402H), in CKPAWS (26CCH) and at the exit (2415H).
0628H@KEY (BOOT/SYS), SVC 1: the key at a page pause (2698H) and at a SHIFT-@ pause (26D6H).
0638H@GET (BOOT/SYS), SVC 3: the bytes of the file (24FCH, 2517H, 2574H, 25D0H).
063DH, 0642H@PRT and @DSP (BOOT/SYS), SVC 6 and 2: every byte sent (266BH).
07BDH, 07C2H@HEX16 and @HEX8 (BOOT/SYS), SVC 99 and 98: the record number (25A6H) and the offset (25B7H).
145BH@POSN (SYS0/SYS), SVC 66: the record REC (2595H).
18BBH@DIRRD (SYS0/SYS), SVC 87: the file's directory entry, for its record length (2496H).
196AH@FLAGS (SYS0/SYS), SVC 101: Index Register IY = 006AH (26C9H, 26E1H, 273CH).
1981H@FSPEC (SYS1/SYS), SVC 78: the spec (2453H).
1984H@FEXT (SYS1/SYS), SVC 79: /TXT (246DH).
1987H@PARAM (SYS1/SYS), SVC 17: the parameters (2442H).
198AH@OPEN (SYS2/SYS), SVC 59: the file (2746H).
1B0FH@ERROR (the SYS0/SYS stub that loads SYS4/SYS), SVC 26: the short error message (241FH).

Memory Used by Member 13 (DO)

Address
Size
Contents
007CH
1 byte
SFLAG$ (Index Register IY + 12H)
Bit 0 set before the opens of the JCL file (2434H), of the JCL to run (24D3H) and of an included file (27DFH), so that @OPEN neither tests nor sets the open bit and gives no close authority; @OPEN clears it. Bit 5 (DO active) is set by SYS11 after request 9DH (24E9H).
00C0H-00DFH
32 bytes
JFCB$ (BOOT/SYS)
The FCB of SYSTEM/JCL: SYSJCL copied in by MOVFCB (2503H), opened by @INIT with OUTBUF (245FH) and written by WRCPLD (26C4H), closed by CPLFIN (24C2H); the spec of DO = spec (24F5H); opened again to run with SBUFF$'s page as its buffer, written into JFCB$+4, 00C4H (24E4H), after JFCB$+6 and +7 are read (24DCH); closed by ERREXIT when its bit 7 is set (2979H).
0420H-046FH
80 bytes
INBUF$ (BOOT/SYS)
The command line DO comes in with (Register Pair HL, kept at 2480H); a continuation line is read from two bytes before that pointer (247FH), and with 79 characters runs into 0470H, DCT$ (B106).
1D00H-1DFFHSBUFF$ (SYS0/SYS)
Read by @DIRRD at 24E2H only for its page, which becomes the buffer of the JCL being run.
2400H-2463H
100 bytes
The entry code, then the compiled line (JCLBUF2 in the source)
The compile builds each line here (2595H, 2667H) and TSTCOND writes it out from here (26A6H); a line longer than 146 bytes runs on over UNNEST at 2492H and the code after it (B114).
2480H-2481H
2 bytes
INBUF+1
0000H in the file; the pointer DO came in with, stored at 2404H, read at 247FH.
24C6H
1 byte
NOEXEC?+1
00H in the file; 24H for DO $ (2419H), read at 24C5H: return after the compile.
2516H
1 byte
FNDLBL's operand
00H in the file; 40H after an at sign (2865H): the token being read is the label; cleared by MOVLBL (2550H).
263CH-263DH
2 bytes
BADH1's operand
2A8CH, BADJCL$, in the file; 2A00H, LINLNG$, after a line too long (2692H).
284BH
1 byte
The quote flag (STUFQT in the source, the operand of the XOR at 284AH)
22H in the file, outside quotes; 00H inside; toggled by each double quote (284CH), read at 2852H; never set back (B111).
285EH
1 byte
The label mark (the operand of the SUB at GOTLBL, 285DH)
00H in the file; 40H after the first at sign (2862H); read by TSTLBL (2556H); a second at sign is Too many Proc labels (B110).
2899H
1 byte
PAR6's operand
The field's length at the start of PARSER (2838H), 00H when a character is stored (2884H), read at 2898H for Z or NZ.
2982H-2983H
2 bytes
SPSAV+1
0000H in the file; the Stack Pointer at the entry (2400H), reloaded at 2981H.
298CH-29ABH
32 bytes
DOFCB
Not loaded. The FCB of the JCL file being compiled, or of the included file (2423H, 27D0H); saved and restored for //INCLUDE (27C8H, 249CH).
29ACH-29B3H
8 bytes
CURSYM
Not loaded. The token or name PARSNAM reads (27F3H).
29B4H-29D4H
33 bytes
STRLEN and VALBUF
Not loaded. A value's length (2813H) and its 32 characters (27FEH), copied into the table by MOVALUE (28B0H); written past by B109.
29D5H-29DDH
9 bytes
LBLSAV and its end mark
LBLSAV not loaded: the label of the DO line (254DH), compared at 2582H; 29DDH, 00H in the file, ends it as a table.
29DEH-29DFH
2 bytes
LINENO
0000H in the file; the number of the last line read, in all files (2672H), shown by BADHDR (262FH).
29E0H-29ECH
13 bytes
SYSJCL and DRVNUM
SYSTEM/JCL, 03H, 0, 03H in the file; P631G1 makes it SYSTEM/JCL:d (2AAFH); 29E7H-29E9H are also DOFEXT's extension (2985H).
2ACCH-2ACDH
2 bytes
NESTPTR
2ACEH in the file; the next free //INCLUDE save area (27CBH, 249FH).
2ACEH-2B6DH
160 bytes
NESTFCB
Not loaded. Five save areas of 32 bytes for the FCBs of the files that hold an open //INCLUDE.
2B6EH-2B6FH
2 bytes
CONDPTR
2B70H in the file; the current //IF level, read by IF04 (2736H), moved by 273CH and 2750H.
2B70H-2B8FH
32 bytes
CONDFLG and the levels
2B70H, 00H in the file, the first level, true; 2B71H-2B8FH not loaded, the states of nested //IFs, 00H true or FFH false; deeper levels run on into BADHDR$ and JCLBUF1 (B108).
2B90H-2B9DH
14 bytes
BADHDR$
Line xxxxx and the arrow; the line number written at 2B95H-2B99H by @HEXDEC (2634H).
2B9EH-2BEDH
80 bytes
JCLBUF1
Not loaded. The line read from the JCL file (2686H); a carriage return is stored at 2BEEH after a line too long (268DH).
2C00H-2CFFH
256 bytes
INPBUF
Not loaded. The buffer of DOFCB, for the JCL file and an included file.
2D00H-2DFFH
256 bytes
OUTBUF
Not loaded. The buffer of SYSTEM/JCL while it is written (245AH).
2E00H upSYMTAB
00H in the file; entries of 41 bytes, the name (8), the length (1) and the value (32), and a 00H after the last (28A7H, 28ACH, 28B6H); no upper limit (B115).

Routines of Other Files Called by Member 13

AddressRoutine
0500H@LOGOT (BOOT/SYS), SVC 12: the messages, BADHDR's line and the //QUIT line (263AH, 2972H).
0503H@LOGER (BOOT/SYS), SVC 11: a continuation line (248FH).
052DH@DSPLY (BOOT/SYS), SVC 10: a //. comment (26BFH).
0585H@KEYIN (BOOT/SYS), SVC 9: a continuation line (2489H).
0638H, 0642H, 0645H@GET, @DSP and @PUT (BOOT/SYS), SVC 3, 2 and 4: the JCL file's bytes (2680H), the question mark (247EH) and SYSTEM/JCL's bytes (26C4H).
06F6H@HEXDEC (BOOT/SYS), SVC 97: the line number of BADHDR (2634H).
149AH@RREAD (SYS0/SYS), SVC 69: the outer file's sector after an //INCLUDE (24A7H).
18BBH@DIRRD (SYS0/SYS), SVC 87: the page of SBUFF$ for the JCL's buffer (24E2H).
196AH@FLAGS (SYS0/SYS), SVC 101: Index Register IY = 006AH (2409H).
1981H, 1984H@FSPEC and @FEXT (SYS1/SYS), SVC 78 and 79: the specs (2428H, 24F5H, 27D5H) and /JCL (298AH).
198AH, 198DH, 1993H@OPEN, @INIT and @CKDRV (SYS2/SYS), SVC 59, 58 and 33: the JCL file (243AH), the JCL to run (24D9H), an included file (27E5H), SYSTEM/JCL (245FH) and the drive search (2449H).
1999H@CLOSE (SYS3/SYS), SVC 60: SYSTEM/JCL after the compile (24C2H) and after an error (2980H).
1B0FH@ERROR (the SYS0/SYS stub that loads SYS4/SYS), SVC 26: the short error message (294EH).
SYS11/SYSRequest 9DH, function 1: the start of the JCL's run (24E9H); it does not return.

Memory Used by Member 14 (RUN and LOAD)

Address
Size
Contents
0074H
1 byte
KFLAG$ (Index Register IY + 0AH)
Bits 0 (BREAK) and 2 (ENTER) tested by FLASH (2469H) and bit 2 by CKENT (249DH); bits 0 to 2 cleared by RESKFLG (24BCH).
007CH
1 byte
SFLAG$ (Index Register IY + 12H)
Bit 2 set by LOADIT (2512H) so that a file of EXEC protection loads.
1E00H-23FFHThe overlay area (SYS0/SYS)
SYS2/SYS is loaded there by request 84H (250EH) before the source diskette is asked for.
24FCH-24FDH
2 bytes
XPARM+1
0000H in the file; X's value (table word 258EH): FFFFH for a plain X, the number for X=n; read at 2408H, 242EH (low byte) and 24FBH.
258DH
1 byte
The response byte of X
Set by @PARAM, not read.
2594H-25B3H
32 bytes
FCB
Only its first byte, 00H, the member's last, is in the file. The spec from @FSPEC (24E0H), given /CMD (24F5H); the FCB of @LOAD (2413H, 2518H) and of @RUN (2439H).
3000H upThe program
Where the manual says it must load; nothing tests it.

Routines of Other Files Called by Member 14

AddressRoutine
0028HRST28, the SVC dispatcher: @RUN (SVC 77, 1B1DH) entered by a jump (2439H).
0382H@PAUSE (BOOT/SYS), SVC 16: the wait in FLASH (2468H).
052DH@DSPLY (BOOT/SYS), SVC 10: the prompts (2475H).
0500H@LOGOT (BOOT/SYS), SVC 12: File spec required and Command aborted (2457H).
0553H@CKBRKC (BOOT/SYS), SVC 106: BREAK at a prompt (2492H).
0635H, 0642H@KBD and @DSP (BOOT/SYS), SVC 8 and 2: the type-ahead emptied (24ACH) and the control codes sent (2522H).
196AH@FLAGS (SYS0/SYS), SVC 101: Index Register IY = 006AH (24D2H).
1981H, 1984H, 1987H@FSPEC, @FEXT and @PARAM (SYS1/SYS), SVC 78, 79 and 17: the spec (24E0H), /CMD (24F5H) and X (24CEH).
1B0FH@ERROR (the SYS0/SYS stub that loads SYS4/SYS), SVC 26: the short error message (2453H).
1B38H@LOAD (SYS0/SYS), SVC 76: the program (2413H, 2518H).
SYS2/SYSRequest 84H: SYS2/SYS loaded and nothing else (250EH).

Disassembly

2400H - Member 1 (MEMORY): Entry and the Parameters

SYS1/SYS runs MEMORY with request 88H and Register B = 1EH, the member byte of its command table entry; the overlay loader of SYS0/SYS reads member 1 to 2400H-2983H and calls 2400H with Register Pair HL at the text after the word MEMORY. The member checks BREAK, keeps the Stack Pointer for its exit, lets @PARAM fill in its parameter table (28AAH) and checks that every parameter got a kind of value it allows.

2400MEMORY
LD A,6AH 3E 6A
MEMORY: load Register A with 6AH, SVC 106, @CKBRKC, the SVC that tests and clears the BREAK key.
2402
RST 28H EF
Call @CKBRKC with RST 28H: the Z flag comes back set when BREAK was not pressed, cleared when it was.
2403
If the Z flag is set (no BREAK) jump to BEGINA at 2409H to run the command.
2405
LD HL,FFFFH 21 FF FF
BREAK was pressed: load Register Pair HL with FFFFH, the return code of an abort.
2408
RET C9
Return to SYS1/SYS's caller with Register Pair HL = FFFFH, doing nothing.
2409BEGINA
LD (2809H),SP ED 73 09 28
BEGINA: store the Stack Pointer into 2809H, the operand of the LD SP,0000H of EXIT (2808H), so that every error path can drop what it pushed and return.
240D
LD DE,28AAH 11 AA 28LD DE,PRMTBL$
Load Register Pair DE with 28AAH, PRMTBL$, the parameter table of MEMORY in the 6.x form @PARAM reads.
2410
PUSH DE D5
Push Register Pair DE (28AAH) onto the stack (Stack Pointer) to have the table start again after @PARAM.
2411
LD A,11H 3E 11
Load Register A with 11H, SVC 17, @PARAM, which reads the parameters at Register Pair HL against the table at Register Pair DE.
2413
RST 28H EF
Call @PARAM with RST 28H: each parameter's value goes into the word its table entry points at, its kind into the entry's response byte; NZ means a parameter error.
2414
POP HL E1
Pop Register Pair HL (28AAH, the table start) from the stack (Stack Pointer) for CKPARM.
2415PERR
PERR: if the Z flag is cleared (an error of @PARAM, or a parameter error passed on by 241BH, 2444H or 2473H) jump to PRMERR at 27EEH for the Parameter error message.
2418GDPARMS
GDPARMS: call CKPARM at 27B8H with Register Pair HL at the table: it returns NZ if a parameter was given a kind of value (number, flag or string) that its entry does not allow.
241B
If the Z flag is cleared jump back to PERR at 2415H, whose JP NZ goes to the Parameter error.
241D
LD A,65H 3E 65
Load Register A with 65H, SVC 101, @FLAGS, which returns the system flag table in Index Register IY.
241F
RST 28H EF
Call @FLAGS with RST 28H: Index Register IY = 006AH, FLGTAB$, so that CFLAG$ is at IY+02H.

2420H - CLEAR: Fill Memory with a Byte

CLEAR (C) is not in the manual's table of MEMORY parameters. CLEAR alone or CLEAR=Y fills with 00H, CLEAR=N does nothing, CLEAR=X'nn' or a decimal number fills with its low byte, and CLEAR="c" fills with that one character. The fill runs from 2465H, inside MEMORY itself, to HIGH$, or to LOW$ for a command run by a program through @CMNDR, and MEMORY returns at once after it: CLEAR ignores every other parameter. HIGH$ frozen (CFLAG$ bit 0) gives No memory available.

2420CPARM
LD BC,FF00H 01 00 FF
CPARM: load Register Pair BC with the value of CLEAR, which @PARAM stores into 2421H-2422H (FF00H when CLEAR is not given): Register C is the fill byte, Register B is FFH for CLEAR alone or Y.
2423
LD A,(28DDH) 3A DD 28LD A,(CRESP)
Load Register A with the response byte of CLEAR at 28DDH (CRESP): bit 7 numeric, bit 6 flag, bit 5 string with the length in bits 3-0, 00H if CLEAR was not given.
2426
OR A B7
OR Register A with itself to test the response byte.
2427
If the Z flag is set (no CLEAR) jump to NEXTPRM at 2465H for ADD and the rest.
2429
BIT 0,(IY+02H) FD CB 02 46
Test bit 0 of CFLAG$ (IY+02H, 006CH), set while HIGH$ is frozen. Index Register IY holds 006AH from @FLAGS.
242D
If the Z flag is cleared (memory frozen) jump to NOMEM at 27FBH for No memory available.
2430
BIT 6,A CB 77
Test bit 6 of Register A, the flag bit of the response.
2432
If the Z flag is set (not a flag: a number or a string) jump to ISNUMER at 2439H.
2434L2434
INC B 04
L2434: increment Register B: FFH for CLEAR alone or Y (value FFFFH) becomes 00H and sets the Z flag; 00H for N (value 0000H) becomes 01H.
2435
If the Z flag is cleared (CLEAR=N) jump to NEXTPRM at 2465H without clearing.
2437
Jump to FILLMEM at 2448H with the fill byte at 245EH still 00H.
2439ISNUMER
LD HL,245EH 21 5E 24
ISNUMER: load Register Pair HL with 245EH, the operand of the LD (HL),00H at FILLBYT (245DH), the fill byte.
243C
BIT 7,A CB 7F
Test bit 7 of Register A, the numeric bit of the response.
243E
LD (HL),C 71
Store Register C, the low byte of the value, into 245EH (Register Pair HL): for a number this is the fill byte.
243F
If the Z flag is cleared (a number) jump to FILLMEM at 2448H.
2441
AND 0FH E6 0F
A string: AND Register A with 0FH to keep its length.
2443
DEC A 3D
Decrement Register A: the Z flag is set only for a string of one character.
2444
If the Z flag is cleared (a longer or empty string) jump to PERR at 2415H, whose JP NZ goes to the Parameter error.
2446
LD A,(BC) 0A
Load Register A with the character at the address in Register Pair BC, which @PARAM sets to the first character of a string.
2447
LD (HL),A 77
Store Register A, the character, into 245EH (Register Pair HL) as the fill byte.
2448FILLMEM
FILLMEM: call GETHILO at 27DEH: Register Pair HL = HIGH$, Register Pair DE = LOW$.
244B
BIT 1,(IY+02H) FD CB 02 4E
Test bit 1 of CFLAG$ (IY+02H, 006CH), set by SYS1/SYS while a command runs through @CMNDR for a program. Index Register IY holds 006AH from @FLAGS.
244F
If the Z flag is set (a command typed at LS-DOS Ready) jump to USEHIGH at 2452H to fill up to HIGH$.
2451
EX DE,HL EB
Run through @CMNDR: exchange Register Pairs DE and HL so that Register Pair HL is LOW$, the top of the fill, and the program's memory above it is kept.
2452USEHIGH
LD DE,2465H 11 65 24LD DE,NEXTPRM
USEHIGH: load Register Pair DE with 2465H, the first byte to fill: everything of MEMORY from NEXTPRM on, while the fill loop at 245DH-2464H is left in place.
2455
XOR A AF
XOR Register A with itself to clear the Carry flag for the SBC.
2456
SBC HL,DE ED 52
Subtract Register Pair DE (2465H) from Register Pair HL (the top) with SBC: Register Pair HL = the number of bytes after the first one.
2458
LD B,H 44
Load Register B with Register H, the high byte of the count.
2459
LD C,L 4D
Load Register C with Register L: Register Pair BC = the count for LDIR.
245A
LD H,D 62
Load Register H with Register D, the high byte of 2465H.
245B
LD L,E 6B
Load Register L with Register E: Register Pair HL = 2465H, the first byte.
245C
INC DE 13
Increment Register Pair DE to 2466H, one past Register Pair HL, so that LDIR carries the byte up through memory.
245DFILLBYT
LD (HL),00H 36 00
FILLBYT: store the fill byte into the address in Register Pair HL (2465H); its operand at 245EH is set by CLEAR.
245F
LDIR ED B0
LDIR: copy (HL) to (DE) with Register Pairs HL and DE counting up and Register Pair BC down, which repeats the fill byte up to the top.
2461GOODEX
LD HL,0000H 21 00 00
GOODEX: load Register Pair HL with 0000H, the return code of a good exit.
2464
RET C9
Return to SYS1/SYS's caller with Register Pair HL = 0000H (MEMORY's last exit, also reached from 27B1H).

2465H - ADD, WORD and BYTE: Show and Change Memory

ADD=address shows the address in hex and decimal and the two bytes there in the order they lie in memory (the manual's LO-HI format); WORD=X'nnnn' stores the two bytes of its value in that order, high byte first, BYTE=X'nn' stores one byte, and the line shows old => new. Not in the manual: ADD="c" with one letter takes the address of that system flag (ADD="C" is CFLAG$, 006CH), and the manual's limits (WORD not 0, BYTE not X'FF') are not tested. The line ends without a carriage return so that the High and Low line follows on it.

2465NEXTPRM
LD A,(28BEH) 3A BE 28LD A,(ARESP)
NEXTPRM: load Register A with the response byte of ADD at 28BEH (ARESP), 00H if ADD was not given.
2468
OR A B7
OR Register A with itself to test the response byte.
2469
If the Z flag is set (no ADD) jump to HICHECK at 250CH for HIGH and LOW.
246C
BIT 7,A CB 7F
Test bit 7 of Register A, the numeric bit of the response.
246E
If the Z flag is cleared (a number) jump to APARM at 248CH with the address in its operand.
2470
AND 0FH E6 0F
A string: AND Register A with 0FH to keep its length.
2472
DEC A 3D
Decrement Register A: the Z flag is set only for a string of one character.
2473
If the Z flag is cleared jump to PERR at 2415H, whose JP NZ goes to the Parameter error.
2475
LD HL,(248DH) 2A 8D 24
Load Register Pair HL with the word at 248DH, the operand of APARM, where @PARAM stored the address of the string's first character.
2478
LD A,(HL) 7E
Load Register A with the character at the address in Register Pair HL.
2479
RES 5,A CB AF
Reset bit 5 of Register A to make a lower case letter upper case.
247B
SUB 41H D6 41
Subtract 41H (A) from Register A: the number of the flag, 0 for A to 25 for Z.
247D
CP 1AH FE 1A
Compare Register A with 1AH (26). The 26 letters A to Z give 00H to 19H.
247F
If the Carry flag is cleared (not a letter A to Z) jump to RANGER at 27FFH for Range error.
2482
PUSH IY FD E5
Push Index Register IY (006AH, the flag table) onto the stack (Stack Pointer).
2484
POP HL E1
Pop it into Register Pair HL: Register Pair HL = 006AH, FLGTAB$, where AFLAG$ is.
2485
LD D,00H 16 00
Load Register D with 00H, the high byte of the offset.
2487
LD E,A 5F
Load Register E with Register A: Register Pair DE = the flag's number.
2488
ADD HL,DE 19
Add Register Pair DE to Register Pair HL: Register Pair HL = 006AH plus the number, the address of that letter's flag byte.
2489
LD (248DH),HL 22 8D 24
Store Register Pair HL into 248DH, the operand of APARM, as the address to show.
248CAPARM
LD DE,0000H 11 00 00
APARM: load Register Pair DE with the address of ADD, stored into 248DH-248EH by @PARAM or by 2489H. The operand is 0000H as assembled.
248F
LD HL,290AH 21 0A 29LD HL,HEXADD
Load Register Pair HL with 290AH, HEXADD, the four hex digits of the address in the message.
2492
LD A,63H 3E 63
Load Register A with 63H, SVC 99, @HEX16, which writes Register Pair DE as four hex digits at Register Pair HL.
2494
RST 28H EF
Call @HEX16 with RST 28H: the address in hex goes to 290AH-290DH; Register Pair DE is kept.
2495
EX DE,HL EB
Exchange Register Pairs DE and HL: Register Pair HL = the address.
2496
PUSH HL E5
Push Register Pair HL, the address, onto the stack (Stack Pointer), as @HEXDEC uses it up.
2497
LD DE,2912H 11 12 29LD DE,DECADD
Load Register Pair DE with 2912H, DECADD, the five decimal digits in the message.
249A
LD A,61H 3E 61
Load Register A with 61H, SVC 97, @HEXDEC, which writes Register Pair HL in decimal, five characters with leading spaces, at Register Pair DE.
249C
RST 28H EF
Call @HEXDEC with RST 28H: the address in decimal goes to 2912H-2916H.
249D
POP HL E1
Pop the address from the stack (Stack Pointer) into Register Pair HL.
249E
PUSH HL E5
Push Register Pair HL, the address, onto the stack (Stack Pointer) again for the store of WORD or BYTE at 24AFH.
249F
LD C,(HL) 4E
Load Register C with the byte at the address in Register Pair HL, the old byte.
24A0
LD D,C 51
Load Register D with Register C: the byte at the address goes first in the word shown.
24A1
INC HL 23
Increment Register Pair HL to the next address.
24A2
LD E,(HL) 5E
Load Register E with the byte at the address in Register Pair HL: Register Pair DE = the two bytes in memory order.
24A3
LD HL,2930H 21 30 29LD HL,OLDBYTE
Load Register Pair HL with 2930H, OLDBYTE, the two hex digits of the old byte.
24A6
LD A,62H 3E 62
Load Register A with 62H, SVC 98, @HEX8, which writes Register C (the dispatcher passes it in Register A) as two hex digits at Register Pair HL.
24A8
RST 28H EF
Call @HEX8 with RST 28H: the old byte goes to 2930H-2931H.
24A9
LD HL,291CH 21 1C 29LD HL,OLDWORD
Load Register Pair HL with 291CH, OLDWORD, the four hex digits of the old word.
24AC
LD A,63H 3E 63
Load Register A with 63H, SVC 99, @HEX16, for Register Pair DE.
24AE
RST 28H EF
Call @HEX16 with RST 28H: the two bytes go to 291CH-291FH.
24AF
POP IX DD E1
Pop the address from the stack (Stack Pointer) into Index Register IX for the stores.
24B1
LD HL,28CEH 21 CE 28LD HL,BRESP
Load Register Pair HL with 28CEH, BRESP, the response byte of BYTE.
24B4
LD DE,28C6H 11 C6 28LD DE,WRESP
Load Register Pair DE with 28C6H, WRESP, the response byte of WORD.
24B7
LD A,(DE) 1A
Load Register A with the response byte of WORD at the address in Register Pair DE (28C6H).
24B8
OR (HL) B6
OR Register A with the response byte of BYTE at the address in Register Pair HL (28CEH).
24B9
If the Z flag is cleared (WORD or BYTE given) jump to WHICH at 24CBH.
24BB
LD HL,2921H 21 21 29
Neither: load Register Pair HL with 2921H, just past the old word in the message.
24BE
LD (HL),29H 36 29
Store 29H, a closing parenthesis, into 2921H (Register Pair HL) in place of the space of => so that no new word is shown.
24C0
INC HL 23
Increment Register Pair HL to 2922H. The next byte of the old word string.
24C1
LD (HL),20H 36 20
Store 20H, a space, into 2922H (Register Pair HL).
24C3
INC HL 23
Increment Register Pair HL to 2923H. The next byte of the old word string.
24C4
LD (HL),20H 36 20
Store 20H, a space, into 2923H (Register Pair HL).
24C6
INC HL 23
Increment Register Pair HL to 2924H. The last byte to change.
24C7
LD (HL),03H 36 03
Store 03H into 2924H (Register Pair HL): the string ends with a closing parenthesis and two spaces and no carriage return.
24C9
Jump to DSPSTR at 24F7H to show the line. No value is stored.
24CBWHICH
LD A,(DE) 1A
WHICH: load Register A with the response byte of WORD at the address in Register Pair DE (28C6H).
24CC
OR A B7
OR Register A with itself to test it. Z means WORD was not given.
24CD
If the Z flag is set (no WORD, so BYTE) jump to BPARM at 24E5H.
24CF
LD A,(HL) 7E
Load Register A with the response byte of BYTE at the address in Register Pair HL (28CEH).
24D0
OR A B7
OR Register A with itself to test it. Z means BYTE was not given.
24D1
If the Z flag is cleared (WORD and BYTE both given) jump to PRMERR at 27EEH for the Parameter error.
24D4WPARM
LD DE,0000H 11 00 00
WPARM: load Register Pair DE with the value of WORD, stored into 24D5H-24D6H by @PARAM. The operand is 0000H as assembled.
24D7
LD (IX+00H),D DD 72 00
Store Register D, the high byte of WORD, at the address in Index Register IX (IX+00H): the first byte in memory, as the word is shown.
24DA
LD (IX+01H),E DD 73 01
Store Register E, the low byte of WORD, at the address in Index Register IX plus 1 (IX+01H).
24DDSTUFVAL
LD HL,2927H 21 27 29LD HL,NEWWORD
STUFVAL: load Register Pair HL with 2927H, NEWWORD, the four hex digits of the new word.
24E0
LD A,63H 3E 63
Load Register A with 63H, SVC 99, @HEX16, for Register Pair DE.
24E2
RST 28H EF
Call @HEX16 with RST 28H: the new word goes to 2927H-292AH.
24E3
Jump to DSPSTR at 24F7H to show the line. With the new word in the message.
24E5BPARM
LD DE,00FFH 11 FF 00
BPARM: load Register Pair DE with the value of BYTE, stored into 24E6H-24E7H by @PARAM (00FFH as assembled; only read when BYTE is given).
24E8
LD A,D 7A
Load Register A with Register D, the high byte of the value.
24E9
OR A B7
OR Register A with itself: the value must be below 0100H.
24EA
If the Z flag is cleared (above FFH) jump to PRMERR at 27EEH for the Parameter error.
24ED
LD (IX+00H),E DD 73 00
Store Register E, the byte, at the address in Index Register IX (IX+00H).
24F0
LD C,E 4B
Load Register C with Register E, the new byte, for @HEX8.
24F1
LD HL,2939H 21 39 29LD HL,NEWBYTE
Load Register Pair HL with 2939H, NEWBYTE, the two hex digits of the new byte.
24F4
LD A,62H 3E 62
Load Register A with 62H, SVC 98, @HEX8, for Register C.
24F6
RST 28H EF
Call @HEX8 with RST 28H: the new byte goes to 2939H-293AH.
24F7DSPSTR
LD HL,2908H 21 08 29LD HL,ADDMSG
DSPSTR: load Register Pair HL with 2908H, ADDMSG, the start of the line X'nnnn' = ddddd (X'.
24FA
Call DSPLY at 2790H to send the first part of the line to the display, and to the printer with PRINT.
24FD
LD HL,291CH 21 1C 29LD HL,OLDWORD
Load Register Pair HL with 291CH, OLDWORD, the word string nnnn' => X'nnnn').
2500
LD A,(28CEH) 3A CE 28LD A,(BRESP)
Load Register A with the response byte of BYTE at 28CEH (BRESP).
2503
OR A B7
OR Register A with itself to test it. Z means BYTE was not given.
2504
If the Z flag is set (no BYTE) jump to DSPSTR2 at 2509H with Register Pair HL at the word string.
2506
LD HL,2930H 21 30 29LD HL,OLDBYTE
BYTE was given: load Register Pair HL with 2930H, OLDBYTE, the byte string nn' => X'nn').
2509DSPSTR2
DSPSTR2: call DSPLY at 2790H to send the string at Register Pair HL; it ends with 03H, so the High and Low line goes on after it.

250CH - HIGH and LOW: Move HIGH$ Down, Set LOW$

HIGH=address must not be above the present HIGH$. MEMORY reserves the memory above it behind a ten byte module header (27D4H): JR over the header, the old HIGH$, and the name &nnnn with the reserved block's first address, so that the memory map lists it. HIGH$ becomes the address given less 10, as the Note line says, and the block runs from the address given plus 1 to the old HIGH$. LOW= must be 2600H or more. HIGH$ is then checked to be not below LOW$, LOW$ is set (always, even with neither parameter) and HIGH$ is set when HIGH was given. With HIGH$ frozen either parameter gives No memory available.

250CHICHECK
HICHECK: call GETHILO at 27DEH: Register Pair HL = HIGH$, Register Pair DE = LOW$.
250F
LD (27D6H),HL 22 D6 27LD (OLDHI),HL
Store Register Pair HL, the present HIGH$, into 27D6H, OLDHI in the module header, as the last byte of the block to reserve.
2512
LD A,(28B0H) 3A B0 28LD A,(HRESP)
Load Register A with the response byte of HIGH at 28B0H (HRESP).
2515
OR A B7
OR Register A with itself to test it. Z means HIGH was not given.
2516
If the Z flag is set (no HIGH) jump to LOCHECK at 2536H with Register Pair HL still the present HIGH$.
2518
BIT 0,(IY+02H) FD CB 02 46
Test bit 0 of CFLAG$ (IY+02H, 006CH), set while HIGH$ is frozen. Index Register IY holds 006AH from @FLAGS.
251C
If the Z flag is cleared (frozen) jump to NOMEM at 27FBH for No memory available.
251FHPARM
LD BC,0000H 01 00 00
HPARM: load Register Pair BC with the value of HIGH, stored into 2520H-2521H by @PARAM. The operand is 0000H as assembled.
2522
SBC HL,BC ED 42
Subtract Register Pair BC (the new HIGH$) from Register Pair HL (the present HIGH$) with SBC; the Carry flag is clear after the OR A at 2515H.
2524
If the Carry flag is set (the new HIGH$ is above the present one) jump to RANGER at 27FFH for Range error.
2527
PUSH DE D5
Push Register Pair DE (LOW$) onto the stack (Stack Pointer).
2528
LD D,B 50
Load Register D with Register B, the high byte of the new HIGH$.
2529
LD E,C 59
Load Register E with Register C: Register Pair DE = the new HIGH$.
252A
INC DE 13
Increment Register Pair DE: the first address of the reserved block.
252B
LD HL,27DAH 21 DA 27LD HL,HD_ADD
Load Register Pair HL with 27DAH, HD_ADD, the four hex digits of the header's name &nnnn.
252E
LD A,63H 3E 63
Load Register A with 63H, SVC 99, @HEX16, which writes Register Pair DE as four hex digits at Register Pair HL (Register Pair BC is kept).
2530
RST 28H EF
Call @HEX16 with RST 28H: the block's first address goes into the name at 27DAH-27DDH.
2531
LD HL,FFF6H 21 F6 FF
Load Register Pair HL with FFF6H, minus 10, the size of the header.
2534
ADD HL,BC 09
Add Register Pair BC to Register Pair HL: Register Pair HL = the new HIGH$ less 10, the HIGH$ that will be set. There is no test for a value below 10, which wraps round (B40).
2535
POP DE D1
Pop LOW$ from the stack (Stack Pointer) into Register Pair DE.
2536LOCHECK
LD A,(28B7H) 3A B7 28LD A,(LRESP)
LOCHECK: load Register A with the response byte of LOW at 28B7H (LRESP).
2539
OR A B7
OR Register A with itself to test it. Z means LOW was not given.
253A
If the Z flag is set (no LOW) jump to CHKBOTH at 2552H with Register Pair DE the present LOW$.
253C
BIT 0,(IY+02H) FD CB 02 46
Test bit 0 of CFLAG$ (IY+02H, 006CH), set while HIGH$ is frozen. Index Register IY holds 006AH from @FLAGS.
2540
If the Z flag is cleared (frozen) jump to NOMEM at 27FBH for No memory available.
2543LPARM
LD DE,0000H 11 00 00
LPARM: load Register Pair DE with the value of LOW, stored into 2544H-2545H by @PARAM. The operand is 0000H as assembled.
2546
LD BC,2600H 01 00 26LD BC,LOWEST
Load Register Pair BC with 2600H, LOWEST, the lowest LOW$ allowed.
2549
EX DE,HL EB
Exchange Register Pairs DE and HL: Register Pair HL = the new LOW$, Register Pair DE = HIGH$.
254A
PUSH HL E5
Push Register Pair HL (the new LOW$) onto the stack (Stack Pointer).
254B
SBC HL,BC ED 42
Subtract Register Pair BC (2600H) from Register Pair HL with SBC; the Carry flag is clear after the OR A at 2539H.
254D
POP HL E1
Pop the new LOW$ from the stack (Stack Pointer) into Register Pair HL.
254E
EX DE,HL EB
Exchange Register Pairs DE and HL back: Register Pair DE = the new LOW$, Register Pair HL = HIGH$.
254F
If the Carry flag is set (the new LOW$ is below 2600H) jump to RANGER at 27FFH for Range error.
2552CHKBOTH
PUSH HL E5
CHKBOTH: push Register Pair HL (HIGH$) onto the stack (Stack Pointer).
2553
OR A B7
OR Register A with itself to clear the Carry flag for the SBC.
2554
SBC HL,DE ED 52
Subtract Register Pair DE (LOW$) from Register Pair HL (HIGH$) with SBC.
2556
POP HL E1
Pop HIGH$ from the stack (Stack Pointer) into Register Pair HL.
2557
If the Carry flag is set (HIGH$ below LOW$) jump to RANGER at 27FFH for Range error.
255A
EX DE,HL EB
Exchange Register Pairs DE and HL: Register Pair DE = HIGH$, Register Pair HL = LOW$.
255B
LD B,01H 06 01
Load Register B with 01H, the LOW$ function of @HIGH$.
255D
LD A,64H 3E 64
Load Register A with 64H, SVC 100, @HIGH$, which sets LOW$ to Register Pair HL when Register B is 1 and Register Pair HL is not 0000H.
255F
RST 28H EF
Call @HIGH$ with RST 28H to set LOW$; its error return for frozen memory is not tested here.
2560
LD A,(28B0H) 3A B0 28LD A,(HRESP)
Load Register A with the response byte of HIGH at 28B0H (HRESP).
2563
OR A B7
OR Register A with itself to test it. Z means HIGH was not given.
2564
If the Z flag is set (no HIGH) jump to DSPHI at 2579H.
2566
LD A,0AH 3E 0A
Load Register A with 0AH, a line feed. It will replace the carriage return at 2940H.
2568
LD (2940H),A 32 40 29LD (HEADMES),A
Store Register A into 2940H, the first byte of HEADMES: the carriage return there, which only ends the High and Low line, becomes a line feed so that the line Note : Memory Header Inserted follows.
256B
PUSH DE D5
Push Register Pair DE, the new HIGH$, onto the stack (Stack Pointer).
256C
INC DE 13
Increment Register Pair DE: the first byte of the header, one above the new HIGH$.
256D
LD HL,27D4H 21 D4 27LD HL,HEADER
Load Register Pair HL with 27D4H, HEADER, the ten bytes of the module header.
2570
LD BC,000AH 01 0A 00LD BC,HLEN
Load Register Pair BC with 000AH, the length of the header.
2573
LDIR ED B0
LDIR: copy the header from (HL) to (DE) with Register Pairs HL and DE counting up and Register Pair BC down to 0000H.
2575
POP HL E1
Pop the new HIGH$ from the stack (Stack Pointer) into Register Pair HL; Register B is 00H after LDIR, the HIGH$ function.
2576
LD A,64H 3E 64
Load Register A with 64H, SVC 100, @HIGH$, which sets HIGH$ to Register Pair HL when Register B is 0.
2578
RST 28H EF
Call @HIGH$ with RST 28H to set HIGH$. Register Pair HL = the new HIGH$, Register B = 00H.

2579H - The High and Low Line and the Memory Banks

Every MEMORY command ends with these lines (6.3.1 added the banks and the memory map): High = X'hhhh' Low = X'llll', the Note line when HIGH was given, then 32K Banks avail = ff/tt, In use = <...>. MEMORY counts the banks by selecting banks 1, 2, 3 in turn with @BANK until one is refused (bank 3 always is), then selects bank 0; it then tests each bank's in use bit: a minus sign for a bank not in use, a plus sign for one in use, the first number counting the minus signs. Bank 0, the normal upper 32K, has its bit clear (SYS0/SYS sets BUR$ to FEH, or F8H with 128K, at 1E71H) and counts as free.

2579DSPHI
DSPHI: call GETHILO at 27DEH: Register Pair HL = HIGH$, Register Pair DE = LOW$, as now set.
257C
PUSH HL E5
Push Register Pair HL (HIGH$) onto the stack (Stack Pointer).
257D
LD HL,2902H 21 02 29LD HL,LOWIS1
Load Register Pair HL with 2902H, LOWIS1, the four hex digits of Low = X'.
2580
LD A,63H 3E 63
Load Register A with 63H, SVC 99, @HEX16, which writes Register Pair DE as four hex digits at Register Pair HL.
2582
RST 28H EF
Call @HEX16 with RST 28H: LOW$ goes to 2902H-2905H.
2583
POP DE D1
Pop HIGH$ from the stack (Stack Pointer) into Register Pair DE.
2584
LD HL,28F3H 21 F3 28LD HL,HIGHIS1
Load Register Pair HL with 28F3H, HIGHIS1, the four hex digits of High = X'.
2587
LD A,63H 3E 63
Load Register A with 63H, SVC 99, @HEX16, for Register Pair DE.
2589
RST 28H EF
Call @HEX16 with RST 28H: HIGH$ goes to 28F3H-28F6H.
258A
LD HL,28EAH 21 EA 28LD HL,HIGHIS
Load Register Pair HL with 28EAH, HIGHIS, the line High = X'hhhh' Low = X'llll' ending with 03H.
258D
Call DSPLY at 2790H to show the line (after ADD's line, on the same line).
2590
LD HL,2940H 21 40 29LD HL,HEADMES
Load Register Pair HL with 2940H, HEADMES: a carriage return alone, which ends the line, or with HIGH a line feed and Note : Memory Header Inserted.
2593
Call DSPLY at 2790H to send it with @LOGOT, and to the printer with PRINT.
2596
Call 2771H to count the line against the screen (The Note line, when it is shown, is not counted, so the first screen can take one line more.)
2599L2599
LD BC,0000H 01 00 00
L2599: load Register Pair BC with 0000H: Register B = 00H, the select function of @BANK, Register C = the bank, counted from 1.
259CL259C
INC C 0C
L259C: increment Register C, the next bank to try.
259D
PUSH BC C5
Push Register Pair BC onto the stack (Stack Pointer), as @BANK changes it.
259E
LD A,66H 3E 66
Load Register A with 66H, SVC 102, @BANK, which gets the bank in Register A from the caller's Register C and the function in Register B.
25A0
RST 28H EF
Call @BANK with RST 28H to select bank C: it switches the upper 32K of memory to that bank, or returns NZ if the bank is not installed or is above 2, or if the Stack Pointer @BANK sees (a few bytes below the program's, after the RST and the dispatcher) is 7FFBH or higher (B41).
25A1
POP BC C1
Pop Register Pair BC from the stack (Stack Pointer).
25A2
If the Z flag is set (the bank was selected) jump back to L259C at 259CH for the next one.
25A4
PUSH BC C5
Push Register Pair BC onto the stack (Stack Pointer): Register C = the first bank refused, the number of banks.
25A5
LD C,B 48
Load Register C with Register B (00H): bank 0, with function 0, select.
25A6
LD A,66H 3E 66
Load Register A with 66H, SVC 102, @BANK. Register B = 00H, select; Register C = 00H, bank 0.
25A8
RST 28H EF
Call @BANK with RST 28H to select bank 0 again, the bank that was selected when MEMORY started, as SYS1/SYS selects bank 0 (CMD20) before it runs any library command.
25A9
POP BC C1
Pop Register Pair BC from the stack (Stack Pointer).
25AA
LD E,C 59
Load Register E with Register C, the number of banks, for the loop at 25B9H.
25AB
LD A,C 79
Load Register A with Register C, the number of banks, to make two decimal digits.
25ACL25AC
L25AC: call 27A2H: Register C = the tens digit and Register B = the units digit of Register A.
25AF
LD (2975H),BC ED 43 75 29LD (L2975),BC
Store Register Pair BC into 2975H-2976H, the dd after the slash: the tens digit at 2975H, the units at 2976H.
25B3
LD HL,2982H 21 82 29LD HL,L2982
Load Register Pair HL with 2982H, the less than sign that opens the list; the first character goes into 2983H.
25B6
LD BC,00FFH 01 FF 00
Load Register Pair BC with 00FFH: Register B = 00H, the count of free banks, Register C = FFH, the bank, which the loop increments to 00H.
25B9L25B9
INC HL 23
L25B9: increment Register Pair HL to the next character of the list.
25BAL25BA
INC C 0C
L25BA: increment Register C, the next bank to test.
25BB
LD A,C 79
Load Register A with Register C, the bank to compare with the number of banks.
25BC
CP E BB
Compare Register A with Register E, the number of banks.
25BD
If the Z flag is set (every bank done) jump to L25CF at 25CFH to close the list.
25BF
PUSH BC C5
Push Register Pair BC onto the stack (Stack Pointer), as @BANK changes it.
25C0
LD B,02H 06 02
Load Register B with 02H, the test function of @BANK.
25C2
LD A,66H 3E 66
Load Register A with 66H, SVC 102, @BANK. Register B = 02H, the test function.
25C4
RST 28H EF
Call @BANK with RST 28H to test bank C's bit in BUR$ (0200H): the Z flag is set when the bank is not in use.
25C5
POP BC C1
Pop Register Pair BC from the stack (Stack Pointer); the flags of @BANK are kept.
25C6
LD (HL),2BH 36 2B
Store 2BH, a plus sign, at the address in Register Pair HL for a bank in use.
25C8
If the Z flag is cleared (in use) jump back to L25B9 at 25B9H for the next bank.
25CAL25CA
INC B 04
L25CA: the bank is free: increment Register B, the count of free banks.
25CB
LD (HL),2DH 36 2D
Store 2DH, a minus sign, at the address in Register Pair HL in place of the plus sign.
25CD
Jump back to L25B9 at 25B9H for the next bank.
25CFL25CF
LD (HL),3EH 36 3E
L25CF: store 3EH, a greater than sign, at the address in Register Pair HL to close the list.
25D1
INC HL 23
Increment Register Pair HL past it for the carriage return after it.
25D2
LD (HL),0DH 36 0D
Store 0DH, a carriage return, at the address in Register Pair HL to end the line (with one to three banks the greater than sign and the carriage return land in 2984H-2987H, past the end of the member).
25D4
LD A,B 78
Load Register A with Register B, the number of free banks.
25D5
Call 27A2H: Register C = the tens digit and Register B = the units digit of Register A.
25D8
LD (2972H),BC ED 43 72 29LD (L2972),BC
Store Register Pair BC into 2972H-2973H, the dd before the slash.
25DC
LD HL,295FH 21 5F 29LD HL,UNK1
Load Register Pair HL with 295FH, UNK1, the bank line, which starts with a line feed.
25DF
Call DSPLY at 2790H to show it with @LOGOT, and to the printer with PRINT.

25E2H - The Memory Map: Low Memory, then High Memory

The map has two parts. Low Memory Directory starts at the keyboard driver, found by name ($KI) with @GTMOD, and ends at DVRHI$, the first free byte of the driver zone; High Memory Directory starts at HIGH$ plus 1 and ends at FFFFH. Each part has a title line with its start in hex and its length in decimal, then the column heading, then one line for each module. The lines are built in 2400H-2439H, over the start of MEMORY itself, which has already run.

25E2
LD DE,2835H 11 35 28LD DE,L2835
Load Register Pair DE with 2835H, the name $KI ended by 03H.
25E5
LD A,53H 3E 53
Load Register A with 53H, SVC 83, @GTMOD, which looks for a module by name in the driver zone and in high memory.
25E7
RST 28H EF
Call @GTMOD with RST 28H: Z and Register Pair HL at the module's first byte (08F0H, KIDVR, in the release) if found.
25E8L25E8
L25E8: if the Z flag is cleared (no $KI) jump to L25FA at 25FAH to show only high memory.
25EA
LD (267BH),HL 22 7B 26LD (L267B),HL
Store Register Pair HL, the keyboard driver's address, into 267BH, the operand of the LD HL,0000H at 267AH, the start shown on the title line.
25ED
PUSH HL E5
Push Register Pair HL onto the stack (Stack Pointer) for the walk.
25EE
Call L275F at 275FH to show an empty line. It also blanks the buffer and counts the line.
25F1
Call L2671 at 2671H to build and show the line Low Memory Directory Start = X'hhhh' Length = n and put the column heading in the buffer.
25F4
Call L2764 at 2764H to show the column heading.
25F7
POP HL E1
Pop the keyboard driver's address from the stack (Stack Pointer) into Register Pair HL.
25F8
Jump to L2618 at 2618H to walk the modules from there.
25FAL25FA
L25FA: call GETHILO at 27DEH: Register Pair HL = HIGH$, Register Pair DE = LOW$.
25FD
LD DE,FFFFH 11 FF FF
Load Register Pair DE with FFFFH, the top of memory.
2600
LD (269CH),HL 22 9C 26LD (L269C),HL
Store Register Pair HL (HIGH$) into 269CH, the operand of the LD HL,0000H at 269BH, the start shown on the title line.
2603
LD (26A5H),HL 22 A5 26LD (L26A5),HL
Store Register Pair HL (HIGH$) into 26A5H, the operand of the LD DE,0000H at 26A4H, for the length.
2606
EX DE,HL EB
Exchange Register Pairs DE and HL: Register Pair HL = FFFFH, Register Pair DE = HIGH$.
2607
SBC HL,DE ED 52
Subtract Register Pair DE (HIGH$) from Register Pair HL (FFFFH) with SBC; the Carry flag is clear after GETHILO.
2609
If the Z flag is set (HIGH$ is FFFFH: nothing in high memory) jump to L27AD at 27ADH to finish.
260CL260C
PUSH DE D5
L260C: push Register Pair DE (HIGH$) onto the stack (Stack Pointer).
260D
Call L275F at 275FH to show an empty line. It also blanks the buffer and counts the line.
2610
Call L2692 at 2692H to build and show the line High Memory Directory HIGH$ = X'hhhh' Length = n and put the column heading in the buffer.
2613
Call L2764 at 2764H to show the column heading.
2616
POP HL E1
Pop HIGH$ from the stack (Stack Pointer) into Register Pair HL.
2617
INC HL 23
Increment Register Pair HL: the walk starts at HIGH$ plus 1, the first byte in use.

2618H - The Module Loop: One Line for Each Module

A module starts with a header: JR over it (18H), the word of its last byte, the length of its name and the name. For each header MEMORY shows the name, X'start', X'end' and the length in decimal, and goes on at the byte after the end. A byte that is not 18H ends the low memory part when its address is below 1300H; in high memory it starts a search for the next header (26C2H). The walk ends after a module whose last byte is FFFFH, or for low memory at DVRHI$. The length byte is used whole as the count of the name (@GTMOD keeps only its bits 3-0). A header whose last byte lies below its own address makes the walk go back and show the same lines for ever (B43).

2618L2618
LD (264CH),HL 22 4C 26LD (L264C),HL
L2618: store Register Pair HL, the module's first byte, into 264CH, the operand of the LD DE,0000H at 264BH.
261BL261B
LD A,(HL) 7E
L261B: load Register A with the byte at the address in Register Pair HL.
261C
CP 18H FE 18
Compare Register A with 18H, the opcode of JR, the first byte of a module header.
261E
If the Z flag is cleared (no header here) jump to L26C2 at 26C2H.
2621
INC HL 23
Increment Register Pair HL past the JR's opcode.
2622
INC HL 23
Increment Register Pair HL past the JR's offset, to the word of the last byte.
2623L2623
LD E,(HL) 5E
L2623: load Register E with the low byte of the module's last byte from the address in Register Pair HL.
2624
INC HL 23
Increment Register Pair HL to the high byte of the word of the module's last byte.
2625
LD D,(HL) 56
Load Register D with the high byte from the address in Register Pair HL: Register Pair DE = the module's last byte.
2626
LD (2640H),DE ED 53 40 26LD (SM003),DE
Store Register Pair DE into 2640H, the operand of the LD HL,0000H at 263FH.
262A
INC HL 23
Increment Register Pair HL to the length of the name.
262B
LD B,(HL) 46
Load Register B with the length of the name from the address in Register Pair HL; the whole byte is the count, with no test: a length of 0 copies 256 bytes and one above 57 runs over the carriage return at 2439H.
262C
INC HL 23
Increment Register Pair HL to the first character of the name.
262DL262D
LD DE,2400H 11 00 24LD DE,MEMORY
L262D: load Register Pair DE with 2400H, the line buffer: the name goes in from its first column.
2630L2630
LD A,(HL) 7E
L2630: load Register A with a character of the name from the address in Register Pair HL.
2631
LD (DE),A 12
Store Register A into the line at the address in Register Pair DE.
2632
INC HL 23
Increment Register Pair HL to the next character.
2633
INC DE 13
Increment Register Pair DE to the next column.
2634L2634
L2634: decrement Register B and loop back to 2630H until the whole name is copied.
2636
LD HL,(264CH) 2A 4C 26LD HL,(L264C)
Load Register Pair HL with the module's first byte from 264CH.
2639
LD DE,2412H 11 12 24LD DE,L2412
Load Register Pair DE with 2412H, the column of the start address.
263C
Call L274D at 274DH to write X'hhhh' of Register Pair HL at Register Pair DE (2412H-2418H).
263FL263F
LD HL,0000H 21 00 00
L263F: load Register Pair HL with the module's last byte, stored into 2640H-2641H by 2626H, 26DFH or 271DH. The operand is 0000H as assembled.
2642
LD DE,2424H 11 24 24LD DE,SM002
Load Register Pair DE with 2424H, the column of the end address.
2645
Call L274D at 274DH to write X'hhhh' at 2424H-242AH.
2648L2648
LD HL,(2640H) 2A 40 26LD HL,(SM003)
L2648: load Register Pair HL with the module's last byte from 2640H.
264BL264B
LD DE,0000H 11 00 00
L264B: load Register Pair DE with the module's first byte, stored into 264CH-264DH by 2618H. The operand is 0000H as assembled.
264E
OR A B7
OR Register A with itself to clear the Carry flag for the SBC.
264F
SBC HL,DE ED 52
Subtract Register Pair DE (first byte) from Register Pair HL (last byte) with SBC.
2651
INC HL 23
Increment Register Pair HL: Register Pair HL = the length of the module.
2652
LD DE,2433H 11 33 24LD DE,L2433
Load Register Pair DE with 2433H, the column of the length.
2655
LD A,61H 3E 61
Load Register A with 61H, SVC 97, @HEXDEC, which writes Register Pair HL in decimal, five characters with leading spaces, at Register Pair DE.
2657
RST 28H EF
Call @HEXDEC with RST 28H: the length goes to 2433H-2437H; 2439H holds the carriage return written by the title line (26B2H).
2658
Call L2764 at 2764H to show the line, blank it and count it.
265B
LD HL,(2640H) 2A 40 26LD HL,(SM003)
Load Register Pair HL with the module's last byte from 2640H; a last byte below the module's first one sends the walk back to an address it has already shown (B43).
265E
INC HL 23
Increment Register Pair HL: the byte after the module.
265F
LD A,H 7C
Load Register A with Register H to test Register Pair HL for 0000H.
2660
OR L B5
OR Register A with Register L: the Z flag is set when Register Pair HL wrapped to 0000H.
2661
If the Z flag is set (the module ended at FFFFH) jump to L27AD at 27ADH to finish.
2664
EX DE,HL EB
Exchange Register Pairs DE and HL: Register Pair DE = the byte after the module.
2665L2665
LD HL,0000H 21 00 00
L2665: load Register Pair HL with the end of the low memory part, DVRHI$ as stored into 2666H-2667H by 268CH (0000H if there was no low part).
2668
SBC HL,DE ED 52
Subtract Register Pair DE from Register Pair HL with SBC; the Carry flag is clear after the OR L at 2660H.
266A
EX DE,HL EB
Exchange Register Pairs DE and HL back: Register Pair HL = the byte after the module.
266B
If the Z flag is set (the low part reached DVRHI$) jump to L25FA at 25FAH for high memory.
266EL266E
L266E: jump to L2618 at 2618H for the next module.

2671H - The Title Lines of the Two Parts

Low Memory Directory gives the keyboard driver's address and the length up to DVRHI$, which MEMORY reads as the word just below the KI device control block (KIDCB$ is at 0208H and DVRHI$ at 0206H). High Memory Directory gives HIGH$ and FFFFH less HIGH$. Both write a carriage return at 2439H, the end of every later module line, and leave the column heading in the buffer.

2671L2671
LD HL,28F9H 21 F9 28LD HL,LOWIS
L2671: load Register Pair HL with 28F9H, LOWIS, whose first four characters are a space and Low.
2674
LD DE,2851H 11 51 28LD DE,L2851
Load Register Pair DE with 2851H, the text Start =.
2677
Call L2722 at 2722H to put Low Memory Directory and Start = into the line.
267A
LD HL,0000H 21 00 00
Load Register Pair HL with the keyboard driver's address, stored into 267BH-267CH by 25EAH. The operand is 0000H as assembled.
267D
PUSH HL E5
Push Register Pair HL onto the stack (Stack Pointer) for the length.
267E
Call L273B at 273BH to write X'hhhh' of Register Pair HL at 2421H and the text Length = at 242CH.
2681
LD DE,494BH 11 4B 49
Load Register Pair DE with 494BH: Register E = 4BH (K) and Register D = 49H (I), the device name KI.
2684
LD A,52H 3E 52
Load Register A with 52H, SVC 82, @GTDCB, which returns the device control block of the device named in Register Pair DE in Register Pair HL.
2686
RST 28H EF
Call @GTDCB with RST 28H: Register Pair HL = 0208H, KIDCB$.
2687
DEC L 2D
Decrement Register L to the byte below the DCB, 0207H, the high byte of DVRHI$.
2688
LD A,(HL) 7E
Load Register A with that byte from the address in Register Pair HL.
2689
DEC L 2D
Decrement Register L to 0206H, the low byte of DVRHI$.
268A
LD L,(HL) 6E
Load Register L with the low byte from the address in Register Pair HL.
268B
LD H,A 67
Load Register H with Register A: Register Pair HL = DVRHI$, the first free byte of the driver zone.
268C
LD (2666H),HL 22 66 26LD (L2666),HL
Store Register Pair HL into 2666H, the operand of the LD HL,0000H at 2665H, the end of the low memory walk.
268F
POP DE D1
Pop the keyboard driver's address from the stack (Stack Pointer) into Register Pair DE.
2690
Jump to L26A7 at 26A7H for the length DVRHI$ less the start.
2692L2692
LD HL,28EAH 21 EA 28LD HL,HIGHIS
L2692: load Register Pair HL with 28EAH, HIGHIS, whose first four characters are High.
2695
LD DE,284AH 11 4A 28LD DE,L284A
Load Register Pair DE with 284AH, the text HIGH$ =.
2698
Call L2722 at 2722H to put High Memory Directory and HIGH$ = into the line.
269B
LD HL,0000H 21 00 00
Load Register Pair HL with HIGH$, stored into 269CH-269DH by 2600H. The operand is 0000H as assembled.
269E
Call L273B at 273BH to write X'hhhh' of Register Pair HL at 2421H and the text Length = at 242CH.
26A1
LD HL,FFFFH 21 FF FF
Load Register Pair HL with FFFFH, the top of memory.
26A4
LD DE,0000H 11 00 00
Load Register Pair DE with HIGH$, stored into 26A5H-26A6H by 2603H. The operand is 0000H as assembled.
26A7L26A7
OR A B7
L26A7: OR Register A with itself to clear the Carry flag for the SBC.
26A8
SBC HL,DE ED 52
Subtract Register Pair DE (the start) from Register Pair HL (the end) with SBC: Register Pair HL = the length of the part.
26AA
LD DE,2434H 11 34 24LD DE,L2434
Load Register Pair DE with 2434H, the column of the length on a title line.
26AD
LD A,61H 3E 61
Load Register A with 61H, SVC 97, @HEXDEC, for Register Pair HL.
26AF
RST 28H EF
Call @HEXDEC with RST 28H: the length goes to 2434H-2438H and Register Pair DE ends at 2439H.
26B0
LD A,0DH 3E 0D
Load Register A with 0DH, a carriage return to end the title line and every module line.
26B2
LD (DE),A 12
Store Register A into 2439H (Register Pair DE): the end of this line and, as the blanking at 276AH stops at 2438H, of every line after it.
26B3
Call L2764 at 2764H to show the title line, blank it and count it.
26B6L26B6
LD HL,2860H 21 60 28LD HL,L2860
L26B6: load Register Pair HL with 2860H, the column heading Module, Start Address, End Address, Length.
26B9
LD DE,2400H 11 00 24LD DE,MEMORY
Load Register Pair DE with 2400H, the line buffer.
26BC
LD BC,0039H 01 39 00
Load Register Pair BC with 0039H, 57 bytes: the heading without its carriage return at 2899H, which 2439H supplies.
26BF
LDIR ED B0
LDIR: copy the heading from (HL) to (DE) with Register Pairs HL and DE counting up and Register Pair BC down.
26C1
RET C9
Return with the heading in the buffer (also called from 2788H to show it again at the top of a new screen).

26C2H - Bytes without a Header: Find the Next Module

Below 1300H a byte that is not a header ends the low memory part. In high memory MEMORY looks for the next 18H that starts a believable header: its last byte not below the byte in front of the 18H, a name length below 16 and a name whose characters are all 30H to 7AH (which refuses every name with a dollar or ampersand sign: B42). The bytes before it are shown as one module named <unknown>; with no header found the unknown block runs to FFFFH.

26C2L26C2
LD A,H 7C
L26C2: load Register A with Register H, the high byte of the address.
26C3
CP 13H FE 13
Compare Register A with 13H 1300H is where SYS0/SYS's resident system starts.
26C5
If the Carry flag is set (below 1300H, in the low memory part) jump to L25FA at 25FAH for high memory.
26C8
PUSH HL E5
Push Register Pair HL, the first byte of the unknown block, onto the stack (Stack Pointer).
26C9
DEC HL 2B
Decrement Register Pair HL to the byte before it.
26CA
LD DE,FFFFH 11 FF FF
Load Register Pair DE with FFFFH, the top of memory.
26CD
EX DE,HL EB
Exchange Register Pairs DE and HL: Register Pair HL = FFFFH, Register Pair DE = the byte before the block.
26CE
OR A B7
OR Register A with itself to clear the Carry flag for the SBC.
26CF
SBC HL,DE ED 52
Subtract Register Pair DE from Register Pair HL with SBC: the number of bytes from the block's first byte to FFFFH.
26D1
LD B,H 44
Load Register B with Register H, the high byte of the count.
26D2
LD C,L 4D
Load Register C with Register L: Register Pair BC = the count for CPIR.
26D3
POP HL E1
Pop the block's first byte from the stack (Stack Pointer) into Register Pair HL; the flags of the SBC are kept.
26D4L26D4
L26D4: if the Z flag is set (no bytes left) jump to L27AD at 27ADH to finish.
26D7
LD A,18H 3E 18
Load Register A with 18H, the opcode of JR. CPIR looks for it.
26D9
CPIR ED B1
CPIR: compare Register A with (HL), Register Pair HL counting up and Register Pair BC down, until a match or Register Pair BC is 0000H.
26DB
If the Z flag is cleared (no 18H up to FFFFH) jump to L271A at 271AH.
26DD
DEC HL 2B
Decrement Register Pair HL: CPIR left it one past the 18H, so this is the 18H.
26DE
DEC HL 2B
Decrement Register Pair HL to the byte before the 18H, the end of the unknown block if a header starts there.
26DF
LD (2640H),HL 22 40 26LD (SM003),HL
Store Register Pair HL into 2640H, the operand of the LD HL,0000H at 263FH, as the block's last byte.
26E2
INC HL 23
Increment Register Pair HL from the byte before the 18H to the 18H itself.
26E3
INC HL 23
Increment Register Pair HL to the JR's offset.
26E4
INC HL 23
Increment Register Pair HL to the word of the last byte.
26E5
LD E,(HL) 5E
Load Register E with its low byte from the address in Register Pair HL.
26E6
INC HL 23
Increment Register Pair HL to the high byte of the word of the last byte.
26E7
LD D,(HL) 56
Load Register D with the high byte from the address in Register Pair HL: Register Pair DE = the would-be module's last byte.
26E8
LD HL,(2640H) 2A 40 26LD HL,(SM003)
Load Register Pair HL with the byte before the 18H from 2640H.
26EB
EX DE,HL EB
Exchange Register Pairs DE and HL: Register Pair HL = the last byte, Register Pair DE = the byte before the 18H.
26EC
OR A B7
OR Register A with itself to clear the Carry flag for the SBC.
26ED
SBC HL,DE ED 52
Subtract Register Pair DE from Register Pair HL with SBC.
26EFL26EF
L26EF: if the Carry flag is set (the last byte lies before the byte in front of the 18H) jump to L2713 at 2713H to search on. A last byte equal to the byte in front of the 18H, a module of no length before itself, is accepted (B43).
26F1L26F1
LD HL,(2640H) 2A 40 26LD HL,(SM003)
L26F1: load Register Pair HL with the byte before the 18H from 2640H.
26F4
INC HL 23
Increment Register Pair HL from the byte before the 18H to the 18H itself.
26F5
INC HL 23
Increment Register Pair HL to the JR's offset.
26F6
INC HL 23
Increment Register Pair HL to the low byte of the last byte word.
26F7
INC HL 23
Increment Register Pair HL to the high byte of the word of the last byte.
26F8
INC HL 23
Increment Register Pair HL to the length of the name.
26F9
LD A,(HL) 7E
Load Register A with the length of the name from the address in Register Pair HL.
26FA
CP 10H FE 10
Compare Register A with 10H. A name must be shorter than 16 characters.
26FC
If the Carry flag is cleared (16 or more) jump to L2713 at 2713H: not a header.
26FE
LD B,A 47
Load Register B with Register A, the length, as the loop count (a length of 0 is taken as 256).
26FFL26FF
INC HL 23
L26FF: increment Register Pair HL to the next character of the name.
2700
LD A,(HL) 7E
Load Register A with the character from the address in Register Pair HL.
2701
CP 30H FE 30
Compare Register A with 30H (0), the lowest character a name may have; every character of the name is tested, so a name with a dollar sign (24H) or an ampersand sign (26H) is refused (B42).
2703
If the Carry flag is set (below 0) jump to L2713 at 2713H: not a header.
2705
CP 7BH FE 7B
Compare Register A with 7BH, one above z. The highest character a name may have is 7AH.
2707
If the Carry flag is cleared (above z) jump to L2713 at 2713H: not a header.
2709
Decrement Register B and loop back to 26FFH for the rest of the name.
270BL270B
LD HL,289AH 21 9A 28LD HL,L289A
L270B: a header follows: load Register Pair HL with 289AH, the name <unknown>.
270E
LD B,09H 06 09
Load Register B with 09H, its length. It is copied as the module's name.
2710
Jump to L262D at 262DH to show the unknown block from its first byte (264CH) to its last (2640H); the walk then goes on at the header.
2713L2713
LD HL,(2640H) 2A 40 26LD HL,(SM003)
L2713: not a header: load Register Pair HL with the byte before the 18H from 2640H.
2716
INC HL 23
Increment Register Pair HL from the byte before the 18H to the 18H itself.
2717
INC HL 23
Increment Register Pair HL past it, where the search goes on.
2718
Jump back to L26C2 at 26C2H to search from there.
271AL271A
LD HL,FFFFH 21 FF FF
L271A: no header up to FFFFH: load Register Pair HL with FFFFH.
271D
LD (2640H),HL 22 40 26LD (SM003),HL
Store Register Pair HL into 2640H: the unknown block ends at FFFFH.
2720
Jump back to L270B at 270BH to show it; the walk then ends at 2661H.

2722H - Line Helpers: Titles, X'nnnn', Show and Blank, Count the Screen

The line buffer is 2400H-2438H with the carriage return at 2439H. After a line is shown it is blanked with 57 spaces and counted: the first screen takes 20 lines after the High and Low line, each later one the heading and 23 lines. At the bottom of a screen MEMORY waits for a key (BREAK ends the command), clears the screen and shows the column heading again, to the display only. The count is kept with PRINT too.

2722L2722
PUSH DE D5
L2722: push Register Pair DE, the text for the end of the title (Start = or HIGH$ =), onto the stack (Stack Pointer).
2723
LD DE,2400H 11 00 24LD DE,MEMORY
Load Register Pair DE with 2400H, the line buffer.
2726
LD BC,0004H 01 04 00
Load Register Pair BC with 0004H, the four characters Low (with its space) or High.
2729
LDIR ED B0
LDIR: copy them from (HL) to (DE) with Register Pairs HL and DE counting up and Register Pair BC down.
272B
LD HL,2839H 21 39 28LD HL,L2839
Load Register Pair HL with 2839H, the text Memory Directory with its space.
272E
LD C,11H 0E 11
Load Register C with 11H, its 17 characters (Register B is 00H after LDIR).
2730
LDIR ED B0
LDIR: copy it to 2404H-2414H, Register Pairs HL and DE counting up and Register Pair BC down.
2732
POP HL E1
Pop the text for the end of the title from the stack (Stack Pointer) into Register Pair HL.
2733
LD DE,2419H 11 19 24
Load Register Pair DE with 2419H, its column.
2736
LD C,07H 0E 07
Load Register C with 07H, its seven characters.
2738
LDIR ED B0
LDIR: copy it to 2419H-241FH, Register Pairs HL and DE counting up and Register Pair BC down.
273A
RET C9
Return to the title line's routine with Register Pair DE at 2420H.
273BL273B
LD DE,2421H 11 21 24LD DE,SM001
L273B: load Register Pair DE with 2421H, the column of the title's address.
273E
Call L274D at 274DH to write X'hhhh' of Register Pair HL at 2421H-2427H.
2741
LD HL,2858H 21 58 28LD HL,L2858
Load Register Pair HL with 2858H, the text Length =.
2744
LD DE,242CH 11 2C 24LD DE,L242C
Load Register Pair DE with 242CH, its column.
2747
LD BC,0008H 01 08 00
Load Register Pair BC with 0008H, its eight characters.
274A
LDIR ED B0
LDIR: copy it to 242CH-2433H, Register Pairs HL and DE counting up and Register Pair BC down.
274C
RET C9
Return to the title line's routine with Register Pair DE at 2434H for the length.
274DL274D
PUSH DE D5
L274D: push Register Pair DE, the column to write at, onto the stack (Stack Pointer).
274E
EX DE,HL EB
Exchange Register Pairs DE and HL: Register Pair DE = the value.
274F
LD HL,28A5H 21 A5 28LD HL,L28A5
Load Register Pair HL with 28A5H, the four places inside X' ' at 28A3H.
2752
LD A,63H 3E 63
Load Register A with 63H, SVC 99, @HEX16, which writes Register Pair DE as four hex digits at Register Pair HL.
2754
RST 28H EF
Call @HEX16 with RST 28H: the value goes to 28A5H-28A8H.
2755
POP DE D1
Pop the column from the stack (Stack Pointer) into Register Pair DE.
2756
LD HL,28A3H 21 A3 28LD HL,L28A3
Load Register Pair HL with 28A3H, the text X'hhhh'.
2759
LD BC,0007H 01 07 00
Load Register Pair BC with 0007H, its seven characters.
275C
LDIR ED B0
LDIR: copy it to the column, Register Pairs HL and DE counting up and Register Pair BC down.
275E
RET C9
Return with Register Pair DE past the X'hhhh'.
275FL275F
LD A,0DH 3E 0D
L275F: load Register A with 0DH, a carriage return.
2761
LD (2400H),A 32 00 24LD (MEMORY),A
Store Register A into 2400H, so that the line shown next is empty.
2764L2764
LD HL,2400H 21 00 24LD HL,MEMORY
L2764: load Register Pair HL with 2400H, the line buffer.
2767
Call DSPLY at 2790H to show the line, and print it with PRINT.
276AP631H2
LD B,39H 06 39
P631H2: load Register B with 39H, the 57 bytes 2400H-2438H to blank (the 6.3.1H change).
276CL276C
LD (HL),20H 36 20
L276C: store 20H, a space, at the address in Register Pair HL.
276E
INC HL 23
Increment Register Pair HL to the next byte of the line buffer.
276F
Decrement Register B and loop back to 276CH until the line is blank.
2771
LD A,15H 3E 15
Load Register A with the line count, 15H (21) as assembled, the operand at 2772H that 2774H and 2785H change.
2773
DEC A 3D
Decrement Register A, one line more on the screen.
2774
LD (2772H),A 32 72 27LD (L2772),A
Store Register A into 2772H as the new count.
2777
RET NZ C0
Return if the Z flag is cleared: there is room for another line.
2778
LD A,01H 3E 01
The screen is full: load Register A with 01H, SVC 1, @KEY, which waits for a key.
277A
RST 28H EF
Call @KEY with RST 28H: Register A = the key.
277B
CP 80H FE 80
Compare Register A with 80H, the BREAK key @KEY returns 80H for BREAK.
277D
If the Z flag is set (BREAK) jump to ABORT at 2805H to end the command.
2780
LD A,69H 3E 69
Load Register A with 69H, SVC 105, @CLS, which clears the screen.
2782
RST 28H EF
Call @CLS with RST 28H. The new screen starts at the top.
2783
LD A,18H 3E 18
Load Register A with 18H (24), the count for a new screen (the 6.3.1H change).
2785
LD (2772H),A 32 72 27LD (L2772),A
Store Register A into 2772H, the operand of the LD A,15H at 2771H.
2788
Call L26B6 at 26B6H to put the column heading into the buffer.
278B
LD HL,2400H 21 00 24LD HL,MEMORY
Load Register Pair HL with 2400H, the buffer.
278E
Jump to P631H1 at 280FH to show the heading on the display and blank and count it.
2790DSPLY
LD DE,0000H 11 00 00
DSPLY: load Register Pair DE with the value of PRINT, stored into 2791H-2792H by @PARAM: Register E = FFH for PRINT, 00H without it. The operand is 0000H as assembled.
2793
INC E 1C
Increment Register E to test it. An INC and a DEC set the Z flag for 00H.
2794
DEC E 1D
Decrement Register E back: the Z flag is set when Register E is 00H.
2795
If the Z flag is set (no PRINT) jump to L279C at 279CH.
2797
LD A,0EH 3E 0E
Load Register A with 0EH, SVC 14, @PRINT, which sends the line at Register Pair HL to the printer.
2799
RST 28H EF
Call @PRINT with RST 28H. Register Pair HL is the line.
279A
If the Z flag is cleared (a printer error) jump to IOERR at 27F0H with the error number in Register A.
279CL279C
LD A,0CH 3E 0C
L279C: load Register A with 0CH, SVC 12, @LOGOT, which shows the line at Register Pair HL and writes it to the job log.
279E
RST 28H EF
Call @LOGOT with RST 28H. Register Pair HL is the line.
279F
RET Z C8
Return if the Z flag is set (no error). Register Pair HL is unchanged.
27A0
Jump to IOERR at 27F0H with the error number in Register A.
27A2L27A2
LD C,2FH 0E 2F
L27A2: load Register C with 2FH, one below the character 0, for the tens digit.
27A4
INC C 0C
Increment Register C, one more ten. The tens digit counts up from 30H.
27A5
SUB 0AH D6 0A
Subtract 0AH (10) from Register A until Register A goes below zero.
27A7
If the Carry flag is cleared (not yet below 0) jump back to 27A4H.
27A9
ADD A,3AH C6 3A
Add 3AH to Register A: the remainder less 10 becomes the units digit 0 to 9.
27AB
LD B,A 47
Load Register B with Register A: Register C = tens, Register B = units, as Register Pair BC is stored.
27AC
RET C9
Return with the two digits in Register Pair BC (a number up to 99).

27ADH - GO, the Parameter Check, the Header, HIGH$ and LOW$, Errors and Exit

GO=address jumps there after everything else, with MEMORY's return address still on the stack, so the code at the address may RET to LS-DOS; GO, marked as one that may be abbreviated in the table, is also taken as G (the manual says it may not be abbreviated). Errors show their message and return with Register Pair HL = the error code, or FFFFH for the messages of MEMORY, after the Stack Pointer is put back to what it was at 2409H.

27ADL27AD
LD A,(28D4H) 3A D4 28LD A,(GRESP)
L27AD: load Register A with the response byte of GO at 28D4H (GRESP).
27B0
OR A B7
OR Register A with itself to test it. Z means GO was not given.
27B1
If the Z flag is set (no GO) jump to GOODEX at 2461H for the good exit.
27B4GPARM
JP 0000H C3 00 00
GPARM: jump to the address of GO, stored into 27B5H-27B6H by @PARAM; the operand 0000H as assembled is never used.
27B7GOODPRM
POP DE D1
GOODPRM: pop the name address of the entry just checked from the stack (Stack Pointer) into Register Pair DE, to drop it.
27B8CKPARM
INC HL 23
CKPARM: increment Register Pair HL past the 80H of the table, or past the address field of the last entry.
27B9
LD A,(HL) 7E
Load Register A with the entry's type byte from the address in Register Pair HL: bit 7 numeric, bit 6 flag, bit 5 string, bit 4 may be abbreviated, bits 3-0 the name's length.
27BA
LD B,A 47
Load Register B with Register A, the type byte.
27BB
AND 0FH E6 0F
AND Register A with 0FH to keep the length in bits 3-0 of the type byte.
27BD
RET Z C8
Return with the Z flag set at the end of the table (00H at 28E9H): every parameter was given a kind of value it allows.
27BE
INC HL 23
Increment Register Pair HL to the name the first character after the type byte.
27BF
PUSH HL E5
Push Register Pair HL, the name, onto the stack (Stack Pointer).
27C0
LD E,A 5F
Load Register E with Register A, the length to step over the name.
27C1
LD D,00H 16 00
Load Register D with 00H: Register Pair DE = the length.
27C3
ADD HL,DE 19
Add Register Pair DE to Register Pair HL: Register Pair HL = the response byte.
27C4
LD A,(HL) 7E
Load Register A with the response byte from the address in Register Pair HL.
27C5
AND E0H E6 E0
AND Register A with E0H to keep bits 7-5, the kind of value given.
27C7
LD D,A 57
Load Register D with Register A, the kind given.
27C8
LD A,B 78
Load Register A with Register B, the type byte.
27C9
AND D A2
AND Register A with Register D: the kinds given that the entry allows.
27CA
XOR D AA
XOR Register A with Register D: zero when every kind given is allowed (or nothing was given).
27CB
INC HL 23
Increment Register Pair HL to the low byte of the address field.
27CC
INC HL 23
Increment Register Pair HL to the high byte of the entry's address field.
27CD
If the Z flag is set (allowed) jump back to GOODPRM at 27B7H for the next entry.
27CF
LD C,E 4B
Load Register C with Register E, the length of the name.
27D0
LD B,00H 06 00
Load Register B with 00H: Register Pair BC = the length.
27D2
POP HL E1
Pop the name from the stack (Stack Pointer) into Register Pair HL.
27D3
RET C9
Return with the Z flag cleared: a parameter got a kind of value it does not allow (Register Pair HL = its name, Register Pair BC = its length).
27D4HEADER
JR 27DEH 18 08JR MEMSTRT
HEADER: JR 27DEH, the first two bytes of the header copied above the new HIGH$: in memory the JR jumps over the header to the reserved block.
27D6-27D7OLDHI
DEFW 0000H 00 00
OLDHI, 27D6H-27D7H: the last byte of the reserved block, HIGH$ before the command (stored by 250FH).
27D8-27D9
DEFB 05H / DEFM "&" 05 26
27D8H-27D9H: the length of the name, 5, and its first character, an ampersand sign, which marks a block reserved by MEMORY.
27DA-27DDHD_ADD
DEFM "nnnn" 6E 6E 6E 6E
HD_ADD, 27DAH-27DDH: the four hex digits of the reserved block's first address, written by 2530H.
27DEGETHILO
LD HL,0000H 21 00 00
GETHILO: load Register Pair HL with 0000H, the value that makes @HIGH$ read instead of set.
27E1
LD D,H 54
Load Register D with Register H (00H) to make Register Pair DE 0000H.
27E2
LD E,L 5D
Load Register E with Register L: Register Pair DE = 0000H.
27E3
LD B,01H 06 01
Load Register B with 01H, the LOW$ function of @HIGH$.
27E5
LD A,64H 3E 64
Load Register A with 64H, SVC 100, @HIGH$. Register B = 01H reads LOW$.
27E7
RST 28H EF
Call @HIGH$ with RST 28H: Register Pair HL = LOW$ (001EH).
27E8
EX DE,HL EB
Exchange Register Pairs DE and HL: Register Pair DE = LOW$, Register Pair HL = 0000H.
27E9
LD B,L 45
Load Register B with Register L (00H), the HIGH$ function of @HIGH$.
27EA
LD A,64H 3E 64
Load Register A with 64H, SVC 100, @HIGH$. Register B = 00H reads HIGH$.
27EC
RST 28H EF
Call @HIGH$ with RST 28H: Register Pair HL = HIGH$ (040EH), the Z flag set and the Carry flag cleared.
27ED
RET C9
Return with Register Pair HL = HIGH$ and Register Pair DE = LOW$.
27EEPRMERR
LD A,2CH 3E 2C
PRMERR: load Register A with 2CH, error 44, Parameter error.
27F0IOERR
LD L,A 6F
IOERR: load Register L with Register A, the error number.
27F1
LD H,00H 26 00
Load Register H with 00H: Register Pair HL = the error number, the return code.
27F3
OR C0H F6 C0
OR Register A with C0H: bit 7 return to the caller, bit 6 the short message.
27F5
LD C,A 4F
Load Register C with Register A, the error request for @ERROR.
27F6
LD A,1AH 3E 1A
Load Register A with 1AH, SVC 26, @ERROR. Register C holds the error request.
27F8
RST 28H EF
Call @ERROR with RST 28H to show the error message.
27F9
Jump to EXIT at 2808H to put the Stack Pointer back and return.
27FBNOMEM
LD HL,2815H 21 15 28LD HL,NOMEM$
NOMEM: load Register Pair HL with 2815H, the message No memory available.
27FE
DEFB 0DDH DD
27FEH: DDH, the IX prefix: with it the LD HL,2829H that follows runs as LD IX,2829H, so NOMEM keeps its Register Pair HL.
27FFRANGER
LD HL,2829H 21 29 28LD HL,RANGER$
RANGER: load Register Pair HL with 2829H, the message Range error.
2802
LD A,0CH 3E 0C
Load Register A with 0CH, SVC 12, @LOGOT, which shows the line at Register Pair HL and writes it to the job log.
2804
RST 28H EF
Call @LOGOT with RST 28H. Register Pair HL is the message.
2805ABORT
LD HL,FFFFH 21 FF FF
ABORT: load Register Pair HL with FFFFH, the return code of an abort (also BREAK at the bottom of a screen).
2808EXIT
LD SP,0000H 31 00 00
EXIT: load the Stack Pointer with its value at the start, stored into 2809H-280AH by BEGINA (2409H). The operand is 0000H as assembled.
280B
LD A,6AH 3E 6A
Load Register A with 6AH, SVC 106, @CKBRKC, to clear a BREAK.
280D
RST 28H EF
Call @CKBRKC with RST 28H so that no BREAK is left over for LS-DOS.
280E
RET C9
Return to SYS1/SYS's caller with the return code in Register Pair HL.
280FP631H1
P631H1: call L279C at 279CH to show the heading at Register Pair HL with @LOGOT, not on the printer (the 6.3.1H change).
2812
Jump to P631H2 at 276AH to blank the buffer and count the heading.

2815H - MEMORY Data: Messages, Names and the Column Heading

The messages of MEMORY's own errors, the name $KI for @GTMOD, and the pieces of the memory map's lines.

2815-2828NOMEM$
DEFM "No memory available" / DEFB 0DH 4E 6F 20 6D 65 6D 6F 72 79 20 61 76 61 69 6C 61 62 6C 65 0D
NOMEM$, 2815H-2828H: shown by NOMEM (27FBH) when HIGH$ is frozen (CFLAG$ bit 0) and CLEAR, HIGH or LOW is given.
2829-2834RANGER$
DEFM "Range error" / DEFB 0DH 52 61 6E 67 65 20 65 72 72 6F 72 0D
RANGER$, 2829H-2834H: shown by RANGER (27FFH) for a bad flag letter, a HIGH above HIGH$, a LOW below 2600H or HIGH$ below LOW$.
2835-2838L2835
DEFM "$KI" / DEFB 03H 24 4B 49 03
2835H-2838H: the module name of the keyboard driver, ended by 03H, looked up by @GTMOD through the RST 28H at 25E7H.
2839-2849L2839
DEFM " Memory Directory" 20 4D 65 6D 6F 72 79 20 44 69 72 65 63 74 6F 72 79
2839H-2849H: the middle of both title lines, copied to 2404H by the LDIR at 2730H.
284A-2850L284A
DEFM "HIGH$ =" 48 49 47 48 24 20 3D
284AH-2850H: the end of the High Memory Directory title, copied to 2419H.
2851-2857L2851
DEFM "Start =" 53 74 61 72 74 20 3D
2851H-2857H: the end of the Low Memory Directory title, copied to 2419H.
2858-285FL2858
DEFM "Length =" 4C 65 6E 67 74 68 20 3D
2858H-285FH: the length label of both titles, copied to 242CH by the LDIR at 274AH.
2860-2899L2860
DEFM "Module Start Address End Address Length" / DEFB 0DH 4D 6F 64 75 6C 65 20 20 20 20 20 20 20 20 20 53 74 61 72 74 20 41 64 64 72 65 73 73 20 20 20 20 20 20 45 6E 64 20 41 64 64 72 65 73 73 20 20 20 20 20 20 4C 65 6E 67 74 68 0D
2860H-2899H: the column heading; 26B6H copies the 57 bytes up to 2898H, and the carriage return at 2899H is never used.
289A-28A2L289A
DEFM "<unknown>" 3C 75 6E 6B 6E 6F 77 6E 3E
289AH-28A2H: the name shown for bytes in high memory that have no module header (270BH).
28A3-28A9L28A3
DEFM "X' '" 58 27 20 20 20 20 27
28A3H-28A9H: the frame of an address, its four hex digits written into 28A5H-28A8H by L274D.

28AAH - MEMORY Data: the Parameter Table

The 6.x form of a @PARAM table: 80H, then for each parameter a type byte (bit 7 numeric, bit 6 flag, bit 5 string, bit 4 may be abbreviated to its first letter, bits 3-0 the length of the name), the name, a response byte that @PARAM fills in with the kind of value given, and the address where it stores the value, each one the operand of an instruction in MEMORY. 00H ends the table.

28AAPRMTBL$
DEFB 80H 80
PRMTBL$, 28AAH: 80H, the mark of the 6.x table form.
28AB
DEFB 94H 94
28ABH: type 94H, numeric, may be abbreviated, a name of 4.
28AC-28AF
DEFM "HIGH" 48 49 47 48
28ACH-28AFH: the name HIGH (High Memory, the top of free memory).
28B0HRESP
DEFB 00H 00
HRESP, 28B0H: the response byte of HIGH, read at 2512H and 2560H.
28B1-28B2
DEFW 2520H 20 25
28B1H-28B2H: 2520H, HPARM+1, the operand of the LD BC at 251FH.
28B3
DEFB 93H 93
28B3H: type 93H, numeric, may be abbreviated, a name of 3.
28B4-28B6
DEFM "LOW" 4C 4F 57
28B4H-28B6H: the name LOW (the bottom of free memory).
28B7LRESP
DEFB 00H 00
LRESP, 28B7H: the response byte of LOW, read at 2536H.
28B8-28B9
DEFW 2544H 44 25
28B8H-28B9H: 2544H, LPARM+1, the operand of the LD DE at 2543H.
28BA
DEFB 0B3H B3
28BAH: type B3H, numeric or string, may be abbreviated, a name of 3.
28BB-28BD
DEFM "ADD" 41 44 44
28BBH-28BDH: the name ADD (an address to show or change).
28BEARESP
DEFB 00H 00
ARESP, 28BEH: the response byte of ADD, read at 2465H.
28BF-28C0
DEFW 248DH 8D 24
28BFH-28C0H: 248DH, APARM+1, the operand of the LD DE at 248CH.
28C1
DEFB 94H 94
28C1H: type 94H, numeric, may be abbreviated, a name of 4.
28C2-28C5
DEFM "WORD" 57 4F 52 44
28C2H-28C5H: the name WORD (two bytes to store).
28C6WRESP
DEFB 00H 00
WRESP, 28C6H: the response byte of WORD, read at 24B7H and 24CBH.
28C7-28C8
DEFW 24D5H D5 24
28C7H-28C8H: 24D5H, WPARM+1, the operand of the LD DE at 24D4H.
28C9
DEFB 94H 94
28C9H: type 94H, numeric, may be abbreviated, a name of 4.
28CA-28CD
DEFM "BYTE" 42 59 54 45
28CAH-28CDH: the name BYTE (one byte to store).
28CEBRESP
DEFB 00H 00
BRESP, 28CEH: the response byte of BYTE, read at 24B8H, 24CFH and 2500H.
28CF-28D0
DEFW 24E6H E6 24
28CFH-28D0H: 24E6H, BPARM+1, the operand of the LD DE at 24E5H.
28D1
DEFB 92H 92
28D1H: type 92H, numeric, may be abbreviated, a name of 2: GO is matched by G too.
28D2-28D3
DEFM "GO" 47 4F
28D2H-28D3H: the name GO (an address to jump to).
28D4GRESP
DEFB 00H 00
GRESP, 28D4H: the response byte of GO, read at 27ADH.
28D5-28D6
DEFW 27B5H B5 27
28D5H-28D6H: 27B5H, GPARM+1, the operand of the JP at 27B4H.
28D7
DEFB 0F5H F5
28D7H: type F5H, numeric, flag or string, may be abbreviated, a name of 5.
28D8-28DC
DEFM "CLEAR" 43 4C 45 41 52
28D8H-28DCH: the name CLEAR (a byte to fill memory with).
28DDCRESP
DEFB 00H 00
CRESP, 28DDH: the response byte of CLEAR, read at 2423H.
28DE-28DF
DEFW 2421H 21 24
28DEH-28DFH: 2421H, CPARM+1, the operand of the LD BC at 2420H.
28E0
DEFB 55H 55
28E0H: type 55H, flag, may be abbreviated, a name of 5.
28E1-28E5
DEFM "PRINT" 50 52 49 4E 54
28E1H-28E5H: the name PRINT (added in 6.3.1).
28E6PRESP
DEFB 00H 00
PRESP, 28E6H: the response byte of PRINT, never read: DSPLY tests the value itself.
28E7-28E8
DEFW 2791H 91 27
28E7H-28E8H: 2791H, DSPLY+1, the operand of the LD DE at 2790H.
28E9
DEFB 00H 00
28E9H: 00H, the end of the table (the source writes it as a NOP).

28EAH - MEMORY Data: the Lines Shown

The High and Low line, the ADD line with its word and byte strings, the Note line and the bank line. The letters x, n, d are the places that the hex and decimal conversions write into; 03H ends a part of a line that something else follows on the same line.

28EA-28F2HIGHIS
DEFM "High = X'" 48 69 67 68 20 3D 20 58 27
HIGHIS, 28EAH-28F2H: the start of the High and Low line; its first four characters also open the High Memory Directory title (2692H).
28F3-28F8HIGHIS1
DEFM "xxxx' " 78 78 78 78 27 20
HIGHIS1, 28F3H-28F8H: HIGH$ in hex, written by 2589H.
28F9-2901LOWIS
DEFM " Low = X'" 20 4C 6F 77 20 3D 20 58 27
LOWIS, 28F9H-2901H: its first four characters also open the Low Memory Directory title (2671H).
2902-2907LOWIS1
DEFM "xxxx'" / DEFB 03H 78 78 78 78 27 03
LOWIS1, 2902H-2907H: LOW$ in hex, written by 2582H, and 03H: HEADMES supplies the end of the line.
2908-2909ADDMSG
DEFM "X'" 58 27
ADDMSG, 2908H-2909H: the start of the ADD line.
290A-2911HEXADD
DEFM "nnnn' = " 6E 6E 6E 6E 27 20 3D 20
HEXADD, 290AH-2911H: the address in hex, written by 2494H.
2912-291BDECADD
DEFM "ddddd (X'" / DEFB 03H 64 64 64 64 64 20 28 58 27 03
DECADD, 2912H-291BH: the address in decimal, written by 249CH, ending the first part of the line.
291C-2926OLDWORD
DEFM "nnnn' => X'" 6E 6E 6E 6E 27 20 3D 3E 20 58 27
OLDWORD, 291CH-2926H: the two bytes at the address, written by 24AEH; 2921H-2924H become a closing parenthesis, two spaces and 03H without WORD or BYTE (24BEH).
2927-292FNEWWORD
DEFM "nnnn') " / DEFB 03H 6E 6E 6E 6E 27 29 20 20 03
NEWWORD, 2927H-292FH: the new word, written by 24E2H.
2930-2938OLDBYTE
DEFM "nn' => X'" 6E 6E 27 20 3D 3E 20 58 27
OLDBYTE, 2930H-2938H: the old byte, written by 24A8H, shown instead of the word string when BYTE is given.
2939-293FNEWBYTE
DEFM "nn') " / DEFB 03H 6E 6E 27 29 20 20 03
NEWBYTE, 2939H-293FH: the new byte, written by 24F6H.
2940-295EHEADMES
DEFB 0DH / DEFM "Note : Memory Header Inserted" / DEFB 0DH 0D 4E 6F 74 65 20 3A 20 4D 65 6D 6F 72 79 20 48 65 61 64 65 72 20 49 6E 73 65 72 74 65 64 0D
HEADMES, 2940H-295EH: shown after the High and Low line; the first byte is a carriage return that ends that line and the rest is never shown, unless HIGH was given and 2568H made it a line feed.
295F-2971UNK1
DEFB 0AH / DEFM "32K Banks avail = " 0A 33 32 4B 20 42 61 6E 6B 73 20 61 76 61 69 6C 20 3D 20
UNK1, 295FH-2971H: the bank line, a line feed first (6.3.1).
2972-2973L2972
DEFM "dd" 64 64
2972H-2973H: the number of banks not in use, written by 25D8H.
2974
DEFM "/" 2F
2974H: the slash between the two numbers in 32K Banks avail = dd/dd.
2975-2976L2975
DEFM "dd" 64 64
2975H-2976H: the number of banks, written by 25AFH.
2977-2981
DEFM ", In use = " 2C 20 49 6E 20 75 73 65 20 3D 20
2977H-2981H: the label of the list of banks that follows in the bank line.
2982-2983L2982
DEFM "<+" 3C 2B
2982H-2983H: the less than sign that opens the list, and the first place of it, written over by the loop at 25B9H, which goes on past the end of the member.

2400H - Member 2 (DIR and CAT): Entry Points

SYS1/SYS runs DIR with request 21H and CAT with request 20H; both headers point at member 2, which the overlay loader reads to 2400H-2FCEH. DIR enters at 2400H, CAT at 2403H. CAT is DIR with the A parameter turned off before the parameters are read.

2400ENTRY
ENTRY: DIR's entry, jump to DIR at 2D9CH, the start of the command, at the end of the member (the code there is used once and then becomes buffer space).
2403CATBGN
PUSH HL E5
CATBGN: CAT's entry, push Register Pair HL (the pointer to the command text) onto the stack (Stack Pointer) while Register Pair HL is used.
2404
LD HL,0000H 21 00 00
Load Register Pair HL with 0000H, the value that means the A parameter is off.
2407
LD (27FCH),HL 22 FC 27
Store Register Pair HL (0000H) into 27FCH, the operand of the LD DE at APARM (27FBH), so that the brief format is shown unless the command line itself says (A).
240A
POP HL E1
Pop Register Pair HL from the stack (Stack Pointer): the pointer to the command text again.
240B
Jump back to 2400H and so on to DIR at 2D9CH: from here CAT is the DIR command; a CAT (A) still gets the full format, because @PARAM fills in 27FCH later.

240DH - DIR's Exits: the Messages, the Error Numbers and the Return

NOMEM and BADFMT show a message of DIR's own and return FFFFH; ERR32 and IOERR show a DOS error through @ERROR and return the error number; EXIT returns 0000H. These exits reload the Stack Pointer DIR had at its start and clear BREAK; the returns at 263FH and 2647H (the end of a range or a drive with no diskette) and the BREAK return at 2DA4H go back directly.

240DNOMEM
LD HL,2D53H 21 53 2DLD HL,NOMEM$
NOMEM: load Register Pair HL with 2D53H, NOMEM$, the message No memory for SORT, when the sort buffer would run past the top of free memory (272DH, 2B3BH).
2410
DEFB 0DDH DD
2410H: DDH, the IX prefix: with it the LD HL,2D66H that follows runs as LD IX,2D66H, so NOMEM keeps its Register Pair HL.
2411BADFMT
LD HL,2D66H 21 66 2DLD HL,BADFMT$
BADFMT: load Register Pair HL with 2D66H, BADFMT$, the message Bad date format, for a DATE parameter that cannot be read (2F52H, 2F6CH, 2F7AH).
2414
LD A,0CH 3E 0C
Load Register A with 0CH, SVC 12, @LOGOT, which shows a line and writes it to the job log.
2416
RST 28H EF
Call @LOGOT with RST 28H to show the message at Register Pair HL, ended by its carriage return.
2417ABORT
LD HL,FFFFH 21 FF FF
ABORT: load Register Pair HL with FFFFH, the return code of a command that has given its own message or was stopped with BREAK (2AD1H, 2ADFH jump here).
241A
Jump to SAVESP at 242BH, keeping Register Pair HL = FFFFH, to restore the Stack Pointer and return.
241CERR32
LD A,20H 3E 20
ERR32: load Register A with 20H, error 32, Illegal drive number, for a drive given that is not enabled or a drive specification DIR cannot read (2467H, 2E11H).
241EIOERR
LD L,A 6F
IOERR: load Register L with Register A, the error number, the return code's low byte; every disk and parameter error of DIR jumps here with the number in Register A.
241F
LD H,00H 26 00
Load Register H with 00H: Register Pair HL = the error number, returned to the caller.
2421
OR C0H F6 C0
OR Register A with C0H: bit 7 tells @ERROR to return to the caller instead of aborting, bit 6 asks for the short message, as in every library member.
2423
LD C,A 4F
Load Register C with Register A, the error number with bits 7 and 6 set, the form @ERROR takes.
2424
LD A,1AH 3E 1A
Load Register A with 1AH, SVC 26, @ERROR, which shows the message of the error in Register C.
2426
RST 28H EF
Call @ERROR with RST 28H to show the error message of the number in Register C.
2427
DEFB 0DDH DD
2427H: DDH, the IX prefix: with it the LD HL,0000H of EXIT runs as LD IX,0000H, so IOERR returns the error number in Register Pair HL (a 6.3.1 change, marked 631 in the source).
2428EXIT
LD HL,0000H 21 00 00
EXIT: load Register Pair HL with 0000H, the return code of a command that worked, when every drive of the range is done (2635H).
242BSAVESP
LD SP,0000H 31 00 00
SAVESP: load the Stack Pointer with 0000H, the operand that DIRA stores at 242CH (2DA5H): the Stack Pointer DIR had at its start, dropping whatever an error path left pushed.
242EABORT3
LD A,6AH 3E 6A
ABORT3: load Register A with 6AH, SVC 106, @CKBRKC, which tests and clears the BREAK key.
2430
RST 28H EF
Call @CKBRKC with RST 28H, so that a BREAK pressed during the directory does not also stop what runs next.
2431
RET C9
Return to SYS1/SYS (or the program that sent the command through @CMNDR) with Register Pair HL = 0000H, FFFFH or the error number.

2432H - DIR4: the Next Drive

Run once for each drive of the range, with the drive number in Register C. The four across count is reset, the instruction that tests the drive's dating style is built, the drive digit is written into the two messages that show it, and the drive is tested with @CKDRV. A drive that is not enabled is passed over (or is an error when it was asked for alone); an enabled drive with no diskette gets the line Drive :n [No Disk].

2432DIR4
PUSH BC C5
DIR4: push Register Pair BC onto the stack (Stack Pointer): Register C, the drive number, is popped again at 2593H or 2638H.
2433
LD A,04H 3E 04
Load Register A with 04H, the number of file names on a line of the brief format.
2435
LD (2804H),A 32 04 28
Store Register A (04H) into 2804H, the operand of the LD A at DONAM9 (2803H), the count of names still to come on the line.
2438
LD B,C 41
Load Register B with Register C, the drive number, to count the loop below.
2439
INC B 04
Increment Register B so that the loop runs at least once (drive 0 gives one pass).
243A
LD A,3FH 3E 3F
Load Register A with 3FH: 3FH plus 8 for each pass gives 47H plus 8 times the drive, the second byte of BIT n,A with n = the drive number.
243CDVTLP
ADD A,08H C6 08
DVTLP: add 08H to Register A, the step from BIT n,A to BIT n+1,A.
243E
Decrement Register B and loop to DVTLP at 243CH until Register A = 47H + 8 x drive.
2440
LD (2A85H),A 32 85 2ALD (DVTEST),A
Store Register A into 2A85H, DVTEST, the second byte of the BIT instruction at 2A84H in UNPACK, which tests the drive's bit of YFLAG$ for the date comparisons.
2443
LD (28F8H),A 32 F8 28LD (DVTEST1),A
Store Register A into 28F8H, DVTEST1, the second byte of the BIT instruction at 28F7H, the same test for the date shown in the full format.
2446
LD A,C 79
Load Register A with Register C, the drive number.
2447
ADD A,30H C6 30
Add 30H to Register A, turning the drive number into its digit.
2449
LD (2C43H),A 32 43 2CLD (DRIVE),A
Store Register A (the digit) into 2C43H, the d of Drive :d in the drive's title line (DSTRING 2C3CH); ALL16 (29EDH) reads the drive number back from there.
244C
LD (2D07H),A 32 07 2DLD (NDRIVE),A
Store Register A (the digit) into 2D07H, the n of the line Drive :n [No Disk] (NODISK 2D00H).
244F
LD A,51H 3E 51
Load Register A with 51H, SVC 81, @GTDCT, which returns the drive code table of the drive in Register C.
2451
RST 28H EF
Call @GTDCT with RST 28H: Index Register IY = the DCT of the drive (DCT$ 0470H + 10 x drive), used for the drive's geometry from here on.
2452
LD A,21H 3E 21
Load Register A with 21H, SVC 33, @CKDRV, which tests that the drive is enabled and has a readable diskette.
2454
RST 28H EF
Call @CKDRV with RST 28H: the Z flag comes back set when the drive is ready.
2455
PUSH AF F5
Push Register Pair AF onto the stack (Stack Pointer), keeping the Z flag of @CKDRV across the BREAK test.
2456
Call CKPAWS at 2ACDH, which ends DIR on BREAK and waits while the pause key is held.
2459
POP AF F1
Pop Register Pair AF from the stack (Stack Pointer): the result of @CKDRV again.
245A
If the Z flag is set (the drive is ready) jump to GDCKDRV at 2482H to show its directory.
245C
LD A,(IY+00H) FD 7E 00
The drive did not answer: load Register A with the byte at Index Register IY+00H, the first byte of the DCT, C3H (JP) for an enabled drive and C9H (RET) for a disabled one.
245F
CP C3H FE C3
Compare Register A with C3H, the JP of an enabled drive.
2461
If the Z flag is set (enabled, but no diskette) jump to NO_DISK at 246CH to show the No Disk line.
2463
LD A,(263AH) 3A 3A 26
The drive is disabled: load Register A with the byte at 263AH, the operand of SPECIF (2639H), 00H when a single drive was asked for.
2466
OR A B7
OR Register A with itself to set the Z flag when only this drive was asked for.
2467
If the Z flag is set jump to ERR32 at 241CH: the one drive given is not enabled, error 32, Illegal drive number.
246A
Part of a range: jump to NEXTDRV at 247FH and go on with the next drive.
246CNO_DISK
LD (2AC2H),A 32 C2 2A
NO_DISK: store Register A (C3H, not zero) into 2AC2H, the operand of NOTITLE (2AC1H), so that a page pause in the lines below does not show a title line.
246F
Call CKPAGE at 2A9FH to count the line and pause at the end of a screen.
2472
LD HL,2D00H 21 00 2DLD HL,NODISK
Load Register Pair HL with 2D00H, NODISK, the line Drive :n [No Disk], with the drive digit at 2D07H.
2475
Call LINOUT at 2A10H to show the line at Register Pair HL (and print it with P).
2478
Call CKPAGE at 2A9FH again for the line feed the message ends with.
247B
XOR A AF
Load Register A with 00H by XOR, to let page pauses show titles again.
247C
LD (2AC2H),A 32 C2 2A
Store Register A (00H) into 2AC2H, the operand of NOTITLE (2AC1H).
247FNEXTDRV
NEXTDRV: jump to CKHIT4 at 2638H, which pops the drive number and goes on with the next drive of the range, or returns when the drive was asked for alone.

2482H - GDCKDRV: the Drive's Title Line

The line Drive :d name, the cylinders, the density, free and total space and the date of the diskette is built in DSTRING (2C3CH-2C8BH) from the DCT and the GAT; it is shown later, before the first file (or alone when no file is selected).

2482GDCKDRV
PUSH BC C5
GDCKDRV: push Register Pair BC onto the stack (Stack Pointer) to keep Register C, the drive number.
2483
LD A,(IY+08H) FD 7E 08
Load Register A with the byte at Index Register IY+08H, DCT+8: bits 7-5 the granules per track less one, bits 4-0 the sectors per granule less one.
2486
AND 1FH E6 1F
AND Register A with 1FH, keeping bits 4-0, the sectors per granule less one.
2488
INC A 3C
Increment Register A: the sectors per granule.
2489
LD (2A44H),A 32 44 2A
Store Register A into 2A44H, the operand of the LD C at CALCK1 (2A43H), the multiplier that turns granules into sectors.
248C
LD L,(IY+06H) FD 6E 06
Load Register L with the byte at Index Register IY+06H, DCT+6, the highest cylinder number.
248F
INC L 2C
Increment Register L: the number of cylinders (cylinders are counted from 0).
2490
LD H,00H 26 00
Load Register H with 00H: Register Pair HL = the number of cylinders.
2492
LD DE,2C4EH 11 4E 2C
Load Register Pair DE with 2C4EH, the end of the name field, where the five digit cylinder count goes (it ends at 2C52H, before the word Cyl).
2495
LD A,61H 3E 61
Load Register A with 61H, SVC 97, @HEXDEC, which writes Register Pair HL as five decimal characters at Register Pair DE.
2497
RST 28H EF
Call @HEXDEC with RST 28H: the cylinder count goes into 2C4EH-2C52H, right justified with leading spaces.
2498
LD DE,2C59H 11 59 2CLD DE,DENSITY
Load Register Pair DE with 2C59H, DENSITY, the four characters nDEN of the title, the destination of the density word.
249B
LD HL,2C34H 21 34 2CLD HL,DEN
Load Register Pair HL with 2C34H, DEN, the word xDEN, whose x becomes S or D.
249E
LD A,44H 3E 44
Load Register A with 44H, the letter D, for double density.
24A0
BIT 6,(IY+03H) FD CB 03 76
Test bit 6 of the byte at Index Register IY+03H, DCT+3 bit 6, set for a double density drive.
24A4
If the Z flag is cleared (double density) jump to DUBDEN at 24A8H, keeping the D.
24A6
LD A,53H 3E 53
Load Register A with 53H, the letter S, for single density.
24A8DUBDEN
LD (HL),A 77
DUBDEN: store Register A (D or S) into the byte at Register Pair HL, 2C34H: DDEN or SDEN.
24A9
LD BC,0004H 01 04 00
Load Register Pair BC with 0004H, the four characters to copy.
24AC
BIT 3,(IY+03H) FD CB 03 5E
Test bit 3 of the byte at Index Register IY+03H, DCT+3 bit 3, set for a hard drive.
24B0
If the Z flag is set (a floppy) jump to DOLDIR at 24B5H and copy DDEN or SDEN.
24B2
LD HL,2C38H 21 38 2CLD HL,HARD
Load Register Pair HL with 2C38H, HARD, the word Hard, shown for a hard drive instead of a density.
24B5DOLDIR
LDIR ED B0
DOLDIR: copy 4 bytes (Register Pair BC) from Register Pair HL to Register Pair DE (2C59H): the density word of the title.
24B7
POP BC C1
Pop Register Pair BC from the stack (Stack Pointer): Register C = the drive number again.
24B8
LD HL,2E00H 21 00 2ELD HL,GAT
Load Register Pair HL with 2E00H, the buffer of the GAT and the HIT (over DIR's own start code at 2E00H, which has run).
24BB
LD D,(IY+09H) FD 56 09
Load Register D with the byte at Index Register IY+09H, DCT+9, the directory cylinder.
24BE
LD E,L 5D
Load Register E with Register L (00H), sector 0 of the directory cylinder, the GAT (a 6.3.1 saving of one byte).
24BF
LD A,55H 3E 55
Load Register A with 55H, SVC 85, @RDSSC, which reads the system sector of Register Pair DE (cylinder, sector) of drive C into Register Pair HL.
24C1
RST 28H EF
Call @RDSSC with RST 28H: the GAT of the diskette into 2E00H-2EFFH; NZ on an error.
24C2
LD A,14H 3E 14
Load Register A with 14H, error 20, GAT read error, the error reported for any failure of the read.
24C4
If the Z flag is cleared (the read failed) jump to IOERR at 241EH with Register A = 14H.
24C7
Call CKPAWS at 2ACDH: BREAK ends DIR, the pause key holds it.
24CA
LD DE,0000H 11 00 00
Load Register Pair DE with 0000H, the count of free granules.
24CD
LD L,CCH 2E CC
Load Register L with CCH: Register Pair HL = 2ECCH, GAT+CCH, the number of cylinders beyond 35.
24CF
LD A,(HL) 7E
Load Register A with the byte at Register Pair HL (GAT+CCH), the excess cylinder count.
24D0
ADD A,23H C6 23
Add 23H (35) to Register A: the number of cylinders the GAT covers.
24D2
LD B,A 47
Load Register B with Register A, the count of GAT bytes to examine, one for each cylinder.
24D3
LD L,D 6A
Load Register L with Register D (00H): Register Pair HL = 2E00H, the first byte of the GAT.
24D4
PUSH BC C5
Push Register Pair BC onto the stack (Stack Pointer): Register B, the cylinder count, is needed again at 24E2H.
24D5FS1
LD A,(HL) 7E
FS1: load Register A with the GAT byte at Register Pair HL, one bit for each granule of the cylinder (1 = in use).
24D6FS2
SCF 37
FS2: set the Carry flag, so that the rotate below feeds a 1 into bit 7 and the byte fills up with 1 bits.
24D7
RRA 1F
Rotate Register A right through the Carry flag: the next granule's bit goes into the Carry flag.
24D8
If the Carry flag is set (the granule is in use) jump to FS3 at 24DBH without counting.
24DA
INC DE 13
Increment Register Pair DE: one more free granule.
24DBFS3
CP FFH FE FF
FS3: compare Register A with FFH: when only 1 bits are left the byte is done (the bits of granules that do not exist are 1 in the GAT).
24DD
If the Z flag is cleared jump back to FS2 at 24D6H for the next bit of the byte.
24DF
INC L 2C
Increment Register L to the GAT byte of the next cylinder.
24E0
Decrement Register B and loop to FS1 at 24D5H until all the cylinders are counted.
24E2
POP BC C1
Pop Register Pair BC from the stack (Stack Pointer): Register B = the number of cylinders, Register C the drive number.
24E3
LD A,(IY+08H) FD 7E 08
Load Register A with the byte at Index Register IY+08H, DCT+8, whose bits 7-5 hold the granules per track less one.
24E6
RLCA 07
Rotate Register A left once of three, to bring bits 7-5 down to bits 2-0.
24E7
RLCA 07
Rotate Register A left again, the second of three.
24E8
RLCA 07
Rotate Register A left a third time: bits 2-0 of Register A = the granules per track less one.
24E9
AND 07H E6 07
AND Register A with 07H, keeping bits 2-0: the granules per track less one.
24EB
INC A 3C
Increment Register A: the granules per track.
24EC
BIT 5,(IY+04H) FD CB 04 6E
Test bit 5 of the byte at Index Register IY+04H, DCT+4 bit 5, set for a two sided drive.
24F0
If the Z flag is set (one side) jump to NOTDUB at 24F3H.
24F2
ADD A,A 87
Add Register A to itself: two sides double the granules of a cylinder.
24F3NOTDUB
LD HL,0000H 21 00 00
NOTDUB: load Register Pair HL with 0000H, the total of granules.
24F6
PUSH DE D5
Push Register Pair DE (the free granules) onto the stack (Stack Pointer).
24F7
LD D,H 54
Load Register D with Register H (00H), the high byte of the cylinder count.
24F8
LD E,B 58
Load Register E with Register B: Register Pair DE = the number of cylinders.
24F9
LD B,A 47
Load Register B with Register A, the granules per cylinder, the count of the loop below.
24FAGPCLOOP
ADD HL,DE 19
GPCLOOP: add Register Pair DE (the cylinders) to Register Pair HL.
24FB
Decrement Register B and loop to GPCLOOP at 24FAH: Register Pair HL = cylinders x granules per cylinder, the granules of the diskette.
24FD
BIT 3,(IY+03H) FD CB 03 5E
Test bit 3 of the byte at Index Register IY+03H, DCT+3 bit 3, set for a hard drive.
2501
If the Z flag is cleared (a hard drive) jump to SKIPLOC at 2521H: a hard drive has no lockout table.
2503
LD B,E 43
Load Register B with Register E, the number of cylinders, the count of the lockout loop.
2504
EX DE,HL EB
Exchange Register Pairs DE and HL: Register Pair DE = the total granules, Register Pair HL free.
2505
LD HL,2E60H 21 60 2E
Load Register Pair HL with 2E60H, GAT+60H, the lockout table of a floppy, one byte for each cylinder.
2508
LD C,00H 0E 00
Load Register C with 00H, the count of locked out cylinders (Register C, the drive number, is on the stack from 2432H).
250A
PUSH AF F5
Push Register Pair AF onto the stack (Stack Pointer): Register A, the granules per cylinder.
250BLKLOOP
LD A,01H 3E 01
LKLOOP: load Register A with 01H, the bit of the cylinder's first granule.
250D
AND (HL) A6
AND Register A with the lockout byte at Register Pair HL: not zero when the cylinder's first granule is locked out.
250E
If the Z flag is set (not locked out) jump to GOODCYL at 2511H.
2510
INC C 0C
Increment Register C: one more locked out cylinder.
2511GOODCYL
INC L 2C
GOODCYL: increment Register L to the lockout byte of the next cylinder.
2512
Decrement Register B and loop to LKLOOP at 250BH until every cylinder is tested; Register B ends at 00H.
2514
POP AF F1
Pop Register Pair AF from the stack (Stack Pointer): Register A = the granules per cylinder.
2515
PUSH AF F5
Push Register Pair AF onto the stack (Stack Pointer) again, to keep it over the loop below.
2516
LD H,B 60
Load Register H with Register B (00H after the loop), the high byte of the count.
2517
LD L,B 68
Load Register L with Register B: Register Pair HL = 0000H, the count of locked out granules.
2518GTUSED
ADD HL,BC 09
GTUSED: add Register Pair BC (00H and the locked out cylinders in Register C) to Register Pair HL.
2519
DEC A 3D
Decrement Register A, the count of granules per cylinder.
251A
If the Z flag is cleared jump back to GTUSED at 2518H: Register Pair HL = locked out cylinders x granules per cylinder.
251C
POP AF F1
Pop Register Pair AF from the stack (Stack Pointer), dropping the saved granules per cylinder.
251D
OR A B7
OR Register A with itself to clear the Carry flag for the subtraction.
251E
EX DE,HL EB
Exchange Register Pairs DE and HL: Register Pair HL = the total granules, Register Pair DE the locked out ones.
251F
SBC HL,DE ED 52
Subtract Register Pair DE from Register Pair HL: Register Pair HL = the granules that can be used, the size of the diskette.
2521SKIPLOC
POP DE D1
SKIPLOC: pop Register Pair DE from the stack (Stack Pointer): the free granules counted at FS1.
2522
PUSH HL E5
Push Register Pair HL (the usable granules) onto the stack (Stack Pointer).
2523
LD HL,2C65H 21 65 2CLD HL,KFREE
Load Register Pair HL with 2C65H, KFREE, where the free space in K goes.
2526
Call CALCK at 2A3FH: the free granules in Register Pair DE as K with two decimals into 2C65H-2C6CH.
2529
POP DE D1
Pop Register Pair DE from the stack (Stack Pointer): the usable granules.
252A
LD HL,2C71H 21 71 2CLD HL,KPOSS
Load Register Pair HL with 2C71H, KPOSS, where the size of the diskette in K goes.
252D
Call CALCK at 2A3FH: the usable granules in Register Pair DE as K into 2C71H-2C78H.
2530
LD HL,2ED0H 21 D0 2E
Load Register Pair HL with 2ED0H, GAT+D0H, the name of the diskette (eight characters).
2533
LD DE,2C46H 11 46 2CLD DE,NAME
Load Register Pair DE with 2C46H, NAME, the name field of the title line.
2536
LD C,08H 0E 08
Load Register C with 08H: Register Pair BC = 0008H (Register B is 00H here), the name's length.
2538
LDIR ED B0
Copy 8 bytes (Register Pair BC) from Register Pair HL (2ED0H) to Register Pair DE (2C46H); Register Pair HL ends at 2ED8H, GAT+D8H, the date of the diskette (mm/dd/yy).
253A
LD DE,2C82H 11 82 2CLD DE,DATBUF
Load Register Pair DE with 2C82H, DATBUF, the date field dd-mmm-yy of the title.
253D
LD A,20H 3E 20
Load Register A with 20H, a space, to blank the date field of the title.
253F
LD B,09H 06 09
Load Register B with 09H, the nine characters of the date field.
2541CLRLP
LD (DE),A 12
CLRLP: store Register A (a space) into the byte at Register Pair DE.
2542
INC DE 13
Increment Register Pair DE to the next character of the date field.
2543
Decrement Register B and loop to CLRLP at 2541H: the field is blank, which is what shows when the date cannot be read.
2545
LD A,(HL) 7E
Load Register A with the byte at Register Pair HL (GAT+D8H), the tens digit of the month.
2546
SUB 30H D6 30
Subtract 30H from Register A, the tens of the month as a number.
2548
LD C,A 4F
Load Register C with Register A, the tens of the month, for the times 10 below.
2549
ADD A,A 87
Add Register A to itself: Register A = the tens of the month times 2.
254A
ADD A,A 87
Add Register A to itself again: Register A = the tens of the month times 4.
254B
ADD A,C 81
Add Register C to Register A: Register A = the tens of the month times 5.
254C
ADD A,A 87
Add Register A to itself: Register A = the tens of the month times 10.
254D
LD C,A 4F
Load Register C with Register A, the tens of the month times 10.
254E
INC HL 23
Increment Register Pair HL to the units digit of the month.
254F
LD A,(HL) 7E
Load Register A with the byte at Register Pair HL, the units digit of the month.
2550
SUB 31H D6 31
Subtract 31H from Register A: the units less one (a 6.3.1 change, so that January is 0).
2552
ADD A,C 81
Add Register C to Register A: the month less one, 0-11 for a good date.
2553
CP 0CH FE 0C
Compare Register A with 0CH (12): Carry set for a month 0-11 (January to December).
2555
If the Carry flag is cleared (not a month) jump to ILLDATE at 257DH and leave the date blank.
2557
LD C,A 4F
Load Register C with Register A, the month less one.
2558
ADD A,A 87
Add Register A to itself: Register A = the month less one, times 2.
2559
ADD A,C 81
Add Register C to Register A: month x 3, the offset of its three letter name.
255A
LD C,A 4F
Load Register C with Register A: Register Pair BC = the offset (Register B is 00H after CLRLP).
255B
PUSH HL E5
Push Register Pair HL (the pointer into the GAT date) onto the stack (Stack Pointer).
255C
LD HL,04DCH 21 DC 04LD HL,MONTBL
Load Register Pair HL with 04DCH, MONTBL$, the month names Jan to Dec in BOOT/SYS (a 6.3.1 patch, Level 1D: DIR's own copy was given up).
255F
ADD HL,BC 09
Add Register Pair BC to Register Pair HL: Register Pair HL = the month's name.
2560
LD A,2DH 3E 2D
Load Register A with 2DH, the minus sign that separates the parts of the date.
2562
LD DE,2C85H 11 85 2C
Load Register Pair DE with 2C85H, the month of dd-mmm-yy.
2565
LD C,03H 0E 03
Load Register C with 03H: Register Pair BC = 0003H, three letters.
2567
LDIR ED B0
Copy 3 bytes (Register Pair BC) from Register Pair HL to Register Pair DE: the month's name into 2C85H-2C87H.
2569
LD (DE),A 12
Store Register A (the minus sign) into the byte at Register Pair DE, 2C88H.
256A
POP HL E1
Pop Register Pair HL from the stack (Stack Pointer): the units digit of the month in the GAT.
256B
INC HL 23
Increment Register Pair HL past the digit to the slash.
256C
INC HL 23
Increment Register Pair HL to the day of the month (two digits).
256D
LD DE,2C82H 11 82 2CLD DE,DATBUF
Load Register Pair DE with 2C82H, the day of dd-mmm-yy.
2570
LD C,02H 0E 02
Load Register C with 02H: Register Pair BC = 0002H, two digits.
2572
LDIR ED B0
Copy 2 bytes (Register Pair BC) from Register Pair HL to Register Pair DE: the day into 2C82H-2C83H.
2574
LD (DE),A 12
Store Register A (the minus sign) into the byte at Register Pair DE, 2C84H.
2575
INC HL 23
Increment Register Pair HL past the second slash to the year.
2576
LD C,02H 0E 02
Load Register C with 02H: Register Pair BC = 0002H, the two digits of the year.
2578
LD DE,2C89H 11 89 2C
Load Register Pair DE with 2C89H, the year of dd-mmm-yy.
257B
LDIR ED B0
Copy 2 bytes (Register Pair BC) from Register Pair HL to Register Pair DE: the year into 2C89H-2C8AH.

257DH - ILLDATE: the Counts and the HIT

The title is ready. The flag that the title is still to be shown is set, the sort buffer emptied, the counts cleared, and the HIT (sector 1 of the directory cylinder) read into 2E00H over the GAT.

257DILLDATE
LD A,D 7A
ILLDATE: load Register A with Register D (2CH, never zero: Register Pair DE points into the title here) as the flag value.
257E
LD (2D9BH),A 32 9B 2DLD (FILFLAG),A
Store Register A into 2D9BH, FILFLAG: not zero while the title line of this drive has not been shown (cleared by MATCH at 2740H).
2581
LD HL,3000H 21 00 30LD HL,MEMORY
Load Register Pair HL with 3000H, the start of the sort buffer above the member.
2584
LD (2D9CH),HL 22 9C 2DLD (DIRPTR),HL
Store Register Pair HL (3000H) into 2D9CH, DIRPTR, the next free byte of the sort buffer (the first bytes of DIR's start code, which has run).
2587
XOR A AF
Load Register A with 00H by XOR, which also clears the Carry flag for the SBC.
2588
SBC HL,HL ED 62
Subtract Register Pair HL and the Carry flag from Register Pair HL: Register Pair HL = 0000H.
258A
LD (25F6H),HL 22 F6 25
Store Register Pair HL (0000H) into 25F6H, the operand of TFILES (25F5H), the count of live files on the drive.
258D
LD (25DAH),HL 22 DA 25
Store Register Pair HL (0000H) into 25DAH, the operand of COUNT (25D9H), the count of files shown.
2590
LD (2601H),HL 22 01 26
Store Register Pair HL (0000H) into 2601H, the operand of TOTGRNS (2600H), the granules of the files shown.
2593
POP BC C1
Pop Register Pair BC from the stack (Stack Pointer): Register C = the drive number, pushed at DIR4 (2432H).
2594
LD D,(IY+09H) FD 56 09
Load Register D with the byte at Index Register IY+09H, DCT+9, the directory cylinder.
2597
LD E,01H 1E 01
Load Register E with 01H, sector 1, the HIT (hash index table).
2599
LD HL,2E00H 21 00 2ELD HL,HIT
Load Register Pair HL with 2E00H, the buffer, over the GAT that is no longer needed.
259C
LD A,55H 3E 55
Load Register A with 55H, SVC 85, @RDSSC, the read of a system sector.
259E
RST 28H EF
Call @RDSSC with RST 28H: the HIT of drive C into 2E00H-2EFFH.
259F
LD A,16H 3E 16
Load Register A with 16H, error 22, HIT read error.
25A1
If the Z flag is cleared (the read failed) jump to IOERR at 241EH with Register A = 16H.
25A4
Call CKPAWS at 2ACDH: BREAK ends DIR, the pause key holds it.
25A7$JP0
$JP0: jump to CKHIT5 at 2648H with Register Pair HL at the next HIT byte to test, 2E00H the first time (the loop is entered in its middle; CKHIT2 comes back here).

25AAH - CKHIT: the Walk Through the HIT, the Totals and the Next Drive

The HIT has a byte for each directory entry, at offset entry x 20H + sector; DIR takes the offsets 00H, 20H ... E0H (the eight entries of directory sector 0), then 01H, 21H ... and so on, so that each directory sector is read once. After the last, the sorted list is shown, then the totals line of the full format, and the next drive is started.

25AACKHIT
POP HL E1
CKHIT: pop Register Pair HL from the stack (Stack Pointer), dropping the entry pointer the name test pushed (26C9H, 26F8H, 272AH come here).
25ABCKHIT1
POP BC C1
CKHIT1: pop Register Pair BC from the stack (Stack Pointer): Register B = the HIT offset of the entry just done, Register C the drive number (pushed at 264EH).
25AC
LD H,2EH 26 2E
Load Register H with 2EH, the high byte of the HIT buffer at 2E00H.
25AE
LD L,B 68
Load Register L with Register B: Register Pair HL points at the HIT byte of the entry just done.
25AFCKHIT2
LD A,L 7D
CKHIT2: load Register A with Register L, the HIT offset (the walk comes here from 264AH for a free slot).
25B0
ADD A,20H C6 20
Add 20H to Register A: the next entry of the same directory sector.
25B2
LD L,A 6F
Load Register L with Register A: Register Pair HL at that entry's HIT byte.
25B3
If the Carry flag is cleared (still in the sector's eight entries) jump to $JP0 at 25A7H to test it.
25B5
INC L 2C
The eight entries are done: increment Register L to the first entry of the next directory sector (offset 01H, 02H ...).
25B6
BIT 5,L CB 6D
Test bit 5 of Register L: it becomes 1 when the offset reaches 20H, after all thirty-two sector columns.
25B8
If the Z flag is set (more sectors) jump to $JP0 at 25A7H to go on.
25BA
LD A,(26FCH) 3A FC 26
The HIT is done: load Register A with the byte at 26FCH, the low byte of the operand of SORTPRM (26FBH), not zero when the list is sorted.
25BD
OR A B7
OR Register A with itself to test the SORT value for zero.
25BE
If the Z flag is cleared (sorted) call SORTIT at 2B14H to sort the entries kept in the buffer and show them.
25C1
LD HL,(25DAH) 2A DA 25
Load Register Pair HL with the word at 25DAH, the operand of COUNT (25D9H): the files shown.
25C4
LD A,H 7C
Load Register A with Register H, the high byte of the count.
25C5
OR L B5
OR Register L into Register A to test the count for zero.
25C6
If the Z flag is cleared (files were shown) jump to FILES at 25D3H.
25C8
LD HL,2C3CH 21 3C 2CLD HL,DSTRING
No file was selected: load Register Pair HL with 2C3CH, DSTRING, the drive's title line.
25CB
Call LINOUT at 2A10H to show the title line alone.
25CE
Call CKPAGE at 2A9FH to count the line; at the end of a screen CKPAGE shows the title again after the pause, because FILFLAG is still set (B45).
25D1
Jump to NOTAP at 261DH, which finds FILFLAG set and goes on with the next drive.
25D3FILES
LD A,(27FCH) 3A FC 27
FILES: load Register A with the byte at 27FCH, the low byte of the operand of APARM (27FBH), not zero with the A parameter.
25D6
OR A B7
OR Register A with itself to test the A parameter's value for zero.
25D7
If the Z flag is set (the brief format) jump to NOTAP at 261DH: only the full format has a totals line.
25D9COUNT
LD HL,0000H 21 00 00
COUNT: load Register Pair HL with 0000H, the operand at 25DAH, the files shown on this drive (cleared at 258DH, counted by MATCH at 273AH).
25DC
LD A,H 7C
Load Register A with Register H, the high byte of the count.
25DD
OR L B5
OR Register L into Register A to test the count for zero.
25DE
If the Z flag is set (no file) jump to TERMDRV at 262EH, the next drive.
25E0
LD B,4FH 06 4F
Load Register B with 4FH, the 79 equals signs of the line above the totals.
25E2D79EQ
LD A,3DH 3E 3D
D79EQ: load Register A with 3DH, the equals sign.
25E4
Call BYTOUT at 2A22H to show the character in Register A (and print it with P).
25E7
Decrement Register B and loop to D79EQ at 25E2H for 79 signs.
25E9
Call CKPAGE1 at 2A9AH, which ends the line with a carriage return and counts it (6.3.1).
25EC
PUSH BC C5
Push Register Pair BC onto the stack (Stack Pointer): Register C, the drive number, which the output below would change.
25ED
LD B,03H 06 03
Load Register B with 03H, the width of the count field.
25EF
LD DE,2CDAH 11 DA 2CLD DE,FDISP
Load Register Pair DE with 2CDAH, FDISP, where the count of files shown goes.
25F2
LD A,5FH 3E 5F
Load Register A with 5FH, SVC 95, @HEXD, which writes Register Pair HL in decimal into a field of Register B characters at Register Pair DE.
25F4
RST 28H EF
Call @HEXD with RST 28H: the files shown, three characters into 2CDAH-2CDCH.
25F5TFILES
LD HL,0000H 21 00 00
TFILES: load Register Pair HL with 0000H, the operand at 25F6H, the count of live files of the drive (counted at 2675H).
25F8
LD DE,2CE7H 11 E7 2C
Load Register Pair DE with 2CE7H, inside FUSED, where the count of files goes.
25FB
LD B,03H 06 03
Load Register B with 03H, the width of the field.
25FD
LD A,5FH 3E 5F
Load Register A with 5FH, SVC 95, @HEXD, the decimal conversion with a field width.
25FF
RST 28H EF
Call @HEXD with RST 28H: the live files, three characters into 2CE7H-2CE9H.
2600TOTGRNS
LD DE,0000H 11 00 00
TOTGRNS: load Register Pair DE with 0000H, the operand at 2601H, the granules of the files shown (added at 28ADH).
2603
LD HL,2CF5H 21 F5 2CLD HL,SPUSED
Load Register Pair HL with 2CF5H, SPUSED, where the space in K goes.
2606
Call CALCK at 2A3FH: the granules in Register Pair DE as K with two decimals into 2CF5H-2CFCH.
2609
LD B,13H 06 13
Load Register B with 13H, 19 spaces to put the totals line under the file size column.
260B
Call OUTSPC at 2A37H to show Register B spaces.
260E
POP BC C1
Pop Register Pair BC from the stack (Stack Pointer): Register C = the drive number.
260F
LD HL,2CDAH 21 DA 2CLD HL,FDISP
Load Register Pair HL with 2CDAH, FDISP, the line nnn files of nnn selected, nnnnn.nn K.
2612
Call LINOUT at 2A10H to show the line, which ends with a line feed and a carriage return.
2615
Call CKPAGE at 2A9FH to count the totals line on the screen.
2618
Call CKPAGE at 2A9FH again, for the blank line the line feed made.
261B
Jump to TERMDRV at 262EH, which goes on with the next drive of the range.
261DNOTAP
LD A,(2D9BH) 3A 9B 2DLD A,(FILFLAG)
NOTAP: load Register A with the byte at 2D9BH, FILFLAG, not zero when no title was shown (no file of the drive was selected).
2620
OR A B7
OR Register A with itself to test FILFLAG for zero.
2621
If the Z flag is cleared jump to TERMDRV at 262EH: nothing was listed, no line to end.
2623
LD A,(2804H) 3A 04 28
Load Register A with the byte at 2804H, the operand of DONAM9 (2803H), the names still to come on the line.
2626
CP 04H FE 04
Compare Register A with 04H: 04H when the last line of names is full and ended.
2628
If the Z flag is cleared (a line part full) call ENDLINE at 280FH to end it.
262B
Call ENDLINE at 280FH for a blank line after the drive's list.
262ETERMDRV
LD A,00H 3E 00
TERMDRV: load Register A with 00H, the operand at 262FH, the last drive of the range (stored at 2E63H).
2630
INC C 0C
Increment Register C, the drive number, to the next drive.
2631
CP C B9
Compare Register A with Register C: the Carry flag is set when Register C has passed the last drive.
2632TODIR4
TODIR4: if the Carry flag is cleared (more drives) jump to DIR4 at 2432H (CKHIT4 also comes here, 2645H, a 6.3.1E change).
2635
All drives done: jump to EXIT at 2428H with Register Pair HL = 0000H.
2638CKHIT4
POP BC C1
CKHIT4: pop Register Pair BC from the stack (Stack Pointer): Register C = the drive number, pushed at DIR4 (2432H), for a drive passed over.
2639SPECIF
LD A,00H 3E 00
SPECIF: load Register A with 00H, the operand at 263AH: the first drive less the last (2E5FH), 00H when one drive was given.
263B
OR A B7
OR Register A with itself to test SPECIF's value for zero.
263C
LD HL,0000H 21 00 00
Load Register Pair HL with 0000H, the return code for the RET Z below and the RET at 2647H (6.3.1E: before that level a range that ended on a drive passed over returned with a non-zero Register Pair HL).
263F
RET Z C8
If the Z flag is set (one drive was asked for) return with Register Pair HL = 0000H: DIR is finished.
2640
LD A,(262FH) 3A 2F 26
Load Register A with the byte at 262FH, the operand of TERMDRV, the last drive.
2643
INC C 0C
Increment Register C, the drive number, to the next drive of the range.
2644
CP C B9
Compare Register A with Register C: the Carry flag is set when Register C has passed the last drive.
2645
If the Carry flag is cleared (more drives) jump to TODIR4 at 2632H, whose JP NC goes to DIR4 (6.3.1).
2647
RET C9
Return with Register Pair HL = 0000H: the range is done (the Stack Pointer is the one DIR started with).

2648H - CKHIT5: Read the Entry and Test It

For a HIT byte that is not zero the directory sector is read with @DIRRD (only when it is not the one already in the buffer) and the entry is tested: in use, a primary entry, SYS and INV against the S and I parameters, MOD, the name against the partspec (or the -partspec) and the date against DATE. An entry that passes is copied to the sort buffer or shown at once.

2648CKHIT5
LD A,(HL) 7E
CKHIT5: load Register A with the HIT byte at Register Pair HL, the hash of the entry's file name, 00H for a free slot.
2649
OR A B7
OR Register A with itself to test the HIT byte for zero, a free slot.
264A
If the Z flag is set (a free slot) jump to CKHIT2 at 25AFH for the next HIT byte.
264D
LD B,L 45
Load Register B with Register L, the HIT offset, which is the DEC (directory entry code) of the entry: bits 7-5 the entry, bits 4-0 the sector less 2.
264E
PUSH BC C5
Push Register Pair BC (Register B the DEC, Register C the drive) onto the stack (Stack Pointer), popped at CKHIT1 (25ABH).
264F
LD A,L 7D
Load Register A with Register L, the DEC, to split it into entry and sector.
2650
AND E0H E6 E0
AND Register A with E0H, keeping bits 7-5, the entry number times 32: the offset of the entry in its sector.
2652
LD L,A 6F
Load Register L with Register A, the entry's offset, for the pointer into the sector buffer.
2653
XOR B A8
XOR Register A with Register B: Register A = bits 4-0 of the DEC, the directory sector less 2.
2654CKHIT6
CP FFH FE FF
CKHIT6: compare Register A with FFH, the operand at 2655H, the sector last read (FFH at the start; not set back for the next drive, harmless because sectors 0 and 1 always hold BOOT/SYS and DIR/SYS).
2656
If the Z flag is set (that sector is in the buffer) jump to CKDIR1 at 2668H.
2658
LD (2655H),A 32 55 26
Store Register A (the sector) into 2655H, the operand of CKHIT6, as the sector now in the buffer.
265B
LD A,57H 3E 57
Load Register A with 57H, SVC 87, @DIRRD, which reads the directory sector of the DEC in Register B of drive C into the system buffer.
265D
RST 28H EF
Call @DIRRD with RST 28H: Register Pair HL comes back at the entry in SBUFF$ (1D00H); NZ on an error.
265E
If the Z flag is cleared (the read failed) jump to IOERR at 241EH with the error in Register A.
2661
LD A,H 7C
Load Register A with Register H, the high byte of the system buffer (1DH).
2662
LD (2669H),A 32 69 26
Store Register A into 2669H, the operand of CKDIR1 (2668H), so that later entries of the same sector need no read.
2665
LD (29DDH),A 32 DD 29
Store Register A into 29DDH, the operand of SBUFFER (29DCH), for an FXDE in the same sector.
2668CKDIR1
LD H,00H 26 00
CKDIR1: load Register H with 00H, the operand at 2669H, the buffer's high byte: Register Pair HL = the entry, DIR+0.
266A
BIT 4,(HL) CB 66
Test bit 4 of the byte at Register Pair HL, DIR+0 bit 4, set for an entry in use.
266C
If the Z flag is set (a dead entry, killed) jump to CKHIT1 at 25ABH, the next HIT byte.
266F
BIT 7,(HL) CB 7E
Test bit 7 of the byte at Register Pair HL, DIR+0 bit 7, set for an extended entry (FXDE).
2671
If the Z flag is cleared (an FXDE, not a file of its own) jump to CKHIT1 at 25ABH.
2674
PUSH HL E5
Push Register Pair HL (DIR+0) onto the stack (Stack Pointer).
2675
LD HL,(25F6H) 2A F6 25
Load Register Pair HL with the word at 25F6H, the operand of TFILES (25F5H), the count of live files.
2678
INC HL 23
Increment Register Pair HL: one more file, counted whatever the parameters select.
2679
LD (25F6H),HL 22 F6 25
Store Register Pair HL into 25F6H, the operand of TFILES.
267C
POP HL E1
Pop Register Pair HL from the stack (Stack Pointer): DIR+0 again.
267D
BIT 6,(HL) CB 76
Test bit 6 of the byte at Register Pair HL, DIR+0 bit 6, set for a system file.
267F
If the Z flag is set (not a system file) jump to CKDIR3 at 268BH.
2681SPARM
LD DE,0000H 11 00 00
SPARM: load Register Pair DE with 0000H, the operand at 2682H that @PARAM fills in for S (SYS).
2684
LD A,D 7A
Load Register A with Register D, the high byte of the value.
2685
OR E B3
OR Register E into Register A: not zero when S was given.
2686
If the Z flag is set (no S) jump to CKHIT1 at 25ABH: system files are not shown.
2689
Jump to CKMOD at 2697H: a system file shown with S needs no I, even when it is invisible.
268BCKDIR3
BIT 3,(HL) CB 5E
CKDIR3: test bit 3 of the byte at Register Pair HL, DIR+0 bit 3, set for an invisible file.
268D
If the Z flag is set (visible) jump to CKMOD at 2697H.
268FIPARM
LD DE,0000H 11 00 00
IPARM: load Register Pair DE with 0000H, the operand at 2690H that @PARAM fills in for I (INV).
2692
LD A,D 7A
Load Register A with Register D, the high byte of the value.
2693
OR E B3
OR Register E into Register A: not zero when I was given.
2694
If the Z flag is set (no I) jump to CKHIT1 at 25ABH: the invisible file is not shown.
2697CKMOD
LD DE,0000H 11 00 00
CKMOD: load Register Pair DE with 0000H, the operand at 2698H that @PARAM fills in for MOD.
269A
LD A,D 7A
Load Register A with Register D, the high byte of the value.
269B
OR E B3
OR Register E into Register A: not zero when MOD was given.
269C
If the Z flag is set (no MOD) jump to CKNAM at 26A5H.
269E
INC L 2C
Increment Register L: Register Pair HL = DIR+1.
269F
BIT 6,(HL) CB 76
Test bit 6 of the byte at Register Pair HL, DIR+1 bit 6, the MOD flag (the file was written since its last backup).
26A1
If the Z flag is set (not modified) jump to CKHIT1 at 25ABH.
26A4
DEC L 2D
Decrement Register L: Register Pair HL = DIR+0 again.
26A5CKNAM
PUSH HL E5
CKNAM: push Register Pair HL (DIR+0) onto the stack (Stack Pointer), popped at CKNAM2A (26CCH) or CKHIT (25AAH).
26A6
LD A,L 7D
Load Register A with Register L, the offset of the entry.
26A7
ADD A,05H C6 05
Add 05H to Register A, the offset of the name in an entry.
26A9
LD L,A 6F
Load Register L with Register A: Register Pair HL = DIR+5, the name (8) and the extension (3).
26AA
LD DE,2DA7H 11 A7 2DLD DE,BLANKS
Load Register Pair DE with 2DA7H, BLANKS, the partspec as DIRA parsed it: eight characters of name and three of extension, spaces where nothing was given.
26AD
LD B,0BH 06 0B
Load Register B with 0BH, the eleven characters of name and extension.
26AFCKNAM1
LD A,(DE) 1A
CKNAM1: load Register A with the partspec character at Register Pair DE.
26B0
CP 24H FE 24
Compare Register A with 24H, the dollar sign, the wild card.
26B2
If the Z flag is set (a wild card) jump to CKNAM2 at 26BBH: it matches anything.
26B4
CP (HL) BE
Compare Register A with the name character at Register Pair HL.
26B5
If the Z flag is set (the same) jump to CKNAM2 at 26BBH.
26B7
CP 20H FE 20
Compare Register A with 20H: a space in the partspec matches anything too, so that a partial name matches every name it begins.
26B9
If the Z flag is cleared (a different character) jump to MFLG at 26C6H: no match.
26BBCKNAM2
INC HL 23
CKNAM2: increment Register Pair HL to the next name character.
26BC
INC DE 13
Increment Register Pair DE to the next partspec character.
26BD
Decrement Register B and loop to CKNAM1 at 26AFH for all eleven characters.
26BF
LD A,(26C7H) 3A C7 26
The name matches: load Register A with the byte at 26C7H, the operand of MFLG, 2DH (minus) when a -partspec was given.
26C2
CP 2DH FE 2D
Compare Register A with 2DH: Z when the match means the file is excluded.
26C4
Jump to CK2HIT at 26C9H with that Z flag (the OR of MFLG is skipped).
26C6MFLG
LD A,00H 3E 00
MFLG: no match: load Register A with 00H, the operand at 26C7H, the exclude flag (set to 2DH at 2E27H).
26C8
OR A B7
OR Register A with itself: Z without a minus sign, the file is not selected.
26C9CK2HIT
CK2HIT: if the Z flag is set jump to CKHIT at 25AAH, the next entry (the name decides against the file).
26CCCKNAM2A
POP HL E1
CKNAM2A: pop Register Pair HL from the stack (Stack Pointer): DIR+0.
26CD
PUSH HL E5
Push Register Pair HL (DIR+0) onto the stack (Stack Pointer) again.
26CE
INC HL 23
Increment Register Pair HL to DIR+1, the month and flags byte.
26CF
Call UNPACK at 2A70H: Register Pair DE = the file's date as one comparable word (year, month, day), 0000H when it has none.
26D2
LD A,(2D9AH) 3A 9A 2DLD A,(FTFLG)
Load Register A with the byte at 2D9AH, FTFLG: bit 7 a from date given, bit 0 a to date.
26D5
RLCA 07
Rotate Register A left: bit 7 (from) goes into the Carry flag.
26D6
If the Carry flag is cleared (no from date) jump to CKNAM2B at 26E7H.
26D8
LD A,D 7A
Load Register A with Register D, the high byte of the file's date.
26D9
OR E B3
OR Register E into Register A: zero when the file has no date.
26DA
If the Z flag is set (no date) jump to CKHIT at 25AAH: a file without a date is never selected by DATE.
26DD
LD HL,(2DA0H) 2A A0 2DLD HL,(FMPAKD)
Load Register Pair HL with the word at 2DA0H, FMPAKD, the from date packed the same way.
26E0
EX DE,HL EB
Exchange Register Pairs DE and HL: Register Pair HL = the file's date, Register Pair DE the from date.
26E1
Call CPHLDE at 2A6AH, which compares Register Pair HL with Register Pair DE: Carry set when the file's date is earlier.
26E4
EX DE,HL EB
Exchange Register Pairs DE and HL back: Register Pair DE = the file's date (the flags stay).
26E5
If the Carry flag is set (before the from date) jump to $JP1 at 26F8H, whose JP C goes to the next entry.
26E7CKNAM2B
LD A,(2D9AH) 3A 9A 2DLD A,(FTFLG)
CKNAM2B: load Register A with the byte at 2D9AH, FTFLG, again, for its to bit.
26EA
RRCA 0F
Rotate Register A right: bit 0 (to) goes into the Carry flag.
26EB
If the Carry flag is cleared (no to date) jump to SORTPRM at 26FBH.
26ED
LD A,D 7A
Load Register A with Register D, the high byte of the file's date.
26EE
OR E B3
OR Register E into Register A: zero when the file has no date.
26EF
If the Z flag is set (no date) jump to CKHIT at 25AAH.
26F2
LD HL,(2DA2H) 2A A2 2DLD HL,(TOPAKD)
Load Register Pair HL with the word at 2DA2H, TOPAKD, the to date packed.
26F5
Call CPHLDE at 2A6AH: Carry set when the to date (Register Pair HL) is earlier than the file's date (Register Pair DE).
26F8$JP1
$JP1: if the Carry flag is set (the file is out of the range) jump to CKHIT at 25AAH, the next entry.
26FBSORTPRM
LD DE,FFFFH 11 FF FF
SORTPRM: load Register Pair DE with FFFFH, the operand at 26FCH: sorted unless SORT=NO or O=NO was given (or DIR came through @CMNDR: 2E6FH).
26FE
POP HL E1
Pop Register Pair HL from the stack (Stack Pointer): DIR+0.
26FF
LD A,D 7A
Load Register A with Register D, the high byte of the value.
2700
OR E B3
OR Register E into Register A: zero for SORT=NO.
2701
If the Z flag is set (not sorted) jump to DODSP at 2730H and show the entry now.
2703
PUSH HL E5
Push Register Pair HL (DIR+0) onto the stack (Stack Pointer).
2704
Call ALL09A at 29B2H: the granules in Register Pair DE and the extents in Register Pair BC, while the entry's FXDE, if any, can still be read with the sector.
2707
POP HL E1
Pop Register Pair HL from the stack (Stack Pointer): DIR+0.
2708
PUSH HL E5
Push Register Pair HL onto the stack (Stack Pointer), to move it into Index Register IX.
2709
POP IX DD E1
Pop Index Register IX from the stack (Stack Pointer): Index Register IX = DIR+0 of the entry in SBUFF$.
270B
LD (IX+16H),E DD 73 16
Store Register E into the byte at Index Register IX+16H, DIR+22, the low byte of the granules, over the first extent of the entry (in SBUFF$ itself; nothing writes the buffer back).
270E
LD (IX+17H),D DD 72 17
Store Register D into the byte at Index Register IX+17H, DIR+23, the high byte of the granules.
2711
LD (IX+18H),C DD 71 18
Store Register C into the byte at Index Register IX+18H, DIR+24, the low byte of the extent count.
2714
LD (IX+19H),B DD 70 19
Store Register B into the byte at Index Register IX+19H, DIR+25, the high byte of the extent count.
2717
LD DE,(2D9CH) ED 5B 9C 2DLD DE,(DIRPTR)
Load Register Pair DE with the word at 2D9CH, DIRPTR, the next free byte of the sort buffer.
271B
PUSH HL E5
Push Register Pair HL (DIR+0) onto the stack (Stack Pointer), popped at CKHIT (25AAH).
271C
LD BC,0020H 01 20 00
Load Register Pair BC with 0020H, the 32 bytes of an entry.
271F
LDIR ED B0
Copy 32 bytes (Register Pair BC) from Register Pair HL (the entry) to Register Pair DE (the sort buffer).
2721
LD (2D9CH),DE ED 53 9C 2DLD (DIRPTR),DE
Store Register Pair DE (the byte after the copy) into 2D9CH, DIRPTR.
2725
LD HL,(2D9EH) 2A 9E 2DLD HL,(MAXMEM)
Load Register Pair HL with the word at 2D9EH, MAXMEM, HIGH$ less 33 (2E7AH).
2728
SBC HL,DE ED 52
Subtract Register Pair DE (and the Carry flag, which is clear) from Register Pair HL: Carry set when the buffer has passed MAXMEM.
272A
If the Carry flag is cleared (room left) jump to CKHIT at 25AAH, the next entry.
272D
The buffer is full: jump to NOMEM at 240DH for No memory for SORT.
2730DODSP
DODSP: call MATCH at 2736H to show the entry at Register Pair HL now.
2733
Jump to CKHIT1 at 25ABH, which goes on with the next entry of the HIT.

2736H - MATCH: Show an Entry

Called for each selected entry, at once or from the sorted list (2B5FH), with Register Pair HL at its DIR+0. The first one shows the drive's title. The name goes out in a column of 19 characters, which Register C counts down (BYTOUT2 decrements it for each character), then the attribute letters; the full format adds the rest of the line (ALL01), the brief one puts four names on a line.

2736MATCH
PUSH HL E5
MATCH: push Register Pair HL (DIR+0 of the entry) onto the stack (Stack Pointer).
2737
LD HL,25DAH 21 DA 25
Load Register Pair HL with 25DAH, the operand of COUNT (25D9H), the count of files shown.
273A
INC (HL) 34
Increment the byte at Register Pair HL: only the low byte of COUNT is counted, enough for the most entries a directory has.
273B
LD HL,2D9BH 21 9B 2DLD HL,FILFLAG
Load Register Pair HL with 2D9BH, FILFLAG, not zero while the drive's title is still to be shown.
273E
XOR A AF
Load Register A with 00H by XOR, the value FILFLAG gets.
273F
CP (HL) BE
Compare Register A with the byte at Register Pair HL: the Z flag is cleared when FILFLAG is not zero.
2740
LD (HL),A 77
Store Register A (00H) into the byte at Register Pair HL: the title is shown now (the flags stay).
2741
If the Z flag is cleared (the first file of the drive) call CKTITL at 2AEBH to show the title and, with A, the column heading.
2744ALRPRT
POP HL E1
ALRPRT: pop Register Pair HL from the stack (Stack Pointer): the entry.
2745
LD A,L 7D
Load Register A with Register L, the entry's address low byte.
2746
AND E0H E6 E0
AND Register A with E0H: the entry's start, DIR+0 (the buffer entries begin at multiples of 32).
2748
ADD A,05H C6 05
Add 05H to Register A, the offset of the name.
274A
LD L,A 6F
Load Register L with Register A: Register Pair HL = DIR+5, the file name.
274B
LD C,13H 0E 13
Load Register C with 13H, the 19 columns of one name in the brief format; each character shown counts it down.
274D
LD B,08H 06 08
Load Register B with 08H, the eight characters of the name field.
274FDONAM1
LD A,(HL) 7E
DONAM1: load Register A with the name character at Register Pair HL.
2750
INC HL 23
Increment Register Pair HL to the next character of the name.
2751
CP 20H FE 20
Compare Register A with 20H: a space ends the name.
2753
If the Z flag is set jump to DONAM2 at 275CH to find the extension.
2755
Call BYTOUT2 at 2A21H to show the character, Register C counting down.
2758
Decrement Register B and loop to DONAM1 at 274FH for up to eight characters.
275A
All eight shown: Register Pair HL is at the extension; jump to DONAM3 at 2760H.
275CDONAM2
LD A,L 7D
DONAM2: load Register A with Register L, past the space that ended the name.
275D
ADD A,B 80
Add Register B, the characters of the field not used, to Register A.
275E
DEC A 3D
Decrement Register A once, for the space already passed.
275F
LD L,A 6F
Load Register L with Register A: Register Pair HL = DIR+13, the extension.
2760DONAM3
LD A,(HL) 7E
DONAM3: load Register A with the first character of the extension at Register Pair HL.
2761
CP 20H FE 20
Compare Register A with 20H: a space means no extension.
2763
If the Z flag is set jump to DONAM5 at 2777H.
2765
LD A,2FH 3E 2F
Load Register A with 2FH, the slash between name and extension.
2767
Call BYTOUT2 at 2A21H to show the slash, Register C counting down.
276A
LD B,03H 06 03
Load Register B with 03H, the three characters of the extension.
276CDONAM4
LD A,(HL) 7E
DONAM4: load Register A with the extension character at Register Pair HL.
276D
INC HL 23
Increment Register Pair HL to the next character of the extension.
276E
CP 20H FE 20
Compare Register A with 20H: a space ends the extension.
2770
If the Z flag is set jump to DONAM5 at 2777H.
2772
Call BYTOUT2 at 2A21H to show the character, Register C counting down.
2775
Decrement Register B and loop to DONAM4 at 276CH for up to three characters.
2777DONAM5
LD A,(27FCH) 3A FC 27
DONAM5: load Register A with the byte at 27FCH, the low byte of the operand of APARM (27FBH): not zero with the A parameter.
277A
OR A B7
OR Register A with itself to test the A parameter's value for zero.
277B
If the Z flag is set (the brief format) jump to DONAM5A at 2790H.
277D
LD A,C 79
Full format: load Register A with Register C, the columns left of the 19.
277E
SUB 06H D6 06
Subtract 06H from Register A: spaces up to column 13, where the MOD column of the full format begins.
2780
LD B,A 47
Load Register B with Register A, the count for OUTSPC.
2781
Call OUTSPC at 2A37H to show Register B spaces (Register C counting down).
2784
LD A,L 7D
Load Register A with Register L, inside the entry.
2785
AND E0H E6 E0
AND Register A with E0H: back to the entry's start.
2787
LD L,A 6F
Load Register L with Register A: Register Pair HL = DIR+0.
2788
Call OUTMOD at 298EH: a plus sign under MOD if the file was modified, else a space.
278B
LD B,01H 06 01
Load Register B with 01H, one more space after the MOD column.
278D
Call OUTSPC at 2A37H to show Register B spaces.
2790DONAM5A
LD B,01H 06 01
DONAM5A: load Register B with 01H, the space after the file specification.
2792
Call OUTSPC at 2A37H to show the space, Register C counting down.
2795
LD A,L 7D
Load Register A with Register L, inside the entry.
2796
AND E0H E6 E0
AND Register A with E0H, the start of the entry.
2798
LD L,A 6F
Load Register L with Register A: Register Pair HL = DIR+0.
2799
LD A,3FH 3E 3F
Load Register A with 3FH, the question mark shown for an open file.
279B
INC HL 23
Increment Register Pair HL to DIR+1, the byte with the open bit.
279C
BIT 5,(HL) CB 6E
Test bit 5 of the byte at Register Pair HL, DIR+1 bit 5, set while the file is open (or was left open).
279E
DEC HL 2B
Decrement Register Pair HL back to DIR+0 (the flags stay).
279F
If the Z flag is cleared (open) call BYTOUT2 at 2A21H to show the question mark.
27A2
LD B,(HL) 46
Load Register B with the attribute byte at Register Pair HL, DIR+0.
27A3
LD A,2AH 3E 2A
Load Register A with 2AH, the asterisk shown for a partitioned data set.
27A5
BIT 5,B CB 68
Test bit 5 of Register B, the attribute byte's PDS (partitioned data set) bit.
27A7
If the Z flag is cleared call BYTOUT2 at 2A21H to show the asterisk.
27AA
BIT 6,B CB 70
Test bit 6 of Register B, the system file bit.
27AC
LD A,53H 3E 53
Load Register A with 53H, the letter S (the flags of the BIT stay).
27AE
If the Z flag is cleared call BYTOUT2 at 2A21H to show S.
27B1
BIT 3,B CB 58
Test bit 3 of Register B, the attribute byte's invisible bit.
27B3
LD A,49H 3E 49
Load Register A with 49H, the letter I (the flags of the BIT stay).
27B5
If the Z flag is cleared call BYTOUT2 at 2A21H to show I.
27B8
PUSH HL E5
Push Register Pair HL (DIR+0) onto the stack (Stack Pointer).
27B9
LD A,L 7D
Load Register A with Register L, the entry's offset.
27BA
ADD A,10H C6 10
Add 10H to Register A, the offset of the owner (update) password hash.
27BC
LD L,A 6F
Load Register L with Register A: Register Pair HL = DIR+16.
27BD
LD E,(HL) 5E
Load Register E with the low byte of the password hash at Register Pair HL.
27BE
INC L 2C
Increment Register L to DIR+17, the high byte of the password hash.
27BF
LD D,(HL) 56
Load Register D with the high byte at Register Pair HL: Register Pair DE = the owner password hash.
27C0
PUSH HL E5
Push Register Pair HL (DIR+17) onto the stack (Stack Pointer).
27C1
LD HL,4296H 21 96 42LD HL,BLKHASH
Load Register Pair HL with 4296H, the hash of a blank password (eight spaces).
27C4
SBC HL,DE ED 52
Subtract Register Pair DE from Register Pair HL (the Carry flag is clear from the ADD at 27BAH): Z when the file has no password.
27C6
POP HL E1
Pop Register Pair HL from the stack (Stack Pointer), the flags stay.
27C7
If the Z flag is set (no password) jump to DONAM6 at 27D0H: no P.
27C9
LD A,B 78
Load Register A with Register B, the attribute byte.
27CA
AND 07H E6 07
AND Register A with 07H, the protection level, 0 for FULL.
27CC
LD A,50H 3E 50
Load Register A with 50H, the letter P (the flags of the AND stay).
27CE
If the Z flag is cleared (a level above FULL) jump to DONAM7 at 27D2H with the P.
27D0DONAM6
LD A,20H 3E 20
DONAM6: load Register A with 20H, a space: no protection to show.
27D2DONAM7
LD (2817H),A 32 17 28
DONAM7: store Register A (P or a space) into 2817H, the operand of ALL02 (2816H), which decides whether ALL01 shows the level.
27D5
CP 20H FE 20
Compare Register A with 20H, a space: Z when there is no P to show.
27D7
If the Z flag is cleared (a P) call BYTOUT2 at 2A21H to show it.
27DA
POP HL E1
Pop Register Pair HL from the stack (Stack Pointer): DIR+0.
27DB
INC HL 23
Increment Register Pair HL to DIR+1, the byte with the CREATE bit.
27DC
LD A,(HL) 7E
Load Register A with the byte at Register Pair HL, DIR+1, whose bit 7 means the file was made by CREATE.
27DD
DEC HL 2B
Decrement Register Pair HL to DIR+0 again (the loaded Register A stays).
27DE
RLCA 07
Rotate Register A left: bit 7 into the Carry flag.
27DF
LD A,43H 3E 43
Load Register A with 43H, the letter C (the Carry flag of the rotate stays).
27E1
If the Carry flag is set (created) call BYTOUT2 at 2A21H to show C.
27E4
LD A,(27FCH) 3A FC 27
Load Register A with the byte at 27FCH, the low byte of the A parameter's value.
27E7
OR A B7
OR Register A with itself to test the A parameter's value for zero.
27E8
PUSH AF F5
Push Register Pair AF onto the stack (Stack Pointer) to keep the Z flag.
27E9
If the Z flag is set (the brief format) call OUTMOD at 298EH: the plus sign of MOD goes after the letters.
27EC
POP AF F1
Pop Register Pair AF from the stack (Stack Pointer): the Z flag of the A test.
27ED
If the Z flag is set (the brief format) jump to DONAM8 at 27F3H.
27EF
LD A,04H 3E 04
Full format: load Register A with 04H, four more columns to fill.
27F1
ADD A,C 81
Add Register C to Register A: four more columns for the attributes field of the full line.
27F2
LD C,A 4F
Load Register C with Register A, the spaces still to show.
27F3DONAM8
LD A,20H 3E 20
DONAM8: load Register A with 20H, a space to fill the column with.
27F5
Call BYTOUT at 2A22H to show the space; BYTOUT does not count Register C.
27F8
DEC C 0D
Decrement Register C, the columns of the name field still to fill.
27F9
If the Z flag is cleared jump back to DONAM8 at 27F3H. When the name and its letters use all 19 columns, Register C is 00H or FFH here and 256 or 255 spaces come out (B46).
27FBAPARM
LD DE,FFFFH 11 FF FF
APARM: load Register Pair DE with FFFFH, the operand at 27FCH that @PARAM fills in for A: the full format unless A=NO or CAT (2407H).
27FE
LD A,D 7A
Load Register A with Register D, the high byte of the value.
27FF
OR E B3
OR Register E into Register A: not zero for the full format.
2800
If the Z flag is cleared call ALL01 at 2815H to show the rest of the full line.
2803DONAM9
LD A,00H 3E 00
DONAM9: load Register A with 00H, the operand at 2804H, the names still to come on this line (04H at 2435H, 01H after ALL01).
2805
DEC A 3D
Decrement Register A, the count of names still to come on the line.
2806
LD (2804H),A 32 04 28
Store Register A into 2804H, the operand of DONAM9.
2809
RET NZ C0
If the Z flag is cleared (more names fit on the line) return to the caller.
280A
LD A,04H 3E 04
The line is full: load Register A with 04H, the count for a new line.
280C
LD (2804H),A 32 04 28
Store Register A (04H) into 2804H for the next line.
280FENDLINE
ENDLINE: call CKPAGE1 at 2A9AH, which ends the line with a carriage return and counts it (6.3.1).
2812
Jump to CKPAWS at 2ACDH, which tests BREAK and the pause key and returns from there (6.3.1).

2815H - ALL01: the Rest of a Full Format Line

Built in the line buffer PLEVEL (2DB4H-2DECH, over DIR's start code, blanked at 2DE9H) and shown with LINOUT: the protection level, LRL, the number of records, the EOF offset, the size in K, the extents, the date and, for a diskette with the new style of dating, the time.

2815ALL01
PUSH HL E5
ALL01: push Register Pair HL (DIR+0) onto the stack (Stack Pointer).
2816ALL02
LD A,00H 3E 00
ALL02: load Register A with 00H, the operand at 2817H: P or a space, stored by DONAM7 (27D2H).
2818
SUB 20H D6 20
Subtract 20H from Register A: zero when there is no protection to show.
281A
If the Z flag is set jump to ALL03 at 281FH with Register A = 00H, the level of FULL.
281C
LD A,(HL) 7E
Load Register A with the attribute byte at Register Pair HL, DIR+0.
281D
AND 07H E6 07
AND Register A with 07H, the protection level 0-7.
281FALL03
RLCA 07
ALL03: rotate Register A left, the level times 2.
2820
RLCA 07
Rotate Register A left again: the level times 4, the offset of its name in PROTS$.
2821
LD C,A 4F
Load Register C with Register A, the offset of the level's name in PROTS$.
2822
LD B,00H 06 00
Load Register B with 00H: Register Pair BC = the offset.
2824
LD HL,2D1FH 21 1F 2DLD HL,PROTS$
Load Register Pair HL with 2D1FH, PROTS$, the names FULL, REMV, NAME, WRIT, UPDT, READ, EXEC and NO, four characters each.
2827
ADD HL,BC 09
Add Register Pair BC to Register Pair HL: Register Pair HL = the name of the level.
2828
LD DE,2DB4H 11 B4 2DLD DE,PLEVEL
Load Register Pair DE with 2DB4H, PLEVEL, the start of the line.
282B
LD C,04H 0E 04
Load Register C with 04H: Register Pair BC = 0004H.
282D
LDIR ED B0
Copy 4 bytes (Register Pair BC) from Register Pair HL to Register Pair DE: the level's name into 2DB4H-2DB7H.
282F
POP HL E1
Pop Register Pair HL from the stack (Stack Pointer): DIR+0.
2830
PUSH HL E5
Push Register Pair HL onto the stack (Stack Pointer) again.
2831
INC L 2C
Increment Register L to DIR+1, on the way to the EOF offset.
2832
INC L 2C
Increment Register L to DIR+2, on the way to the EOF offset.
2833
INC L 2C
Increment Register L to DIR+3, the EOF offset.
2834
LD A,(HL) 7E
Load Register A with the byte at Register Pair HL, DIR+3, the offset of the end of file in the last sector.
2835
LD (2883H),A 32 83 28
Store Register A into 2883H, the low byte of the operand of EOFBYTE (2882H).
2838
LD A,(HL) 7E
Load Register A with the same byte at Register Pair HL again.
2839
PUSH AF F5
Push Register Pair AF (the EOF offset in Register A) onto the stack (Stack Pointer).
283A
INC L 2C
Increment Register L to DIR+4, the logical record length.
283B
LD A,(HL) 7E
Load Register A with the LRL at Register Pair HL, 00H for 256.
283C
LD (2858H),A 32 58 28
Store Register A into 2858H, the operand of ALL04 (2857H).
283F
PUSH HL E5
Push Register Pair HL (DIR+4) onto the stack (Stack Pointer).
2840
LD L,A 6F
Load Register L with Register A, the LRL, for the field of the line.
2841
LD H,00H 26 00
Load Register H with 00H: Register Pair HL = the LRL.
2843
OR A B7
OR Register A with itself: zero means an LRL of 256.
2844
If the Z flag is cleared jump to 2847H with Register Pair HL = the LRL.
2846
INC H 24
Increment Register H: Register Pair HL = 0100H, 256.
2847
LD DE,2DB9H 11 B9 2D
Load Register Pair DE with 2DB9H, the LRL field of the line.
284A
LD A,61H 3E 61
Load Register A with 61H, SVC 97, @HEXDEC, five decimal characters.
284C
RST 28H EF
Call @HEXDEC with RST 28H: the LRL in five characters into 2DB9H-2DBDH.
284D
POP HL E1
Pop Register Pair HL from the stack (Stack Pointer): DIR+4.
284E
LD A,L 7D
Load Register A with Register L, the low byte of the pointer DIR+4.
284F
ADD A,10H C6 10
Add 10H to Register A, from DIR+4 to DIR+20, the ERN (ending record number, in sectors).
2851
LD L,A 6F
Load Register L with Register A: Register Pair HL = DIR+20.
2852
LD E,(HL) 5E
Load Register E with the low byte of the ERN at Register Pair HL.
2853
INC L 2C
Increment Register L to DIR+21, the high byte of the ERN.
2854
LD D,(HL) 56
Load Register D with the high byte at Register Pair HL: Register Pair DE = the ERN.
2855
POP BC C1
Pop Register Pair BC from the stack (Stack Pointer): Register B = the EOF offset (pushed as Register A of AF).
2856
EX DE,HL EB
Exchange Register Pairs DE and HL: Register Pair HL = the ERN.
2857ALL04
LD A,00H 3E 00
ALL04: load Register A with 00H, the operand at 2858H, the LRL.
2859
OR A B7
OR Register A with itself: the Z flag set for an LRL of 256.
285A
If the Z flag is set (256) jump to TSTSIZ at 2874H, where the Z flag takes the ERN as the record count.
285C
LD E,A 5F
Load Register E with Register A, the LRL, the divisor of the second division.
285D
INC B 04
Increment Register B, the EOF offset, to test it for zero.
285E
DEC B 05
Decrement Register B back, the Z flag set when the EOF offset is 0.
285F
If the Z flag is set (the last sector is full) jump to DONTDEC at 2862H.
2861
DEC HL 2B
Decrement Register Pair HL: the ERN counts the partly filled last sector; HL = the full sectors.
2862DONTDEC
DONTDEC: call DIVIDE at 2987H: Register Pair HL = full sectors / LRL, Register A = the remainder.
2865
LD C,L 4D
Load Register C with Register L, the low byte of that quotient.
2866
LD D,H 54
Load Register D with Register H, its high byte, which must be 0 for a count that fits in 16 bits.
2867
LD H,A 67
Load Register H with Register A, the remainder.
2868
LD L,B 68
Load Register L with Register B: Register Pair HL = remainder x 256 + the EOF offset, the bytes left over.
2869
LD A,E 7B
Load Register A with Register E, the LRL, the divisor for DIVIDE.
286A
Call DIVIDE at 2987H: Register Pair HL = those bytes / LRL (under 256), Register A = the remainder.
286D
LD H,C 61
Load Register H with Register C: Register Pair HL = the records, the first quotient times 256 plus the second.
286E
OR A B7
OR Register A with itself to test Register A, the remainder, for zero.
286F
If the Z flag is set (no partial record) jump to DONTINC at 2872H.
2871
INC HL 23
Increment Register Pair HL: a partial record counts as one; a count of FFFFH wraps to 0000H, so a file of 65535 whole records and a partial one shows 0 records and EOF 0 (B50).
2872DONTINC
LD A,D 7A
DONTINC: load Register A with Register D, the high byte of the first quotient.
2873
OR A B7
OR Register A with itself: not zero when the records do not fit in 16 bits.
2874TSTSIZ
TSTSIZ: if the Z flag is set (the count fits) jump to EOFBYTE at 2882H.
2876
LD HL,2DBFH 21 BF 2DLD HL,RECORDS
Load Register Pair HL with 2DBFH, the records field.
2879
LD B,0AH 06 0A
Load Register B with 0AH, the ten characters of the records and EOF fields.
287BDOSTAR
LD (HL),2AH 36 2A
DOSTAR: store 2AH, an asterisk, into the byte at Register Pair HL.
287D
INC HL 23
Increment Register Pair HL to the next character.
287E
Decrement Register B and loop to DOSTAR at 287BH: ten asterisks for a count too large.
2880
Jump to DIR_0 at 289BH, past the conversion of the record count and EOF.
2882EOFBYTE
LD DE,0000H 11 00 00
EOFBYTE: load Register Pair DE with 0000H, the operand at 2883H, the EOF offset (Register D stays 00H).
2885
LD A,H 7C
Load Register A with Register H, the high byte of the records.
2886
OR L B5
OR Register L into Register A: zero for an empty file.
2887
If the Z flag is cleared jump to KEEPEOF at 288BH.
2889
LD E,01H 1E 01
Load Register E with 01H, so that the empty file shows EOF 0.
288BKEEPEOF
PUSH HL E5
KEEPEOF: push Register Pair HL (the records) onto the stack (Stack Pointer).
288C
LD HL,2DC4H 21 C4 2D
Load Register Pair HL with 2DC4H, the EOF field of the line.
288F
DEC E 1D
Decrement Register E: the EOF shown is the offset of the last byte, one less than DIR+3 (255 for a full last sector).
2890
EX DE,HL EB
Exchange Register Pairs DE and HL: Register Pair HL = the EOF to show, Register Pair DE the field.
2891
LD A,61H 3E 61
Load Register A with 61H, SVC 97, @HEXDEC, five decimal characters.
2893
RST 28H EF
Call @HEXDEC with RST 28H: the EOF in five characters into 2DC4H-2DC8H.
2894
POP HL E1
Pop Register Pair HL from the stack (Stack Pointer): the records.
2895
LD DE,2DBFH 11 BF 2DLD DE,RECORDS
Load Register Pair DE with 2DBFH, the records field.
2898
LD A,61H 3E 61
Load Register A with 61H, SVC 97, @HEXDEC, five decimal characters.
289A
RST 28H EF
Call @HEXDEC with RST 28H: the records in five characters into 2DBFH-2DC3H.
289BDIR_0
POP HL E1
DIR_0: pop Register Pair HL from the stack (Stack Pointer): DIR+0.
289C
PUSH HL E5
Push Register Pair HL onto the stack (Stack Pointer) again.
289D
Call ALL09 at 299CH: Register Pair DE = the granules of the file, Register C the extents.
28A0
PUSH DE D5
Push Register Pair DE (the granules) onto the stack (Stack Pointer).
28A1
LD A,C 79
Load Register A with Register C, the extents.
28A2
LD DE,2DD7H 11 D7 2DLD DE,EXTENTS
Load Register Pair DE with 2DD7H, EXTENTS, the field of the line.
28A5
Call ATO2D at 2967H: Register A in two digits at Register Pair DE.
28A8
POP DE D1
Pop Register Pair DE from the stack (Stack Pointer): the granules.
28A9
LD HL,(2601H) 2A 01 26
Load Register Pair HL with the word at 2601H, the operand of TOTGRNS (2600H), the granules of the files shown so far.
28AC
ADD HL,DE 19
Add Register Pair DE (this file's granules) to Register Pair HL.
28AD
LD (2601H),HL 22 01 26
Store Register Pair HL into 2601H for the totals line.
28B0
LD HL,2DCBH 21 CB 2DLD HL,KSIZE
Load Register Pair HL with 2DCBH, KSIZE, the size field.
28B3
Call CALCK at 2A3FH: the granules in Register Pair DE as K into 2DCBH-2DD2H.
28B6
LD HL,2DDAH 21 DA 2D
Load Register Pair HL with 2DDAH, a space before the date field.
28B9
LD DE,2DDBH 11 DB 2DLD DE,DATEFLD
Load Register Pair DE with 2DDBH, DATEFLD, the date and time field.
28BC
LD BC,0011H 01 11 00
Load Register Pair BC with 0011H, seventeen bytes.
28BF
LDIR ED B0
Copy 17 bytes (Register Pair BC) from Register Pair HL to Register Pair DE: the space spreads over 2DDBH-2DEBH, clearing the date and time of the line before.
28C1
POP HL E1
Pop Register Pair HL from the stack (Stack Pointer): DIR+0.
28C2
LD DE,2DDBH 11 DB 2DLD DE,DATEFLD
Load Register Pair DE with 2DDBH, DATEFLD, where the day of the date goes.
28C5
INC HL 23
Increment Register Pair HL to DIR+1, on the way to the date byte.
28C6
INC HL 23
Increment Register Pair HL to DIR+2, the day and year byte.
28C7
LD A,(HL) 7E
Load Register A with the byte at Register Pair HL, DIR+2: bits 7-3 the day, bits 2-0 the year less 1980 (old style).
28C8
OR A B7
OR Register A with itself: 00H when the file has no date.
28C9
If the Z flag is set (no date) jump to ALL08 at 295BH and show the line with the date blank.
28CC
RRCA 0F
Rotate Register A right once of three, moving the day from bits 7-3 down.
28CD
RRCA 0F
Rotate Register A right again, the second of three rotates.
28CE
RRCA 0F
Rotate Register A right a third time: the day in bits 4-0.
28CF
AND 1FH E6 1F
AND Register A with 1FH: Register A = the day, 1-31.
28D1
Call ATO2D at 2967H: the day in two characters at 2DDBH (a leading zero becomes a space).
28D4
INC DE 13
Increment Register Pair DE past the minus sign at 2DDDH.
28D5
PUSH HL E5
Push Register Pair HL (DIR+2) onto the stack (Stack Pointer).
28D6
DEC HL 2B
Decrement Register Pair HL to DIR+1, the month in bits 3-0.
28D7
LD A,(HL) 7E
Load Register A with the byte at Register Pair HL, DIR+1.
28D8
AND 0FH E6 0F
AND Register A with 0FH, keeping bits 3-0, the month 1-12.
28DA
DEC A 3D
Decrement Register A: the month less one, 0-11, to index the table.
28DB
LD C,A 4F
Load Register C with Register A, the month less one, for the times 3.
28DC
RLCA 07
Rotate Register A left: the month less one times 2.
28DD
ADD A,C 81
Add Register C to Register A: times 3, the offset of its name.
28DE
LD C,A 4F
Load Register C with Register A, the month less one times 3, the offset.
28DF
LD B,00H 06 00
Load Register B with 00H: Register Pair BC = the offset.
28E1
LD HL,04DCH 21 DC 04LD HL,MONTBL
Load Register Pair HL with 04DCH, MONTBL$ in BOOT/SYS (Level 1D).
28E4
ADD HL,BC 09
Add Register Pair BC to Register Pair HL: Register Pair HL = the month's name.
28E5
LD C,03H 0E 03
Load Register C with 03H: Register Pair BC = 0003H.
28E7
LDIR ED B0
Copy 3 bytes (Register Pair BC) from Register Pair HL to Register Pair DE: the month's name into 2DDEH-2DE0H.
28E9
INC DE 13
Increment Register Pair DE past the minus sign at 2DE1H to 2DE2H, the year.
28EA
LD A,2DH 3E 2D
Load Register A with 2DH, the minus sign (6.3.1).
28EC
LD (2DDDH),A 32 DD 2D
Store Register A into 2DDDH, between the day and the month.
28EF
LD (2DE1H),A 32 E1 2D
Store Register A into 2DE1H, between the month and the year.
28F2
POP HL E1
Pop Register Pair HL from the stack (Stack Pointer): DIR+2.
28F3
PUSH HL E5
Push Register Pair HL onto the stack (Stack Pointer) again, popped at OLDCODE (295AH).
28F4
LD A,(0000H) 3A 00 00
Load Register A with the byte at 0000H, the operand at 28F5H that DIRA sets to 0082H, YFLAG$: bit n set when the diskette in drive n uses the new style of dating.
28F7
BIT 0,A CB 47
BIT 0,A as assembled; its second byte at 28F8H (DVTEST1) is set by DIR4 (2443H) so that the bit tested in Register A is the drive's own: NZ for the new style.
28F9
PUSH AF F5
Push Register Pair AF onto the stack (Stack Pointer), keeping the Z flag for the time test at 2915H.
28FA
If the Z flag is cleared (new style) jump to NEWDT2 at 2901H.
28FC
LD A,(HL) 7E
Old style: load Register A with the byte at Register Pair HL, DIR+2.
28FD
AND 07H E6 07
AND Register A with 07H, the year less 1980, 0-7.
28FF
Jump to NEWDT3 at 2908H with Register A = the year less 1980.
2901NEWDT2
LD A,L 7D
NEWDT2: load Register A with Register L, at DIR+2.
2902
ADD A,11H C6 11
Add 11H to Register A, the offset step from DIR+2 to DIR+19.
2904
LD L,A 6F
Load Register L with Register A: Register Pair HL = DIR+19.
2905
LD A,(HL) 7E
Load Register A with the byte at Register Pair HL, DIR+19: bits 4-0 the year less 1980.
2906
AND 1FH E6 1F
AND Register A with 1FH, the year less 1980, 0-31.
2908NEWDT3
ADD A,50H C6 50
NEWDT3: add 50H (80) to Register A: the year less 1900.
290A
CP 64H FE 64
Compare Register A with 64H (100): Carry set for the years before 2000.
290C
If the Carry flag is set (before 2000) jump to NEWD3A at 2910H.
290E
SUB 64H D6 64
Subtract 64H from Register A: 00-11 for 2000-2011 (6.3.1).
2910NEWD3A
NEWD3A: call ATO2D at 2967H: the year in two characters at 2DE2H.
2913
INC DE 13
Increment Register Pair DE past the space between the year and the time.
2914
INC DE 13
Increment Register Pair DE again, to 2DE6H, the time.
2915
POP AF F1
Pop Register Pair AF from the stack (Stack Pointer): the Z flag of the dating style.
2916
If the Z flag is set (old style, no time kept) jump to OLDCODE at 295AH.
2918NEWDT4
PUSH IY FD E5
NEWDT4: push Index Register IY (the DCT) onto the stack (Stack Pointer): P631D1 changes it (Level 1D).
291A
Call P631D1 at 2D76H, the Level 1D patch: Register A = DIR+18 and Index Register IY = FLGTAB$.
291D
AND F8H E6 F8
AND Register A with F8H, the hours in bits 7-3.
291F
RRCA 0F
Rotate Register A right, the first of three rotates of the hours.
2920
RRCA 0F
Rotate Register A right again, the second of three rotates.
2921
RRCA 0F
Rotate Register A right a third time: Register A = the hour, 0-23.
2922
PUSH AF F5
Push Register Pair AF (the hour) onto the stack (Stack Pointer) for the a or p at 294AH.
2923
BIT 4,(IY+08H) FD CB 08 66
Test bit 4 of the byte at Index Register IY+08H, IFLAG$ (0072H) bit 4: set by SYSTEM (AMPM=OFF) for the 24 hour clock (6.3.1).
2927
If the Z flag is cleared (24 hours) jump to NEWDT8 at 2934H.
2929
OR A B7
OR Register A with itself, testing Register A, the hour, for 0.
292A
If the Z flag is cleared jump to NEWDT7 at 292EH.
292C
LD A,0CH 3E 0C
Load Register A with 0CH: hour 0 is shown as 12.
292ENEWDT7
CP 0DH FE 0D
NEWDT7: compare Register A with 0DH (13): Carry set for the hours 1-12.
2930
If the Carry flag is set (1-12) jump to NEWDT8 at 2934H.
2932
SUB 0CH D6 0C
Subtract 0CH from Register A: 13-23 become 1-11.
2934NEWDT8
NEWDT8: call ATO2D at 2967H: the hour in two characters at 2DE6H.
2937
LD A,3AH 3E 3A
Load Register A with 3AH, the colon between the hours and the minutes.
2939
LD (DE),A 12
Store Register A into the byte at Register Pair DE, 2DE8H.
293A
INC DE 13
Increment Register Pair DE to 2DE9H, the minutes.
293B
LD A,(HL) 7E
Load Register A with the byte at Register Pair HL, DIR+18: bits 2-0 the high three bits of the minutes.
293C
INC HL 23
Increment Register Pair HL to DIR+19, the low bits of the minutes.
293D
LD L,(HL) 6E
Load Register L with the byte at Register Pair HL, DIR+19: bits 7-5 the low three bits of the minutes.
293E
AND 07H E6 07
AND Register A with 07H, the high bits of the minutes.
2940
LD B,03H 06 03
Load Register B with 03H, three bits to move in.
2942NEWDT5
SLA L CB 25
NEWDT5: shift Register L left, its top bit into the Carry flag.
2944
RLA 17
Rotate Register A left through the Carry flag, taking the bit in.
2945
Decrement Register B and loop to NEWDT5 at 2942H: Register A = the minutes, 0-59.
2947
Call ATO2D at 2967H: the minutes in two characters at 2DE9H.
294A
POP AF F1
Pop Register Pair AF from the stack (Stack Pointer): Register A = the hour, 0-23.
294B
Jump to P631D2 at 2D7CH, the second part of the Level 1D patch, which tests IFLAG$ again and restores Index Register IY.
294E
NOP 00
NOP, a byte left over by the Level 1D patch (P631D3, the patch's return, is the next byte).
294FP631D3
P631D3: if the Z flag is cleared (the 24 hour clock: the BIT of 2D7CH) jump to OLDCODE at 295AH, no a or p.
2951
CP 0CH FE 0C
Compare Register A, the hour, with 0CH (12): Carry set before noon.
2953
LD A,61H 3E 61
Load Register A with 61H, the letter a (the flags stay).
2955
If the Carry flag is set (before noon) jump to NEWDT6 at 2959H.
2957
LD A,70H 3E 70
Load Register A with 70H, the letter p, for the hours from noon on.
2959NEWDT6
LD (DE),A 12
NEWDT6: store Register A (a or p) into the byte at Register Pair DE, 2DEBH.
295AOLDCODE
POP HL E1
OLDCODE: pop Register Pair HL from the stack (Stack Pointer), dropping DIR+2 pushed at 28F3H.
295BALL08
LD HL,2DB4H 21 B4 2DLD HL,PLEVEL
ALL08: load Register Pair HL with 2DB4H, PLEVEL, the start of the line, ended by the 03H at 2DECH.
295E
Call LINOUT at 2A10H to show the line (and print it with P); the 03H keeps the cursor on the line.
2961
LD A,01H 3E 01
Load Register A with 01H, one name a line in the full format.
2963
LD (2804H),A 32 04 28
Store Register A into 2804H, the operand of DONAM9 (2803H), so that its countdown ends the line.
2966
RET C9
Return to MATCH, which goes on at DONAM9 (2803H).

2967H - ATO2D, DIVIDE and OUTMOD: Two Digits, a Division and the MOD Sign

ATO2D writes Register A (0-99) as two digits at Register Pair DE, turning a leading zero into a space when a space comes before it; DIVIDE divides Register Pair HL by Register A through @DIV16; OUTMOD shows the plus sign of a modified file.

2967ATO2D
LD BC,0030H 01 30 00
ATO2D: load Register Pair BC with 0030H: Register B = 00H, the tens counter, Register C = 30H, the digit zero (6.3.1).
296AATD1
SUB 0AH D6 0A
ATD1: subtract 0AH (10) from Register A, one ten at a time.
296C
If the Carry flag is set (gone below zero) jump to ATD2 at 2971H: Register B holds the tens.
296E
INC B 04
Increment Register B, the tens counter: one more ten in the number.
296F
Jump back to ATD1 at 296AH to take off the next ten.
2971ATD2
PUSH AF F5
ATD2: push Register Pair AF onto the stack (Stack Pointer): Register A = the units less 10.
2972
LD A,B 78
Load Register A with Register B, the count of tens of the number.
2973
ADD A,C 81
Add Register C (30H) to Register A: the tens digit.
2974
LD (DE),A 12
Store Register A (the tens digit) into the byte at Register Pair DE.
2975
CP C B9
Compare Register A with Register C (30H): Z when the tens digit is a zero.
2976
If the Z flag is cleared jump to ATD3 at 2980H.
2978
DEC DE 1B
Decrement Register Pair DE to the character before the field.
2979
LD A,(DE) 1A
Load Register A with that character at Register Pair DE.
297A
INC DE 13
Increment Register Pair DE back to the tens digit.
297B
CP 20H FE 20
Compare Register A with 20H: a space before means the zero leads the number.
297D
If the Z flag is cleared (a minus sign or colon before it) jump to ATD3 at 2980H and keep the zero.
297F
LD (DE),A 12
Store Register A (a space) into the byte at Register Pair DE over the leading zero.
2980ATD3
INC DE 13
ATD3: increment Register Pair DE to the units position.
2981
POP AF F1
Pop Register Pair AF from the stack (Stack Pointer): Register A = the units less 10.
2982
ADD A,3AH C6 3A
Add 3AH to Register A: plus 10 back and plus 30H, the units digit.
2984
LD (DE),A 12
Store Register A (the units digit) into the byte at Register Pair DE.
2985
INC DE 13
Increment Register Pair DE past the two digits of the field.
2986
RET C9
Return with Register Pair DE after the two digits.
2987DIVIDE
PUSH BC C5
DIVIDE: push Register Pair BC onto the stack (Stack Pointer).
2988
LD C,A 4F
Load Register C with Register A, the divisor (the SVC dispatcher hands Register C to the routine in Register A).
2989
LD A,5EH 3E 5E
Load Register A with 5EH, SVC 94, @DIV16, which divides Register Pair HL by the 8 bit divisor.
298B
RST 28H EF
Call @DIV16 with RST 28H: Register Pair HL = the quotient, Register A = the remainder.
298C
POP BC C1
Pop Register Pair BC from the stack (Stack Pointer).
298D
RET C9
Return with Register Pair HL = the quotient and Register A = the remainder.
298EOUTMOD
INC HL 23
OUTMOD: increment Register Pair HL from DIR+0 to DIR+1.
298F
LD A,20H 3E 20
Load Register A with 20H, a space, shown when the file is not modified.
2991
BIT 6,(HL) CB 76
Test bit 6 of the byte at Register Pair HL, DIR+1 bit 6, the MOD flag.
2993
If the Z flag is set (not modified) jump to OUTCHR at 2997H with the space.
2995
LD A,2BH 3E 2B
Load Register A with 2BH, the plus sign of a modified file.
2997OUTCHR
OUTCHR: call BYTOUT2 at 2A21H to show Register A, Register C counting down.
299A
DEC HL 2B
Decrement Register Pair HL back to DIR+0, as the caller had it.
299B
RET C9
Return to the caller with Register Pair HL at DIR+0.

299CH - ALL09: the Granules and Extents of a File

With the sorted list the counts are already in the copy of the entry (stored by 270BH); otherwise ALL09A walks the extent fields from DIR+22, following an FE link into the extended entry (FXDE), which it finds in the sector buffer, in its own buffer at 2F00H or reads there with @RDSEC.

299CALL09
LD A,(26FCH) 3A FC 26
ALL09: load Register A with the byte at 26FCH, the low byte of the SORT value: not zero when the list is sorted.
299F
OR A B7
OR Register A with itself to test the SORT value for zero.
29A0
If the Z flag is set (not sorted) jump to ALL09A at 29B2H to count from the extents.
29A2
PUSH HL E5
Push Register Pair HL (DIR+0 of the copy in the sort buffer) onto the stack (Stack Pointer).
29A3
POP IX DD E1
Pop Index Register IX from the stack (Stack Pointer): Index Register IX = the copy.
29A5
LD E,(IX+16H) DD 5E 16
Load Register E with the byte at Index Register IX+16H, the low byte of the granules saved at 270BH.
29A8
LD D,(IX+17H) DD 56 17
Load Register D with the byte at Index Register IX+17H: Register Pair DE = the granules.
29AB
LD C,(IX+18H) DD 4E 18
Load Register C with the byte at Index Register IX+18H, the low byte of the extents.
29AE
LD B,(IX+19H) DD 46 19
Load Register B with the byte at Index Register IX+19H: Register Pair BC = the extents.
29B1
RET C9
Return with Register Pair DE = the granules and Register Pair BC the extents.
29B2ALL09A
LD DE,0000H 11 00 00
ALL09A: load Register Pair DE with 0000H, the count of granules.
29B5
LD B,E 43
Load Register B with Register E (00H), the high byte of the extent count.
29B6
LD C,E 4B
Load Register C with Register E: Register Pair BC = 0000H, the count of extents.
29B7ALL10
LD A,L 7D
ALL10: load Register A with Register L, the offset of the entry (also the way back in from an FXDE in the buffer, 29DEH and 29E4H).
29B8ALL11
ADD A,16H C6 16
ALL11: add 16H to Register A, the offset of the first extent field (the way in from an FXDE read at 2A0EH).
29BA
LD L,A 6F
Load Register L with Register A: Register Pair HL = DIR+22.
29BBALL14
LD A,(HL) 7E
ALL14: load Register A with the byte at Register Pair HL, the cylinder of the extent, or FEH (a link) or FFH (the end).
29BC
INC L 2C
Increment Register L to the granule byte of the extent.
29BD
CP FEH FE FE
Compare Register A with FEH: Carry set for a cylinder number, an extent in use.
29BF
If the Carry flag is cleared (FEH or FFH) jump to ALL15 at 29CEH.
29C1
INC BC 03
Increment Register Pair BC, the extent count: one more extent.
29C2
LD A,(HL) 7E
Load Register A with the granule byte at Register Pair HL: bits 7-5 the first granule, bits 4-0 the granules less one.
29C3
INC L 2C
Increment Register L to the next extent field.
29C4
AND 1FH E6 1F
AND Register A with 1FH, the granules of the extent less one.
29C6
INC A 3C
Increment Register A: the granules of the extent.
29C7
ADD A,E 83
Add Register E to Register A, the low byte of the count.
29C8
LD E,A 5F
Load Register E with Register A, the low byte of the granule count.
29C9
If the Carry flag is cleared jump back to ALL14 at 29BBH for the next extent.
29CB
INC D 14
Increment Register D, the carry into the high byte of the count.
29CC
Jump back to ALL14 at 29BBH for the next extent field.
29CEALL15
RET NZ C0
ALL15: if the Z flag is cleared (FFH, the end) return with Register Pair DE = the granules and Register Pair BC the extents.
29CF
LD A,(HL) 7E
FEH: load Register A with the byte at Register Pair HL, the DEC of the extended entry.
29D0
AND 1FH E6 1F
AND Register A with 1FH, its directory sector less 2.
29D2
PUSH AF F5
Push Register Pair AF (the sector in Register A) onto the stack (Stack Pointer).
29D3
XOR (HL) AE
XOR Register A with the byte at Register Pair HL: Register A = bits 7-5 of the DEC, the entry's offset in its sector.
29D4
LD L,A 6F
Load Register L with Register A, that offset.
29D5
POP AF F1
Pop Register Pair AF from the stack (Stack Pointer): Register A = the FXDE's sector.
29D6
PUSH HL E5
Push Register Pair HL onto the stack (Stack Pointer).
29D7
LD HL,2655H 21 55 26
Load Register Pair HL with 2655H, the operand of CKHIT6, the sector in the system buffer.
29DA
CP (HL) BE
Compare Register A with the byte at Register Pair HL: Z when the FXDE is in that sector.
29DB
POP HL E1
Pop Register Pair HL from the stack (Stack Pointer), the flags stay.
29DCSBUFFER
LD H,00H 26 00
SBUFFER: load Register H with 00H, the operand at 29DDH, the high byte of the system buffer (stored at 2665H).
29DE
If the Z flag is set (the FXDE is in that buffer) jump to ALL10 at 29B7H and go on with its extents.
29E0ALL16
CP FFH FE FF
ALL16: compare Register A with FFH, the operand at 29E1H, the sector last read into 2F00H (FFH at the start; not set back when the next drive starts: B48).
29E2
LD H,2FH 26 2F
Load Register H with 2FH, the high byte of DIR's own buffer at 2F00H (the flags stay).
29E4
If the Z flag is set (that sector is at 2F00H) jump to ALL10 at 29B7H.
29E6
LD (29E1H),A 32 E1 29
Store Register A (the sector) into 29E1H, the operand of ALL16, as the sector now at 2F00H.
29E9
PUSH BC C5
Push Register Pair BC (the extent count) onto the stack (Stack Pointer).
29EA
PUSH DE D5
Push Register Pair DE (the granule count) onto the stack (Stack Pointer).
29EB
OR L B5
OR Register L into Register A: Register A = the whole DEC again (sector and entry).
29EC
LD B,A 47
Load Register B with Register A, the DEC, for the sector and the offset below.
29ED
LD A,(2C43H) 3A 43 2CLD A,(DRIVE)
Load Register A with the byte at 2C43H, the drive digit stored by DIR4 (2449H).
29F0
SUB 30H D6 30
Subtract 30H from Register A: the drive number (Register C now holds the extent count).
29F2
LD C,A 4F
Load Register C with Register A, the drive for @RDSEC.
29F3
LD D,(IY+09H) FD 56 09
Load Register D with the byte at Index Register IY+09H, DCT+9, the directory cylinder.
29F6
LD A,B 78
Load Register A with Register B, the DEC of the extended entry.
29F7
AND 1FH E6 1F
AND Register A with 1FH, keeping bits 4-0, the sector less 2.
29F9
ADD A,02H C6 02
Add 02H to Register A, past the GAT and the HIT.
29FB
LD E,A 5F
Load Register E with Register A: Register Pair DE = the cylinder and sector of the FXDE.
29FC
LD HL,2F00H 21 00 2FLD HL,BUF2
Load Register Pair HL with 2F00H, DIR's own buffer (over DIR's start code, which has run).
29FF
LD A,31H 3E 31
Load Register A with 31H, SVC 49, @RDSEC, which reads the sector of Register Pair DE of drive C into Register Pair HL.
2A01
RST 28H EF
Call @RDSEC with RST 28H: a directory sector is written with the system data mark, so a good read returns error 6.
2A02
CP 06H FE 06
Compare Register A with 06H: Z when the read gave the expected error 6.
2A04
LD A,11H 3E 11
Load Register A with 11H, error 17, Directory read error (the flags stay).
2A06
If the Z flag is cleared (any other result) jump to IOERR at 241EH with Register A = 11H.
2A09
LD A,B 78
Load Register A with Register B, the DEC of the extended entry.
2A0A
AND E0H E6 E0
AND Register A with E0H, the offset of the FXDE in the sector.
2A0C
POP DE D1
Pop Register Pair DE from the stack (Stack Pointer): the granule count.
2A0D
POP BC C1
Pop Register Pair BC from the stack (Stack Pointer): the extent count.
2A0E
Jump to ALL11 at 29B8H with Register A = the offset and Register H = 2FH: the extents of the FXDE.

2A10H - LINOUT, BYTOUT and OUTSPC: the Output

Every line goes to the screen with @DSPLY and, with the P parameter, to the printer with @PRINT; single characters go out with @DSP and @PRT. An output error ends DIR through IOERR.

2A10LINOUT
LD A,0AH 3E 0A
LINOUT: load Register A with 0AH, SVC 10, @DSPLY, which shows the line at Register Pair HL up to its 0DH or 03H.
2A12
RST 28H EF
Call @DSPLY with RST 28H to show the line on the screen (the DO device).
2A13
If the Z flag is cleared (an error) jump to IOER1 at 2A1DH.
2A15
LD A,(2A2AH) 3A 2A 2A
Load Register A with the byte at 2A2AH, the low byte of the operand of PPARM (2A29H), not zero with P.
2A18
OR A B7
OR Register A with itself to test the P parameter's value for zero.
2A19
RET Z C8
If the Z flag is set (no P) return to the caller: the line is not printed.
2A1A
LD A,0EH 3E 0E
Load Register A with 0EH, SVC 14, @PRINT, which sends the line at Register Pair HL to the printer.
2A1C
RST 28H EF
Call @PRINT with RST 28H to print the line on the PR device.
2A1DIOER1
IOER1: if the Z flag is cleared (an output error) jump to IOERR at 241EH with the error in Register A.
2A20
RET C9
Return to the caller: the line or character went out without an error.
2A21BYTOUT2
DEC C 0D
BYTOUT2: decrement Register C, the columns left of the name field, for the character that goes out.
2A22BYTOUT
PUSH BC C5
BYTOUT: push Register Pair BC onto the stack (Stack Pointer).
2A23
LD C,A 4F
Load Register C with Register A, the character.
2A24
LD A,02H 3E 02
Load Register A with 02H, SVC 2, @DSP, which shows the character in Register C.
2A26
RST 28H EF
Call @DSP with RST 28H to show the character on the screen.
2A27
If the Z flag is cleared (an error) jump to IOER1 at 2A1DH.
2A29PPARM
LD DE,0000H 11 00 00
PPARM: load Register Pair DE with 0000H, the operand at 2A2AH that @PARAM fills in for P (FFFFH for P alone).
2A2C
INC E 1C
Increment Register E: Z when the value's low byte was FFH, P given.
2A2D
If the Z flag is cleared (no P) jump to NOPRT at 2A35H.
2A2F
LD A,06H 3E 06
Load Register A with 06H, SVC 6, @PRT, which sends the character in Register C to the printer.
2A31
RST 28H EF
Call @PRT with RST 28H to print the character.
2A32
If the Z flag is cleared (an error) jump to IOER1 at 2A1DH.
2A34
LD A,C 79
Load Register A with Register C, the character, as it was.
2A35NOPRT
POP BC C1
NOPRT: pop Register Pair BC from the stack (Stack Pointer): Register C keeps BYTOUT2's count.
2A36
RET C9
Return to the caller with Register C and Register B as they were.
2A37OUTSPC
LD A,20H 3E 20
OUTSPC: load Register A with 20H, a space, the character to show.
2A39
Call BYTOUT2 at 2A21H to show it, Register C counting down.
2A3C
Decrement Register B and loop to OUTSPC at 2A37H for Register B spaces.
2A3E
RET C9
Return to the caller with Register B = 00H after the spaces.

2A3FH - CALCK: Granules to K

Register Pair DE granules times the sectors per granule, divided by 4 (four sectors of 256 bytes to the K), written at Register Pair HL as five digits, a point that the field already holds, and two decimals from HUNDTAB (00, 25, 50, 75).

2A3FCALCK
LD (2A54H),HL 22 54 2A
CALCK: store Register Pair HL, the destination, into 2A54H, the operand of CALCK2 (2A53H).
2A42
EX DE,HL EB
Exchange Register Pairs DE and HL: Register Pair HL = the granules.
2A43CALCK1
LD C,00H 0E 00
CALCK1: load Register C with 00H, the operand at 2A44H, the sectors per granule of the drive (stored at 2489H).
2A45
LD A,5BH 3E 5B
Load Register A with 5BH, SVC 91, @MUL16, which multiplies Register Pair HL by the 8 bit value (Register C, handed in Register A).
2A47
RST 28H EF
Call @MUL16 with RST 28H: the sectors, 24 bits in Registers H, L and A.
2A48
PUSH AF F5
Push Register Pair AF onto the stack (Stack Pointer): Register A = the low byte, whose bits 1-0 give the quarter K.
2A49
LD H,L 65
Load Register H with Register L, the middle byte (the top byte is dropped; the GAT covers at most 203 cylinders of 8 granules of 32 sectors, under 65536).
2A4A
LD L,A 6F
Load Register L with Register A: Register Pair HL = the sectors.
2A4B
SRL H CB 3C
Shift Register H right, the first of two halvings of Register Pair HL.
2A4D
RR L CB 1D
Rotate Register L right, taking the bit from Register H: Register Pair HL / 2.
2A4F
SRL H CB 3C
Shift Register H right again, the second halving of Register Pair HL.
2A51
RR L CB 1D
Rotate Register L right: Register Pair HL = the sectors / 4, the whole K.
2A53CALCK2
LD DE,0000H 11 00 00
CALCK2: load Register Pair DE with 0000H, the operand at 2A54H, the destination.
2A56
LD A,61H 3E 61
Load Register A with 61H, SVC 97, @HEXDEC, five decimal characters.
2A58
RST 28H EF
Call @HEXDEC with RST 28H: the K in five characters at Register Pair DE, which comes back after them.
2A59
INC DE 13
Increment Register Pair DE past the decimal point to the hundredths.
2A5A
POP AF F1
Pop Register Pair AF from the stack (Stack Pointer): Register A = the low byte of the sectors.
2A5B
AND 03H E6 03
AND Register A with 03H, the sectors over whole K, 0-3.
2A5D
ADD A,A 87
Add Register A to itself: times 2, the offset in HUNDTAB.
2A5E
LD B,00H 06 00
Load Register B with 00H, the high byte of the offset into HUNDTAB.
2A60
LD C,A 4F
Load Register C with Register A: Register Pair BC = the offset.
2A61
LD HL,2D4BH 21 4B 2DLD HL,HUNDTAB
Load Register Pair HL with 2D4BH, HUNDTAB, the text 00255075.
2A64
ADD HL,BC 09
Add Register Pair BC to Register Pair HL: Register Pair HL = the two decimals.
2A65
LD C,02H 0E 02
Load Register C with 02H: Register Pair BC = 0002H.
2A67
LDIR ED B0
Copy 2 bytes (Register Pair BC) from Register Pair HL to Register Pair DE: the decimals after the point.
2A69
RET C9
Return to the caller with the K and its decimals in the field.
2A6ACPHLDE
LD A,H 7C
CPHLDE: load Register A with Register H, the high byte of the first word.
2A6B
CP D BA
Compare Register A with Register D, the high byte of the second word.
2A6C
RET NZ C0
If the Z flag is cleared (the high bytes differ) return: Carry set when Register Pair HL is less than Register Pair DE.
2A6D
LD A,L 7D
Load Register A with Register L, the low byte of the first word.
2A6E
CP E BB
Compare Register A with Register E, the low byte of the second word.
2A6F
RET C9
Return with Carry set when Register Pair HL is less than Register Pair DE, Z when equal.

2A70H - UNPACK: a File's Date as One Word

From DIR+1 and DIR+2 (and DIR+19 for the new style) Register Pair DE is built as year (bits 15-11), month (bits 10-7) and day (bits 6-2), the same form as the dates PAKDAT makes, so that one comparison orders them.

2A70UNPACK
LD A,(HL) 7E
UNPACK: load Register A with the byte at Register Pair HL, DIR+1: bits 3-0 the month.
2A71
AND 0FH E6 0F
AND Register A with 0FH, keeping bits 3-0, the month of the file.
2A73
LD E,00H 1E 00
Load Register E with 00H, the low byte of the date word to come.
2A75
LD D,A 57
Load Register D with Register A, the month, to be shifted into place.
2A76
SRL D CB 3A
Shift Register D right: bits 3-1 of the month into bits 2-0 of Register D, bit 0 into the Carry flag.
2A78
RR E CB 1B
Rotate Register E right, taking the month's bit 0 into bit 7 of Register E.
2A7A
INC HL 23
Increment Register Pair HL to DIR+2, the byte of the day and year.
2A7B
LD A,(HL) 7E
Load Register A with the byte at Register Pair HL, DIR+2: bits 7-3 the day.
2A7C
AND F8H E6 F8
AND Register A with F8H, keeping bits 7-3, the day of the file.
2A7E
RRCA 0F
Rotate Register A right: the day in bits 6-2.
2A7F
OR E B3
OR Register E into Register A, the month's bit 0 in bit 7.
2A80
LD E,A 5F
Load Register E with Register A: the month's bit 0 and the day.
2A81
LD A,(0000H) 3A 00 00
Load Register A with the byte at 0000H, the operand at 2A82H that DIRA sets to 0082H, YFLAG$.
2A84
BIT 0,A CB 47
BIT 0,A as assembled; its second byte at 2A85H (DVTEST) is set by DIR4 (2440H) to test the drive's bit of YFLAG$ in Register A: NZ for the new style of dating.
2A86
If the Z flag is cleared (new style) jump to NWDT at 2A91H.
2A88
LD A,(HL) 7E
Load Register A with the byte at Register Pair HL, DIR+2.
2A89
AND 07H E6 07
AND Register A with 07H, the year less 1980 of the old style, 0-7.
2A8BSHFTD
RLCA 07
SHFTD: rotate Register A left, the first of three rotates of the year.
2A8C
RLCA 07
Rotate Register A left again, the second of three rotates.
2A8D
RLCA 07
Rotate Register A left a third time: the year in bits 7-3.
2A8E
OR D B2
OR Register D into Register A, bits 2-0 the high part of the month.
2A8F
LD D,A 57
Load Register D with Register A: Register Pair DE = the date word.
2A90
RET C9
Return with Register Pair DE = the date, 0000H for a file with none.
2A91NWDT
LD A,L 7D
NWDT: load Register A with Register L, at DIR+2.
2A92
ADD A,11H C6 11
Add 11H to Register A, the offset step from DIR+2 to DIR+19.
2A94
LD L,A 6F
Load Register L with Register A: Register Pair HL = DIR+19.
2A95
LD A,(HL) 7E
Load Register A with the byte at Register Pair HL, DIR+19: bits 4-0 the year less 1980.
2A96
AND 1FH E6 1F
AND Register A with 1FH, keeping bits 4-0, the year less 1980, 0-31.
2A98
Jump to SHFTD at 2A8BH to put the year into bits 7-3.

2A9AH - CKPAGE, CKPAWS and CKTITL: Pages, BREAK and the Title

CKPAGE counts the lines and at the end of a screen (22 lines) waits for a key, unless N, P or JCL is active; CKPAWS ends DIR on BREAK and holds it while the pause key is pressed; CKTITL shows the drive's title line and, with A, the column heading.

2A9ACKPAGE1
LD A,0DH 3E 0D
CKPAGE1: load Register A with 0DH, the carriage return that ends a line (6.3.1).
2A9C
Call BYTOUT at 2A22H to show it, and fall into CKPAGE.
2A9FCKPAGE
LD A,00H 3E 00
CKPAGE: load Register A with 00H, the operand at 2AA0H, the lines left on the screen (16H at 2ED7H and after each pause).
2AA1
DEC A 3D
Decrement Register A, the count of lines left on the screen.
2AA2
LD (2AA0H),A 32 A0 2A
Store Register A into 2AA0H, the operand of CKPAGE.
2AA5
RET NZ C0
If the Z flag is cleared (the screen is not full) return.
2AA6
LD A,16H 3E 16
Load Register A with 16H, 22 lines for the next screen (the manual says 15).
2AA8
LD (2AA0H),A 32 A0 2A
Store Register A (16H) into 2AA0H, the operand of CKPAGE.
2AABNPARM
LD DE,0000H 11 00 00
NPARM: load Register Pair DE with 0000H, the operand at 2AACH that @PARAM fills in for N, and that P also sets (2E84H).
2AAE
LD A,E 7B
Load Register A with Register E, the low byte of the value.
2AAF
OR D B2
OR Register D into Register A: not zero for N.
2AB0
RET NZ C0
If the Z flag is cleared (non stop with N or P) return without a pause.
2AB1SFLAG
LD A,00H 3E 00
SFLAG: load Register A with 00H, the operand at 2AB2H, a copy of SFLAG$ (007CH) made at 2DCEH.
2AB3
AND 20H E6 20
AND Register A with 20H, bit 5, set while a JCL (DO) file runs.
2AB5
RET NZ C0
If the Z flag is cleared (DO active) return: no pause.
2AB6
LD A,01H 3E 01
Load Register A with 01H, SVC 1, @KEY, which waits for a key.
2AB8
RST 28H EF
Call @KEY with RST 28H: Register A = the key; NZ on an error.
2AB9IOERR5
IOERR5: if the Z flag is cleared (an error) jump to IOERR at 241EH.
2ABC
LD A,69H 3E 69
Load Register A with 69H, SVC 105, @CLS, left from code that cleared the screen for the next page.
2ABE
NOP 00
NOP where the RST 28H was: the screen is not cleared (CLS out for now, the source says).
2ABF
If the Z flag is cleared jump to IOERR5 at 2AB9H; the Z flag of @KEY is still set, so the jump is never taken.
2AC1NOTITLE
LD A,00H 3E 00
NOTITLE: load Register A with 00H, the operand at 2AC2H, not zero while the No Disk line is shown (246CH).
2AC3
OR A B7
OR Register A with itself to test NOTITLE's value for zero.
2AC4
RET NZ C0
If the Z flag is cleared return without a title.
2AC5
LD A,(2D9BH) 3A 9B 2DLD A,(FILFLAG)
Load Register A with the byte at 2D9BH, FILFLAG, not zero while no file of the drive has been shown.
2AC8
OR A B7
OR Register A with itself to test FILFLAG for zero.
2AC9
If the Z flag is cleared call CKTITL at 2AEBH: the title is shown again when no file has been shown yet (the source's comment has it the other way round; B45).
2ACC
RET C9
Return to the caller after the pause (and the title, if it was shown).
2ACDCKPAWS / KFLAG
LD A,(0000H) 3A 00 00
CKPAWS: load Register A with the byte at 0000H, the operand at 2ACEH that DIRA sets to 0074H, KFLAG$.
2AD0
RRCA 0F
Rotate Register A right: bit 0, BREAK, into the Carry flag.
2AD1
If the Carry flag is set (BREAK) jump to ABORT at 2417H.
2AD4
RRCA 0F
Rotate Register A right again: bit 1, the pause key (SHIFT @), into the Carry flag.
2AD5
RET NC D0
If the Carry flag is cleared (no pause) return.
2AD6CKPAW1
LD A,01H 3E 01
CKPAW1: load Register A with 01H, SVC 1, @KEY.
2AD8
RST 28H EF
Call @KEY with RST 28H: wait for a key, returned in Register A.
2AD9CKPAW2
CP 60H FE 60
CKPAW2: compare Register A with 60H, the SHIFT @ key.
2ADB
If the Z flag is set (the pause key again) jump to CKPAW1 at 2AD6H and wait for another.
2ADD
CP 80H FE 80
Compare Register A with 80H, the BREAK key, which ends DIR.
2ADF
If the Z flag is set (BREAK) jump to ABORT at 2417H.
2AE2RESKFL
LD A,(0000H) 3A 00 00
RESKFL: load Register A with the byte at 0000H, the operand at 2AE3H, KFLAG$ (0074H).
2AE5
AND F9H E6 F9
AND Register A with F9H, clearing bit 1 (pause) and bit 2 (ENTER).
2AE7KFLAG1
LD (0000H),A 32 00 00
KFLAG1: store Register A into the byte at 0000H, the operand at 2AE8H, KFLAG$ (0074H).
2AEA
RET C9
Return to the caller with KFLAG$ cleared of the pause and ENTER bits.
2AEBCKTITL
LD HL,2C3CH 21 3C 2CLD HL,DSTRING
CKTITL: load Register Pair HL with 2C3CH, DSTRING, the drive's title line.
2AEE
Call LINOUT at 2A10H to show the title line (and print it with P).
2AF1
Call CKPAGE at 2A9FH to count the title line on the screen.
2AF4
Call CKPAGE at 2A9FH again, for the blank line or the heading that follows.
2AF7
LD A,(27FCH) 3A FC 27
Load Register A with the byte at 27FCH, the low byte of the A parameter's value.
2AFA
OR A B7
OR Register A with itself to test the A parameter's value for zero.
2AFB
LD A,0DH 3E 0D
Load Register A with 0DH, a carriage return (the flags stay).
2AFD
If the Z flag is set (the brief format) jump to BYTOUT at 2A22H: a blank line, and BYTOUT returns to the caller.
2B00
LD HL,2C8CH 21 8C 2CLD HL,HEADING
Load Register Pair HL with 2C8CH, HEADING, the column heading of the full format.
2B03
Call LINOUT at 2A10H to show the column heading (and print it with P).
2B06
PUSH BC C5
Push Register Pair BC onto the stack (Stack Pointer), keeping Register C.
2B07
LD B,4FH 06 4F
Load Register B with 4FH, the 79 minus signs that underline the heading.
2B09D79L
LD A,2DH 3E 2D
D79L: load Register A with 2DH, the minus sign.
2B0B
Call BYTOUT at 2A22H to show the minus sign in Register A.
2B0E
Decrement Register B and loop to D79L at 2B09H for 79 signs.
2B10
POP BC C1
Pop Register Pair BC from the stack (Stack Pointer).
2B11
Jump to CKPAGE1 at 2A9AH, which ends the line, counts it and returns to the caller (6.3.1).

2B14H - SORTIT and SHELL: the Sorted List

The selected entries lie in the buffer from 3000H, 32 bytes each, up to DIRPTR. SORTIT puts a table of their addresses after them, sorts the table with a Shell sort on the eleven characters of name and extension (SHELL, whose variables are the operands of its own instructions) and shows the entries in that order through MATCH.

2B14SORTIT
LD HL,(2D9CH) 2A 9C 2DLD HL,(DIRPTR)
SORTIT: load Register Pair HL with the word at 2D9CH, DIRPTR, the end of the entries kept.
2B17
LD DE,3000H 11 00 30LD DE,MEMORY
Load Register Pair DE with 3000H, the first entry.
2B1A
LD (HL),E 73
Store Register E (00H) into the byte at Register Pair HL, the first word of the address table, in case there is only one entry.
2B1B
INC HL 23
Increment Register Pair HL to the high byte of the table's first word.
2B1C
LD (HL),D 72
Store Register D (30H) into the byte at Register Pair HL: the table's first word is 3000H.
2B1D
DEC HL 2B
Decrement Register Pair HL back to the table's start.
2B1E
XOR A AF
Load Register A with 00H by XOR, clearing the Carry flag.
2B1F
SBC HL,DE ED 52
Subtract Register Pair DE from Register Pair HL: the bytes of the entries.
2B21
RET Z C8
If the Z flag is set (no entry was kept) return.
2B22
LD B,05H 06 05
Load Register B with 05H, five halvings: 32 bytes an entry.
2B24SORT1
SRL H CB 3C
SORT1: shift Register H right, the high byte of the byte count.
2B26
RR L CB 1D
Rotate Register L right, taking the bit from Register H: Register Pair HL / 2.
2B28
Decrement Register B and loop to SORT1 at 2B24H: Register Pair HL = the number of entries.
2B2A
LD B,L 45
Load Register B with Register L, the number as the count of the loops below (00H for 256).
2B2B
PUSH BC C5
Push Register Pair BC (the count in Register B) onto the stack (Stack Pointer) for the display loop.
2B2C
LD (2B68H),HL 22 68 2BLD (COUNTM1),HL
Store Register Pair HL (the number of entries) into 2B68H, the operand of SHELL (2B67H): N.
2B2F
LD A,H 7C
Load Register A with Register H, the high byte of the entry count.
2B30
OR L B5
OR Register L into Register A: zero entries need no sort (not possible here: 2B21H has returned for none).
2B31
If the Z flag is set jump to SORT2A at 2B54H.
2B33
ADD HL,HL 29
Add Register Pair HL to itself: two bytes of table for each entry.
2B34
EX DE,HL EB
Exchange Register Pairs DE and HL: Register Pair DE = the table's size.
2B35
LD HL,(2D9EH) 2A 9E 2DLD HL,(MAXMEM)
Load Register Pair HL with the word at 2D9EH, MAXMEM, HIGH$ less 33.
2B38
XOR A AF
Load Register A with 00H by XOR, clearing the Carry flag.
2B39
SBC HL,DE ED 52
Subtract Register Pair DE from Register Pair HL: Carry set only when the table's size alone is above MAXMEM, which never happens, not when the table placed at DIRPTR runs past HIGH$ (B44); NOMEM below is never reached from here.
2B3B
If the Carry flag is set jump to NOMEM at 240DH for No memory for SORT.
2B3E
LD HL,(2D9CH) 2A 9C 2DLD HL,(DIRPTR)
Load Register Pair HL with the word at 2D9CH, DIRPTR, where the table goes.
2B41
LD DE,3000H 11 00 30LD DE,MEMORY
Load Register Pair DE with 3000H, the first entry.
2B44SORT2
LD (HL),E 73
SORT2: store Register E, the low byte of the entry's address, into the table at Register Pair HL.
2B45
INC HL 23
Increment Register Pair HL to the high byte of the table word.
2B46
LD (HL),D 72
Store Register D, the high byte, into the table at Register Pair HL.
2B47
INC HL 23
Increment Register Pair HL to the next word of the table.
2B48
LD A,E 7B
Load Register A with Register E, the low byte of the entry's address.
2B49
ADD A,20H C6 20
Add 20H to Register A, the next entry 32 bytes on.
2B4B
LD E,A 5F
Load Register E with Register A, the low byte of the next entry's address.
2B4C
If the Carry flag is cleared (no carry) jump to 2B4FH, past the INC D.
2B4E
INC D 14
Increment Register D, the carry into the high byte.
2B4F
Decrement Register B and loop to SORT2 at 2B44H for every entry.
2B51
Call SHELL at 2B67H to sort the table by name.
2B54SORT2A
POP BC C1
SORT2A: pop Register Pair BC from the stack (Stack Pointer): Register B = the number of entries.
2B55
LD HL,(2D9CH) 2A 9C 2DLD HL,(DIRPTR)
Load Register Pair HL with the word at 2D9CH, DIRPTR, the start of the table.
2B58SORT3
LD E,(HL) 5E
SORT3: load Register E with the low byte of the next address in the table at Register Pair HL.
2B59
INC HL 23
Increment Register Pair HL to the high byte of the table word.
2B5A
LD D,(HL) 56
Load Register D with the high byte at Register Pair HL: Register Pair DE = the entry.
2B5B
INC HL 23
Increment Register Pair HL to the next word of the address table.
2B5C
PUSH HL E5
Push Register Pair HL (the table pointer) onto the stack (Stack Pointer).
2B5D
PUSH BC C5
Push Register Pair BC (the count) onto the stack (Stack Pointer).
2B5E
EX DE,HL EB
Exchange Register Pairs DE and HL: Register Pair HL = the entry.
2B5F
Call MATCH at 2736H to show the entry at Register Pair HL.
2B62
POP BC C1
Pop Register Pair BC from the stack (Stack Pointer): the count.
2B63
POP HL E1
Pop Register Pair HL from the stack (Stack Pointer): the table pointer.
2B64
Decrement Register B and loop to SORT3 at 2B58H for every entry.
2B66
RET C9
Return to CKHIT (25C1H): the sorted list of the drive is shown.
2B67SHELL
LD HL,0000H 21 00 00
SHELL: load Register Pair HL with 0000H, the operand at 2B68H, N, the number of entries (the source's comment calls it count minus 1).
2B6A
LD (2B6EH),HL 22 6E 2BLD (STORM),HL
Store Register Pair HL into 2B6EH, the operand of CYCLE (2B6DH): the gap M starts at N.
2B6DCYCLE
LD DE,0000H 11 00 00
CYCLE: load Register Pair DE with 0000H, the operand at 2B6EH, the gap M.
2B70
SRL D CB 3A
Shift Register D right, the high byte of the gap M.
2B72
RR E CB 1B
Rotate Register E right: Register Pair DE = M / 2.
2B74
LD A,D 7A
Load Register A with Register D, the high byte of the new gap.
2B75
OR E B3
OR Register E into Register A: zero when the gap is 0.
2B76
RET Z C8
If the Z flag is set return: the table is sorted.
2B77
LD (2B6EH),DE ED 53 6E 2BLD (STORM),DE
Store Register Pair DE (M) into 2B6EH, the operand of CYCLE.
2B7B
LD HL,(2B68H) 2A 68 2BLD HL,(COUNTM1)
Load Register Pair HL with the word at 2B68H: N.
2B7E
SBC HL,DE ED 52
Subtract Register Pair DE (M) from Register Pair HL (the Carry flag is clear from the OR at 2B75H): K = N - M.
2B80
LD (2BEFH),HL 22 EF 2BLD (STORK),HL
Store Register Pair HL (K) into 2BEFH, the operand of the LD DE at 2BEEH.
2B83
LD HL,0000H 21 00 00
Load Register Pair HL with 0000H, the first value of J: J = 0.
2B86
LD (2B8AH),HL 22 8A 2BLD (STORJ),HL
Store Register Pair HL (J) into 2B8AH, the operand of AGAIN (2B89H).
2B89AGAIN
LD HL,0000H 21 00 00
AGAIN: load Register Pair HL with 0000H, the operand at 2B8AH, J.
2B8C
LD (2B90H),HL 22 90 2BLD (STORI),HL
Store Register Pair HL into 2B90H, the operand of REPEAT (2B8FH): I = J.
2B8FREPEAT
LD HL,0000H 21 00 00
REPEAT: load Register Pair HL with 0000H, the operand at 2B90H, I.
2B92
LD DE,(2B6EH) ED 5B 6E 2BLD DE,(STORM)
Load Register Pair DE with the word at 2B6EH: M.
2B96
ADD HL,DE 19
Add Register Pair DE to Register Pair HL: L = I + M.
2B97
ADD HL,HL 29
Add Register Pair HL to itself: L x 2, the offset of its word in the table.
2B98
PUSH HL E5
Push Register Pair HL (L x 2) onto the stack (Stack Pointer).
2B99
LD HL,(2B90H) 2A 90 2BLD HL,(STORI)
Load Register Pair HL with the word at 2B90H: I.
2B9C
ADD HL,HL 29
Add Register Pair HL to itself: I x 2, the offset of its word in the table.
2B9D
LD BC,(2D9CH) ED 4B 9C 2DLD BC,(DIRPTR)
Load Register Pair BC with the word at 2D9CH, DIRPTR, the start of the table.
2BA1
ADD HL,BC 09
Add Register Pair BC to Register Pair HL: Register Pair HL = the word of entry I.
2BA2
EX DE,HL EB
Exchange Register Pairs DE and HL: Register Pair DE = the word of entry I.
2BA3
POP HL E1
Pop Register Pair HL from the stack (Stack Pointer): L x 2.
2BA4
ADD HL,BC 09
Add Register Pair BC to Register Pair HL: Register Pair HL = the word of entry L.
2BA5
PUSH HL E5
Push Register Pair HL (the word of L) onto the stack (Stack Pointer).
2BA6
PUSH DE D5
Push Register Pair DE (the word of I) onto the stack (Stack Pointer).
2BA7
LD B,0BH 06 0B
Load Register B with 0BH, the eleven characters compared.
2BA9
PUSH BC C5
Push Register Pair BC (the length in Register B) onto the stack (Stack Pointer).
2BAA
LD A,(HL) 7E
Load Register A with the low byte of the address in the word at Register Pair HL (entry L).
2BAB
INC HL 23
Increment Register Pair HL to the high byte of entry L's address.
2BAC
LD H,(HL) 66
Load Register H with the high byte of the address at Register Pair HL.
2BAD
LD L,A 6F
Load Register L with Register A: Register Pair HL = entry L.
2BAE
LD BC,0005H 01 05 00
Load Register Pair BC with 0005H, the offset of the name in an entry.
2BB1
ADD HL,BC 09
Add Register Pair BC to Register Pair HL: Register Pair HL = the name of entry L.
2BB2
EX DE,HL EB
Exchange Register Pairs DE and HL: Register Pair DE = the name of entry L, Register Pair HL the word of entry I.
2BB3
LD A,(HL) 7E
Load Register A with the low byte of the address in the word at Register Pair HL (entry I).
2BB4
INC HL 23
Increment Register Pair HL to the high byte of entry I's address.
2BB5
LD H,(HL) 66
Load Register H with the high byte of the address at Register Pair HL.
2BB6
LD L,A 6F
Load Register L with Register A: Register Pair HL = entry I.
2BB7
ADD HL,BC 09
Add Register Pair BC (0005H) to Register Pair HL: Register Pair HL = the name of entry I.
2BB8
POP BC C1
Pop Register Pair BC from the stack (Stack Pointer): Register B = 0BH.
2BB9BACK
LD A,(DE) 1A
BACK: load Register A with the character of entry L at Register Pair DE.
2BBA
SUB (HL) 96
Subtract the character of entry I at Register Pair HL from Register A.
2BBB
If the Carry flag is set (entry L sorts before entry I) jump to POP at 2BC5H to swap them.
2BBD
If the Z flag is cleared (entry L sorts after) jump to FINIS at 2BE4H: in order.
2BBF
INC DE 13
The same character: increment Register Pair DE.
2BC0
INC HL 23
Increment Register Pair HL to the next character of entry I's name.
2BC1
Decrement Register B and loop to BACK at 2BB9H for the next character.
2BC3
The names are equal (two entries cannot have the same name): jump to FINIS at 2BE4H.
2BC5POP
POP DE D1
POP: pop Register Pair DE from the stack (Stack Pointer): the word of entry I.
2BC6
POP HL E1
Pop Register Pair HL from the stack (Stack Pointer): the word of entry L.
2BC7
LD B,02H 06 02
Load Register B with 02H, the two bytes of a word.
2BC9SWAP
LD C,(HL) 4E
SWAP: load Register C with the byte at Register Pair HL (entry L's word).
2BCA
EX DE,HL EB
Exchange Register Pairs DE and HL: Register Pair HL = entry I's word.
2BCB
LD A,(HL) 7E
Load Register A with the byte at Register Pair HL (entry I's word).
2BCC
LD (HL),C 71
Store Register C into the byte at Register Pair HL.
2BCD
EX DE,HL EB
Exchange Register Pairs DE and HL back: Register Pair HL = entry L's word.
2BCE
LD (HL),A 77
Store Register A into the byte at Register Pair HL: one byte of the two words exchanged.
2BCF
INC HL 23
Increment Register Pair HL to the second byte of entry L's word.
2BD0
INC DE 13
Increment Register Pair DE to the second byte of entry I's word.
2BD1
Decrement Register B and loop to SWAP at 2BC9H for the second byte.
2BD3
LD HL,(2B6EH) 2A 6E 2BLD HL,(STORM)
Load Register Pair HL with the word at 2B6EH: M.
2BD6
EX DE,HL EB
Exchange Register Pairs DE and HL: Register Pair DE = M.
2BD7
LD HL,(2B90H) 2A 90 2BLD HL,(STORI)
Load Register Pair HL with the word at 2B90H: I.
2BDA
XOR A AF
Load Register A with 00H by XOR, clearing the Carry flag.
2BDB
SBC HL,DE ED 52
Subtract Register Pair DE from Register Pair HL: I - M.
2BDD
LD (2B90H),HL 22 90 2BLD (STORI),HL
Store Register Pair HL into 2B90H: I = I - M.
2BE0
If the Carry flag is cleared (I is still 0 or more) jump to REPEAT at 2B8FH to compare the entry further down.
2BE2
Jump to EXITSRT at 2BE6H: entry I has gone below the start of the table.
2BE4FINIS
POP DE D1
FINIS: pop Register Pair DE from the stack (Stack Pointer), dropping the word of entry I.
2BE5
POP HL E1
Pop Register Pair HL from the stack (Stack Pointer), dropping the word of entry L.
2BE6EXITSRT
LD HL,(2B8AH) 2A 8A 2BLD HL,(STORJ)
EXITSRT: load Register Pair HL with the word at 2B8AH: J.
2BE9
INC HL 23
Increment Register Pair HL, the value of J: J = J + 1.
2BEA
LD (2B8AH),HL 22 8A 2BLD (STORJ),HL
Store Register Pair HL (J) into 2B8AH, the operand of AGAIN.
2BED
XOR A AF
Load Register A with 00H by XOR, clearing the Carry flag.
2BEE
LD DE,0000H 11 00 00
Load Register Pair DE with 0000H, the operand at 2BEFH, K (stored at 2B80H).
2BF1
SBC HL,DE ED 52
Subtract Register Pair DE from Register Pair HL: J - K.
2BF3
If the Carry flag is cleared (J has reached K) jump to CYCLE at 2B6DH for the next gap.
2BF6
Jump to AGAIN at 2B89H for the next value of J.

2BF9H - DIR Data: the Parameter Table

The 6.x form that @PARAM reads (as in MEMORY, 28AAH): 80H, then for each parameter a type byte (bit 7 numeric, bit 6 flag, bit 5 string, bit 4 the first letter alone will do, bits 3-0 the length of the name), the name, a response byte and the address of the operand that receives the value. @PARAM does not check the kinds of value against the type byte, and DIR does not either. SORT and O both fill in SORTPRM. 00H ends the table.

2BF9PRMTBL$
DEFB 80H 80
PRMTBL$, 2BF9H: 80H, the mark of the 6.x table form.
2BFA
DEFB 41H 41
2BFAH: type 41H, a flag, a name of 1 character, not abbreviated.
2BFB
DEFM "A" 41
2BFBH: the name A, the full (allocation) format.
2BFC
DEFB 00H 00
2BFCH: the response byte of A, which DIR does not read.
2BFD-2BFE
DEFW 27FCH FC 27
2BFDH-2BFEH: 27FCH, APARM+1, the operand of the LD DE at 27FBH.
2BFF
DEFB 53H 53
2BFFH: type 53H, a flag, may be abbreviated, a name of 3.
2C00-2C02
DEFM "INV" 49 4E 56
2C00H-2C02H: the name INV (or I), to show the invisible files too.
2C03
DEFB 00H 00
2C03H: the response byte of INV, which DIR does not read.
2C04-2C05
DEFW 2690H 90 26
2C04H-2C05H: 2690H, IPARM+1, the operand of the LD DE at 268FH.
2C06
DEFB 41H 41
2C06H: type 41H, a flag, a name of 1 character, not abbreviated.
2C07
DEFM "P" 50
2C07H: the name P, the printer as well as the screen.
2C08
DEFB 00H 00
2C08H: the response byte of P, which DIR does not read.
2C09-2C0A
DEFW 2A2AH 2A 2A
2C09H-2C0AH: 2A2AH, PPARM+1, the operand of the LD DE at 2A29H.
2C0B
DEFB 53H 53
2C0BH: type 53H, a flag, may be abbreviated, a name of 3.
2C0C-2C0E
DEFM "SYS" 53 59 53
2C0CH-2C0EH: the name SYS (or S), to show the system files too.
2C0F
DEFB 00H 00
2C0FH: the response byte of SYS, which DIR does not read.
2C10-2C11
DEFW 2682H 82 26
2C10H-2C11H: 2682H, SPARM+1, the operand of the LD DE at 2681H.
2C12
DEFB 41H 41
2C12H: type 41H, a flag, a name of 1 character, not abbreviated.
2C13
DEFM "N" 4E
2C13H: the name N, no pause at the end of a screen.
2C14
DEFB 00H 00
2C14H: the response byte of N, which DIR does not read.
2C15-2C16
DEFW 2AACH AC 2A
2C15H-2C16H: 2AACH, NPARM+1, the operand of the LD DE at 2AABH.
2C17
DEFB 74H 74
2C17H: type 74H, a flag or a string, may be abbreviated, a name of 4.
2C18-2C1B
DEFM "DATE" 44 41 54 45
2C18H-2C1BH: the name DATE (or D), the dates of the files to show.
2C1CDRESP
DEFB 00H 00
DRESP, 2C1CH: the response byte of DATE, read at GTDATE (2E87H): 00H not given, bit 6 a flag, otherwise a string.
2C1D-2C1E
DEFW 2E8EH 8E 2E
2C1DH-2C1EH: 2E8EH, DATPRM+1, the operand of the LD HL at 2E8DH.
2C1F
DEFB 53H 53
2C1FH: type 53H, a flag, may be abbreviated, a name of 3.
2C20-2C22
DEFM "MOD" 4D 4F 44
2C20H-2C22H: the name MOD (or M), only the files modified since their last backup.
2C23
DEFB 00H 00
2C23H: the response byte of MOD, which DIR does not read.
2C24-2C25
DEFW 2698H 98 26
2C24H-2C25H: 2698H, CKMOD+1, the operand of the LD DE at 2697H.
2C26
DEFB 44H 44
2C26H: type 44H, a flag, a name of 4 (not abbreviated: O stands for it).
2C27-2C2A
DEFM "SORT" 53 4F 52 54
2C27H-2C2AH: the name SORT, the alphabetical order.
2C2B
DEFB 00H 00
2C2BH: the response byte of SORT, which DIR does not read.
2C2C-2C2D
DEFW 26FCH FC 26
2C2CH-2C2DH: 26FCH, SORTPRM+1, the operand of the LD DE at 26FBH.
2C2E
DEFB 41H 41
2C2EH: type 41H, a flag, a name of 1 character, not abbreviated.
2C2F
DEFM "O" 4F
2C2FH: the name O, the manual's sOrt, a second name of SORT.
2C30
DEFB 00H 00
2C30H: the response byte of O, which DIR does not read.
2C31-2C32
DEFW 26FCH FC 26
2C31H-2C32H: 26FCH, SORTPRM+1 again: O sets the same value as SORT.
2C33
DEFB 00H 00
2C33H: 00H, the end of the table that @PARAM reads.

2C34H - DIR Data: the Lines and the Tables

The drive's title line (DSTRING, 2C3CH-2C8BH, one line that the code fills in), the column heading of the full format, the totals line, the No Disk line, today's date for DATE alone, the names of the protection levels, the days of the months, the hundredths of a K and DIR's two messages. The letters x, d, n and the words diskname, dd-mmm-yy are only places that the code writes over.

2C34-2C37DEN
DEFM "xDEN" 78 44 45 4E
DEN, 2C34H-2C37H: the density word; the x becomes D or S (24A8H) and the word is copied into the title at 2C59H.
2C38-2C3BHARD
DEFM "Hard" 48 61 72 64
HARD, 2C38H-2C3BH: the word copied into the title instead for a hard drive (24B2H).
2C3C-2C42DSTRING
DEFM "Drive :" 44 72 69 76 65 20 3A
DSTRING, 2C3CH-2C42H: the start of the drive's title line, shown by CKTITL (2AEBH) or alone at 25C8H.
2C43-2C45DRIVE
DEFM "d " 64 20 20
DRIVE, 2C43H-2C45H: the d becomes the drive digit (2449H), read back by ALL16 (29EDH).
2C46-2C4FNAME
DEFM "diskname " 64 69 73 6B 6E 61 6D 65 20 20
NAME, 2C46H-2C4FH: the name of the diskette from GAT+D0H goes into the first eight (2538H); the last two take the start of the cylinder count.
2C50-2C58CYLCNT
DEFM " Cyl, " 20 20 20 20 43 79 6C 2C 20
CYLCNT, 2C50H-2C58H: the cylinder count ends at 2C52H (@HEXDEC at 2497H from 2C4EH), then the word Cyl.
2C59-2C64DENSITY
DEFM "nDEN, Free =" 6E 44 45 4E 2C 20 46 72 65 65 20 3D
DENSITY, 2C59H-2C64H: nDEN becomes DDEN, SDEN or Hard (24B5H).
2C65-2C70KFREE
DEFM " . K" / DEFB 20H, 2FH, 20H 20 20 20 20 20 2E 20 20 4B 20 2F 20
KFREE, 2C65H-2C70H: the free space, five digits, the point and two decimals (2526H).
2C71-2C81KPOSS
DEFM " . K, Date " 20 20 20 20 20 2E 20 20 4B 2C 20 20 44 61 74 65 20
KPOSS, 2C71H-2C81H: the size of the diskette (252DH).
2C82-2C8BDATBUF
DEFM "dd-mmm-yy" / DEFB 0DH 64 64 2D 6D 6D 6D 2D 79 79 0D
DATBUF, 2C82H-2C8BH: the diskette's date from GAT+D8H (2545H-257BH), blank when its month is not 01-12, and the carriage return that ends the title.
2C8C-2CABHEADING
DEFM "Filespec MOD Attr Prot LRL" 46 69 6C 65 73 70 65 63 20 20 20 20 4D 4F 44 20 41 74 74 72 20 20 20 50 72 6F 74 20 20 4C 52 4C
HEADING, 2C8CH-2CABH: the column heading of the full format, shown by CKTITL (2B00H), first part.
2CAC-2CCD
DEFM " #Recs EOF File Size Ext Mod " 20 20 23 52 65 63 73 20 20 45 4F 46 20 20 46 69 6C 65 20 53 69 7A 65 20 20 45 78 74 20 20 4D 6F 64 20
2CACH-2CCDH: the heading, second part (Ext is the extents, Mod Date the date the file was last written).
2CCE-2CD9
DEFM "Date Time" / DEFB 0DH 44 61 74 65 20 20 20 54 69 6D 65 0D
2CCEH-2CD9H: the end of the heading and its carriage return.
2CDA-2CE5FDISP
DEFM " files of" 20 20 20 20 66 69 6C 65 73 20 6F 66
FDISP, 2CDAH-2CE5H: the totals line of the full format; the files shown go into 2CDAH-2CDCH (25F4H).
2CE6-2CF4FUSED
DEFM " selected, " 20 20 20 20 20 73 65 6C 65 63 74 65 64 2C 20
FUSED, 2CE6H-2CF4H: the live files of the drive go into 2CE7H-2CE9H (25FFH); the manual calls the line xx files out of yyy selected, Space = zzz.00K.
2CF5-2CFFSPUSED
DEFM " . K" / DEFB 0AH, 0DH 20 20 20 20 20 2E 20 20 4B 0A 0D
SPUSED, 2CF5H-2CFFH: the space of the files shown (2606H), a line feed and the carriage return.
2D00-2D06NODISK
DEFM "Drive :" 44 72 69 76 65 20 3A
NODISK, 2D00H-2D06H: the line shown for an enabled drive without a diskette (2472H).
2D07-2D15NDRIVE
DEFM "n [No Disk]" / DEFB 0AH, 0DH 6E 20 20 5B 4E 6F 20 20 44 69 73 6B 5D 0A 0D
NDRIVE, 2D07H-2D15H: the n becomes the drive digit (244CH); a line feed and the carriage return end the line.
2D16-2D1ETDATE
DEFM "mm/dd/yy" / DEFB 22H 6D 6D 2F 64 64 2F 79 79 22
TDATE, 2D16H-2D1EH: today's date from @DATE goes here for DATE alone (2E9EH); the quotation mark after it ends it as if it had been typed in quotes.
2D1F-2D3EPROTS$
DEFM "FULLREMVNAMEWRITUPDTREADEXECNO " 46 55 4C 4C 52 45 4D 56 4E 41 4D 45 57 52 49 54 55 50 44 54 52 45 41 44 45 58 45 43 4E 4F 20 20
PROTS$, 2D1FH-2D3EH: the protection levels 0-7, four characters each, for the Prot column (2824H).
2D3F-2D4AMAXDAYS
DEFB 1FH, 1CH, 1FH, 1EH, 1FH, 1EH, 1FH, 1FH, 1EH, 1FH, 1EH, 1FH 1F 1C 1F 1E 1F 1E 1F 1F 1E 1F 1E 1F
MAXDAYS, 2D3FH-2D4AH: the days of the months January to December; February's 28 at 2D40H is raised by PAKDAT for a leap year and stays raised for the rest of the command, so the second date of a range is checked against it (B47).
2D4B-2D52HUNDTAB
DEFM "00255075" 30 30 32 35 35 30 37 35
HUNDTAB, 2D4BH-2D52H: the decimals .00, .25, .50 and .75 of a K, for 0-3 sectors over a whole K (2A61H).
2D53-2D65NOMEM$
DEFM "No memory for SORT" / DEFB 0DH 4E 6F 20 6D 65 6D 6F 72 79 20 66 6F 72 20 53 4F 52 54 0D
NOMEM$, 2D53H-2D65H: shown by NOMEM (240DH) when the sort buffer would pass HIGH$ less 33.
2D66-2D75BADFMT$
DEFM "Bad date format" / DEFB 0DH 42 61 64 20 64 61 74 65 20 66 6F 72 6D 61 74 0D
BADFMT$, 2D66H-2D75H: shown by BADFMT (2411H) for a DATE that PAKDAT cannot read.

2D76H - The Level 1D Patch and the Flags

6.3.1 added the AM/PM time (BIT 4 of IFLAG$); Level 1D moved its @FLAGS call into P631D1 and put PUSH IY and POP IY around it, so that Index Register IY still holds the DCT when an FXDE is read later (29F3H; before 1D it read the directory cylinder from 0073H). P631D2 only tests the bit and restores Index Register IY. Then the rest of the old month table, which nothing reads now, and the two flag bytes of DATE and the title.

2D76P631D1
DEC HL 2B
P631D1: decrement Register Pair HL from DIR+19 to DIR+18, the hours and the high bits of the minutes (Level 1D).
2D77
LD A,65H 3E 65
Load Register A with 65H, SVC 101, @FLAGS, which returns the flag table in Index Register IY.
2D79
RST 28H EF
Call @FLAGS with RST 28H: Index Register IY = 006AH, FLGTAB$ (NEWDT4 at 2918H has pushed the DCT).
2D7A
LD A,(HL) 7E
Load Register A with the byte at Register Pair HL, DIR+18.
2D7B
RET C9
Return to NEWDT4 (291DH) with Register A = DIR+18.
2D7CP631D2
BIT 4,(IY+08H) FD CB 08 66
P631D2: test bit 4 of the byte at Index Register IY+08H, IFLAG$ (0072H) bit 4, set for the 24 hour clock; the Z flag goes back to P631D3.
2D80
POP IY FD E1
Pop Index Register IY from the stack (Stack Pointer): the DCT of the drive again (pushed at 2918H).
2D82
Jump back to P631D3 at 294FH with the Z flag of the BIT.
2D85-2D99
DEFM "JunJulAugSepOctNovDec" 4A 75 6E 4A 75 6C 41 75 67 53 65 70 4F 63 74 4E 6F 76 44 65 63
2D85H-2D99H: June to December, seven names of DIR's old twelve month table; the Level 1D code at 2D76H-2D84H took the fifteen bytes of January to May, the code uses MONTBL$ at 04DCH in BOOT/SYS, and nothing reads these 21 bytes (the source keeps them to match the MISOSYS patch DIR1/FIX).
2D9AFTFLG
DEFB 00H 00
FTFLG, 2D9AH: the DATE flags, bit 7 a from date given (2EA7H), bit 0 a to date (2ECCH); read at 26D2H and 26E7H.
2D9BFILFLAG
DEFB 00H 00
FILFLAG, 2D9BH: not zero while the drive's title is still to be shown (257EH), cleared by MATCH (2740H).

2D9CH - DIR: the Start of the Command

Run once, then written over: from 2D9CH the bytes become DIRPTR, MAXMEM, the packed dates, the date being parsed, the partspec and the full format line, and from 2E00H the GAT, HIT and FXDE buffers. DIR checks BREAK, keeps the Stack Pointer, points its self-modified flag loads at YFLAG$ and KFLAG$, copies SFLAG$, reads the parameters, blanks the buffers and parses the drive and partspec.

2D9CDIR
LD A,6AH 3E 6A
DIR: load Register A with 6AH, SVC 106, @CKBRKC.
2D9E
RST 28H EF
Call @CKBRKC with RST 28H: the Z flag comes back set when BREAK was not pressed.
2D9F
If the Z flag is set (no BREAK) jump to DIRA at 2DA5H.
2DA1
LD HL,FFFFH 21 FF FF
BREAK was pressed: load Register Pair HL with FFFFH, the return code of an abort.
2DA4
RET C9
Return to SYS1/SYS with Register Pair HL = FFFFH, doing nothing.
2DA5DIRA
LD (242CH),SP ED 73 2C 24
DIRA: store the Stack Pointer into 242CH, the operand of SAVESP (242BH), for every exit.
2DA9
PUSH HL E5
Push Register Pair HL (the command text) onto the stack (Stack Pointer).
2DAA
LD A,65H 3E 65
Load Register A with 65H, SVC 101, @FLAGS, for the system flag table.
2DAC
RST 28H EF
Call @FLAGS with RST 28H: Index Register IY = 006AH, FLGTAB$.
2DAD
PUSH IY FD E5
Push Index Register IY onto the stack (Stack Pointer), to copy it to Register Pair DE.
2DAF
POP DE D1
Pop Register Pair DE from the stack (Stack Pointer): Register Pair DE = 006AH.
2DB0
LD HL,0018H 21 18 00
Load Register Pair HL with 0018H, the offset of YFLAG$ in the flag table.
2DB3
ADD HL,DE 19
Add Register Pair DE to Register Pair HL: Register Pair HL = 0082H, YFLAG$, a bit for each drive using the new style of dating.
2DB4
LD (2A82H),HL 22 82 2ALD (YFLAG1),HL
Store Register Pair HL (0082H) into 2A82H, the operand of the LD A at 2A81H in UNPACK.
2DB7
LD (28F5H),HL 22 F5 28LD (YFLAG2),HL
Store Register Pair HL (0082H) into 28F5H, the operand of the LD A at 28F4H in the full format's date.
2DBA
LD HL,000AH 21 0A 00LD HL,KFLAG$
Load Register Pair HL with 000AH, the offset of KFLAG$.
2DBD
ADD HL,DE 19
Add Register Pair DE to Register Pair HL: Register Pair HL = 0074H, KFLAG$ (BREAK, pause and ENTER bits).
2DBE
LD (2ACEH),HL 22 CE 2A
Store Register Pair HL (0074H) into 2ACEH, the operand of KFLAG (2ACDH) in CKPAWS.
2DC1
LD (2AE3H),HL 22 E3 2A
Store Register Pair HL (0074H) into 2AE3H, the operand of RESKFL (2AE2H).
2DC4
LD (2AE8H),HL 22 E8 2A
Store Register Pair HL (0074H) into 2AE8H, the operand of KFLAG1 (2AE7H).
2DC7
Call RESKFL at 2AE2H to clear the pause and ENTER bits of KFLAG$ (bits 1 and 2; the source says bits 0-2).
2DCA
POP HL E1
Pop Register Pair HL from the stack (Stack Pointer): the command text.
2DCB
LD A,(IY+12H) FD 7E 12
Load Register A with the byte at Index Register IY+12H, SFLAG$ (007CH): bit 5 set while a JCL (DO) file runs.
2DCE
LD (2AB2H),A 32 B2 2A
Store Register A into 2AB2H, the operand of SFLAG (2AB1H) in CKPAGE.
2DD1
PUSH HL E5
Push Register Pair HL (the command text) onto the stack (Stack Pointer).
2DD2FPLP
LD A,(HL) 7E
FPLP: load Register A with the character at Register Pair HL.
2DD3
CP 28H FE 28
Compare Register A with 28H, the opening parenthesis of the parameters.
2DD5
If the Z flag is set (parameters) jump to GETPRM at 2DDEH.
2DD7
CP 0DH FE 0D
Compare Register A with 0DH, the end of the line.
2DD9
If the Z flag is set (no parameters) jump to RESTPTR at 2DE4H with the Z flag set.
2DDB
INC HL 23
Increment Register Pair HL to the next character.
2DDC
Jump back to FPLP at 2DD2H until a parenthesis or the end of the line.
2DDEGETPRM
LD DE,2BF9H 11 F9 2BLD DE,PRMTBL$
GETPRM: load Register Pair DE with 2BF9H, PRMTBL$, DIR's parameter table.
2DE1
LD A,11H 3E 11
Load Register A with 11H, SVC 17, @PARAM, which reads a parameter list.
2DE3
RST 28H EF
Call @PARAM with RST 28H: the values into the operands the table names; NZ for an error in the list.
2DE4RESTPTR
POP HL E1
RESTPTR: pop Register Pair HL from the stack (Stack Pointer): the start of the command text again.
2DE5
If the Z flag is cleared (a parameter error) jump to IOERR at 241EH with the error in Register A.
2DE8
PUSH HL E5
Push Register Pair HL (the command text) onto the stack (Stack Pointer).
2DE9
LD HL,2DA7H 21 A7 2DLD HL,BLANKS
Load Register Pair HL with 2DA7H, BLANKS, the partspec, then the full format line PLEVEL (2DB4H).
2DEC
LD (HL),20H 36 20
Store 20H, a space, into the byte at Register Pair HL, 2DA7H.
2DEE
LD D,H 54
Load Register D with Register H, the high byte of 2DA7H.
2DEF
LD E,L 5D
Load Register E with Register L: Register Pair DE = 2DA7H.
2DF0
INC DE 13
Increment Register Pair DE to 2DA8H, one byte past Register Pair HL.
2DF1
LD BC,0044H 01 44 00
Load Register Pair BC with 0044H, 68 bytes to fill with the space.
2DF4
LDIR ED B0
Copy 68 bytes (Register Pair BC) from Register Pair HL to Register Pair DE: the space spreads over 2DA8H-2DEBH, over the code just run (the LDIR itself is past the end).
2DF6
LD A,03H 3E 03
Load Register A with 03H, the end of text byte that ends the full format line.
2DF8
LD (DE),A 12
Store Register A (03H) into the byte at Register Pair DE, 2DECH.
2DF9
LD A,2EH 3E 2E
Load Register A with 2EH, the decimal point of the size.
2DFB
LD (2DD0H),A 32 D0 2D
Store Register A into 2DD0H, between the K and the hundredths of the size field.
2DFE
LD A,4BH 3E 4B
Load Register A with 4BH, the letter K after the size's decimals.
2E00
LD (2DD3H),A 32 D3 2D
Store Register A into 2DD3H, after the hundredths.
2E03
POP HL E1
Pop Register Pair HL from the stack (Stack Pointer): the command text.
2E04
LD A,(HL) 7E
Load Register A with the first character of the command text at Register Pair HL.
2E05
CP 0DH FE 0D
Compare Register A with 0DH, the end of the line.
2E07
If the Z flag is set (nothing given) jump to DIR2 at 2E41H, which takes all drives, 0-7.
2E09
CP 38H FE 38
Compare Register A with 38H, the digit 8, which is not a drive.
2E0B
If the Z flag is set jump to ILLDRV at 2E11H: there is no drive 8.
2E0D
CP 39H FE 39
Compare Register A with 39H, the digit 9, which is not a drive.
2E0F
If the Z flag is cleared (not 9) jump to CKITOUT at 2E14H.
2E11ILLDRV
ILLDRV: jump to ERR32 at 241CH, Illegal drive number (also from 2E54H, 2E58H and 2EFDH).
2E14CKITOUT
PUSH HL E5
CKITOUT: push Register Pair HL (the command text) onto the stack (Stack Pointer).
2E15
Call CKDSPEC at 2EDDH: Z when the text is a drive number or range without a colon, with Register B = the first drive and Register C the last.
2E18
POP DE D1
Pop Register Pair DE from the stack (Stack Pointer): the start of the text.
2E19
If the Z flag is set (a drive or range) jump to DIR3 at 2E5AH.
2E1B
EX DE,HL EB
Exchange Register Pairs DE and HL: Register Pair HL = the start of the text again, for a partspec.
2E1C
LD A,(HL) 7E
Load Register A with the first character at Register Pair HL.
2E1D
INC HL 23
Increment Register Pair HL past the first character of the text.
2E1EDIR0
LD DE,2DA7H 11 A7 2DLD DE,BLANKS
DIR0: load Register Pair DE with 2DA7H, BLANKS, the name part of the partspec.
2E21
LD B,08H 06 08
Load Register B with 08H, the eight characters of a name.
2E23
CP 2DH FE 2D
Compare Register A with 2DH, the minus sign of a -partspec.
2E25
If the Z flag is cleared jump to DIR1 at 2E2CH.
2E27
LD (26C7H),A 32 C7 26
Store Register A (2DH) into 26C7H, the operand of MFLG (26C6H): the files that match are excluded.
2E2A
LD A,(HL) 7E
Load Register A with the next character at Register Pair HL.
2E2B
INC HL 23
Increment Register Pair HL past the character after the minus sign.
2E2CDIR1
DIR1: call PRSPC at 2F20H: the name part into 2DA7H, Register A = the character that ended it.
2E2F
CP 2FH FE 2F
Compare Register A with 2FH, the slash of an extension.
2E31
If the Z flag is set (a slash) jump to DIR1A at 2E37H for the extension.
2E33
CP 2EH FE 2E
Compare Register A with 2EH, the period, also taken as the separator.
2E35
If the Z flag is cleared jump to DIR2 at 2E41H.
2E37DIR1A
LD DE,2DAFH 11 AF 2D
DIR1A: load Register Pair DE with 2DAFH, the extension part of the partspec.
2E3A
LD B,03H 06 03
Load Register B with 03H, the three characters of an extension.
2E3C
LD A,(HL) 7E
Load Register A with the next character at Register Pair HL.
2E3D
INC HL 23
Increment Register Pair HL past the first character of the extension.
2E3E
Call PRSPC at 2F20H: the extension into 2DAFH, Register A = the character that ended it.
2E41DIR2
CP 3AH FE 3A
DIR2: compare Register A with 3AH, the colon of a drive specification.
2E43
LD BC,0007H 01 07 00
Load Register Pair BC with 0007H: Register B = 0, the first drive, Register C = 7, the last.
2E46
If the Z flag is set (a colon) jump to DIR2A at 2E51H.
2E48
CP 29H FE 29
Compare Register A with 29H: a space, the end of the line or an opening parenthesis is below it.
2E4A
If the Carry flag is set (the end of the specification) jump to DIR3 at 2E5AH with drives 0-7.
2E4C
LD A,13H 3E 13
Load Register A with 13H, error 19, Illegal file name.
2E4E
Jump to IOERR at 241EH with Register A = 13H, error 19.
2E51DIR2A
DIR2A: call CKDSPEC at 2EDDH: the drive or range after the colon.
2E54
If the Z flag is cleared (not a drive) jump to ILLDRV at 2E11H.
2E56
CP 08H FE 08
Compare Register A with 08H: for :8 (and :-8) LEGDRV1 returns with the Z flag set and Register A = 08H (CCF leaves the Z of CP 08H), so the JR NZ at 2E54H is not taken and only this test stops drive 8.
2E58
If the Z flag is set jump to ILLDRV at 2E11H.
2E5ADIR3
LD A,B 78
DIR3: load Register A with Register B, the first drive.
2E5B
LD (2ED4H),A 32 D4 2E
Store Register A into 2ED4H, the operand of DIR3A (2ED3H).
2E5E
SUB C 91
Subtract Register C, the last drive, from Register A: 00H when one drive is asked for.
2E5F
LD (263AH),A 32 3A 26
Store Register A into 263AH, the operand of SPECIF (2639H).
2E62
LD A,C 79
Load Register A with Register C, the last drive.
2E63
LD (262FH),A 32 2F 26
Store Register A into 262FH, the operand of TERMDRV (262EH).
2E66
BIT 1,(IY+02H) FD CB 02 4E
Test bit 1 of the byte at Index Register IY+02H, CFLAG$ (006CH) bit 1, set while a command runs through @CMNDR.
2E6A
LD HL,0000H 21 00 00
Load Register Pair HL with 0000H, the value of SORT=NO.
2E6D
If the Z flag is set (typed at the keyboard) jump to GETHI at 2E72H.
2E6F
LD (26FCH),HL 22 FC 26
Store Register Pair HL (0000H) into 26FCH, the operand of SORTPRM: a program's DIR is never sorted, so that the buffer at 3000H up, the program's memory, is not used (even with SORT given).
2E72GETHI
LD B,L 45
GETHI: load Register B with Register L (00H), the function of @HIGH$ that reads HIGH$.
2E73
LD A,64H 3E 64
Load Register A with 64H, SVC 100, @HIGH$, to read HIGH$.
2E75
RST 28H EF
Call @HIGH$ with RST 28H: Register Pair HL = HIGH$.
2E76
LD DE,FFDFH 11 DF FF
Load Register Pair DE with FFDFH, minus 33, to take off HIGH$.
2E79
ADD HL,DE 19
Add Register Pair DE to Register Pair HL: HIGH$ less 33, room for one more entry copied before the test.
2E7A
LD (2D9EH),HL 22 9E 2DLD (MAXMEM),HL
Store Register Pair HL into 2D9EH, MAXMEM, the limit of the sort buffer.
2E7D
LD HL,(2A2AH) 2A 2A 2A
Load Register Pair HL with the word at 2A2AH, the P parameter's value.
2E80
LD A,H 7C
Load Register A with Register H, the high byte of the P value.
2E81
OR L B5
OR Register L into Register A: not zero with P.
2E82
If the Z flag is set (no P) jump to GTDATE at 2E87H.
2E84
LD (2AACH),HL 22 AC 2A
Store Register Pair HL (the P value) into 2AACH, the operand of NPARM: P implies N.
2E87GTDATE
LD A,(2C1CH) 3A 1C 2CLD A,(DRESP)
GTDATE: load Register A with the byte at 2C1CH, DRESP, the response byte of DATE.
2E8A
OR A B7
OR Register A with itself to test the response byte of DATE for zero.
2E8B
If the Z flag is set (no DATE) jump to DIR3A at 2ED3H.
2E8DDATPRM
LD HL,0000H 21 00 00
DATPRM: load Register Pair HL with 0000H, the operand at 2E8EH, the value of DATE: a flag value, or the address of the string.
2E90
BIT 6,A CB 77
Test bit 6 of Register A, the response's flag bit.
2E92
If the Z flag is set (a string, or a number taken as a string's address) jump to CHKSTR at 2EA0H.
2E94
LD A,H 7C
Load Register A with Register H, the high byte of the DATE flag value.
2E95
OR L B5
OR Register L into Register A: zero for DATE=NO.
2E96
If the Z flag is set jump to DIR3A at 2ED3H: no date selection.
2E98
LD HL,2D16H 21 16 2DLD HL,TDATE
DATE alone (or DATE=YES): load Register Pair HL with 2D16H, TDATE, for today's date.
2E9B
PUSH HL E5
Push Register Pair HL (2D16H) onto the stack (Stack Pointer).
2E9C
LD A,12H 3E 12
Load Register A with 12H, SVC 18, @DATE, which writes the date as mm/dd/yy at Register Pair HL.
2E9E
RST 28H EF
Call @DATE with RST 28H: today's date into 2D16H-2D1DH, before the quotation mark at 2D1EH.
2E9F
POP HL E1
Pop Register Pair HL from the stack (Stack Pointer): 2D16H, read as if the user had typed today's date.
2EA0CHKSTR
LD A,(HL) 7E
CHKSTR: load Register A with the first character of the date at Register Pair HL.
2EA1
CP 2DH FE 2D
Compare Register A with 2DH, the minus sign of -M1/D1/Y1.
2EA3
If the Z flag is set (only a to date) jump to CKTO at 2EBAH.
2EA5
LD A,80H 3E 80
Load Register A with 80H, the from bit of FTFLG, bit 7.
2EA7
LD (2D9AH),A 32 9A 2DLD (FTFLG),A
Store Register A into 2D9AH, FTFLG: a from date is given.
2EAA
Call PAKDAT at 2F4CH: the date at Register Pair HL packed into Register Pair BC.
2EAD
LD (2DA0H),BC ED 43 A0 2DLD (FMPAKD),BC
Store Register Pair BC into 2DA0H, FMPAKD, the from date.
2EB1
LD A,(HL) 7E
Load Register A with the character after the date at Register Pair HL.
2EB2
CP 22H FE 22
Compare Register A with 22H, the closing quotation mark.
2EB4
If the Z flag is set (one date: that day only) jump to FRCTO at 2EC7H, making the same date the to date.
2EB6
CP 2DH FE 2D
Compare Register A with 2DH, the minus sign of a range.
2EB8
If the Z flag is cleared jump to DIR3A at 2ED3H: anything else after the date is passed over, and the date is a from date only.
2EBACKTO
INC HL 23
CKTO: increment Register Pair HL past the minus sign.
2EBB
LD A,(HL) 7E
Load Register A with the next character at Register Pair HL.
2EBC
CP 22H FE 22
Compare Register A with 22H, the closing quotation mark.
2EBE
If the Z flag is set (M1/D1/Y1- : no to date) jump to DIR3A at 2ED3H.
2EC0
CP 0DH FE 0D
Compare Register A with 0DH, the end of the line.
2EC2
If the Z flag is set (the end of the line) jump to DIR3A at 2ED3H.
2EC4
Call PAKDAT at 2F4CH: the to date packed into Register Pair BC.
2EC7FRCTO
LD A,(2D9AH) 3A 9A 2DLD A,(FTFLG)
FRCTO: load Register A with the byte at 2D9AH, FTFLG.
2ECA
OR 01H F6 01
OR Register A with 01H, the to bit of FTFLG, bit 0.
2ECC
LD (2D9AH),A 32 9A 2DLD (FTFLG),A
Store Register A into 2D9AH, FTFLG, with the to bit set.
2ECF
LD (2DA2H),BC ED 43 A2 2DLD (TOPAKD),BC
Store Register Pair BC into 2DA2H, TOPAKD, the to date.
2ED3DIR3A
LD C,00H 0E 00
DIR3A: load Register C with 00H, the operand at 2ED4H, the first drive (stored at 2E5BH).
2ED5
LD A,16H 3E 16
Load Register A with 16H, the 22 lines of the first screen.
2ED7
LD (2AA0H),A 32 A0 2A
Store Register A into 2AA0H, the operand of CKPAGE (2A9FH).
2EDA
Jump to DIR4 at 2432H to show the first drive.

2EDDH - CKDSPEC, PRSPC, PAKDAT: Drives, Names and Dates

CKDSPEC reads d, d1-d2, d1- or -d2 (drives 0-7) and returns Z with Register B = the first drive and Register C the last, or NZ when the text is not a drive specification; PRSPC copies a name or extension into the partspec, in capitals, with an asterisk turned into dollar signs; PAKDAT reads mm/dd/yy and packs it like UNPACK.

2EDDCKDSPEC
LD A,(HL) 7E
CKDSPEC: load Register A with the character at Register Pair HL.
2EDE
CP 2DH FE 2D
Compare Register A with 2DH: a leading minus sign is the -d2 of a range or the minus of a -partspec.
2EE0
If the Z flag is cleared jump to NOTDASH at 2EEEH.
2EE2
Call LEGDRV at 2F18H: the next character as a drive number; Carry set when it is not 0-7.
2EE5
RET C D8
If the Carry flag is set return: NZ for a -partspec, but Z for -8, whose 8 sets the Z flag in LEGDRV1, so that DIR -8 is taken as drive 0 with the B and C left 00H by the LDIR at 2DF4H (B49).
2EE6
LD C,A 4F
Load Register C with Register A, the last drive of the range.
2EE7
INC HL 23
Increment Register Pair HL past the digit of the last drive.
2EE8
Call TERM at 2F01H: Z when a space, the end of the line or a parenthesis follows.
2EEB
LD B,00H 06 00
Load Register B with 00H, the first drive of -d2 (the flags stay).
2EED
RET C9
Return Z for a good range 0-d2, NZ otherwise.
2EEENOTDASH
NOTDASH: call LEGDRV1 at 2F19H: the character at Register Pair HL as a drive number.
2EF1
RET C D8
If the Carry flag is set (not 0-7) return: NZ for a partspec, but Z with Register A = 08H for the digit 8 (reached through the colon at 2E51H; DIR2A's test at 2E56H catches it).
2EF2
LD B,A 47
Load Register B with Register A, the first drive.
2EF3
LD C,A 4F
Load Register C with Register A: the last drive too, for one drive.
2EF4
INC HL 23
Increment Register Pair HL past the digit of the first drive.
2EF5
LD A,(HL) 7E
Load Register A with the next character at Register Pair HL.
2EF6
CP 2DH FE 2D
Compare Register A with 2DH, the minus sign of d1-d2 or d1-.
2EF8
If the Z flag is set (a range) jump to CKTDRIV at 2F0BH.
2EFA
Call TERM at 2F01H: Z when a space, the end of the line or a parenthesis follows.
2EFD
If the Z flag is cleared (a digit followed by anything else) jump to ILLDRV at 2E11H: a partspec cannot begin with a digit.
2F00
RET C9
Return Z with Register B = Register C = the drive.
2F01TERM
LD A,(HL) 7E
TERM: load Register A with the character at Register Pair HL.
2F02
CP 20H FE 20
Compare Register A with 20H, a space, which may end a drive number.
2F04
RET Z C8
If the Z flag is set (a space) return with the Z flag set.
2F05
CP 0DH FE 0D
Compare Register A with 0DH, the end of the line.
2F07
RET Z C8
If the Z flag is set (the end of the line) return with the Z flag set.
2F08
CP 28H FE 28
Compare Register A with 28H, the parenthesis of the parameters.
2F0A
RET C9
Return Z for a parenthesis, NZ for anything else.
2F0BCKTDRIV
CKTDRIV: call LEGDRV at 2F18H: the character after the minus sign as a drive number.
2F0E
LD C,07H 0E 07
Load Register C with 07H, the last drive when d1- has no second drive (the flags stay).
2F10
If the Carry flag is set (no digit) jump to TERM at 2F01H, which returns Z or NZ.
2F12
LD C,A 4F
Load Register C with Register A, the last drive.
2F13
CP B B8
Compare Register A with Register B, the first drive.
2F14
RET C D8
If the Carry flag is set (the last below the first) return NZ.
2F15
INC HL 23
Increment Register Pair HL past the digit of the last drive.
2F16
Jump to TERM at 2F01H, which returns Z or NZ.
2F18LEGDRV
INC HL 23
LEGDRV: increment Register Pair HL to the next character.
2F19LEGDRV1
LD A,(HL) 7E
LEGDRV1: load Register A with the character at Register Pair HL.
2F1A
SUB 30H D6 30
Subtract 30H from Register A: a digit becomes 0-9.
2F1C
CP 08H FE 08
Compare Register A with 08H: Carry set for 0-7.
2F1E
CCF 3F
Complement the Carry flag: Carry set for anything that is not a drive 0-7, with the Z flag of the compare (NZ but for 8).
2F1F
RET C9
Return with Register A = the drive and the Carry flag cleared for a good one.
2F20PRSPC
CP 2AH FE 2A
PRSPC: compare Register A with 2AH, the asterisk.
2F22
If the Z flag is cleared jump to PS4 at 2F2DH.
2F24
LD A,24H 3E 24
Load Register A with 24H, the dollar sign, the wild card character.
2F26PS5
LD (DE),A 12
PS5: store Register A (a dollar sign) into the partspec at Register Pair DE.
2F27
INC DE 13
Increment Register Pair DE to the next character of the partspec.
2F28
Decrement Register B and loop to PS5 at 2F26H: the rest of the field matches anything.
2F2A
LD A,(HL) 7E
Load Register A with the next character at Register Pair HL.
2F2B
INC HL 23
Increment Register Pair HL past the character after the asterisk.
2F2C
RET C9
Return with Register A = the character after the asterisk.
2F2DPS4
CP 24H FE 24
PS4: compare Register A with 24H, the dollar sign.
2F2F
If the Z flag is set (a wild card) jump to PS2 at 2F45H and store it.
2F31
CP 41H FE 41
Compare Register A with 41H, the letter A, the first letter.
2F33
If the Carry flag is cleared (41H or above) jump to PS1 at 2F3BH.
2F35
CP 3AH FE 3A
Compare Register A with 3AH, one above the digit 9.
2F37
RET NC D0
If the Carry flag is cleared (3AH-40H, punctuation) return: the field ends.
2F38
CP 30H FE 30
Compare Register A with 30H, the digit 0, the first digit.
2F3A
RET C D8
If the Carry flag is set (below 30H) return: the field ends.
2F3BPS1
CP 61H FE 61
PS1: compare Register A with 61H, the letter a.
2F3D
If the Carry flag is set (41H-60H, capitals and the signs after Z) jump to PS2 at 2F45H.
2F3F
CP 7BH FE 7B
Compare Register A with 7BH, one above the letter z.
2F41
If the Carry flag is cleared (7BH and above, stored as they are) jump to PS2 at 2F45H.
2F43
RES 5,A CB AF
Reset bit 5 of Register A: a small letter becomes a capital.
2F45PS2
LD (DE),A 12
PS2: store Register A into the partspec at Register Pair DE.
2F46PS3
INC DE 13
PS3: increment Register Pair DE to the next character of the partspec.
2F47
LD A,(HL) 7E
Load Register A with the next character at Register Pair HL.
2F48
INC HL 23
Increment Register Pair HL past the character just loaded.
2F49
Decrement Register B and loop to PRSPC at 2F20H for the length of the field.
2F4B
RET C9
Return with Register A = the character after the field (a ninth letter of a name gives error 19 at 2E4CH).
2F4CPAKDAT
LD A,(HL) 7E
PAKDAT: load Register A with the character at Register Pair HL.
2F4D
LD C,2FH 0E 2F
Load Register C with 2FH, the slash between the parts of the date.
2F4F
Call PARSDAT at 2F9DH: month, day and year into 2DA6H, 2DA5H and 2DA4H (LILBUF$).
2F52
If the Z flag is cleared (not two digits and slashes) jump to BADFMT at 2411H.
2F55
LD A,(DE) 1A
Load Register A with the year at Register Pair DE, 2DA4H (6.3.1).
2F56
CP 0CH FE 0C
Compare Register A with 0CH (12): Carry set for the years 00-11.
2F58
If the Carry flag is cleared jump to L2F5D at 2F5DH.
2F5A
ADD A,64H C6 64
Add 64H (100) to Register A: years 00-11 are 2000-2011.
2F5C
LD (DE),A 12
Store Register A, the year less 1900, back into 2DA4H at Register Pair DE.
2F5DL2F5D
EX DE,HL EB
L2F5D: exchange Register Pairs DE and HL: Register Pair DE = the text after the date, Register Pair HL = 2DA4H.
2F5E
AND 03H E6 03
AND Register A with 03H: zero for a leap year (every fourth, 2000 too).
2F60
LD HL,2D40H 21 40 2D
Load Register Pair HL with 2D40H, February in MAXDAYS (the flags stay).
2F63
If the Z flag is cleared (not a leap year) jump to NOTLEAP at 2F66H.
2F65
INC (HL) 34
Increment February's days at Register Pair HL to 29; nothing sets them back during the command, so the second date of a range whose first year is a leap year gets 29 or 30 (B47).
2F66NOTLEAP
LD A,(2DA6H) 3A A6 2D
NOTLEAP: load Register A with the byte at 2DA6H, the month.
2F69
DEC A 3D
Decrement Register A: the month less one, 0-11 for a good month.
2F6A
CP 0CH FE 0C
Compare Register A with 0CH (12): Carry set for a month 1-12.
2F6C
If the Carry flag is cleared (month 0 or above 12) jump to BADFMT at 2411H.
2F6F
DEC HL 2B
Decrement Register Pair HL to 2D3FH, January in MAXDAYS.
2F70
ADD A,L 85
Add Register L to Register A: the low byte of the month's entry.
2F71
LD L,A 6F
Load Register L with Register A: Register Pair HL = the month's days.
2F72
If the Carry flag is cleared jump to NOINC at 2F75H.
2F74
INC H 24
Increment Register H, the carry into the high byte of the pointer.
2F75NOINC
LD A,(2DA5H) 3A A5 2D
NOINC: load Register A with the byte at 2DA5H, the day.
2F78
DEC A 3D
Decrement Register A, the day: day 0 becomes FFH and fails the test.
2F79
CP (HL) BE
Compare Register A with the month's days at Register Pair HL.
2F7A
If the Carry flag is cleared (day 0 or past the month) jump to BADFMT at 2411H.
2F7D
LD HL,2DA6H 21 A6 2D
Load Register Pair HL with 2DA6H, the month, to pack the date.
2F80
LD B,(HL) 46
Load Register B with the month at Register Pair HL.
2F81
LD C,00H 0E 00
Load Register C with 00H, the low byte of the date word to come.
2F83
SRL B CB 38
Shift Register B right: bits 3-1 of the month into bits 2-0, bit 0 into the Carry flag.
2F85
RR C CB 19
Rotate Register C right, taking the month's bit 0 into bit 7.
2F87
DEC HL 2B
Decrement Register Pair HL to 2DA5H, the day.
2F88
LD A,(HL) 7E
Load Register A with the day at Register Pair HL.
2F89
DEC HL 2B
Decrement Register Pair HL to 2DA4H, the year.
2F8A
RLCA 07
Rotate Register A left, the day: the first of two rotates.
2F8B
RLCA 07
Rotate Register A left again: the day in bits 6-2.
2F8C
OR C B1
OR Register C into Register A, the month's bit 0 in bit 7.
2F8D
LD C,A 4F
Load Register C with Register A: the low byte of the date word.
2F8E
LD A,(HL) 7E
Load Register A with the year at Register Pair HL, the year less 1900.
2F8F
SUB 50H D6 50
Subtract 50H (80) from Register A: the year less 1980.
2F91
CP 70H FE 70
Compare Register A with 70H (6.3.1): Carry set for a year from 1980 on.
2F93
If the Carry flag is set (1980-2011) jump to GDATE at 2F96H.
2F95
XOR A AF
Load Register A with 00H by XOR: a year 12-79 is taken as 1980, with no error.
2F96GDATE
RLCA 07
GDATE: rotate Register A left, the first of three rotates of the year.
2F97
RLCA 07
Rotate Register A left again, the second of three rotates.
2F98
RLCA 07
Rotate Register A left a third time: the year in bits 7-3.
2F99
OR B B0
OR Register B into Register A, the high bits of the month.
2F9A
LD B,A 47
Load Register B with Register A: Register Pair BC = the packed date.
2F9B
EX DE,HL EB
Exchange Register Pairs DE and HL: Register Pair HL = the text after the date.
2F9C
RET C9
Return with Register Pair BC = the packed date of the text.
2F9DPARSDAT
LD DE,2DA6H 11 A6 2D
PARSDAT: load Register Pair DE with 2DA6H, the last byte of LILBUF$: the fields are stored from the end, month first.
2FA0
LD B,03H 06 03
Load Register B with 03H, three fields: month, day and year.
2FA2PRS1
PUSH DE D5
PRS1: push Register Pair DE onto the stack (Stack Pointer).
2FA3
Call PRS2 at 2FB2H: two digits at Register Pair HL as a number in Register A.
2FA6
POP DE D1
Pop Register Pair DE from the stack (Stack Pointer).
2FA7
RET NZ C0
If the Z flag is cleared (not two digits) return NZ.
2FA8
LD (DE),A 12
Store Register A (the number) into the byte at Register Pair DE.
2FA9
DEC B 05
Decrement Register B, the fields left (6.3.1).
2FAA
RET Z C8
If the Z flag is set (three done) return Z, Register Pair DE at 2DA4H, the year.
2FAB
DEC DE 1B
Decrement Register Pair DE to the next field (6.3.1).
2FAC
LD A,(HL) 7E
Load Register A with the separator at Register Pair HL.
2FAD
INC HL 23
Increment Register Pair HL past the separator character.
2FAE
CP C B9
Compare Register A with Register C, the slash.
2FAF
If the Z flag is set jump back to PRS1 at 2FA2H for the next field.
2FB1
RET C9
Return with the Z flag cleared: a wrong separator between the fields.
2FB2PRS2
PRS2: call PRS4 at 2FC8H: the next character as a digit, Carry set when it is one.
2FB5
If the Carry flag is cleared (not a digit) jump to PRS3 at 2FC6H.
2FB7
LD E,A 5F
Load Register E with Register A, the tens digit's value.
2FB8
RLCA 07
Rotate Register A left: Register A = the tens digit times 2.
2FB9
RLCA 07
Rotate Register A left: Register A = the tens digit times 4.
2FBA
ADD A,E 83
Add Register E to Register A: Register A = the tens digit times 5.
2FBB
RLCA 07
Rotate Register A left: Register A = the tens digit times 10.
2FBC
LD E,A 5F
Load Register E with Register A, the tens digit times 10.
2FBD
Call PRS4 at 2FC8H: the units digit, Carry set when it is one.
2FC0
If the Carry flag is cleared (not a digit) jump to PRS3 at 2FC6H.
2FC2
ADD A,E 83
Add Register E to Register A: the two digit number.
2FC3
LD E,A 5F
Load Register E with Register A, the number of the two digits.
2FC4
CP A BF
Compare Register A with itself, setting the Z flag.
2FC5
RET C9
Return with the Z flag set and Register A = the two digit number.
2FC6PRS3
OR A B7
PRS3: OR Register A with itself: NZ for the error (Register A is not zero: no digit gives 0AH or more).
2FC7
RET C9
Return with the Z flag cleared: the field is not two digits.
2FC8PRS4
LD A,(HL) 7E
PRS4: load Register A with the character at Register Pair HL.
2FC9
INC HL 23
Increment Register Pair HL past the character just loaded.
2FCA
SUB 30H D6 30
Subtract 30H from Register A, the digit's value.
2FCC
CP 0AH FE 0A
Compare Register A with 0AH: Carry set for 0-9.
2FCE
RET C9
Return with the Carry flag set for a digit, cleared for anything else.

2400H - Member 3 (COPY and APPEND): Entry Points and Exits

SYS1/SYS runs COPY with request 32H and APPEND with request 31H; both headers point at member 3, which the overlay loader reads to 2400H-2C03H, 2C43H-2C46H and 2C57H. COPY enters at 2400H, APPEND at 2403H. Both keep the Stack Pointer they were entered with in SAVESP, so that every exit can drop whatever is still pushed. EXIT returns 0000H, IOERR shows a DOS error through @ERROR and returns its number, the message exits show a line of their own, close the destination if it is open and return FFFFH, as ABORT does after BREAK.

2400COPY
COPY: COPY's entry, jump to COPYST at 24F4H, which saves the Stack Pointer, tests BREAK and runs COPYCD at 2504H.
2403APPEND
LD (2423H),SP ED 73 23 24
APPEND: APPEND's entry, store the Stack Pointer into 2423H, the operand of the LD SP at SAVESP (2422H): every way out of COPY and APPEND goes through SAVESP and returns from this depth. A 6.3.1 change, marked 631 in the source: 6.3.0 stored it after the BREAK test (APPENDA) and returned FFFFH itself on BREAK.
2407
LD A,6AH 3E 6A
Load Register A with 6AH, SVC 106, @CKBRKC, which tests and clears the BREAK key.
2409
RST 28H EF
Call @CKBRKC with RST 28H: NZ when BREAK was pressed before APPEND began.
240A
If BREAK was pressed (NZ), jump to ABORT at 2449H to return FFFFH without doing anything.
240C
Call APCODE at 244EH, the APPEND command itself. It never comes back here: every way out of it (GOHOME 26E6H, IOERR, ABORT) jumps to SAVESP, which drops this return address.
240FEXIT
LD HL,0000H 21 00 00
EXIT: load Register Pair HL with 0000H, the return code of a command that worked; reached only after a return from APCODE or COPYCD (2501H), which never happens, since GOHOME (26E9H) sets the return code itself.
2412
Jump to SAVESP at 2422H to restore the Stack Pointer, clear BREAK and return with Register Pair HL = 0000H.
2414IOERR
PUSH AF F5
IOERR: push Register Pair AF onto the stack (Stack Pointer): Register A holds the error number of the failed SVC, which every error path of COPY and APPEND brings here.
2415
Call PMTSYS at 2966H, which with the X parameter on drive 0 asks for the system diskette, so that @ERROR can read SYS4/SYS.
2418
POP AF F1
Pop Register Pair AF from the stack (Stack Pointer): Register A = the error number again.
2419
LD L,A 6F
Load Register L with Register A, the error number, the low byte of the return code.
241A
LD H,00H 26 00
Load Register H with 00H: Register Pair HL = the error number, returned to the caller.
241C
OR C0H F6 C0
OR Register A with C0H: bit 7 tells @ERROR to return to the caller instead of aborting, bit 6 asks for the short message.
241E
LD C,A 4F
Load Register C with Register A, the error number with bits 7 and 6 set, the form @ERROR takes.
241F
LD A,1AH 3E 1A
Load Register A with 1AH, SVC 26, @ERROR, which shows the message of the error in Register C.
2421
RST 28H EF
Call @ERROR with RST 28H to show the error message, then fall into SAVESP with Register Pair HL = the error number.
2422SAVESP
LD SP,0000H 31 00 00
SAVESP: load the Stack Pointer with 0000H, the operand at 2423H that the entries store (2403H, 24F4H): the Stack Pointer of the entry, dropping whatever an error path left pushed.
2425
LD A,6AH 3E 6A
Load Register A with 6AH, SVC 106, @CKBRKC, to clear a BREAK that is still noted.
2427
RST 28H EF
Call @CKBRKC with RST 28H, so that a BREAK pressed during the command does not also stop what runs next.
2428
RET C9
Return with Register Pair HL = 0000H, FFFFH or the error number, through RST28's tail: to @EXIT (1B0BH, which CLEANUP put on the stack) for a typed command, or to the program that sent it through @CMNDR.
2429SAMERR
LD HL,2B19H 21 19 2BLD HL,SAMERR$
SAMERR: load Register Pair HL with 2B19H, SAMERR$, the message Source and destination disks are the same, for COPY (X) when the two diskettes have the same name, date and master password (25EFH).
242C
DEFB 0DDH DD
242CH: DDH, the IX prefix: with it the LD HL,2ADFH that follows runs as LD IX,2ADFH, so SAMERR keeps its Register Pair HL; the same trick follows each message below.
242DSPCREQ
LD HL,2ADFH 21 DF 2ALD HL,SPCREQ$
SPCREQ: load Register Pair HL with 2ADFH, SPCREQ$, the message File spec required, for a source that is not a file or device specification, or a device in COPY (X) or as APPEND's destination.
2430
DEFB 0DDH DD
2430H: DDH, the IX prefix: the LD HL,2AF2H that follows runs as LD IX,2AF2H, and Register Pair HL keeps the message chosen above it.
2431NOINDO
LD HL,2AF2H 21 F2 2ALD HL,NOINDO$
NOINDO: load Register Pair HL with 2AF2H, NOINDO$, the message Invalid command during <DO> processing, for COPY (X) while a JCL file runs (253BH).
2434
DEFB 0DDH DD
2434H: DDH, the IX prefix: the LD HL,2A99H that follows runs as LD IX,2A99H, and Register Pair HL keeps the message chosen above it.
2435DIFLRL
LD HL,2A99H 21 99 2ALD HL,DIFLRL$
DIFLRL: load Register Pair HL with 2A99H, DIFLRL$, the message Files have different LRLs, when APPEND finds the two files with different record lengths (24A5H).
2438
DEFB 0DDH DD
2438H: DDH, the IX prefix: the LD HL,2AB3H that follows runs as LD IX,2AB3H, and Register Pair HL keeps the message chosen above it.
2439DSTREQ
LD HL,2AB3H 21 B3 2ALD HL,DSTREQ$
DSTREQ: load Register Pair HL with 2AB3H, DSTREQ$, the message Destination spec required, for no destination, one that begins with a digit (279DH, 27A6H), or a destination that is the source file itself (2624H).
243C
LD A,0CH 3E 0C
Load Register A with 0CH, SVC 12, @LOGOT, which shows a line and writes it to the job log.
243E
RST 28H EF
Call @LOGOT with RST 28H to show the message at Register Pair HL, ended by its carriage return.
243F
LD DE,2C03H 11 03 2CLD DE,FCB2
Load Register Pair DE with 2C03H, FCB2, the destination's FCB, which may already be open when the error is found.
2442
LD A,(DE) 1A
Load Register A with the byte at Register Pair DE, FCB2+0: bit 7 is set for an open file; for a text it is a character.
2443
RLCA 07
Rotate Register A left: bit 7, the open bit, goes into the Carry flag.
2444
If the destination is not open (No Carry), jump to ABORT at 2449H.
2446
LD A,3CH 3E 3C
Load Register A with 3CH, SVC 60, @CLOSE, to close the destination file that is open.
2448
RST 28H EF
Call @CLOSE with RST 28H to close FCB2 at Register Pair DE; its result is not looked at.
2449ABORT
LD HL,FFFFH 21 FF FF
ABORT: load Register Pair HL with FFFFH, the return code of a command that has given its own message or was stopped with BREAK (240AH, 24FBH, 2444H, 29F0H and 2A31H come here).
244C
Jump to SAVESP at 2422H with Register Pair HL = FFFFH, to restore the Stack Pointer and return.

244EH - APCODE: the APPEND Command

APPEND takes a source (a file or a device) and a destination file, with the parameters STRIP and ECHO. It turns CLONE off and marks the messages as Appending, reads both specifications (a destination that is not a full file specification is copied as text and completed from the source by PRSPC, as in COPY), opens the destination and then the source, both with an LRL of 256, and compares the record lengths of two files from their directory entries. A device as the source, STRIP, or a destination whose end of file is inside a sector goes byte by byte through BYTIO0 (272EH); otherwise whole sectors are copied by the memory loop of COPY (263AH) after the end of the destination.

244EAPCODE
XOR A AF
APCODE: clear Register A to 00H, the value that turns CLONE off and selects the APPEND message.
244F
LD (26A9H),A 32 A9 26
Store Register A (00H) into 26A9H, the low byte of the operand of CPARM's LD DE (26A8H), which holds FFFFH in the file: CLONE on is COPY's default.
2452
LD (26AAH),A 32 AA 26
Store Register A (00H) into 26AAH, the high byte of CPARM's operand: Register Pair DE there will be 0000H, CLONE off, so APPEND never copies a directory entry.
2455
LD (28B2H),A 32 B2 28
Store Register A (00H) into 28B2H, the operand of the LD A at APPFLAG (28B1H): CPYFILE shows Appending: instead of Copying:.
2458
Call DOINIT at 2905H to note where YFLAG$ is, set the top of the memory buffer from HIGH$ (or LOW$) and find the system buffer's page.
245B
LD DE,2C57H 11 57 2CLD DE,FCB1
Load Register Pair DE with 2C57H, FCB1, the FCB of the source (file 1).
245E
LD A,4EH 3E 4E
Load Register A with 4EH, SVC 78, @FSPEC, which copies a file or device specification from the command line to an FCB.
2460
RST 28H EF
Call @FSPEC with RST 28H: Register Pair HL from the command text, the specification into FCB1 at Register Pair DE; Z when it is valid.
2461
If the source is not a valid specification (NZ), jump to SPCREQ at 242DH: File spec required.
2464
LD DE,2C03H 11 03 2CLD DE,FCB2
Load Register Pair DE with 2C03H, FCB2, the FCB of the destination (file 2).
2467
LD A,4EH 3E 4E
Load Register A with 4EH, SVC 78, @FSPEC, to read the destination after the source.
2469
RST 28H EF
Call @FSPEC with RST 28H: Register Pair HL at the destination text, FCB2 at Register Pair DE; NZ when it is not a full specification.
246A
If it is not (NZ), call CVRTUC at 276AH to copy the destination as typed (a partspec such as :1 or /TXT) into FCB2 in capitals, up to the parameters.
246DAPND1
LD A,(2C03H) 3A 03 2CLD A,(FCB2)
APND1: load Register A with 2C03H, FCB2+0, the first character of the destination.
2470
CP 2AH FE 2A
Compare Register A with 2AH, the asterisk that starts a device specification.
2472
If the destination is a device (Z), jump to SPCREQ at 242DH: APPEND needs a file to append to.
2475
LD DE,2BD1H 11 D1 2BLD DE,APPTBL
Load Register Pair DE with 2BD1H, APPTBL, the parameter table of APPEND: STRIP and ECHO.
2478
LD A,11H 3E 11
Load Register A with 11H, SVC 17, @PARAM, which reads the parameter list in parentheses.
247A
RST 28H EF
Call @PARAM with RST 28H: Register Pair HL at the rest of the line, the table at Register Pair DE; the values go into SPARM+1 (24ACH) and EPARM+1 (2762H).
247B
If the parameters cannot be read (NZ, Register A = 2CH, error 44), jump to IOERR at 2414H.
247E
Call PRSPC at 2794H, which refuses a missing destination and fills in the destination's name, extension and password from the source where they are not given; it returns Register Pair DE = 2C03H.
2481
Call OPENSR2 at 2A75H: @OPEN of the destination FCB2 at Register Pair DE with the buffer 2E00H and an LRL of 256 (error 42 is accepted), with the protection check of a source (B51).
2484
Call PUTDEST at 289BH to copy the destination's name, as DOSVC made it in TEMBUF, to TO2 (2C47H) for the Appending line.
2487
Call GETLRL at 28D0H: Register A = the LRL of the destination, DIR+4 of its entry, still in the system buffer after the open.
248A
LD (24A3H),A 32 A3 24
Store Register A (the destination's LRL) into 24A3H, the operand of the LD B at LRL2 (24A2H), for the comparison with the source.
248D
LD (26A6H),A 32 A6 26
Store Register A into 26A6H, the operand of the LD (HL) at GEOF1 (26A5H): the LRL written back into the entry if the sector loop ends at GOTEOF.
2490
Call OPENSRC at 2A6BH: @OPEN of the source FCB1 with the buffer 2E00H, LRL 256, and SFLAG$ bit 0 set so that SYS2 makes no open and LRL checks.
2493
Call PUTSOUR at 2895H to copy the source's name from TEMBUF to FROM (2C33H) for the Appending line.
2496
EX DE,HL EB
Exchange Register Pairs DE and HL: Register Pair HL = 2C57H, FCB1, for the BIT that follows.
2497
BIT 7,(HL) CB 7E
Test bit 7 of the byte at Register Pair HL, FCB1+0: set for an open file, clear for a device (DEVOPEN leaves 10H).
2499
EX DE,HL EB
Exchange Register Pairs DE and HL back: Register Pair DE = FCB1 again; the Z flag of the BIT is kept.
249A
If the source is a device (Z), call CPYFILE at 28ACH to show Appending: source to destination; it returns with the Z flag set.
249D
If the source is a device (Z), jump to APND2 at 24B8H: a device has no LRL, and its bytes are taken one at a time.
249F
Call GETLRL at 28D0H: Register A = the LRL of the source, DIR+4 of its entry in the system buffer.
24A2LRL2
LD B,00H 06 00
LRL2: load Register B with 00H, the operand at 24A3H that 248AH set to the destination's LRL.
24A4
XOR B A8
Exclusive OR Register A (the source's LRL) with Register B (the destination's): Z when they are the same.
24A5
If the record lengths differ (NZ), jump to DIFLRL at 2435H: Files have different LRLs, and the destination is closed untouched.
24A8
Call CPYFILE at 28ACH to show Appending: source to destination.
24ABSPARM
LD DE,0000H 11 00 00
SPARM: load Register Pair DE with 0000H, the operand at 24ACH that @PARAM sets to FFFFH for STRIP (STRIP=NO or none leaves 0000H).
24AE
LD A,D 7A
Load Register A with Register D, the high byte of the STRIP value.
24AF
OR E B3
OR Register E into Register A: Z when STRIP was not given.
24B0
If STRIP was given (NZ), jump to APND2 at 24B8H: the last byte of the destination is to be written over, so the bytes go one at a time.
24B2
LD A,(2C0BH) 3A 0B 2C
Load Register A with 2C0BH, FCB2+8, the end of file offset of the destination.
24B5
OR A B7
OR Register A with itself: Z when the destination ends on a sector boundary.
24B6
If it does (Z), jump to APND3 at 24D7H to append whole sectors.
24B8APND2
LD DE,2C03H 11 03 2CLD DE,FCB2
APND2: load Register Pair DE with 2C03H, FCB2, the destination, for the byte by byte append.
24BB
LD A,41H 3E 41
Load Register A with 41H, SVC 65, @PEOF, which positions a file at its end.
24BD
RST 28H EF
Call @PEOF with RST 28H: FCB2 at Register Pair DE moves to the end of file; the NZ of error 28 that it returns there is not looked at.
24BE
LD A,(24ACH) 3A AC 24
Load Register A with 24ACH, the low byte of the STRIP value (FFH for STRIP, 00H without).
24C1
OR A B7
OR Register A with itself: Z when STRIP was not given.
24C2
If there is no STRIP (Z), jump to APND2A at 24CEH.
24C4
LD HL,2C0CH 21 0C 2C
Load Register Pair HL with 2C0CH, FCB2+9, the LRL of the destination's FCB (00H, 256).
24C7
LD B,(HL) 46
Load Register B with the byte at Register Pair HL, the LRL of the FCB, to put back afterwards.
24C8
LD (HL),01H 36 01
Store 01H at Register Pair HL, FCB2+9: with an LRL of 1, @BKSP steps back one byte.
24CA
LD A,3DH 3E 3D
Load Register A with 3DH, SVC 61, @BKSP, which backs up one logical record.
24CC
RST 28H EF
Call @BKSP with RST 28H to move FCB2 at Register Pair DE one byte back, onto the last byte of the destination (nothing moves for an empty file).
24CD
LD (HL),B 70
Store Register B, the old LRL, back at Register Pair HL, FCB2+9.
24CEAPND2A
LD HL,2F00H 21 00 2FLD HL,BUF2
APND2A: load Register Pair HL with 2F00H, BUF2, a buffer for the destination of its own: the source's bytes are read through 2E00H.
24D1
LD (2C06H),HL 22 06 2C
Store Register Pair HL (2F00H) into 2C06H, FCB2+3, the destination's buffer address; no sector has been read into 2E00H for it yet (@PEOF and @BKSP mark the buffer as not current).
24D4
Jump to BYTIO0 at 272EH to copy byte by byte until the source's end of file or BREAK.
24D7APND3
LD BC,(2C63H) ED 4B 63 2C
APND3: load Register Pair BC with 2C63H, FCB1+12, the ERN of the source, its count of sectors.
24DB
LD A,B 78
Load Register A with Register B, the high byte of the source's ERN.
24DC
OR C B1
OR Register C into Register A: Z when the source is empty.
24DD
If the source is empty (Z), jump to GEOF3 at 26DDH to close the destination unchanged.
24E0
LD HL,(2C0FH) 2A 0F 2C
Load Register Pair HL with 2C0FH, FCB2+12, the ERN of the destination.
24E3
PUSH HL E5
Push Register Pair HL (the destination's ERN) onto the stack (Stack Pointer), to put it back after the space check.
24E4
ADD HL,BC 09
Add Register Pair BC (the source's ERN) to Register Pair HL: the ERN the destination will have after the append.
24E5
LD B,H 44
Load Register B with Register H, the high byte of the new ERN.
24E6
LD C,L 4D
Load Register C with Register L: Register Pair BC = the new ERN.
24E7
Call WRERN at 26EFH to write a sector of E5H as the last sector of the appended file: the space is taken now, and a full diskette stops the command before anything is copied.
24EA
POP HL E1
Pop Register Pair HL from the stack (Stack Pointer): the destination's old ERN.
24EB
LD (2C0FH),HL 22 0F 2C
Store Register Pair HL into 2C0FH, FCB2+12: the ERN is the old one again, so the end of file is where the source's first sector goes.
24EE
LD A,41H 3E 41
Load Register A with 41H, SVC 65, @PEOF, to position the destination at its old end.
24F0
RST 28H EF
Call @PEOF with RST 28H: FCB2 at Register Pair DE (2C03H, set by WRERN) to sector ERN, offset 0.
24F1
Jump to XFER5 at 263AH, the sector loop of COPY, which reads the source into memory and writes it after the end of the destination.

24F4H - COPYST and COPYCD: the COPY Command

COPY takes a source and a destination, each a file or a device, with the parameters ECHO, LRL, CLONE and X. A device on either side sends the bytes one at a time through BYTEIO (270FH). Two files are copied a sector at a time through memory: the destination's missing parts are taken from the source (PRSPC), the source is opened, its directory entry noted for CLONE, the destination is opened or created, and the copy runs from 25F2H. COPY (X) copies a file between two diskettes in one drive, asking for them in turn (2534H).

24F4COPYST
LD (2423H),SP ED 73 23 24
COPYST: store the Stack Pointer into 2423H, the operand of the LD SP at SAVESP (2422H), before the BREAK test: 6.3.1 moved the store here from COPYSTA, after the test, and sends BREAK to ABORT.
24F8
LD A,6AH 3E 6A
Load Register A with 6AH, SVC 106, @CKBRKC, which tests and clears the BREAK key.
24FA
RST 28H EF
Call @CKBRKC with RST 28H: NZ when BREAK was pressed before COPY began.
24FB
If BREAK was pressed (NZ), jump to ABORT at 2449H to return FFFFH.
24FE
Call COPYCD at 2504H, the COPY command itself. Every way out of it (GOHOME 26E6H, IOERR, ABORT) jumps to SAVESP at 2422H, which drops this return address, so COPYCD never comes back here.
2501
Jump to EXIT at 240FH to return 0000H, if COPYCD were to return; it never does, as the copy ends through GOHOME (26E6H), which loads the return code itself.
2504COPYCD
COPYCD: call DOINIT at 2905H to note where YFLAG$ is, set the top of the memory buffer from HIGH$ (or LOW$) and find the system buffer's page.
2507
LD DE,2C57H 11 57 2CLD DE,FCB1
Load Register Pair DE with 2C57H, FCB1, the FCB of the source.
250A
LD A,4EH 3E 4E
Load Register A with 4EH, SVC 78, @FSPEC, which copies a file or device specification from the command line to an FCB.
250C
RST 28H EF
Call @FSPEC with RST 28H: Register Pair HL from the command text, the source into FCB1 at Register Pair DE; Z when it is valid.
250D
If the source is not a valid specification (NZ), jump to SPCREQ at 242DH: File spec required.
2510
LD DE,2C03H 11 03 2CLD DE,FCB2
Load Register Pair DE with 2C03H, FCB2, the FCB of the destination.
2513
LD A,4EH 3E 4E
Load Register A with 4EH, SVC 78, @FSPEC, to read the destination.
2515
RST 28H EF
Call @FSPEC with RST 28H: Register Pair HL at the destination text (a TO before it is passed over), FCB2 at Register Pair DE; NZ when it is not a full specification (:1, /TXT, .PW:1, nothing).
2516
If it is not (NZ), call CVRTUC at 276AH to copy the destination as typed into FCB2 in capitals, up to the parameters; PRSPC completes it later.
2519COPY1
LD DE,2BE4H 11 E4 2BLD DE,COPYTBL
COPY1: load Register Pair DE with 2BE4H, COPYTBL, the parameter table of COPY: ECHO, LRL, CLONE and X.
251C
LD A,11H 3E 11
Load Register A with 11H, SVC 17, @PARAM, which reads the parameter list in parentheses.
251E
RST 28H EF
Call @PARAM with RST 28H: Register Pair HL at the rest of the line, the table at Register Pair DE; the values go into EPARM+1 (2762H), LPARM+1 (25B5H), CPARM+1 (26A9H) and XPARM+1 (2523H).
251F
If the parameters cannot be read (NZ, Register A = 2CH, error 44), jump to IOERR at 2414H.
2522XPARM
LD DE,0000H 11 00 00
XPARM: load Register Pair DE with 0000H, the operand at 2523H that @PARAM sets to FFFFH for X (X=NO or none leaves 0000H).
2525
LD A,D 7A
Load Register A with Register D, the high byte of the X value.
2526
OR E B3
OR Register E into Register A: Z when X was not given.
2527
If X was given (NZ), jump to XFER at 2534H, the copy between two diskettes in one drive.
2529
Call CKDEV at 2A3AH: Z when the source or the destination begins with an asterisk, a device.
252C
If either is a device (Z), jump to BYTEIO at 270FH to copy byte by byte.
252F
Call PRSPC at 2794H, which refuses a missing destination and fills in the destination's name, extension and password from the source where they are not given.
2532
Jump to OPNSRC at 258FH to open the source: without X no diskette is asked for and no GAT is read.
2534XFER
LD A,65H 3E 65
XFER: load Register A with 65H, SVC 101, @FLAGS, which points Index Register IY to the system flags.
2536
RST 28H EF
Call @FLAGS with RST 28H: Index Register IY = 006AH, FLGTAB$.
2537
BIT 5,(IY+12H) FD CB 12 6E
Test bit 5 of SFLAG$ (Index Register IY+12H, 007CH), set while a JCL file runs under DO.
253B
If a JCL file runs (NZ), jump to NOINDO at 2431H: COPY (X) waits for the operator, which a DO file cannot answer.
253E
Call CKDEV at 2A3AH: Z when the source or the destination is a device.
2541
If either is a device (Z), jump to SPCREQ at 242DH: COPY (X) copies only files.
2544
LD HL,2C57H 21 57 2CLD HL,FCB1
Load Register Pair HL with 2C57H, FCB1, the source's specification as @FSPEC left it.
2547
LD C,00H 0E 00
Load Register C with 00H, drive 0, used when the source names no drive; the FCBs then name none either, so @OPEN and @INIT look on every drive (B58).
2549XFER1
LD A,(HL) 7E
XFER1: load Register A with the character at Register Pair HL, the next byte of the specification.
254A
INC HL 23
Increment Register Pair HL to the byte after it.
254B
CP 3AH FE 3A
Compare Register A with 3AH, the colon before a drive number.
254D
If it is the colon (Z), jump to XFER2 at 2555H to read the drive.
254F
CP 20H FE 20
Compare Register A with 20H, the space: the 03H that ends the specification is below it.
2551
If the end of the specification has come (Carry), jump to XFER3 at 2559H with Register C = 0.
2553
Jump back to XFER1 at 2549H for the next character.
2555XFER2
LD A,(HL) 7E
XFER2: load Register A with the character at Register Pair HL, the drive after the colon.
2556
SUB 30H D6 30
Subtract 30H from Register A, the digit 0: the drive number, not checked here (a letter or 8 gives a number that only the open refuses).
2558
LD C,A 4F
Load Register C with Register A, the drive number.
2559XFER3
LD HL,296CH 21 6C 29
XFER3: load Register Pair HL with 296CH, the operand of the LD A at XFRDRV (296BH), the drive of COPY (X).
255C
LD (HL),C 71
Store Register C (the drive number) at Register Pair HL, 296CH, for the prompts and the GAT reads.
255D
LD A,30H 3E 30
Load Register A with 30H, the digit 0, to turn the drive number into its digit.
255F
ADD A,C 81
Add Register C (the drive) to Register A: the drive's digit.
2560
LD (2B82H),A 32 82 2BLD (SRC_DR),A
Store Register A (the digit) into 2B82H, SRC_DR, the d of in drive :d of the prompt Insert SOURCE disk.
2563
LD (2BBCH),A 32 BC 2BLD (DEST_DR),A
Store Register A into 2BBCH, DEST_DR, the d of the prompt Insert DESTINATION disk.
2566
LD HL,2C57H 21 57 2CLD HL,FCB1
Load Register Pair HL with 2C57H, FCB1, the source's specification.
2569
LD DE,2C03H 11 03 2CLD DE,FCB2
Load Register Pair DE with 2C03H, FCB2: the destination is the same specification, on the other diskette.
256C
LD BC,0020H 01 20 00
Load Register Pair BC with 0020H, the 32 bytes of an FCB.
256F
LDIR ED B0
Copy Register Pair BC (32) bytes from Register Pair HL (FCB1) to Register Pair DE (FCB2).
2571
Call GETSYS2 at 2A34H to bring SYS2/SYS into the overlay area while the system diskette is still in drive 0, so that the opens need no system diskette.
2574
LD HL,2B62H 21 62 2BLD HL,PMTSRC$
Load Register Pair HL with 2B62H, PMTSRC$, the prompt Insert SOURCE disk in drive :d and press <ENTER>.
2577
Call FLASH at 29C7H to blink the prompt until ENTER (BREAK ends COPY).
257A
LD A,(296CH) 3A 6C 29
Load Register A with 296CH, the drive of COPY (X).
257D
LD C,A 4F
Load Register C with Register A, the drive, for RDGAT.
257E
Call RDGAT at 2A46H to read the GAT of the diskette in the drive into 2D00H.
2581
If the GAT cannot be read (NZ, Register A = 14H, error 20), jump to IOERR at 2414H.
2584
LD HL,2DCEH 21 CE 2D
Load Register Pair HL with 2DCEH, GAT+CEH: the master password's hash, the diskette's name and its date, the source diskette's identity.
2587
LD DE,2C77H 11 77 2CLD DE,SRCSTR
Load Register Pair DE with 2C77H, SRCSTR, where the source diskette's identity is kept.
258A
LD BC,0012H 01 12 00
Load Register Pair BC with 0012H, the 18 bytes GAT+CEH to GAT+DFH.
258D
LDIR ED B0
Copy Register Pair BC (18) bytes from Register Pair HL (the GAT) to Register Pair DE (SRCSTR), for the checks at each swap (2993H).
258FOPNSRC
OPNSRC: call OPENSRC at 2A6BH: @OPEN of the source FCB1 with the buffer 2E00H, LRL 256 and SFLAG$ bit 0, so that SYS2 does no open or LRL checks.
2592
Call PUTSOUR at 2895H to copy the source's name from TEMBUF to FROM (2C33H) for the Copying line.
2595
Call GETCLON at 28DFH to keep DIR+0 to DIR+2 and DIR+16 to DIR+19 of the source's entry in CLONSAV (2C9BH); it returns Register Pair HL = DIR+20 in the system buffer.
2598
LD A,(2C5DH) 3A 5D 2C
Load Register A with 2C5DH, FCB1+6, the source's drive.
259B
AND 07H E6 07
AND Register A with 07H, the drive number 0-7.
259D
Call WHATBIT at 28FCH: Register A = 47H + 8 times the drive, the second byte of BIT n,A for that drive.
25A0
LD (25A7H),A 32 A7 25LD (SRCBIT),A
Store Register A into 25A7H (SRCBIT), the second byte of the instruction at 25A6H, which becomes BIT n,A of the source drive.
25A3
LD A,(0000H) 3A 00 00
Load Register A with the byte at 0000H, the operand at 25A4H that DOINIT sets to 0082H, YFLAG$: bit n set when the diskette in drive n uses the new style of dating.
25A6
RLC B CB 00
RLC B as assembled (CB 00H, which would rotate Register B); its second byte at 25A7H (SRCBIT) is set by 25A0H, so that it runs as BIT n,A, testing Register A for the source drive's bit: NZ for the new style.
25A8
If the source diskette has the new style (NZ), jump to NEWD1 at 25AFH.
25AA
LD A,FFH 3E FF
Load Register A with FFH, the mark of an old style source.
25AC
LD (26C4H),A 32 C4 26LD (CKTYP),A
Store Register A (FFH) into 26C4H, the operand of the LD A at 26C3H (CKTYP), FEH in the file; the destination adds 1 for the new style (2613H).
25AFNEWD1
LD A,L 7D
NEWD1: load Register A with Register L, the low byte of DIR+20 of the source's entry, as GETCLON left Register Pair HL.
25B0
SUB 10H D6 10
Subtract 10H from Register A: the low byte of DIR+4.
25B2
LD L,A 6F
Load Register L with Register A: Register Pair HL = DIR+4 of the source's entry in the system buffer.
25B3
LD A,(HL) 7E
Load Register A with the byte at Register Pair HL, DIR+4, the source's LRL (00H for 256).
25B4LPARM
LD BC,FF00H 01 00 FF
LPARM: load Register Pair BC with FF00H, the operand at 25B5H that @PARAM replaces by the value of LRL=nnn; FFH in Register B means not given.
25B7
INC B 04
Increment Register B: Z only when Register B was FFH, LRL not given (B52: any value is taken, its low byte used as the length).
25B8
If LRL was given (NZ), jump to USEREGC at 25BBH with its low byte in Register C (256 gives 00H).
25BA
LD C,A 4F
Load Register C with Register A, the source's own LRL.
25BBUSEREGC
LD HL,26A6H 21 A6 26
USEREGC: load Register Pair HL with 26A6H, the operand of the LD (HL) at GEOF1 (26A5H).
25BE
LD (HL),C 71
Store Register C (the LRL) at Register Pair HL, 26A6H: the LRL written into the destination's directory entry after the close.
25BF
LD A,(2523H) 3A 23 25
Load Register A with 2523H, the low byte of the X value (FFH for X).
25C2
OR A B7
OR Register A with itself: Z when X was not given.
25C3
If there is no X (Z), jump to OPNDST at 25F2H to open the destination.
25C5
LD HL,2B97H 21 97 2BLD HL,PMTDST$
Load Register Pair HL with 2B97H, PMTDST$, the prompt Insert DESTINATION disk in drive :d and press <ENTER>.
25C8
Call FLASH at 29C7H to blink the prompt until ENTER.
25CB
LD A,(296CH) 3A 6C 29
Load Register A with 296CH, the drive of COPY (X).
25CE
LD C,A 4F
Load Register C with Register A, the drive, for RDGAT.
25CF
Call RDGAT at 2A46H to read the destination diskette's GAT into 2D00H.
25D2
If the GAT cannot be read (NZ, Register A = 14H, error 20), jump to IOERR at 2414H.
25D5
LD HL,2DCEH 21 CE 2D
Load Register Pair HL with 2DCEH, GAT+CEH, the destination diskette's password hash, name and date.
25D8
LD DE,2C89H 11 89 2CLD DE,DSTSTR
Load Register Pair DE with 2C89H, DSTSTR, where the destination diskette's identity is kept.
25DB
LD BC,0012H 01 12 00
Load Register Pair BC with 0012H, the 18 bytes of the identity.
25DE
PUSH DE D5
Push Register Pair DE (2C89H) onto the stack (Stack Pointer), to compare from it.
25DF
LDIR ED B0
Copy Register Pair BC (18) bytes from Register Pair HL (the GAT) to Register Pair DE (DSTSTR).
25E1
POP DE D1
Pop Register Pair DE from the stack (Stack Pointer): 2C89H, DSTSTR.
25E2
LD HL,2C77H 21 77 2CLD HL,SRCSTR
Load Register Pair HL with 2C77H, SRCSTR, the source diskette's identity.
25E5
LD B,12H 06 12
Load Register B with 12H, the 18 bytes to compare.
25E7
Call CPRHLDE at 29BCH to compare Register B bytes at Register Pair HL and Register Pair DE: Z when the diskettes cannot be told apart.
25EA
If the diskettes differ (NZ), jump to OPNDST at 25F2H: the swaps can be checked.
25EC
Call PMTSYS at 2966H to ask for the system diskette if the drive is 0.
25EF
Jump to SAMERR at 2429H: Source and destination disks are the same, and COPY returns FFFFH.

25F2H - OPNDST to GOHOME: the Sector Copy

The destination is opened or created with @INIT (an LRL of 256, error 42 accepted), and its diskette's dating style decides together with the source's whether the date must be converted. A destination that is the source file itself is refused. A sector of E5H written at the source's last record takes the space at once; then the destination is rewound and the source is read into memory a sector at a time from 2E00H up to the top that DOINIT set, written out, and read again until its end. With X the operator swaps the diskettes before each pass of reads and each pass of writes (PMTSRC, PMTDST), and each swap is checked against the identity kept from the GAT. At the end of file the last sectors are written, the end of file offset copied, the destination closed, and its directory entry given the LRL and, with CLONE, the source's attributes, password and date.

25F2OPNDST
LD DE,2C03H 11 03 2CLD DE,FCB2
OPNDST: load Register Pair DE with 2C03H, FCB2, the destination.
25F5
LD HL,2E00H 21 00 2ELD HL,BUF1
Load Register Pair HL with 2E00H, BUF1, the buffer of the destination's FCB.
25F8
Call INITDES at 2A67H: @INIT of FCB2, which opens the destination if it exists and creates it if not, LRL 256; DOSVC also refuses a write protected diskette (error 15) and a protection level of READ or less (error 25).
25FB
Call PUTDEST at 289BH to copy the destination's name, as DOSVC made it in TEMBUF, to TO2 (2C47H) for the Copying line.
25FE
LD A,(2C09H) 3A 09 2C
Load Register A with 2C09H, FCB2+6, the destination's drive.
2601
AND 07H E6 07
AND Register A with 07H, the drive number 0-7.
2603
Call WHATBIT at 28FCH: Register A = 47H + 8 times the drive, the second byte of BIT n,A.
2606
LD (260DH),A 32 0D 26LD (DSTBIT),A
Store Register A into 260DH (DSTBIT), the second byte of the instruction at 260CH, which becomes BIT n,A of the destination drive.
2609
LD A,(0000H) 3A 00 00
Load Register A with the byte at 0000H, the operand at 260AH that DOINIT sets to 0082H, YFLAG$, as @INIT's drive check left it for the destination diskette.
260C
RLC B CB 00
RLC B as assembled (CB 00H, which would rotate Register B); its second byte at 260DH (DSTBIT) is set by 2606H, so that it runs as BIT n,A, testing Register A for the destination drive's bit: NZ for the new style of dating.
260E
If the destination diskette has the old style (Z), jump to NEWD2 at 2614H.
2610
LD HL,26C4H 21 C4 26LD HL,CKTYP
Load Register Pair HL with 26C4H, the operand of the LD A at 26C3H (CKTYP): FEH, or FFH for an old style source.
2613
INC (HL) 34
Increment the byte at Register Pair HL, 26C4H: FFH for new to new, 00H for old to new, the one case that converts the date (26C6H).
2614NEWD2
LD A,(2523H) 3A 23 25
NEWD2: load Register A with 2523H, the low byte of the X value.
2617
OR A B7
OR Register A with itself: Z when X was not given.
2618
With X (NZ), jump to XF2 at 2627H: the source and the destination are the same specification on the same drive, and the test cannot tell two diskettes apart.
261A
LD HL,(2C5DH) 2A 5D 2C
Load Register Pair HL with 2C5DH, FCB1+6 and FCB1+7, the source's drive and DEC.
261D
LD DE,(2C09H) ED 5B 09 2C
Load Register Pair DE with 2C09H, FCB2+6 and FCB2+7, the destination's drive and DEC.
2621
XOR A AF
Clear Register A to 00H, which clears the Carry flag for the SBC.
2622
SBC HL,DE ED 52
Subtract Register Pair DE from Register Pair HL: Z when both FCBs name the same directory entry on the same drive.
2624
If the destination is the source file itself (Z), jump to DSTREQ at 2439H: Destination spec required, and FCB2 is closed.
2627XF2
XF2: call CPYFILE at 28ACH to show Copying: source to destination.
262A
LD BC,(2C63H) ED 4B 63 2C
Load Register Pair BC with 2C63H, FCB1+12, the ERN of the source, its count of sectors.
262E
Call WRERN at 26EFH to write a sector of E5H as the destination's last sector, record ERN less 1: all the space is taken before any data moves.
2631
LD HL,0000H 21 00 00
Load Register Pair HL with 0000H, the ERN of an empty file.
2634
LD (2C0FH),HL 22 0F 2C
Store Register Pair HL (0000H) into 2C0FH, FCB2+12: the destination counts as empty again, and each write raises its ERN; a destination opened with UPDATE access can therefore write nothing (B61).
2637
LD A,44H 3E 44
Load Register A with 44H, SVC 68, @REW, which positions a file to its start.
2639
RST 28H EF
Call @REW with RST 28H to rewind FCB2 at Register Pair DE (2C03H, set by WRERN) to record 0.
263AXFER5
XFER5: call PMTSRC at 2978H, which with X asks for the source diskette and checks that it is the one (APPEND enters here at 24F1H).
263D
LD HL,2E00H 21 00 2ELD HL,BUF1
Load Register Pair HL with 2E00H, the first page of the memory used for the copy.
2640RDREC1
LD (2C5AH),HL 22 5A 2C
RDREC1: store Register Pair HL into 2C5AH, FCB1+3, the source's buffer address: each sector is read straight into the next page.
2643
LD DE,2C57H 11 57 2CLD DE,FCB1
Load Register Pair DE with 2C57H, FCB1, the source.
2646
LD A,43H 3E 43
Load Register A with 43H, SVC 67, @READ, which reads the next record.
2648
RST 28H EF
Call @READ with RST 28H: with the LRL of 256 the next sector of FCB1 goes into the page at Register Pair HL.
2649
If the sector was read (Z), jump to RDREC2 at 2656H.
264B
CP 1CH FE 1C
Compare Register A with 1CH, error 28, End of file encountered.
264D
At the end of the source (Z), jump to GOTEOF at 2676H.
264F
CP 1DH FE 1D
Compare Register A with 1DH, error 29, Record number out of range, which also means no more sectors.
2651
If so (Z), jump to GOTEOF at 2676H, as for the end of file.
2653
Jump to IOERR at 2414H for any other error of the read, in Register A.
2656RDREC2
INC H 24
RDREC2: increment Register H: Register Pair HL = the next page of memory.
2657
LD A,H 7C
Load Register A with Register H, the page, to compare it with the top.
2658RDREC3
CP 00H FE 00
RDREC3: compare Register A with 00H, the operand at 2659H that DOINIT sets to the page above the last one to use.
265A
If memory is not full (NZ), jump back to RDREC1 at 2640H for the next sector.
265C
Call PMTDST at 299AH, which with X asks for the destination diskette and checks it.
265F
LD HL,2E00H 21 00 2ELD HL,BUF1
Load Register Pair HL with 2E00H, the first page read.
2662RDREC4
LD (2C06H),HL 22 06 2C
RDREC4: store Register Pair HL into 2C06H, FCB2+3, the destination's buffer address: the page to write.
2665
LD DE,2C03H 11 03 2CLD DE,FCB2
Load Register Pair DE with 2C03H, FCB2, the destination.
2668
LD A,4BH 3E 4B
Load Register A with 4BH, SVC 75, @WRITE, which writes the next record.
266A
RST 28H EF
Call @WRITE with RST 28H: the page at Register Pair HL becomes the next sector of FCB2.
266B
If the write failed (NZ), jump to IOERR at 2414H with the error in Register A.
266E
INC H 24
Increment Register H to the next page of memory to write.
266F
LD A,H 7C
Load Register A with Register H, the page, to compare it with the top.
2670RDREC5
CP 00H FE 00
RDREC5: compare Register A with 00H, the operand at 2671H that DOINIT sets to the same top page.
2672
If pages are left (NZ), jump back to RDREC4 at 2662H.
2674
Jump back to XFER5 at 263AH to read the next pages of the source.
2676GOTEOF
GOTEOF: call GEOF5 at 2942H to write the pages read before the end of file, from 2E00H up to Register H (with X after asking for the destination; nothing when Register H is 2EH).
2679
LD HL,(2C5FH) 2A 5F 2C
Load Register Pair HL with 2C5FH, FCB1+8 and FCB1+9, the source's end of file offset and the FCB's LRL (00H).
267C
LD (2C0BH),HL 22 0B 2C
Store Register Pair HL into 2C0BH, FCB2+8 and FCB2+9: the destination ends at the same offset in its last sector.
267F
Call PMTSYS at 2966H, which with X on drive 0 asks for the system diskette, to read SYS3/SYS.
2682
Call GETSYS3 at 2A37H to bring SYS3/SYS, the close overlay, into the overlay area.
2685
LD A,(296CH) 3A 6C 29
Load Register A with 296CH, the drive of COPY (X) (00H without X).
2688
OR A B7
OR Register A with itself: Z for drive 0, the system drive.
2689
On drive 0 (Z), call PMTDST at 299AH, which with X asks for the destination diskette again. On another drive it is not asked for, and after GEOF5 has written nothing the source is still in the drive, as at the end of every COPY (X) sent through @CMNDR, whose one page is written before each read (B53).
268C
LD BC,(2C09H) ED 4B 09 2C
Load Register Pair BC with 2C09H, FCB2+6 and FCB2+7: Register C = the destination's drive, Register B = its DEC, kept for the directory entry after the close.
2690
LD DE,2C03H 11 03 2CLD DE,FCB2
Load Register Pair DE with 2C03H, FCB2, the destination.
2693
LD A,3CH 3E 3C
Load Register A with 3CH, SVC 60, @CLOSE, which writes the directory entry and gives back space past the end.
2695
RST 28H EF
Call @CLOSE with RST 28H to close FCB2 at Register Pair DE.
2696
If the close failed (NZ), jump to IOERR at 2414H with the error in Register A.
2699
LD A,57H 3E 57
Load Register A with 57H, SVC 87, @DIRRD, which reads a directory entry.
269B
RST 28H EF
Call @DIRRD with RST 28H: the entry of DEC Register B on drive Register C into the system buffer; Register Pair HL = its DIR+0.
269C
If the directory cannot be read (NZ, error 17), jump to IOERR at 2414H.
269F
PUSH BC C5
Push Register Pair BC (the drive and the DEC) onto the stack (Stack Pointer), for the @DIRWR at 26D2H.
26A0
PUSH HL E5
Push Register Pair HL (DIR+0 of the destination's entry) onto the stack (Stack Pointer).
26A1
LD A,04H 3E 04
Load Register A with 04H, the offset of the LRL in a directory entry.
26A3
ADD A,L 85
Add Register L to Register A: the low byte of DIR+4.
26A4
LD L,A 6F
Load Register L with Register A: Register Pair HL = DIR+4 (an entry never crosses a page).
26A5GEOF1
LD (HL),00H 36 00
GEOF1: store 00H, the operand at 26A6H that 25BEH or 248DH sets to the LRL, at Register Pair HL, DIR+4 of the destination.
26A7
POP HL E1
Pop Register Pair HL from the stack (Stack Pointer): DIR+0 of the entry.
26A8CPARM
LD DE,FFFFH 11 FF FF
CPARM: load Register Pair DE with FFFFH, the operand at 26A9H that @PARAM sets for CLONE: FFFFH by default and for CLONE, 0000H for CLONE=NO or APPEND (244FH).
26AB
LD A,D 7A
Load Register A with Register D, the high byte of the CLONE value.
26AC
OR E B3
OR Register E into Register A: Z when CLONE is off.
26AD
With CLONE off (Z), jump to GEOF2 at 26D1H to write the entry as the close left it with the new LRL.
26AF
PUSH HL E5
Push Register Pair HL (DIR+0) onto the stack (Stack Pointer).
26B0
EX DE,HL EB
Exchange Register Pairs DE and HL: Register Pair DE = DIR+0 of the destination's entry.
26B1
LD HL,2C9BH 21 9B 2CLD HL,CLONSAV
Load Register Pair HL with 2C9BH, CLONSAV, DIR+0 to DIR+2 and DIR+16 to DIR+19 of the source's entry.
26B4
LD BC,0003H 01 03 00
Load Register Pair BC with 0003H, the three bytes DIR+0 to DIR+2.
26B7
LDIR ED B0
Copy Register Pair BC (3) bytes from Register Pair HL to Register Pair DE: the destination gets the source's DIR+0 (attributes, protection), DIR+1 (flags and month) and DIR+2 (day and year).
26B9
LD A,0DH 3E 0D
Load Register A with 0DH, from DIR+3 to DIR+16.
26BB
ADD A,E 83
Add Register E (the low byte of DIR+3) to Register A.
26BC
LD E,A 5F
Load Register E with Register A: Register Pair DE = DIR+16, the owner password's hash.
26BD
LD C,04H 0E 04
Load Register C with 04H: Register Pair BC = 0004H, DIR+16 to DIR+19.
26BF
LDIR ED B0
Copy Register Pair BC (4) bytes from Register Pair HL to Register Pair DE: the source's owner password hash and its time and year bytes (an old style source: its user password).
26C1
DEC DE 1B
Decrement Register Pair DE to DIR+19, the year byte of the new style.
26C2
POP HL E1
Pop Register Pair HL from the stack (Stack Pointer): DIR+0 of the destination's entry.
26C3
LD A,FEH 3E FE
Load Register A with FEH, the operand at 26C4H (CKTYP): 00H only when the source is old style and the destination new style; new to old is not converted (B59).
26C5
OR A B7
OR Register A with itself: Z for old to new, the case that converts the date.
26C6
For every other case (NZ), jump to GEOF2 at 26D1H.
26C8
INC HL 23
Increment Register Pair HL to DIR+1 of the destination's entry.
26C9
INC HL 23
Increment Register Pair HL to DIR+2, the day and the old style year.
26CA
LD A,(HL) 7E
Load Register A with the byte at Register Pair HL, DIR+2 as copied from the source.
26CB
AND 07H E6 07
AND Register A with 07H, the old style year less 1980 modulo 8.
26CD
LD (DE),A 12
Store Register A at Register Pair DE, DIR+19: the minutes bits 2-0 zero and the year less 1980 as 0 to 7, so an old file of 1988 or later shows a year of 1980-1987.
26CE
DEC DE 1B
Decrement Register Pair DE to DIR+18, the hours and the minutes bits 5-3.
26CF
XOR A AF
Clear Register A to 00H, the time 00:00 for the converted entry.
26D0
LD (DE),A 12
Store Register A (00H) at Register Pair DE, DIR+18: the old user password is gone and the time is 00:00, as the manual says.
26D1GEOF2
POP BC C1
GEOF2: pop Register Pair BC from the stack (Stack Pointer): Register B = the DEC, Register C = the drive.
26D2
LD A,58H 3E 58
Load Register A with 58H, SVC 88, @DIRWR, which writes the directory sector in the system buffer back.
26D4
RST 28H EF
Call @DIRWR with RST 28H to write the sector of DEC Register B on drive Register C.
26D5
Jump to GEOF4 at 26E3H to test the result of @DIRWR in the flags.
26D7GEOF3A
LD HL,FFFFH 21 FF FF
GEOF3A: load Register Pair HL with FFFFH, the return code of a copy stopped by BREAK, so that a JCL file stops too.
26DA
LD (26EAH),HL 22 EA 26
Store Register Pair HL (FFFFH) into 26EAH, the operand of the LD HL at RETCOD (26E9H).
26DDGEOF3
LD DE,2C03H 11 03 2CLD DE,FCB2
GEOF3: load Register Pair DE with 2C03H, FCB2, the destination, to close it after a byte by byte copy (or an append of an empty file).
26E0
LD A,3CH 3E 3C
Load Register A with 3CH, SVC 60, @CLOSE, to close the destination.
26E2
RST 28H EF
Call @CLOSE with RST 28H to close FCB2 at Register Pair DE (a device FCB is put back to its specification).
26E3GEOF4
GEOF4: if the close or the @DIRWR failed (NZ), jump to IOERR at 2414H with the error in Register A.
26E6GOHOME
GOHOME: call PMTSYS at 2966H, which with X on drive 0 asks for the system diskette before the command returns.
26E9RETCOD
LD HL,0000H 21 00 00
RETCOD: load Register Pair HL with 0000H, the operand at 26EAH: 0000H, or FFFFH after BREAK (26DAH).
26EC
Jump to SAVESP at 2422H to restore the Stack Pointer and return the code in Register Pair HL.

26EFH - WRERN: Take the Space of the Destination

WRERN positions the destination FCB2 to record ERN less 1 and writes a sector filled with E5H there, so that every granule the copy needs is allocated before the data moves: a diskette without room stops the command with Disk space full before anything is copied, and in COPY (X) before the first swap. An ERN of 0 writes nothing.

26EFWRERN
LD DE,2C03H 11 03 2CLD DE,FCB2
WRERN: load Register Pair DE with 2C03H, FCB2, the destination.
26F2
LD A,B 78
Load Register A with Register B, the high byte of the ERN to reach.
26F3
OR C B1
OR Register C into Register A: Z when Register Pair BC is 0000H, an empty source.
26F4
RET Z C8
Return with Z if there is nothing to copy: no sector is written.
26F5
DEC BC 0B
Decrement Register Pair BC to the last record, ERN less 1.
26F6
LD A,42H 3E 42
Load Register A with 42H, SVC 66, @POSN, which positions a file to a record.
26F8
RST 28H EF
Call @POSN with RST 28H: FCB2 at Register Pair DE to record Register Pair BC; the error 29 it returns past the end is not looked at.
26F9
PUSH DE D5
Push Register Pair DE (FCB2) onto the stack (Stack Pointer) while Register Pair DE is used for the fill.
26FA
LD HL,2E00H 21 00 2ELD HL,BUF1
Load Register Pair HL with 2E00H, BUF1, the destination's buffer.
26FD
LD DE,2E01H 11 01 2E
Load Register Pair DE with 2E01H, the byte after it.
2700
LD BC,00FFH 01 FF 00
Load Register Pair BC with 00FFH, the 255 bytes after the first.
2703
LD (HL),E5H 36 E5
Store E5H, the byte FORMAT writes in a new sector, at Register Pair HL, 2E00H.
2705
LDIR ED B0
Copy Register Pair BC (255) bytes from Register Pair HL to Register Pair DE: the whole buffer 2E00H-2EFFH is E5H.
2707
POP DE D1
Pop Register Pair DE from the stack (Stack Pointer): FCB2.
2708
LD A,4BH 3E 4B
Load Register A with 4BH, SVC 75, @WRITE, which writes a record.
270A
RST 28H EF
Call @WRITE with RST 28H: the buffer of FCB2 at Register Pair DE (2E00H) goes to the last record, which allocates the granules up to it.
270B
RET Z C8
Return with Z if the sector was written: the space is now allocated.
270C
Jump to IOERR at 2414H with the error, such as 27 (Disk space full), in Register A.

270FH - BYTEIO and BYTIO1: Byte by Byte

When a device is the source or the destination, COPY opens the source and then opens or creates the destination with @INIT (the destination's buffer is 2F00H, its LRL the low byte of the LRL parameter), shows Copying and copies one byte at a time with @GET and @PUT, from APPEND too (BYTIO0, 272EH). The copy ends at the source's end of file, or when BREAK is pressed (the BREAK bit is tested before each byte, and a byte 80H, the BREAK code, is passed on only if the bit is clear). With ECHO each byte is also shown.

270FBYTEIO
BYTEIO: call OPENSRC at 2A6BH: @OPEN of the source FCB1 (a file or a device) with the buffer 2E00H.
2712
Call PUTSOUR at 2895H to copy the source's name from TEMBUF to FROM (2C33H).
2715
LD A,(25B5H) 3A B5 25
Load Register A with 25B5H, the low byte of the LRL value: 00H (256) when LRL was not given.
2718
LD B,A 47
Load Register B with Register A, the LRL for @INIT.
2719
LD DE,2C03H 11 03 2CLD DE,FCB2
Load Register Pair DE with 2C03H, FCB2, the destination.
271C
LD HL,2F00H 21 00 2FLD HL,BUF2
Load Register Pair HL with 2F00H, BUF2: the destination gets a buffer of its own, as the source reads through 2E00H.
271F
LD A,3AH 3E 3A
Load Register A with 3AH, SVC 58, @INIT, which opens a file or a device and creates a file that does not exist.
2721
Call GETFILE at 2A7CH to issue @INIT through DOSVC with the LRL in Register B; an error goes to IOERR.
2724
Call PUTDEST at 289BH to copy the destination's name from TEMBUF to TO2 (2C47H).
2727
Call CPYFILE at 28ACH to show Copying: source to destination.
272A
XOR A AF
Clear Register A to 00H, the LRL of 256 for the destination's FCB.
272B
LD (2C0CH),A 32 0C 2C
Store Register A (00H) into 2C0CH, FCB2+9, the FCB's LRL; @PUT works by bytes whatever the LRL. A new file keeps in its entry the LRL @INIT was given; an existing file keeps its own (error 42 is accepted), so LRL= does nothing for it.
272EBYTIO0
LD C,0EH 0E 0E
BYTIO0: load Register C with 0EH, the code that turns the cursor on (APPEND enters here at 24D4H).
2730
Call DISPB at 2A1AH to send the code in Register C to the screen with @DSP.
2733BYTIO1
BYTIO1: call CKBRK at 2962H: @CKBRKC, NZ when BREAK was pressed (the BREAK bit is cleared).
2736E_O_F
E_O_F: if BREAK was pressed (NZ), jump to GEOF3A at 26D7H to close the destination and return FFFFH (2753H also jumps here, with the NZ of a BREAK).
2739
LD DE,2C57H 11 57 2CLD DE,FCB1
Load Register Pair DE with 2C57H, FCB1, the source.
273C
LD A,03H 3E 03
Load Register A with 03H, SVC 3, @GET, which takes one byte from a device or a file.
273E
RST 28H EF
Call @GET with RST 28H: the next byte of FCB1 at Register Pair DE in Register A, Z when there is one.
273F
If a byte came (Z), jump to BYTIO4 at 274CH to pass it on.
2741
OR A B7
OR Register A with itself: Z when the error code is 00H, a device with no byte ready.
2742
With no byte yet (Z), jump back to BYTIO1 at 2733H to test BREAK and try again.
2744
CP 1CH FE 1C
Compare Register A with 1CH, error 28, End of file encountered.
2746
At the end of the source (Z), jump to GEOF3 at 26DDH to close the destination and return 0000H.
2749
Jump to IOERR at 2414H for any other error, in Register A.
274CBYTIO4
CP 80H FE 80
BYTIO4: compare Register A (the byte) with 80H, the code the keyboard gives for BREAK.
274E
If it is any other byte (NZ), jump to BYTIO4A at 2757H.
2750
Call CKBRK at 2962H: NZ when the BREAK bit is set as well, so this 80H came from the BREAK key.
2753
If so (NZ), jump to 2736H (E_O_F), whose JP NZ ends the copy.
2755
LD A,80H 3E 80
Load Register A with 80H again: the byte is data, and CKBRK loaded Register A with 6AH, the number of @CKBRKC.
2757BYTIO4A
LD DE,2C03H 11 03 2CLD DE,FCB2
BYTIO4A: load Register Pair DE with 2C03H, FCB2, the destination device or file.
275A
LD C,A 4F
Load Register C with Register A, the byte, as @PUT takes it.
275B
LD A,04H 3E 04
Load Register A with 04H, SVC 4, @PUT, which sends one byte to a device or a file.
275D
RST 28H EF
Call @PUT with RST 28H to send Register C to FCB2 at Register Pair DE.
275E
If the byte cannot be sent (NZ), jump to IOERR at 2414H with the error in Register A.
2761EPARM
LD DE,0000H 11 00 00
EPARM: load Register Pair DE with 0000H, the operand at 2762H that @PARAM sets to FFFFH for ECHO.
2764
INC D 14
Increment Register D: Z only when Register D was FFH, ECHO given.
2765
With ECHO (Z), call DISPB at 2A1AH to show the byte in Register C on the screen too (for a file source as well, though the manual allows ECHO only for a device).
2768
Jump back to BYTIO1 at 2733H for the next byte.

276AH - CVRTUC and PRSPC: the Destination Specification

A destination that @FSPEC does not take (:1, /DAT:1, .PW:1, nothing) is copied as typed by CVRTUC: the spaces before it are passed over, then from the character before the first one, up to 32 characters are copied in capitals up to the carriage return or the opening parenthesis, and a carriage return ends the copy. PRSPC then refuses an empty destination or one that starts with a digit (Destination spec required) and fills in what is missing from the source: the name when the destination does not start with a letter, the extension when no slash follows the name, the password when no period follows. The drive is never taken from the source. A destination that is only the blank before a parameter list is not refused, and becomes the source's name and extension with no drive (B54).

276ACVRTUC
CVRTUC: call CVRT at 2772H to copy the text at Register Pair HL to FCB2 at Register Pair DE in capitals; Register Pair DE returns at its last character.
276D
LD A,0DH 3E 0D
Load Register A with 0DH, the carriage return.
276F
LD (DE),A 12
Store Register A (0DH) at Register Pair DE, over the character that ended the copy (the parenthesis, or the carriage return itself).
2770
RET C9
Return to APCODE or COPYCD with the destination's text in FCB2, Register Pair HL at the parameters.
2771CVRT0
INC HL 23
CVRT0: increment Register Pair HL past a space.
2772CVRT
LD A,(HL) 7E
CVRT: load Register A with the character at Register Pair HL, where @FSPEC stopped.
2773
CP 0DH FE 0D
Compare Register A with 0DH, the end of the line.
2775
RET Z C8
Return at the end of the line (Z): CVRTUC writes the 0DH into FCB2+0, no destination.
2776
CP 20H FE 20
Compare Register A with 20H, the space that may come before the destination.
2778
If it is a space (Z), jump back to CVRT0 at 2771H to pass over it.
277A
DEC HL 2B
Decrement Register Pair HL to the character before: @FSPEC stops one past the separator that ended it (a colon, a slash), but at a parenthesis, so there this is the space before it or the last character of the source.
277B
LD B,20H 06 20
Load Register B with 20H, at most 32 characters.
277DCOP1
LD A,(HL) 7E
COP1: load Register A with the character at Register Pair HL.
277E
CP 61H FE 61
Compare Register A with 61H, the small letter a.
2780
If Register A is below it (Carry), jump to COP2 at 2788H unchanged.
2782
CP 7BH FE 7B
Compare Register A with 7BH, one above the small letter z.
2784
If Register A is above z (No Carry), jump to COP2 at 2788H unchanged.
2786
RES 5,A CB AF
Reset bit 5 of Register A: the small letter becomes a capital.
2788COP2
LD (DE),A 12
COP2: store Register A at Register Pair DE in FCB2.
2789
CP 0DH FE 0D
Compare Register A with 0DH, the end of the line.
278B
RET Z C8
Return at the carriage return (Z), Register Pair DE at it.
278C
CP 28H FE 28
Compare Register A with 28H, the parenthesis that opens the parameters.
278E
RET Z C8
Return at the parenthesis (Z), Register Pair HL at it for @PARAM and Register Pair DE at its copy, which CVRTUC turns into 0DH.
278F
INC HL 23
Increment Register Pair HL to the next character of the line.
2790
INC DE 13
Increment Register Pair DE to the next byte of FCB2.
2791
Decrement Register B and loop to COP1 at 277DH until 32 characters are copied.
2793
RET C9
Return after 32 characters; CVRTUC stores 0DH after them, at 2C23H, the first byte of TEMBUF.
2794PRSPC
LD HL,2C57H 21 57 2CLD HL,FCB1
PRSPC: load Register Pair HL with 2C57H, FCB1, the source's text, which @FSPEC wrote and nothing has opened yet.
2797
LD DE,2C03H 11 03 2CLD DE,FCB2
Load Register Pair DE with 2C03H, FCB2, the destination's text.
279A
LD A,(DE) 1A
Load Register A with the character at Register Pair DE, the first of the destination.
279B
CP 0DH FE 0D
Compare Register A with 0DH, the carriage return of an empty destination. The blank that CVRTUC copies before a parameter list is not caught here (B54).
279D
If there is no destination (Z), jump to DSTREQ at 2439H: Destination spec required.
27A0
CP 30H FE 30
Compare Register A with 30H, the digit 0, the lowest of the digits.
27A2
If Register A is below it (Carry: a colon, slash, period, space), jump to CHKDEST at 27A9H.
27A4
CP 3AH FE 3A
Compare Register A with 3AH, one above the digit 9.
27A6
If the destination starts with a digit (Carry), jump to DSTREQ at 2439H.
27A9CHKDEST
PUSH DE D5
CHKDEST: push Register Pair DE (2C03H) onto the stack (Stack Pointer), to return it.
27AA
LD A,(DE) 1A
Load Register A with the character at Register Pair DE, the destination's first.
27AB
CP 41H FE 41
Compare Register A with 41H, the letter A: does the destination start with a name?
27AD
If the destination does not start with a letter (Carry), call PRSPC7 at 27E4H to put the source's name in front of it; Register Pair HL then points after the name in the source.
27B0
LD B,2FH 06 2F
Load Register B with 2FH, the slash that starts an extension.
27B2
Call PRSPC2 at 27BDH: if the destination's name is not followed by a slash, the source's slash and extension are put in.
27B5
LD B,2EH 06 2E
Load Register B with 2EH, the period that starts a password.
27B7
Call PRSPC2 at 27BDH: if no period follows, the source's period and password are put in.
27BA
POP DE D1
Pop Register Pair DE from the stack (Stack Pointer): 2C03H, FCB2.
27BB
RET C9
Return with Register Pair DE = FCB2, its text complete.
27BCPRSPC1
INC DE 13
PRSPC1: increment Register Pair DE past a letter or digit of the destination.
27BDPRSPC2
LD A,(DE) 1A
PRSPC2: load Register A with the destination's character at Register Pair DE.
27BE
CP B B8
Compare Register A with Register B, the separator looked for.
27BF
If it is the separator (Z), jump to PRSPC3 at 27CFH: the destination has this part.
27C1
CP 41H FE 41
Compare Register A with 41H, the letter A: letters belong to the destination's field.
27C3
If it is a letter (No Carry), jump back to PRSPC1 at 27BCH.
27C5
CP 30H FE 30
Compare Register A with 30H, the digit 0: digits belong to the field too.
27C7
If it is below the digits (Carry: another separator, 03H or 0DH), jump to PRSPC4 at 27D1H to take the part from the source.
27C9
CP 3AH FE 3A
Compare Register A with 3AH, one above the digit 9.
27CB
If it is a digit (Carry), jump back to PRSPC1 at 27BCH.
27CD
Jump to PRSPC4 at 27D1H: a sign from 3AH to 40H ends the field too.
27CFPRSPC3
INC DE 13
PRSPC3: increment Register Pair DE past the separator, to the destination's next part.
27D0
RET C9
Return: the destination keeps its own part, which the source does not change.
27D1PRSPC4
PUSH HL E5
PRSPC4: push Register Pair HL (the place in the source) onto the stack (Stack Pointer).
27D2PRSPC5
LD A,(HL) 7E
PRSPC5: load Register A with the source's character at Register Pair HL.
27D3
INC HL 23
Increment Register Pair HL to the next character of the source.
27D4
CP 03H FE 03
Compare Register A with 03H, the end of the source's text.
27D6
If the source ends (Z), jump to PRSPC6 at 27E2H: it has no such part either.
27D8
CP 0DH FE 0D
Compare Register A with 0DH, a carriage return.
27DA
If so (Z), jump to PRSPC6 at 27E2H: the source has no such part either.
27DC
CP B B8
Compare Register A with Register B, the separator looked for.
27DD
If it is another character (NZ), jump back to PRSPC5 at 27D2H.
27DF
Call MVFLD1 at 27F0H with the separator in Register A and Register Pair HL after it: the separator and the source's part are put into the destination at Register Pair DE.
27E2PRSPC6
POP HL E1
PRSPC6: pop Register Pair HL from the stack (Stack Pointer): the place in the source where the search began.
27E3
RET C9
Return to CHKDEST with Register Pair HL back where the search began.
27E4PRSPC7
LD A,(HL) 7E
PRSPC7: load Register A with the source's character at Register Pair HL.
27E5
CP 30H FE 30
Compare Register A with 30H, the digit 0, the lowest letter or digit.
27E7
RET C D8
Return with Carry for a character below the digits: the slash, the period or 03H ends the part (the colon is caught at 27EEH).
27E8
CP 3AH FE 3A
Compare Register A with 3AH, one above the digit 9.
27EA
If it is a digit (Carry), jump to MVFLD at 27EFH to copy it.
27EC
CP 41H FE 41
Compare Register A with 41H, the letter A, the first of the capitals.
27EE
RET C D8
Return with Carry for 3AH to 40H, the colon among them; a letter falls through.
27EFMVFLD
INC HL 23
MVFLD: increment Register Pair HL past the source's character in Register A.
27F0MVFLD1
PUSH HL E5
MVFLD1: push Register Pair HL (the source) onto the stack (Stack Pointer).
27F1
LD H,D 62
Load Register H with Register D, the high byte of the destination place.
27F2
LD L,E 6B
Load Register L with Register E: Register Pair HL = Register Pair DE, the place in FCB2.
27F3MVFLD2
LD C,(HL) 4E
MVFLD2: load Register C with the byte at Register Pair HL, the destination's character there.
27F4
LD (HL),A 77
Store Register A at Register Pair HL: the new character in its place.
27F5
INC HL 23
Increment Register Pair HL to the next byte of FCB2.
27F6
LD A,C 79
Load Register A with Register C, the character pushed along.
27F7
CP 03H FE 03
Compare Register A with 03H, an end of text, which ends the pushing along.
27F9
If it is the end (Z), jump to MVFLD3 at 27FFH.
27FB
CP 0DH FE 0D
Compare Register A with 0DH, the end of the destination's text.
27FD
If not yet the end (NZ), jump back to MVFLD2 at 27F3H: the rest of the destination moves up one byte.
27FFMVFLD3
LD (HL),A 77
MVFLD3: store Register A (03H or 0DH) at Register Pair HL, one byte further than before.
2800
POP HL E1
Pop Register Pair HL from the stack (Stack Pointer): the place in the source.
2801
INC DE 13
Increment Register Pair DE past the character put in.
2802
Jump back to PRSPC7 at 27E4H for the next character of the source's part.

2804H - DOSVC: Open a Source or a Destination

Every open of COPY and APPEND goes through DOSVC with the SVC number in Register A (@OPEN 3BH or @INIT 3AH), the buffer in Register Pair HL, the FCB in Register Pair DE and the LRL in Register B. Before the SVC it copies the specification to TEMBUF for the Copying line: the password is left out, a slash with no extension is dropped, and a file's text ends with a colon and a place for the drive digit, which GETDRIV fills in afterwards from the FCB. After an @INIT of a file it asks @CKDRV whether the diskette is write protected (error 15), and for any open file it checks the access granted: below EXEC for @OPEN, below READ for @INIT, otherwise the file is closed again and error 25 (File access denied) is given. Error 42 (Logical record length open fault) is not an error here.

2804DOSVC
PUSH AF F5
DOSVC: push Register Pair AF onto the stack (Stack Pointer): Register A = the SVC number, 3AH or 3BH.
2805
PUSH HL E5
Push Register Pair HL (the buffer) onto the stack (Stack Pointer).
2806
PUSH DE D5
Push Register Pair DE (the FCB) onto the stack (Stack Pointer).
2807
LD HL,2C23H 21 23 2CLD HL,TEMBUF
Load Register Pair HL with 2C23H, TEMBUF, where the specification is copied for display.
280ATLP
LD A,(DE) 1A
TLP: load Register A with the FCB's character at Register Pair DE.
280B
CP 2FH FE 2F
Compare Register A with 2FH, the slash before an extension.
280D
If it is another character (NZ), jump to STUFCHR at 2817H to copy it.
280F
INC DE 13
Increment Register Pair DE to the character after the slash.
2810
LD A,(DE) 1A
Load Register A with the character at Register Pair DE.
2811
CP 41H FE 41
Compare Register A with 41H, the letter A: an extension starts with a letter.
2813
If no letter follows (Carry), jump to STUFCHR at 2817H with that character: the slash is left out, as for MYFILE/:1.
2815
DEC DE 1B
Decrement Register Pair DE back to the slash.
2816
LD A,(DE) 1A
Load Register A with the slash at Register Pair DE again.
2817STUFCHR
LD (HL),A 77
STUFCHR: store Register A at Register Pair HL in TEMBUF.
2818
INC HL 23
Increment Register Pair HL to the next byte of TEMBUF.
2819
INC DE 13
Increment Register Pair DE to the next character of the FCB.
281A
CP 0EH FE 0E
Compare Register A with 0EH: the 03H that ends an FCB's text and the 0DH that ends CVRTUC's are below it.
281C
At the end of the text (Carry), jump to DUN at 2826H.
281E
CP 3AH FE 3A
Compare Register A with 3AH, the colon before the drive.
2820
At the colon (Z), jump to DUN at 2826H: the drive is written by GETDRIV.
2822
CP 2EH FE 2E
Compare Register A with 2EH, the period before a password.
2824
If it is not the period (NZ), jump back to TLP at 280AH for the next character; the password is never copied.
2826DUN
DEC HL 2B
DUN: decrement Register Pair HL back to the character that ended the copy.
2827
POP DE D1
Pop Register Pair DE from the stack (Stack Pointer): the FCB.
2828
LD A,(DE) 1A
Load Register A with the FCB's first character at Register Pair DE.
2829
CP 2AH FE 2A
Compare Register A with 2AH, the asterisk of a device specification.
282B
For a device (Z), jump to DUN2 at 2834H: no drive.
282D
LD (HL),3AH 36 3A
Store 3AH, the colon, at Register Pair HL over the end character.
282F
INC HL 23
Increment Register Pair HL to the place of the drive digit.
2830
LD (2892H),HL 22 92 28
Store Register Pair HL into 2892H, the operand of the LD (nnnn),A at DSPEC (2891H), where GETDRIV writes the digit.
2833
INC HL 23
Increment Register Pair HL past the drive digit's place.
2834DUN2
LD (HL),03H 36 03
DUN2: store 03H at Register Pair HL, the end of the text that @DSPLY shows.
2836
POP HL E1
Pop Register Pair HL from the stack (Stack Pointer): the buffer.
2837
POP AF F1
Pop Register Pair AF from the stack (Stack Pointer): Register A = the SVC number.
2838
LD (286CH),A 32 6C 28
Store Register A into 286CH, the operand of the LD A at SVCNUM (286BH), for the access check.
283B
RST 28H EF
Call the SVC in Register A with RST 28H: @OPEN or @INIT of the FCB at Register Pair DE with the buffer at Register Pair HL and the LRL in Register B.
283C
PUSH AF F5
Push Register Pair AF (the result: Z, or NZ with the error in Register A) onto the stack (Stack Pointer).
283D
Call GETDRIV at 2884H: Index Register IX = the FCB; for an open file Register C = the drive, the digit stored in TEMBUF and NZ; Z for a device or a failed open.
2840
For a device or an FCB the SVC did not open (Z), jump to DEVICE at 2859H.
2842
LD A,(286CH) 3A 6C 28
Load Register A with 286CH, the SVC number that DOSVC issued (3AH or 3BH).
2845
CP 3AH FE 3A
Compare Register A with 3AH, @INIT, the only open that can write a new file.
2847
After an @OPEN (NZ), jump to DEVICE at 2859H: a write protected diskette does not matter for reading.
2849
POP AF F1
Pop Register Pair AF from the stack (Stack Pointer): the result of @INIT.
284A
PUSH AF F5
Push Register Pair AF back onto the stack (Stack Pointer) for DEVICE.
284B
If @INIT succeeded (Z), jump to DO_CKDR at 2851H.
284D
CP 2AH FE 2A
Compare Register A with 2AH, error 42, Logical record length open fault: the file is open with another LRL.
284F
For any other error (NZ), jump to DEVICE at 2859H, which returns it.
2851DO_CKDR
LD A,21H 3E 21
DO_CKDR: load Register A with 21H, SVC 33, @CKDRV, which tests a drive.
2853
RST 28H EF
Call @CKDRV with RST 28H for drive Register C: Carry when its diskette is write protected (the GAT is read into the system buffer).
2854
LD A,0FH 3E 0F
Load Register A with 0FH, error 15, Write protected disk (the LD keeps the Carry flag).
2856
If the destination's diskette is write protected (Carry), jump to IOERR at 2414H; the FCB stays open.
2859DEVICE
POP AF F1
DEVICE: pop Register Pair AF from the stack (Stack Pointer): the result of the SVC.
285A
If it succeeded (Z), jump to CHKPROT at 285FH.
285C
CP 2AH FE 2A
Compare Register A with 2AH, error 42, which is ignored: COPY sets the LRL itself.
285E
RET NZ C0
Return any other error to GETFILE (NZ, the error in Register A), which jumps to IOERR.
285FCHKPROT
BIT 7,(IX+00H) DD CB 00 7E
CHKPROT: test bit 7 of FCB+0 (Index Register IX+00H): set for an open file.
2863
For a device (Z), jump to OKYDOKY at 2882H: no protection to check.
2865
LD A,(IX+01H) DD 7E 01
Load Register A with FCB+1 (Index Register IX+01H), whose bits 2-0 hold the access the open granted.
2868
AND 07H E6 07
AND Register A with 07H: the access level, 0 (full) to 7 (none).
286A
LD B,A 47
Load Register B with Register A, the access level.
286BSVCNUM
LD A,00H 3E 00
SVCNUM: load Register A with 00H, the operand at 286CH that 2838H set to the SVC number.
286D
CP 3AH FE 3A
Compare Register A with 3AH, @INIT, which needs more access than @OPEN.
286F
LD A,B 78
Load Register A with Register B, the access level (the flags of the compare are kept).
2870
For @INIT (Z), jump to INIT1 at 287EH: a destination must allow writing.
2872
CP 06H FE 06
Compare Register A with 06H, EXEC: execute only. For APPEND's destination, opened with @OPEN, this is the only test as well (B51).
2874
If the level is READ or better (Carry), jump to OKYDOKY at 2882H.
2876ILLACC
LD A,3CH 3E 3C
ILLACC: load Register A with 3CH, SVC 60, @CLOSE.
2878
RST 28H EF
Call @CLOSE with RST 28H to close the file at Register Pair DE that may not be used; in COPY (X) on drive 0 this reads SYS3/SYS from the diskette in drive 0 before the system diskette is asked for (B60).
2879
LD A,19H 3E 19
Load Register A with 19H, error 25, File access denied.
287B
Jump to IOERR at 2414H with error 25 in Register A, whatever the close did.
287EINIT1
CP 05H FE 05
INIT1: compare Register A (the access level) with 05H, READ.
2880
If the level is READ or less (No Carry), jump to ILLACC at 2876H. UPDATE (4) passes, though it may write no record at or past the end of file: COPY's WRERN then writes its E5H sector into the old file and the first write of the copy fails with error 37 (B61).
2882OKYDOKY
XOR A AF
OKYDOKY: clear Register A to 00H and set the Z flag: the open is good.
2883
RET C9
Return with Z to GETFILE: the file or device may be used as asked.
2884GETDRIV
PUSH DE D5
GETDRIV: push Register Pair DE (the FCB) onto the stack (Stack Pointer).
2885
POP IX DD E1
Pop Index Register IX from the stack (Stack Pointer): Index Register IX = the FCB.
2887
LD A,(DE) 1A
Load Register A with FCB+0 at Register Pair DE.
2888
BIT 7,A CB 7F
Test bit 7 of Register A, set for an open file.
288A
RET Z C8
Return with Z for a device (10H after DEVOPEN) or a specification the SVC could not open.
288B
LD A,(IX+06H) DD 7E 06
Load Register A with FCB+6 (Index Register IX+06H), the drive the file was found or created on.
288E
LD C,A 4F
Load Register C with Register A, the drive, for @CKDRV.
288F
ADD A,30H C6 30
Add 30H to Register A: the drive's digit (NZ, as the digit is not 00H).
2891DSPEC
LD (0000H),A 32 00 00
DSPEC: store Register A (the digit) at 0000H, the operand at 2892H that DOSVC set to the place after the colon in TEMBUF.
2894
RET C9
Return with NZ and Register C = the drive of the file just opened.
2895PUTSOUR
PUSH HL E5
PUTSOUR: push Register Pair HL onto the stack (Stack Pointer).
2896
LD HL,2C33H 21 33 2CLD HL,FROM
Load Register Pair HL with 2C33H, FROM, the place of the source's name in the Copying line.
2899
Jump to XBUFF at 289FH to copy TEMBUF there with Register Pair HL at FROM.
289BPUTDEST
PUSH HL E5
PUTDEST: push Register Pair HL onto the stack (Stack Pointer).
289C
LD HL,2C47H 21 47 2CLD HL,TO2
Load Register Pair HL with 2C47H, TO2, the place of the destination's name after the word to.
289FXBUFF
PUSH DE D5
XBUFF: push Register Pair DE (the FCB) onto the stack (Stack Pointer).
28A0
LD DE,2C23H 11 23 2CLD DE,TEMBUF
Load Register Pair DE with 2C23H, TEMBUF, the name DOSVC made.
28A3
EX DE,HL EB
Exchange Register Pairs DE and HL: Register Pair HL = TEMBUF, Register Pair DE = FROM or TO2.
28A4
LD BC,000FH 01 0F 00
Load Register Pair BC with 000FH, 15 bytes, enough for NAME/EXT:d and 03H.
28A7
LDIR ED B0
Copy Register Pair BC (15) bytes from Register Pair HL (TEMBUF) to Register Pair DE.
28A9
POP DE D1
Pop Register Pair DE from the stack (Stack Pointer): the FCB.
28AA
POP HL E1
Pop Register Pair HL from the stack (Stack Pointer).
28AB
RET C9
Return with Register Pairs DE and HL as they were.

28ACH - CPYFILE, GETLRL, GETCLON, WHATBIT, DOINIT and GEOF5

CPYFILE shows the line Copying: (or Appending:) source to destination. GETLRL and GETCLON read the directory entry of an FCB just opened in the system buffer: the LRL, and the bytes CLONE copies. WHATBIT makes the second byte of BIT n,A for a drive. DOINIT, run first by both commands, notes the address of YFLAG$, sets the memory top of the sector copy from HIGH$, or from LOW$ for a command sent by a program, and learns the system buffer's page from a directory read of drive 0. GEOF5 writes out the pages read before the end of file.

28ACCPYFILE
PUSH HL E5
CPYFILE: push Register Pair HL onto the stack (Stack Pointer).
28AD
PUSH DE D5
Push Register Pair DE onto the stack (Stack Pointer).
28AE
LD HL,2A83H 21 83 2ALD HL,COPYMS
Load Register Pair HL with 2A83H, COPYMS, the text Copying: .
28B1APPFLAG
LD A,01H 3E 01
APPFLAG: load Register A with 01H, the operand at 28B2H that APPEND sets to 00H (2455H).
28B3
OR A B7
OR Register A with itself: NZ for COPY, Z for APPEND.
28B4
For COPY (NZ), jump to ITSCOPY at 28B9H with Register Pair HL at COPYMS.
28B6
LD HL,2A8DH 21 8D 2ALD HL,APPDMS
Load Register Pair HL with 2A8DH, APPDMS, the text Appending: .
28B9ITSCOPY
ITSCOPY: call DSPLY at 2A21H to show the text at Register Pair HL up to its 03H.
28BC
LD HL,2C33H 21 33 2CLD HL,FROM
Load Register Pair HL with 2C33H, FROM, the source's name.
28BF
Call DSPLY at 2A21H to show it, up to its 03H, with the cursor left after it.
28C2
LD HL,2C43H 21 43 2CLD HL,TO
Load Register Pair HL with 2C43H, TO, the word to between spaces, followed at 2C47H by TO2, the destination's name, which ends with 03H.
28C5
Call DSPLY at 2A21H to show to and the destination's name.
28C8
LD C,0DH 0E 0D
Load Register C with 0DH, the carriage return that ends the line.
28CA
Call DISPB at 2A1AH to show it; DISPB returns with the Z flag set.
28CD
POP DE D1
Pop Register Pair DE from the stack (Stack Pointer).
28CE
POP HL E1
Pop Register Pair HL from the stack (Stack Pointer).
28CF
RET C9
Return with Z (APCODE depends on it at 249DH).
28D0GETLRL
PUSH DE D5
GETLRL: push Register Pair DE (the FCB) onto the stack (Stack Pointer).
28D1
POP IX DD E1
Pop Index Register IX from the stack (Stack Pointer): Index Register IX = the FCB.
28D3
LD A,(IX+07H) DD 7E 07
Load Register A with FCB+7 (Index Register IX+07H), the DEC of the file's directory entry.
28D6
AND E0H E6 E0
AND Register A with E0H: bits 7-5 of the DEC, the entry's place in its sector times 32.
28D8
ADD A,04H C6 04
Add 04H to Register A: the low byte of DIR+4, the LRL.
28DA
LD L,A 6F
Load Register L with Register A: Register Pair HL will point to DIR+4.
28DBSYSBUF
LD H,00H 26 00
SYSBUF: load Register H with 00H, the operand at 28DCH that DOINIT sets to 1DH, the page of SBUFF$: the open read the entry's sector there.
28DD
LD A,(HL) 7E
Load Register A with the byte at Register Pair HL, DIR+4, the file's LRL (00H for 256).
28DE
RET C9
Return with the LRL in Register A and Index Register IX at the FCB.
28DFGETCLON
PUSH DE D5
GETCLON: push Register Pair DE (FCB1) onto the stack (Stack Pointer).
28E0
POP IX DD E1
Pop Index Register IX from the stack (Stack Pointer): Index Register IX = FCB1.
28E2
LD A,(IX+07H) DD 7E 07
Load Register A with FCB+7 (Index Register IX+07H), the source's DEC.
28E5
AND E0H E6 E0
AND Register A with E0H: the entry's offset in its directory sector.
28E7
LD L,A 6F
Load Register L with Register A, the low byte of DIR+0.
28E8SYSBUF2
LD H,00H 26 00
SYSBUF2: load Register H with 00H, the operand at 28E9H that DOINIT sets to 1DH, the page of SBUFF$.
28EA
LD DE,2C9BH 11 9B 2CLD DE,CLONSAV
Load Register Pair DE with 2C9BH, CLONSAV, seven bytes kept for CLONE.
28ED
LD BC,0003H 01 03 00
Load Register Pair BC with 0003H, DIR+0 to DIR+2.
28F0
LDIR ED B0
Copy Register Pair BC (3) bytes from Register Pair HL to Register Pair DE: the attributes, the flags and month, the day and year.
28F2
LD A,0DH 3E 0D
Load Register A with 0DH, from DIR+3 to DIR+16.
28F4
ADD A,L 85
Add Register L (the low byte of DIR+3) to Register A.
28F5
LD L,A 6F
Load Register L with Register A: Register Pair HL = DIR+16, the owner password's hash.
28F6
LD BC,0004H 01 04 00
Load Register Pair BC with 0004H, DIR+16 to DIR+19.
28F9
LDIR ED B0
Copy Register Pair BC (4) bytes from Register Pair HL to Register Pair DE: the owner password hash and the time and year bytes (an old style user password).
28FB
RET C9
Return with Register Pair HL = DIR+20, which NEWD1 (25AFH) turns into DIR+4.
28FCWHATBIT
LD B,A 47
WHATBIT: load Register B with Register A, the drive number 0-7.
28FD
INC B 04
Increment Register B: the loop below runs once more than the drive.
28FE
LD A,3FH 3E 3F
Load Register A with 3FH, 47H less 8, so that the first ADD makes 47H.
2900WHTB1
ADD A,08H C6 08
WHTB1: add 08H to Register A, the step from BIT n,A to BIT n+1,A.
2902
Decrement Register B and loop to WHTB1 at 2900H: Register A = 47H + 8 times the drive.
2904
RET C9
Return with Register A = the second byte of BIT n,A for drive n.
2905
PUSH HL E5
DOINIT: push Register Pair HL (the command text) onto the stack (Stack Pointer).
2906
LD A,65H 3E 65
Load Register A with 65H, SVC 101, @FLAGS, which returns the flag table.
2908
RST 28H EF
Call @FLAGS with RST 28H: Index Register IY = 006AH, FLGTAB$.
2909
PUSH IY FD E5
Push Index Register IY (006AH) onto the stack (Stack Pointer).
290B
POP DE D1
Pop Register Pair DE from the stack (Stack Pointer): Register Pair DE = 006AH.
290C
LD HL,0018H 21 18 00
Load Register Pair HL with 0018H, the place of YFLAG$ in the flag table.
290F
ADD HL,DE 19
Add Register Pair DE (006AH) to Register Pair HL: 0082H, YFLAG$.
2910
LD (25A4H),HL 22 A4 25LD (YFLAG1),HL
Store Register Pair HL (0082H) into 25A4H, the operand of the LD A at 25A3H, the source's dating test.
2913
LD (260AH),HL 22 0A 26LD (YFLAG2),HL
Store Register Pair HL into 260AH, the operand of the LD A at 2609H, the destination's.
2916
LD HL,0000H 21 00 00
Load Register Pair HL with 0000H: @HIGH$ only reads.
2919
LD B,L 45
Load Register B with Register L (00H): @HIGH$ function 0, HIGH$.
291A
BIT 1,(IY+02H) FD CB 02 4E
Test bit 1 of CFLAG$ (Index Register IY+02H, 006CH), set for a command a program sent through @CMNDR.
291E
For a typed command (Z), jump to USEHI at 2921H with Register B = 0.
2920
INC B 04
Increment Register B to 01H: LOW$, the top of the memory a library command may use under a program.
2921USEHI
LD A,64H 3E 64
USEHI: load Register A with 64H, SVC 100, @HIGH$.
2923
RST 28H EF
Call @HIGH$ with RST 28H: Register Pair HL = HIGH$ (Register B = 0) or LOW$ (Register B = 1).
2924
INC HL 23
Increment Register Pair HL: one past the last byte that may be used.
2925
DEC H 25
Decrement Register H: the page below the one that holds that address. With LOW$ below 2FFFH this is 2EH or less, which the loops never meet (B55).
2926
LD A,H 7C
Load Register A with Register H, the stop page.
2927
LD (2659H),A 32 59 26
Store Register A into 2659H, the operand of the CP at RDREC3 (2658H), the read loop's top.
292A
LD (2671H),A 32 71 26
Store Register A into 2671H, the operand of the CP at RDREC5 (2670H), the write loop's top.
292D
LD (2947H),A 32 47 29
Store Register A into 2947H, the operand of the CP at GEOF6 (2946H).
2930
LD BC,0000H 01 00 00
Load Register Pair BC with 0000H: Register B = DEC 0, Register C = drive 0.
2933
LD A,57H 3E 57
Load Register A with 57H, SVC 87, @DIRRD, which reads a directory entry.
2935
RST 28H EF
Call @DIRRD with RST 28H: the entry of BOOT/SYS on drive 0, read only to learn where SBUFF$ is; Register Pair HL = 1D00H, the result is not looked at.
2936
LD A,H 7C
Load Register A with Register H, the page of SBUFF$ (1DH).
2937
LD (28DCH),A 32 DC 28
Store Register A into 28DCH, the operand of the LD H at SYSBUF (28DBH).
293A
LD (28E9H),A 32 E9 28
Store Register A into 28E9H, the operand of the LD H at SYSBUF2 (28E8H).
293D
Call RESKFLG at 2A0EH to clear the pause and ENTER bits of KFLAG$.
2940
POP HL E1
Pop Register Pair HL from the stack (Stack Pointer): the command text again.
2941
RET C9
Return to APCODE or COPYCD with Register Pair HL at the command text.
2942GEOF5
LD A,H 7C
GEOF5: load Register A with Register H, the page where the read found the end of file.
2943
CP 2EH FE 2E
Compare Register A with 2EH, the first page used for the copy.
2945
RET Z C8
Return (Z) if nothing was read since the last write: the source's last sector was the last of a full memory, or the source is empty.
2946GEOF6
CP 00H FE 00
GEOF6: compare Register A with 00H, the operand at 2947H, the stop page that DOINIT set; the read loop never leaves Register H there.
2948
RET Z C8
Return (Z) if Register A is the stop page; the read loop never gets here with it.
2949
Call PMTDST at 299AH, which with X asks for the destination diskette.
294C
LD B,H 44
Load Register B with Register H, the page after the last one read.
294D
LD HL,2E00H 21 00 2ELD HL,BUF1
Load Register Pair HL with 2E00H, the first page.
2950GEOF7
LD (2C06H),HL 22 06 2C
GEOF7: store Register Pair HL into 2C06H, FCB2+3, the buffer of the destination.
2953
LD DE,2C03H 11 03 2CLD DE,FCB2
Load Register Pair DE with 2C03H, FCB2, the destination to write.
2956
LD A,4BH 3E 4B
Load Register A with 4BH, SVC 75, @WRITE, which writes the next record.
2958
RST 28H EF
Call @WRITE with RST 28H: the page at Register Pair HL becomes the next sector of FCB2 at Register Pair DE.
2959
If the write failed (NZ), jump to IOERR at 2414H.
295C
INC H 24
Increment Register H to the next page of memory to write.
295D
LD A,H 7C
Load Register A with Register H, the page, to compare it with Register B.
295E
CP B B8
Compare Register A with Register B, the page where the read stopped.
295F
If pages are left (NZ), jump back to GEOF7 at 2950H.
2961
RET C9
Return to GOTEOF with every page written, Register Pair HL past the last one.

2962H - CKBRK and the Prompts of COPY (X)

PMTSYS asks for the system diskette, but only for COPY (X) on drive 0. PMTSRC and PMTDST ask for the source and the destination diskette for COPY (X) on any drive, read the GAT of what was put in and ask again until its password hash, name and date are the ones kept at the start. CPRHLDE compares those 18 bytes. Without X all three return at once.

2962CKBRK
LD A,6AH 3E 6A
CKBRK: load Register A with 6AH, SVC 106, @CKBRKC.
2964
RST 28H EF
Call @CKBRKC with RST 28H, which clears the BREAK bit of KFLAG$ after it is found set.
2965
RET C9
Return with Z for no BREAK, NZ when BREAK was pressed.
2966PMTSYS
LD A,(2523H) 3A 23 25
PMTSYS: load Register A with 2523H, the low byte of the X value.
2969
OR A B7
OR Register A with itself: Z when X was not given.
296A
RET Z C8
Return at once without X (Z): the system diskette never leaves drive 0.
296BXFRDRV
LD A,00H 3E 00
XFRDRV: load Register A with 00H, the operand at 296CH that XFER3 (255CH) set to the drive of COPY (X).
296D
OR A B7
OR Register A with itself: Z for drive 0, the drive of the system.
296E
RET NZ C0
Return for another drive (NZ): drive 0 still holds the system diskette.
296F
PUSH HL E5
Push Register Pair HL onto the stack (Stack Pointer).
2970
LD HL,2B43H 21 43 2BLD HL,PMTSYS$
Load Register Pair HL with 2B43H, PMTSYS$, the prompt Insert SYSTEM disk <ENTER>.
2973
Call FLASH at 29C7H to blink it until ENTER; nothing checks that a system diskette was put in.
2976
POP HL E1
Pop Register Pair HL from the stack (Stack Pointer).
2977
RET C9
Return with the system diskette in drive 0, as far as the operator did as asked.
2978PMTSRC
LD A,(2523H) 3A 23 25
PMTSRC: load Register A with 2523H, the low byte of the X value.
297B
OR A B7
OR Register A with itself: Z when X was not given.
297C
RET Z C8
Return at once without X (Z): the source diskette is already in its drive.
297D
PUSH HL E5
Push Register Pair HL onto the stack (Stack Pointer).
297E
LD HL,2B62H 21 62 2BLD HL,PMTSRC$
Load Register Pair HL with 2B62H, PMTSRC$, the prompt Insert SOURCE disk in drive :d and press <ENTER>.
2981
Call FLASH at 29C7H to blink it until ENTER; BREAK ends the command.
2984
LD A,(296CH) 3A 6C 29
Load Register A with 296CH, the drive of COPY (X).
2987
LD C,A 4F
Load Register C with Register A, the drive, for RDGAT.
2988
Call RDGAT at 2A46H to read the GAT of the diskette now in the drive into 2D00H; a read error is not looked at.
298B
LD HL,2DCEH 21 CE 2D
Load Register Pair HL with 2DCEH, GAT+CEH, the identity of that diskette.
298E
LD DE,2C77H 11 77 2CLD DE,SRCSTR
Load Register Pair DE with 2C77H, SRCSTR, the source diskette's identity.
2991
LD B,12H 06 12
Load Register B with 12H, the 18 bytes to compare.
2993
Call CPRHLDE at 29BCH: Z when the bytes at Register Pair HL and Register Pair DE match.
2996
POP HL E1
Pop Register Pair HL from the stack (Stack Pointer).
2997
If it is another diskette (NZ), jump back to PMTSRC at 2978H to ask again.
2999
RET C9
Return with the source diskette in the drive.
299APMTDST
LD A,(2523H) 3A 23 25
PMTDST: load Register A with 2523H, the low byte of the X value.
299D
OR A B7
OR Register A with itself: Z when X was not given.
299E
RET Z C8
Return at once without X (Z): the destination diskette is already in its drive.
299F
PUSH HL E5
Push Register Pair HL (the page reached, for GEOF5) onto the stack (Stack Pointer).
29A0
LD HL,2B97H 21 97 2BLD HL,PMTDST$
Load Register Pair HL with 2B97H, PMTDST$, the prompt Insert DESTINATION disk in drive :d and press <ENTER>.
29A3
Call FLASH at 29C7H to blink it until ENTER; BREAK ends the command.
29A6
LD A,(296CH) 3A 6C 29
Load Register A with 296CH, the drive of COPY (X).
29A9
LD C,A 4F
Load Register C with Register A, the drive, for RDGAT.
29AA
Call RDGAT at 2A46H to read the GAT of the diskette now in the drive into 2D00H.
29AD
LD HL,2DCEH 21 CE 2D
Load Register Pair HL with 2DCEH, GAT+CEH, the identity of that diskette.
29B0
LD DE,2C89H 11 89 2CLD DE,DSTSTR
Load Register Pair DE with 2C89H, DSTSTR, the destination diskette's identity.
29B3
LD B,12H 06 12
Load Register B with 12H, the 18 bytes to compare.
29B5
Call CPRHLDE at 29BCH: Z when the bytes at Register Pair HL and Register Pair DE match.
29B8
POP HL E1
Pop Register Pair HL from the stack (Stack Pointer).
29B9
If it is another diskette (NZ), jump back to PMTDST at 299AH to ask again.
29BB
RET C9
Return with the destination diskette in the drive.
29BCCPRHLDE
LD A,(DE) 1A
CPRHLDE: load Register A with the byte at Register Pair DE.
29BD
CP (HL) BE
Compare Register A with the byte at Register Pair HL.
29BE
RET NZ C0
Return with NZ at the first byte that differs.
29BF
INC HL 23
Increment Register Pair HL to the next byte of the first identity.
29C0
INC DE 13
Increment Register Pair DE to the next byte of the second identity.
29C1
Decrement Register B and loop to CPRHLDE at 29BCH until all are compared.
29C3
RET C9
Return with Z: Register B bytes are the same.

29C4H - FLASH: Blink a Prompt Until ENTER

FLASH first waits until neither ENTER nor BREAK is noted in KFLAG$, then shows the prompt and erases it in turn, testing BREAK and ENTER all the time. BREAK ends the command at ABORT; ENTER empties the type-ahead, erases the line and returns. KFLAG$'s BREAK bit stays set until @CKBRKC clears it, and the waiting loop never calls it: a BREAK pressed before FLASH is entered keeps FLASH in that loop for good (B56).

29C4FLASH0
FLASH0: call RESKFLG at 2A0EH to clear the pause and ENTER bits of KFLAG$; the BREAK bit is left as it is.
29C7FLASH
LD BC,41FDH 01 FD 41
FLASH: load Register Pair BC with 41FDH, a delay count for @PAUSE.
29CA
LD A,10H 3E 10
Load Register A with 10H, SVC 16, @PAUSE, which waits for the count in Register Pair BC.
29CC
RST 28H EF
Call @PAUSE with RST 28H to wait, so that a key held down is seen again.
29CD
LD A,(IY+0AH) FD 7E 0A
Load Register A with KFLAG$ (Index Register IY+0AH, 0074H), the keyboard flags.
29D0
AND 05H E6 05
AND Register A with 05H: bit 0, BREAK, and bit 2, ENTER.
29D2
If either is set (NZ), jump to FLASH0 at 29C4H to wait again. Only the pause and ENTER bits are cleared there, so a noted BREAK loops here without end, with no prompt shown (B56).
29D4
Call RESKFLG at 2A0EH to clear the pause and ENTER bits.
29D7FLS1
FLS1: call DSPLY at 2A21H to show the prompt at Register Pair HL; it ends with 1DH, so the cursor goes back to the start of the line.
29DA
LD BC,4000H 01 00 40
Load Register Pair BC with 4000H, the count of tests while the prompt is shown.
29DD
Call FLS2 at 29EDH to test BREAK and ENTER Register Pair BC times.
29E0
LD C,1EH 0E 1E
Load Register C with 1EH, the code that erases to the end of the line.
29E2
Call DISPB at 2A1AH to erase the prompt, which blinks it off.
29E5
LD BC,3333H 01 33 33
Load Register Pair BC with 3333H, the count of tests while the line is blank.
29E8
Call FLS2 at 29EDH to test BREAK and ENTER Register Pair BC times.
29EB
Jump back to FLS1 at 29D7H to show the prompt again.
29EDFLS2
FLS2: call CKBRK at 2962H: NZ when BREAK was pressed.
29F0
If BREAK was pressed (NZ), jump to ABORT at 2449H. The command ends without asking for the system diskette, even when another one is in drive 0; STOP (2A28H), which would ask, is never called (B57).
29F3
BIT 2,(IY+0AH) FD CB 0A 56
Test bit 2 of KFLAG$ (Index Register IY+0AH, 0074H), set by the keyboard driver when ENTER is pressed.
29F7
If ENTER was pressed (NZ), jump to FLS4 at 29FFH.
29F9
DEC BC 0B
Decrement Register Pair BC, the count of tests.
29FA
LD A,B 78
Load Register A with Register B, the high byte of the count.
29FB
OR C B1
OR Register C into Register A: Z when the count is used up.
29FC
If tests remain (NZ), jump back to FLS2 at 29EDH.
29FE
RET C9
Return to FLS1 to switch the prompt on or off.
29FFFLS4
POP AF F1
FLS4: pop Register Pair AF from the stack (Stack Pointer), dropping the return address into FLS1: the RET of RESKFLG returns from FLASH.
2A00CLRTYPE
LD A,08H 3E 08
CLRTYPE: load Register A with 08H, SVC 8, @KBD, which takes a key from the type-ahead.
2A02
RST 28H EF
Call @KBD with RST 28H: Z with a key in Register A, NZ with A = 00H when no key is waiting.
2A03
If a key was taken (Z), jump back to CLRTYPE at 2A00H for the next: the ENTER and any keys typed are thrown away.
2A05
OR A B7
OR Register A with itself: Z for 00H, the type-ahead is empty.
2A06
For any other result (NZ), jump to IOERR at 2414H with the error in Register A.
2A09
LD C,1EH 0E 1E
Load Register C with 1EH, the code that erases to the end of the line.
2A0B
Call DISPB at 2A1AH to erase the prompt, and fall into RESKFLG.
2A0ERESKFLG
LD A,65H 3E 65
RESKFLG: load Register A with 65H, SVC 101, @FLAGS.
2A10
RST 28H EF
Call @FLAGS with RST 28H: Index Register IY = 006AH, FLGTAB$.
2A11
LD A,(IY+0AH) FD 7E 0A
Load Register A with KFLAG$ (Index Register IY+0AH, 0074H).
2A14
AND F9H E6 F9
AND Register A with F9H, clearing bit 1 (the pause key) and bit 2 (ENTER).
2A16
LD (IY+0AH),A FD 77 0A
Store Register A into KFLAG$ (Index Register IY+0AH, 0074H).
2A19
RET C9
Return with Index Register IY at FLGTAB$ and KFLAG$ bits 1 and 2 clear.
2A1ADISPB
LD A,02H 3E 02
DISPB: load Register A with 02H, SVC 2, @DSP, which shows the character in Register C.
2A1C
RST 28H EF
Call @DSP with RST 28H to show Register C on the screen at the cursor.
2A1D
RET Z C8
Return with Z if it was shown, as every caller expects.
2A1E
Jump to IOERR at 2414H with the error in Register A.
2A21DSPLY
LD A,0AH 3E 0A
DSPLY: load Register A with 0AH, SVC 10, @DSPLY, which shows a text up to 03H or 0DH.
2A23
RST 28H EF
Call @DSPLY with RST 28H to show the text at Register Pair HL.
2A24
RET Z C8
Return with Z if it was shown, as every caller expects.
2A25
Jump to IOERR at 2414H with the error in Register A.
2A28STOP
LD HL,2ACDH 21 CD 2ALD HL,STOP$
STOP: load Register Pair HL with 2ACDH, STOP$, the line Transfer aborted. Nothing in the member jumps or calls here (B57).
2A2B
LD A,0CH 3E 0C
Load Register A with 0CH, SVC 12, @LOGOT, which shows and logs a line.
2A2D
RST 28H EF
Call @LOGOT with RST 28H to show the line at Register Pair HL and write it to the job log.
2A2E
Call PMTSYS at 2966H to ask for the system diskette on drive 0.
2A31
Jump to ABORT at 2449H to return FFFFH after the Transfer aborted line.

2A34H - GETSYS2, GETSYS3, CKDEV, RDGAT and the Opens

GETSYS2 and GETSYS3 send the overlay requests 84H and 85H, function 0, which only read SYS2/SYS or SYS3/SYS into the overlay area: RST28 drops the return address of the RST, so each RST 28H returns to the caller of GETSYS2 or GETSYS3, and the code after it does not run. CKDEV tests for a device on either side. RDGAT reads a GAT for the checks of COPY (X). The open entries all lead to GETFILE, which goes through DOSVC.

2A34GETSYS2
LD A,84H 3E 84
GETSYS2: load Register A with 84H, the request of SYS2/SYS with function 0, load only.
2A36
RST 28H EF
Call RST 28H: SYS2/SYS is read unless it is already in the overlay area; its RET returns to the caller of GETSYS2, as RST28 drops the address after this RST.
2A37GETSYS3
LD A,85H 3E 85
GETSYS3: load Register A with 85H, the request of SYS3/SYS with function 0, load only.
2A39
RST 28H EF
Call RST 28H: SYS3/SYS is read for the @CLOSE that follows; its RET returns to the caller of GETSYS3.
2A3ACKDEV
LD A,(2C57H) 3A 57 2CLD A,(FCB1)
CKDEV: load Register A with 2C57H, FCB1+0, the source's first character.
2A3D
CP 2AH FE 2A
Compare Register A with 2AH, the asterisk of a device specification.
2A3F
RET Z C8
Return with Z if the source is a device: byte by byte copy.
2A40
LD A,(2C03H) 3A 03 2CLD A,(FCB2)
Load Register A with 2C03H, FCB2+0, the destination's first character.
2A43
CP 2AH FE 2A
Compare Register A with 2AH, the asterisk of a device specification.
2A45
RET C9
Return with Z if the destination is a device, NZ if neither is.
2A46RDGAT
PUSH DE D5
RDGAT: push Register Pair DE onto the stack (Stack Pointer). RDGAT reads only the GAT: unlike @CKDRV it sets neither DCT+4 bit 5 (two sided) nor DCT+6 for the diskette put in (B62).
2A47
PUSH HL E5
Push Register Pair HL onto the stack (Stack Pointer).
2A48
PUSH IY FD E5
Push Index Register IY (FLGTAB$) onto the stack (Stack Pointer).
2A4A
LD A,51H 3E 51
Load Register A with 51H, SVC 81, @GTDCT, which finds a drive code table.
2A4C
RST 28H EF
Call @GTDCT with RST 28H: Index Register IY = the drive code table entry of drive Register C (masked to 0-7).
2A4D
LD D,(IY+09H) FD 56 09
Load Register D with DCT+9 (Index Register IY+09H), the directory cylinder known for the drive.
2A50
LD E,00H 1E 00
Load Register E with 00H, sector 0 of the directory cylinder, the GAT.
2A52
LD HL,2D00H 21 00 2DLD HL,GAT
Load Register Pair HL with 2D00H, GAT, a buffer of the member's own.
2A55
LD A,55H 3E 55
Load Register A with 55H, SVC 85, @RDSSC, which reads a system sector.
2A57
RST 28H EF
Call @RDSSC with RST 28H: cylinder Register D, sector Register E into Register Pair HL; for a diskette whose directory is elsewhere it reads the boot sector, corrects DCT+9 and reads again.
2A58
POP IY FD E1
Pop Index Register IY from the stack (Stack Pointer).
2A5A
POP HL E1
Pop Register Pair HL from the stack (Stack Pointer).
2A5B
POP DE D1
Pop Register Pair DE from the stack (Stack Pointer).
2A5C
LD A,14H 3E 14
Load Register A with 14H, error 20, GAT read error (the LD keeps the flags of @RDSSC).
2A5E
RET C9
Return with Z when the GAT was read, NZ with Register A = 14H when not.
2A5FOPENDES
LD HL,2F00H 21 00 2FLD HL,BUF2
OPENDES: load Register Pair HL with 2F00H, BUF2. Nothing in the member calls OPENDES.
2A62
LD DE,2C03H 11 03 2CLD DE,FCB2
Load Register Pair DE with 2C03H, FCB2, the destination's FCB.
2A65
Jump to OPENFIL at 2A78H to open the destination with @OPEN.
2A67INITDES
LD A,3AH 3E 3A
INITDES: load Register A with 3AH, SVC 58, @INIT, for the destination (FCB2 in Register Pair DE, the buffer in Register Pair HL).
2A69
Jump to INITFIL at 2A7AH with the SVC number of @INIT in Register A.
2A6BOPENSRC
LD DE,2C57H 11 57 2CLD DE,FCB1
OPENSRC: load Register Pair DE with 2C57H, FCB1, the source.
2A6E
LD A,65H 3E 65
Load Register A with 65H, SVC 101, @FLAGS, which returns the flag table.
2A70
RST 28H EF
Call @FLAGS with RST 28H: Index Register IY = 006AH, FLGTAB$.
2A71
SET 0,(IY+12H) FD CB 12 C6
Set bit 0 of SFLAG$ (Index Register IY+12H, 007CH): SYS2 then makes no LRL test, sets no open bit and gives the FCB no right to change the directory at its close.
2A75OPENSR2
LD HL,2E00H 21 00 2ELD HL,BUF1
OPENSR2: load Register Pair HL with 2E00H, BUF1 (APPEND enters here at 2481H for its destination, with SFLAG$ bit 0 clear and Register Pair DE = FCB2).
2A78OPENFIL
LD A,3BH 3E 3B
OPENFIL: load Register A with 3BH, SVC 59, @OPEN.
2A7AINITFIL
LD B,00H 06 00
INITFIL: load Register B with 00H, an LRL of 256 for the FCB.
2A7CGETFILE
GETFILE: call DOSVC at 2804H to copy the specification for display, issue the SVC in Register A and check the result.
2A7F
RET Z C8
Return with Z when the file or device is open.
2A80
Jump to IOERR at 2414H with the error in Register A.

2A83H - COPY and APPEND Data: the Messages and the Prompts

The two words of the Copying line end with 03H, so that @DSPLY leaves the cursor after them. The messages of the exits end with a carriage return. The prompts of COPY (X) begin with 1DH (to the start of the line) and 1EH (erase to its end) and end with 1DH and 03H, so that FLASH can blink them on one line; the zeros in drive :0 are written over with the drive's digit (2560H, 2563H). STOP$ is shown by nothing.

2A83-2A8CCOPYMS
DEFM "Copying: " / DEFB 03H 43 6F 70 79 69 6E 67 3A 20 03
COPYMS, 2A83H-2A8CH: the start of the line that names the source and the destination, shown by CPYFILE (28AEH).
2A8D-2A98APPDMS
DEFM "Appending: " / DEFB 03H 41 70 70 65 6E 64 69 6E 67 3A 20 03
APPDMS, 2A8DH-2A98H: the same for APPEND, chosen when APPFLAG (28B2H) is 00H.
2A99-2AB2DIFLRL$
DEFM "Files have different LRLs" / DEFB 0DH 46 69 6C 65 73 20 68 61 76 65 20 64 69 66 66 65 72 65 6E 74 20 4C 52 4C 73 0D
DIFLRL$, 2A99H-2AB2H: APPEND's message for two files of different record lengths (2435H).
2AB3-2ACCDSTREQ$
DEFM "Destination spec required" / DEFB 0DH 44 65 73 74 69 6E 61 74 69 6F 6E 20 73 70 65 63 20 72 65 71 75 69 72 65 64 0D
DSTREQ$, 2AB3H-2ACCH: the message of DSTREQ (2439H), also for a destination that is the source itself.
2ACD-2ADESTOP$
DEFB 1DH / DEFM "Transfer aborted" / DEFB 0DH 1D 54 72 61 6E 73 66 65 72 20 61 62 6F 72 74 65 64 0D
STOP$, 2ACDH-2ADEH: the start of the line, then the message of STOP (2A28H), which no code reaches (B57).
2ADF-2AF1SPCREQ$
DEFM "File spec required" / DEFB 0DH 46 69 6C 65 20 73 70 65 63 20 72 65 71 75 69 72 65 64 0D
SPCREQ$, 2ADFH-2AF1H: the message of SPCREQ (242DH).
2AF2-2B0DNOINDO$
DEFM "Invalid command during <DO> " 49 6E 76 61 6C 69 64 20 63 6F 6D 6D 61 6E 64 20 64 75 72 69 6E 67 20 3C 44 4F 3E 20
NOINDO$, 2AF2H-2B0DH: the first part of the message of NOINDO (2431H) for COPY (X) under DO.
2B0E-2B18
DEFM "processing" / DEFB 0DH 70 72 6F 63 65 73 73 69 6E 67 0D
2B0EH-2B18H: the end of NOINDO$ and its carriage return.
2B19-2B42SAMERR$
DEFM "Source and destination disks are the same" / DEFB 0DH 53 6F 75 72 63 65 20 61 6E 64 20 64 65 73 74 69 6E 61 74 69 6F 6E 20 64 69 73 6B 73 20 61 72 65 20 74 68 65 20 73 61 6D 65 0D
SAMERR$, 2B19H-2B42H: the message of SAMERR (2429H) when the two diskettes of COPY (X) have the same identity.
2B43-2B61PMTSYS$
DEFB 1DH, 1EH / DEFM " Insert SYSTEM disk <ENTER>" / DEFB 1DH, 03H 1D 1E 20 49 6E 73 65 72 74 20 53 59 53 54 45 4D 20 64 69 73 6B 20 3C 45 4E 54 45 52 3E 1D 03
PMTSYS$, 2B43H-2B61H: the prompt of PMTSYS (2970H), blinked by FLASH.
2B62-2B81PMTSRC$
DEFB 1DH, 1EH / DEFM " Insert SOURCE disk in drive :" 1D 1E 20 49 6E 73 65 72 74 20 53 4F 55 52 43 45 20 64 69 73 6B 20 69 6E 20 64 72 69 76 65 20 3A
PMTSRC$, 2B62H-2B81H: the start of the source prompt (2574H, 297EH).
2B82SRC_DR
DEFM "0" 30
SRC_DR, 2B82H: the drive digit of the source prompt, written by 2560H.
2B83-2B96
DEFM " and press <ENTER>" / DEFB 1DH, 03H 20 61 6E 64 20 70 72 65 73 73 20 3C 45 4E 54 45 52 3E 1D 03
2B83H-2B96H: the end of the source prompt, then 1DH and 03H, which keep the cursor on the line.
2B97-2BBBPMTDST$
DEFB 1DH, 1EH / DEFM " Insert DESTINATION disk in drive :" 1D 1E 20 49 6E 73 65 72 74 20 44 45 53 54 49 4E 41 54 49 4F 4E 20 64 69 73 6B 20 69 6E 20 64 72 69 76 65 20 3A
PMTDST$, 2B97H-2BBBH: the start of the destination prompt (25C5H, 29A0H).
2BBCDEST_DR
DEFM "0" 30
DEST_DR, 2BBCH: the drive digit of the destination prompt, written by 2563H.
2BBD-2BD0
DEFM " and press <ENTER>" / DEFB 1DH, 03H 20 61 6E 64 20 70 72 65 73 73 20 3C 45 4E 54 45 52 3E 1D 03
2BBDH-2BD0H: the end of the destination prompt.

2BD1H - COPY and APPEND Data: the Parameter Tables

The 6.x form that @PARAM reads: 80H, then for each parameter a type byte (bit 7 numeric, bit 6 flag, bit 5 string, bit 4 the first letter alone will do, bits 3-0 the length of the name), the name, a response byte and the address of the operand that receives the value. @PARAM does not check the kind of value against the type byte. 00H ends a table. ECHO of both tables fills the same operand.

2BD1APPTBL
DEFB 80H 80
APPTBL, 2BD1H: 80H, the mark of the 6.x table form, APPEND's table (2475H).
2BD2
DEFB 55H 55
2BD2H: type 55H, a flag, may be abbreviated, a name of 5 characters.
2BD3-2BD7
DEFM "STRIP" 53 54 52 49 50
2BD3H-2BD7H: the name STRIP (or S), to write over the destination's last byte.
2BD8
DEFB 00H 00
2BD8H: the response byte of STRIP, which APPEND does not read.
2BD9-2BDA
DEFW 24ACH AC 24
2BD9H-2BDAH: 24ACH, SPARM+1, the operand of the LD DE at 24ABH.
2BDB
DEFB 54H 54
2BDBH: type 54H, a flag, may be abbreviated, a name of 4 characters.
2BDC-2BDF
DEFM "ECHO" 45 43 48 4F
2BDCH-2BDFH: the name ECHO (or E), to show each byte copied from a device.
2BE0
DEFB 00H 00
2BE0H: the response byte of ECHO, which APPEND does not read.
2BE1-2BE2
DEFW 2762H 62 27
2BE1H-2BE2H: 2762H, EPARM+1, the operand of the LD DE at 2761H.
2BE3
DEFB 00H 00
2BE3H: 00H, the end of APPEND's table, after its two parameters.
2BE4COPYTBL
DEFB 80H 80
COPYTBL, 2BE4H: 80H, the mark of the 6.x table form, COPY's table (2519H).
2BE5
DEFB 54H 54
2BE5H: type 54H, a flag, may be abbreviated, a name of 4 characters.
2BE6-2BE9
DEFM "ECHO" 45 43 48 4F
2BE6H-2BE9H: the name ECHO (or E), for a device as the source.
2BEA
DEFB 00H 00
2BEAH: the response byte of ECHO, which COPY does not read.
2BEB-2BEC
DEFW 2762H 62 27
2BEBH-2BECH: 2762H, EPARM+1, the same operand as APPEND's ECHO.
2BED
DEFB 93H 93
2BEDH: type 93H, a number, may be abbreviated, a name of 3 characters.
2BEE-2BF0
DEFM "LRL" 4C 52 4C
2BEEH-2BF0H: the name LRL (or L), the record length of the destination.
2BF1
DEFB 00H 00
2BF1H: the response byte of LRL, which COPY does not read.
2BF2-2BF3
DEFW 25B5H B5 25
2BF2H-2BF3H: 25B5H, LPARM+1, the operand of the LD BC at 25B4H, FF00H until a value is given.
2BF4
DEFB 55H 55
2BF4H: type 55H, a flag, may be abbreviated, a name of 5 characters.
2BF5-2BF9
DEFM "CLONE" 43 4C 4F 4E 45
2BF5H-2BF9H: the name CLONE (or C), to copy the source's directory entry.
2BFA
DEFB 00H 00
2BFAH: the response byte of CLONE, which COPY does not read.
2BFB-2BFC
DEFW 26A9H A9 26
2BFBH-2BFCH: 26A9H, CPARM+1, the operand of the LD DE at 26A8H, FFFFH until changed.
2BFD
DEFB 41H 41
2BFDH: type 41H, a flag, a name of 1 character, not abbreviated.
2BFE
DEFM "X" 58
2BFEH: the name X, the copy between two diskettes in one drive.
2BFF
DEFB 00H 00
2BFFH: the response byte of X, which COPY does not read.
2C00-2C01
DEFW 2523H 23 25
2C00H-2C01H: 2523H, XPARM+1, the operand of the LD DE at 2522H.
2C02
DEFB 00H 00
2C02H: 00H, the end of COPY's table, after its four parameters.

2C03H - COPY and APPEND Data: the FCBs, the Lines and the Buffers

Only three parts of this area are in the file: the first byte of each FCB (00H, so that an FCB is not taken as open when the member is loaded) and the word to of the Copying line. The rest are buffers that hold whatever the memory held: the rest of the two FCBs, TEMBUF, where DOSVC puts each name for display, FROM and TO2, the two names of the Copying line, SRCSTR and DSTSTR, the identities of the two diskettes of COPY (X), CLONSAV, the bytes of the source's entry for CLONE, and from 2D00H the GAT buffer and the two sector buffers. The sector copy itself uses every page from 2E00H up to the top that DOINIT sets.

2C03FCB2
DEFB 00H 00
FCB2, 2C03H: the destination's FCB, 00H in the file so that the exits (2442H) do not close an FCB that was never opened. @FSPEC or CVRTUC puts the destination's text here, and the open turns it into an FCB.
2C04-2C22
DEFS 31
FCB2+1 to FCB2+31, 2C04H-2C22H: not loaded. The code writes FCB2+3 (the buffer, 24D1H, 2662H, 2950H), +8 and +9 (267CH, 24C8H, 272BH) and +12 (24EBH, 2634H), and reads +6 and +7 (the drive and DEC, 25FEH, 261DH, 268CH), +8 (24B2H) and +12 (24E0H).
2C23-2C32TEMBUF
DEFS 16
TEMBUF, 2C23H-2C32H: not loaded. DOSVC writes the name of each file or device opened here (NAME/EXT:d and 03H), and XBUFF copies 15 bytes of it to FROM or TO2 (28A0H).
2C33-2C42FROM
DEFS 16
FROM, 2C33H-2C42H: not loaded. The source's name for the Copying line, written by PUTSOUR (2896H), shown by CPYFILE (28BCH).
2C43-2C46TO
DEFM " to " 20 74 6F 20
TO, 2C43H-2C46H: the word to between two spaces; CPYFILE shows it together with TO2 that follows (28C2H).
2C47-2C56TO2
DEFS 16
TO2, 2C47H-2C56H: not loaded. The destination's name for the Copying line, written by PUTDEST (289CH), ended by its 03H.
2C57FCB1
DEFB 00H 00
FCB1, 2C57H: the source's FCB, 00H in the file. @FSPEC puts the source's text here and the open turns it into an FCB.
2C58-2C76
DEFS 31
FCB1+1 to FCB1+31, 2C58H-2C76H: not loaded. The code writes FCB1+3 (the buffer, 2640H) and reads +6 and +7 (2598H, 261AH), +8 and +9 (2679H) and +12 (the ERN, 24D7H, 262AH).
2C77-2C88SRCSTR
DEFS 18
SRCSTR, 2C77H-2C88H: not loaded. GAT+CEH to GAT+DFH of the source diskette of COPY (X): the master password's hash, the diskette's name and its date (258DH), compared at each swap (298EH).
2C89-2C9ADSTSTR
DEFS 18
DSTSTR, 2C89H-2C9AH: not loaded. The same 18 bytes of the destination diskette (25DFH), compared with SRCSTR (25E7H) and at each swap (29B0H).
2C9B-2CA1CLONSAV
DEFS 7
CLONSAV, 2C9BH-2CA1H: not loaded. DIR+0 to DIR+2 and DIR+16 to DIR+19 of the source's entry, kept by GETCLON (28F0H, 28F9H) and copied into the destination's entry with CLONE (26B7H, 26BFH).
2D00-2DFF
DEFS 256
GAT, 2D00H-2DFFH: not loaded, after the ORG to the next page. RDGAT reads the GAT of the diskette in the drive of COPY (X) here (2A52H); its bytes CEH to DFH, 2DCEH-2DDFH, are the diskette's identity.
2E00-2EFF
DEFS 256
BUF1, 2E00H-2EFFH: not loaded. The buffer of the source's FCB and of the destination's (WRERN fills it with E5H), and the first page of the sector copy (263DH).
2F00-2FFF
DEFS 256
BUF2, 2F00H-2FFFH: not loaded. The destination's buffer in a byte by byte copy (24CEH, 271CH), and the second page of the sector copy, whose pages go on up to the top DOINIT sets (2927H).

2400H - Member 4 (LIB, CLS, ID and TOF): Entry Points, TOF and CLS

SYS1/SYS runs LIB with request 19H, CLS with 24H, ID with 26H and TOF with 25H; all four headers point at member 4, which the overlay loader reads to 2400H-249EH and 2500H-251EH. Each command has its entry in the jump list at the start: LIB 2400H, CLS 2403H, ID 2406H, TOF 2409H, where TOF's code itself begins. TOF sends a form feed to the printer and returns 0000H when @PRT worked; when @PRT fails, TOF shows the short message of the error and returns its number. CLS clears the screen and always returns 0000H.

2400LIB
LIB: LIB's entry (request 19H), jump to JPLIB at 2422H.
2403
CLS's entry (request 24H), jump to CLS at 241CH.
2406
ID's entry (request 26H), jump to DOID at 2500H, the start of the second load block after the ORG to the next page.
2409TOF
LD C,0CH 0E 0C
TOF: TOF's entry (request 25H): load Register C with 0CH, the form feed character, the byte @PRT is to send.
240B
LD A,06H 3E 06
Load Register A with 06H, SVC 6, @PRT, which sends the byte in Register C to the printer device through PRDCB$ (0218H).
240D
RST 28H EF
Call @PRT with RST 28H: Z when the printer took the byte; NZ with Register A = 8 (Device not available), the printer driver's only error, when PRDVR has waited for the printer 65535 times without its becoming ready.
240EL240E
LD HL,0000H 21 00 00
L240E: load Register Pair HL with 0000H, the return code of a command that worked; CLS comes here too (2420H), with the Z flag set.
2411
RET Z C8
Return with Z and Register Pair HL = 0000H, to @EXIT for a typed command or to the program that sent it through @CMNDR.
2412TOFERR
LD L,A 6F
TOFERR: load Register L with Register A, the error number @PRT returned, the low byte of the return code.
2413
LD H,00H 26 00
Load Register H with 00H: Register Pair HL = the error number, returned to the caller.
2415
OR C0H F6 C0
OR Register A with C0H: bit 7 tells @ERROR to return to the caller instead of aborting, bit 6 asks for the message alone, without the error code, file and last SVC lines.
2417
LD C,A 4F
Load Register C with Register A, the error number with bits 7 and 6 set, the form @ERROR takes.
2418
LD A,1AH 3E 1A
Load Register A with 1AH, SVC 26, @ERROR, which shows the message of the error in Register C.
241A
RST 28H EF
Call @ERROR with RST 28H to show the message, Device not available for a printer that is off or not ready.
241B
RET C9
Return NZ with Register Pair HL = the error number (0008H from the printer driver) and Register A as @ERROR gives it back: TOF has failed, though the manual says it does nothing when the printer is unavailable.
241CCLS
LD A,69H 3E 69
CLS: CLS's command: load Register A with 69H, SVC 105, @CLS, which sends 1CH (home, which also sets 80 characters a line and normal video) and 1FH (clear to the end of the frame) to the video.
241E
RST 28H EF
Call @CLS with RST 28H; the result it returns is not looked at.
241F
XOR A AF
XOR Register A with itself: Register A = 00H and the Z flag set, the result of a command that worked.
2420
Jump to L240E at 240EH to return Register Pair HL = 0000H with Z. A 6.3.1 change, marked 631 in the source: 6.3.0 loaded Register H and Register L from Register A here and returned.

2422H - JPLIB: the LIB Command

LIB shows the three command libraries from LIBTBL$, SYS1/SYS's table of commands at 1F24H, whose address it takes from 1E02H, the word after SYS1's first jump: SYS1 is still at 1E00H, because it sent the library request and a library member loads at 2400H. Each LIBTBL$ entry is 6 characters and a word whose high byte names the library (80H Library A in SYS6/SYS, A0H Library B in SYS7/SYS, C0H Library C in SYS8/SYS) and whose low byte is the request. LIB passes over the whole table three times, once a library: it shows the heading Library <A>, <B> or <C>, then each command of that library with its first letter as a capital and the others in lower case, 7 to a line after 2 spaces, each in 11 columns. BOOT (word 1F22H) is in no library and is never shown. After each pass the heading's letter (249CH) and the library byte of the test (2441H) are stepped; the member is read again for every library command, so they are A and 80H each time LIB begins.

2422JPLIB
LD B,03H 06 03
JPLIB: load Register B with 03H, the count of libraries to show.
2424LIB0
PUSH BC C5
LIB0: push Register Pair BC onto the stack (Stack Pointer): Register B = the libraries still to show.
2425
LD HL,2492H 21 92 24LD HL,LIBMSG
Load Register Pair HL with 2492H, LIBMSG, the heading Library <A> and its carriage return.
2428
LD A,0AH 3E 0A
Load Register A with 0AH, SVC 10, @DSPLY, which shows a line on the video up to its 0DH or 03H.
242A
RST 28H EF
Call @DSPLY with RST 28H to show the heading; @MSG gives back Register Pair HL = 2492H. On the first pass the first byte is 00H, which only toggles the video driver's show control code bit (TGGLCTL 0C9FH) before the L, an ordinary character, is shown.
242B
LD (HL),0AH 36 0A
Store 0AH, a line feed, at Register Pair HL, 2492H: the headings of Library <B> and <C> begin with a new line, which leaves a blank line under the commands above them.
242D
LD HL,(1E02H) 2A 02 1E
Load Register Pair HL with the word at 1E02H, the address of LIBTBL$ (1F24H) in SYS1/SYS.
2430LIB1
LD B,02H 06 02
LIB1: load Register B with 02H, the spaces in front of each line of commands.
2432
Call TAB at 248AH to show the 2 spaces counted in Register B.
2435
LD C,07H 0E 07
Load Register C with 07H, the commands that still fit on this line.
2437LIB2
LD A,(HL) 7E
LIB2: load Register A with the byte at Register Pair HL, the first character of the next LIBTBL$ entry, or the 00H at 205CH that ends the table.
2438
OR A B7
OR Register A with itself: Z at the end of the table.
2439
If the table has ended (Z), jump to LIB4 at 2472H to end the library's last line.
243B
PUSH HL E5
Push Register Pair HL, the start of the entry, onto the stack (Stack Pointer).
243C
LD DE,0007H 11 07 00
Load Register Pair DE with 0007H, the offset of the high byte of the entry's word.
243F
ADD HL,DE 19
Add Register Pair DE to Register Pair HL: Register Pair HL = the entry + 7, its library byte (80H, A0H, C0H, or 1FH for BOOT).
2440LIBX
LD A,80H 3E 80
LIBX: load Register A with 80H, the library byte of Library A; this operand at 2441H is raised by 20H after each pass (2480H): A0H for Library B, C0H for Library C.
2442
CP (HL) BE
Compare Register A with the byte at Register Pair HL, the entry's library byte.
2443
If the command is in the library of this pass (Z), jump to LIB2A at 2449H to show it.
2445
POP AF F1
Pop Register Pair AF from the stack (Stack Pointer): the entry's start pushed at 243BH is dropped into Register A and the flags.
2446
INC HL 23
Increment Register Pair HL from the entry + 7 to the entry + 8, the next entry.
2447
Jump to LIB2 at 2437H to test the next entry.
2449LIB2A
POP HL E1
LIB2A: pop Register Pair HL from the stack (Stack Pointer): the start of the entry, its first character.
244A
PUSH BC C5
Push Register Pair BC onto the stack (Stack Pointer): Register C = the commands that still fit on this line.
244B
LD C,(HL) 4E
Load Register C with the byte at Register Pair HL, the command's first character, a capital.
244C
LD A,02H 3E 02
Load Register A with 02H, SVC 2, @DSP, which shows the character in Register C on the video.
244E
RST 28H EF
Call @DSP with RST 28H to show the first character as it stands.
244F
LD B,05H 06 05
Load Register B with 05H, the count of the other 5 characters of the name.
2451LIB3
INC HL 23
LIB3: increment Register Pair HL to the next character of the name.
2452
LD A,(HL) 7E
Load Register A with the byte at Register Pair HL, the character.
2453
CP 20H FE 20
Compare Register A with 20H, a space, the padding of a name shorter than 6 characters.
2455
If it is a space (Z), jump to 2459H to show it unchanged.
2457
XOR 20H EE 20
XOR Register A with 20H: a capital becomes its lower case letter; any other character would be changed too, but the table holds only capitals and spaces.
2459
LD C,A 4F
Load Register C with Register A, the character to show.
245A
LD A,02H 3E 02
Load Register A with 02H, SVC 2, @DSP, to show the character in Register C.
245C
RST 28H EF
Call @DSP with RST 28H to show the character.
245D
Decrement Register B and jump back to LIB3 at 2451H until the 5 characters are shown; Register Pair HL is then the entry + 5.
245F
LD B,05H 06 05
Load Register B with 05H, the spaces after the name: each command takes 11 columns.
2461
Call TAB at 248AH to show the 5 spaces counted in Register B.
2464
INC HL 23
Increment Register Pair HL to the entry + 6, the low byte of the word, the request, which LIB does not show.
2465
INC HL 23
Increment Register Pair HL to the entry + 7, the library byte.
2466
INC HL 23
Increment Register Pair HL to the entry + 8, the next entry.
2467
POP BC C1
Pop Register Pair BC from the stack (Stack Pointer): Register C = the commands that still fit on this line, Register B = 00H.
2468
DEC C 0D
Decrement Register C, the commands that still fit on this line.
2469
If there is room for another (NZ), jump to LIB2 at 2437H for the next entry.
246B
LD C,0DH 0E 0D
Load Register C with 0DH, a carriage return, to end the line of 7 commands.
246D
LD A,02H 3E 02
Load Register A with 02H, SVC 2, @DSP, to show the carriage return in Register C.
246F
RST 28H EF
Call @DSP with RST 28H to end the line, before the end of the table is looked for (B63).
2470
Jump to LIB1 at 2430H to begin a new line with its 2 spaces.
2472LIB4
LD C,0DH 0E 0D
LIB4: load Register C with 0DH, a carriage return, to end the library's last line.
2474
LD A,02H 3E 02
Load Register A with 02H, SVC 2, @DSP, to show the carriage return in Register C.
2476
RST 28H EF
Call @DSP with RST 28H to end the line; after a full line of 7 (Library A has 21 commands, 3 full lines) it ends a line that holds only the 2 spaces (B63).
2477
LD HL,249CH 21 9C 24
Load Register Pair HL with 249CH, the letter A of the heading Library <A>.
247A
INC (HL) 34
Increment the byte at Register Pair HL, 249CH: B for the second pass, C for the third.
247B
LD A,(2441H) 3A 41 24
Load Register A with the byte at 2441H, LIBX's operand, the library byte of this pass.
247E
ADD A,20H C6 20
Add 20H to Register A: 80H becomes A0H (Library B), A0H becomes C0H (Library C).
2480
LD (2441H),A 32 41 24
Store Register A at 2441H, LIBX's operand, for the next pass.
2483
POP BC C1
Pop Register Pair BC from the stack (Stack Pointer): Register B = the libraries still to show, pushed at 2424H.
2484
Decrement Register B and jump back to LIB0 at 2424H until the three libraries are shown.
2486
LD HL,0000H 21 00 00
Load Register Pair HL with 0000H, the return code of a command that worked.
2489
RET C9
Return with Register Pair HL = 0000H, to @EXIT for a typed command or to the program that sent it through @CMNDR.

248AH - TAB: Show Spaces

TAB shows as many spaces as Register B holds, for the 2 spaces in front of a line (2432H) and the 5 after a name (2461H).

248ATAB
LD C,20H 0E 20
TAB: load Register C with 20H, a space, again on each pass.
248C
LD A,02H 3E 02
Load Register A with 02H, SVC 2, @DSP, to show the space in Register C.
248E
RST 28H EF
Call @DSP with RST 28H to show the space in Register C on the video at the cursor.
248F
Decrement Register B and jump back to TAB at 248AH until the spaces counted in Register B are shown.
2491
RET C9
Return to the caller (2435H or 2464H) with Register B = 00H, the count used up.

2492H - LIB Data: the Heading

LIBMSG is the heading shown at the start of each pass. Its first byte is 00H for the first heading and 0AH, a line feed, for the next two (242BH); its letter at 249CH is A, then B and C (247AH). After it, up to 24FFH, the file loads nothing: the source moves the origin to 2500H for the ID command.

2492LIBMSG
DEFB 00H 00
LIBMSG, 2492H: 00H in the file, so that the first heading begins on the line where the cursor is; LIB stores 0AH here after showing it (242BH).
2493-249B
DEFM "Library <" 4C 69 62 72 61 72 79 20 3C
2493H-249BH: the word Library and the < in front of the library's letter.
249C
DEFM "A" 41
249CH: the library's letter, A in the file, raised to B and C by 247AH.
249D-249E
DEFM ">" / DEFB 0DH 3E 0D
249DH-249EH: the > after the letter and the carriage return that ends the heading.
249F-24FF
DEFS 97
249FH-24FFH: not loaded, the gap the source's ORG 2500H leaves; it holds whatever the memory held and nothing in member 4 reads or writes it.

2500H - DOID: the ID Command

In 6.3.1 ID only shows No service contract! and returns 0000H: the release has no customer service number. 6.3.0 opened SYS0/SYS with its password (the name is stored with each byte XOR 1BH), read the sector holding the number, put its 10 digits at 22F6H-22FFH and called the DOID entry of SYS3/SYS (request B5H), which in 6.3.1 is a RET (SYS3 2136H).

2500DOID
LD HL,250AH 21 0A 25LD HL,NOID$
DOID: load Register Pair HL with 250AH, NOID$, the message No service contract! and its carriage return. A 6.3.1 change, marked 631 in the source, as are the rows down to 251EH.
2503
LD A,0AH 3E 0A
Load Register A with 0AH, SVC 10, @DSPLY, which shows a line on the video up to its 0DH.
2505
RST 28H EF
Call @DSPLY with RST 28H to show the message on the video; it is not written to the job log.
2506
LD HL,0000H 21 00 00
Load Register Pair HL with 0000H, the return code of a command that worked.
2509
RET C9
Return with Register Pair HL = 0000H, to @EXIT for a typed command or to the program that sent it through @CMNDR.
250A-251ENOID$
DEFM "No service contract!" / DEFB 0DH 4E 6F 20 73 65 72 76 69 63 65 20 63 6F 6E 74 72 61 63 74 21 0D
NOID$, 250AH-251EH: the message of ID, ended by its carriage return.

2400H - Member 5 (REMOVE): Entry Point and Exits

SYS1/SYS runs REMOVE with request 18H; its header points at member 5, which the overlay loader reads to 2400H-2542H and 2552H. REMOVE enters at 2400H with Register Pair HL at the text after the command word. It keeps the Stack Pointer it was entered with in SAVESP, so that every exit can drop whatever is still pushed. EXIT returns 0000H, IOERR shows a DOS error through @ERROR and returns its number, SPCREQ shows File spec required and returns FFFFH, as BRKABT does after BREAK.

2400REMOVE
LD (2410H),SP ED 73 10 24
REMOVE: REMOVE's entry (request 18H): store the Stack Pointer into 2410H, the operand of the LD SP at SAVESP (240FH), so that every way out of REMOVE returns from this depth. A 6.3.1 change, marked 631 in the source: 6.3.0 stored it after the BREAK test (BEGINA) and returned FFFFH itself on BREAK.
2404
LD A,6AH 3E 6A
Load Register A with 6AH, SVC 106, @CKBRKC, which tests and clears the BREAK key.
2406
RST 28H EF
Call @CKBRKC with RST 28H: NZ when BREAK was pressed before REMOVE began.
2407
If BREAK was pressed (NZ), jump to BRKABT at 2416H to return FFFFH without removing anything (631).
2409BEGINA
BEGINA: call REMOV at 242EH with Register Pair HL at the command line after the word REMOVE: REMOV removes each file and device named there and returns when it reaches the end of the line.
240CEXIT
LD HL,0000H 21 00 00
EXIT: load Register Pair HL with 0000H, the return code of a command that worked, after REMOV has returned at the end of the line (2440H).
240FSAVESP
LD SP,0000H 31 00 00
SAVESP: load the Stack Pointer with 0000H, the operand at 2410H that the entry stores (2400H): the Stack Pointer of the entry, dropping whatever an error path left pushed.
2412
LD A,6AH 3E 6A
Load Register A with 6AH, SVC 106, @CKBRKC, to clear a BREAK that is still noted.
2414
RST 28H EF
Call @CKBRKC with RST 28H, so that a BREAK pressed during the command does not also stop what runs next.
2415
RET C9
Return with Register Pair HL = 0000H, FFFFH or the error number, through RST28's tail: to @EXIT for a typed command, or to the program that sent it through @CMNDR.
2416BRKABT
LD HL,FFFFH 21 FF FF
BRKABT: load Register Pair HL with FFFFH, the return code of a command stopped by BREAK (2407H, 2437H) or by its own message (2421H). Marked 631 in the source, as are 2419H and 2421H: 6.3.0 had BRKABT before EXIT.
2419
Jump to SAVESP at 240FH to restore the Stack Pointer, clear BREAK and return with Register Pair HL = FFFFH.
241BSPCREQ
LD HL,2523H 21 23 25LD HL,SPCREQ$
SPCREQ: load Register Pair HL with 2523H, SPCREQ$, the message File spec required, when @FSPEC refuses the text at the command line pointer (2447H).
241E
LD A,0CH 3E 0C
Load Register A with 0CH, SVC 12, @LOGOT, which shows a line on the video and writes it to the job log.
2420
RST 28H EF
Call @LOGOT with RST 28H to show File spec required.
2421ERREXIT
ERREXIT: jump to BRKABT at 2416H to return FFFFH, the code of a command that has shown its own message (631; 6.3.0 loaded Register Pair HL here and jumped to SAVESP).
2423IOERR
LD L,A 6F
IOERR: load Register L with Register A, the error number of the failed SVC, which every error path of REMOVE brings here through REMOV1 (2431H) or directly (246EH).
2424
LD H,00H 26 00
Load Register H with 00H: Register Pair HL = the error number, returned to the caller.
2426
OR C0H F6 C0
OR Register A with C0H: bit 7 tells @ERROR to return to the caller instead of aborting, bit 6 asks for the message alone, without the error code, file and last SVC lines.
2428
LD C,A 4F
Load Register C with Register A, the error number with bits 7 and 6 set, the form @ERROR takes.
2429
LD A,1AH 3E 1A
Load Register A with 1AH, SVC 26, @ERROR, which shows the message of the error in Register C.
242B
RST 28H EF
Call @ERROR with RST 28H to show the error message, as File not in directory, Illegal access attempted to protected file or Device in use.
242C
Jump to SAVESP at 240FH to restore the Stack Pointer, clear BREAK and return with Register Pair HL = the error number.

242EH - REMOV: the Loop over the Command Line, and Files

REMOV takes the words of the command line one at a time. It skips the spaces before each, returns at the 0DH that ends the line and gives the next word to @FSPEC. A device specification goes to RMVDVC at 249FH; a file is opened, its access level checked, and its name, without the password and with the drive the open found, is shown after Removing: before @REMOVE deletes it. Every SVC result comes back to REMOV1, which ends the command with IOERR at the first error, so the words after a file that is not found are not looked at.

242EREMOV
PUSH HL E5
REMOV: push Register Pair HL onto the stack (Stack Pointer): the command line pointer, which REMOV1 pops at once.
242FREMOV0
XOR A AF
REMOV0: XOR Register A with itself: Register A = 00H and the Z flag set, so that REMOV1 goes on; RMVDVC comes back here after each device (24F7H).
2430REMOV1
POP HL E1
REMOV1: pop Register Pair HL from the stack (Stack Pointer): the command line pointer, as @FSPEC left it after the last word (pushed at 244AH). The result of each step comes here with the Z flag set when it worked, or NZ with the error number in Register A (2463H, 2492H, 249CH, 24ABH, 24BDH, 24C7H).
2431
If the last step failed (NZ), jump to IOERR at 2423H to show the error in Register A and end REMOVE.
2434
LD A,6AH 3E 6A
Load Register A with 6AH, SVC 106, @CKBRKC, to test the BREAK key before each word.
2436
RST 28H EF
Call @CKBRKC with RST 28H: NZ when BREAK has been pressed.
2437
If BREAK was pressed (NZ), jump to BRKABT at 2416H to return FFFFH; the files and devices already removed stay removed.
2439
DEC HL 2B
Decrement Register Pair HL, the command line pointer, so that the INC at 243AH lands on the character it pointed at.
243AREMOV2
INC HL 23
REMOV2: increment Register Pair HL to the next character of the command line.
243B
LD A,(HL) 7E
Load Register A with the character at Register Pair HL.
243C
CP 20H FE 20
Compare Register A, the character at the command line pointer, with 20H, a space: Z for a space, Carry for a character below it.
243E
If it is a space (Z), jump back to REMOV2 at 243AH to skip it.
2440
RET C D8
If the character is below 20H (Carry), the 0DH that ends the line, return to EXIT at 240CH: every word has been dealt with. With nothing after the word REMOVE the command returns 0000H at once, without a message.
2441REMOV3
LD DE,2552H 11 52 25LD DE,FCB
REMOV3: load Register Pair DE with 2552H, FCB, where @FSPEC is to put the specification.
2444
LD A,4EH 3E 4E
Load Register A with 4EH, SVC 78, @FSPEC, which checks the specification at Register Pair HL and copies it into the FCB at Register Pair DE, ended by 03H.
2446
RST 28H EF
Call @FSPEC with RST 28H: Z with Register Pair HL after the specification: on the 0DH when it ends the line, otherwise past its separator and any spaces after it; NZ when the text is not a file or device specification.
2447
If @FSPEC refused it (NZ), jump to SPCREQ at 241BH to show File spec required.
244A
PUSH HL E5
Push Register Pair HL onto the stack (Stack Pointer): the command line pointer after this specification, for REMOV1 (2430H).
244B
PUSH DE D5
Push Register Pair DE onto the stack (Stack Pointer): 2552H, the FCB.
244C
EX DE,HL EB
Exchange Register Pair DE and Register Pair HL: Register Pair HL = 2552H, the FCB's text, Register Pair DE = the command line pointer, which is not used again here.
244D
LD DE,2543H 11 43 25LD DE,FILESPC
Load Register Pair DE with 2543H, FILESPC, where the name to be shown is built.
2450
Call MOVSPC at 2502H to copy the FCB's text to FILESPC without its password: on return Register Pair HL points at the 03H that ends the FCB's text and Register Pair DE after the last character copied.
2453
LD A,0DH 3E 0D
Load Register A with 0DH, the carriage return that ends the name for @DSPLY.
2455
LD (DE),A 12
Store Register A, 0DH, at Register Pair DE, after the name in FILESPC. FILESPC has 15 bytes: a specification of 15 characters, possible only with a drive and an exclamation mark (NAME/EXT:d!, with or without a password), puts this 0DH at 2552H, the first byte of the FCB, before the open (B66).
2456
POP DE D1
Pop Register Pair DE from the stack (Stack Pointer): 2552H, the FCB.
2457
LD A,(DE) 1A
Load Register A with the FCB's first byte at Register Pair DE (2552H), the first character of the specification.
2458
CP 2AH FE 2A
Compare Register A with 2AH, the character that begins a device specification.
245A
If it is one (Z), jump to RMVDVC at 249FH to remove the device.
245C
LD A,3BH 3E 3B
Load Register A with 3BH, SVC 59, @OPEN, which opens the file named in the FCB at Register Pair DE. Register Pair HL, the buffer address, points at the FCB's 03H, harmless because neither @OPEN nor @REMOVE uses the buffer; Register B, the record length, is whatever MOVSPC's LDI left in it, so the record length error 42 is allowed for below.
245E
RST 28H EF
Call @OPEN with RST 28H: Z when the file was found and opened; NZ with the error number in Register A.
245F
If the file was opened (Z), jump to GOODOPN at 2465H.
2461
CP 2AH FE 2A
Compare Register A with 2AH, error 42, Logical record length open fault: the file was found and is open all the same.
2463
If it is any other error (NZ), as error 24, File not in directory, jump to REMOV1 at 2430H, which ends REMOVE through IOERR with that error.
2465GOODOPN
LD A,(2553H) 3A 53 25
GOODOPN: load Register A with the byte at 2553H, FCB+1, which @OPEN set: bits 2-0 hold the access level the password gave.
2468
AND 07H E6 07
AND Register A with 07H to keep the access level: 0 FULL, 1 REMOVE, 2 RENAME, 3 WRITE, 4 UPDATE, 5 READ, 6 EXECUTE, 7 NO ACCESS.
246A
CP 02H FE 02
Compare Register A with 02H: Carry for FULL and REMOVE, the levels that may delete the file.
246C
LD A,25H 3E 25
Load Register A with 25H, error 37, Illegal access attempted to protected file; the load leaves the flags of the compare.
246E
If the access level is RENAME or less (No Carry), jump to IOERR at 2423H to show error 37 and end REMOVE. SYS10/SYS makes the same test again (@REMOVE). On a write protected diskette @OPEN gives every file READ access at best, so REMOVE stops here with error 37, not Write protected disk.
2471
LD HL,2543H 21 43 25LD HL,FILESPC
Load Register Pair HL with 2543H, FILESPC, to look for a drive in the name.
2474FLOOP
LD A,(HL) 7E
FLOOP: load Register A with the character at Register Pair HL.
2475
CP 0EH FE 0E
Compare Register A with 0EH: Carry only for the 0DH that ends the name.
2477
If it is not the end (No Carry), jump to CHKDSPC at 2487H.
2479
LD (HL),3AH 36 3A
The name has no drive: store 3AH, a colon, over the 0DH at Register Pair HL.
247B
INC HL 23
Increment Register Pair HL past the colon, to the byte after it in FILESPC where the drive digit goes.
247C
LD A,(2558H) 3A 58 25
Load Register A with the byte at 2558H, FCB+6, the drive on which @OPEN found the file.
247F
ADD A,30H C6 30
Add 30H to Register A to make the drive number a digit.
2481
LD (HL),A 77
Store Register A, the drive digit, at Register Pair HL.
2482
INC HL 23
Increment Register Pair HL past the digit, to the byte after it in FILESPC where the new 0DH goes.
2483
LD (HL),0DH 36 0D
Store 0DH at Register Pair HL to end the name again. With a name of 13 characters (a full name and extension and an exclamation mark, typed with no password and no drive) this is 2552H, FCB+0, which loses the open flag: @REMOVE then takes the FCB for a device and answers File not open (B66).
2485
Jump to SHOWFIL at 248CH to show the name and remove the file.
2487CHKDSPC
CP 3AH FE 3A
CHKDSPC: compare Register A with 3AH, a colon: Z when the name already has its drive.
2489
INC HL 23
Increment Register Pair HL to the next character; the increment leaves the Z flag of the compare.
248A
If this was not a colon (NZ), jump back to FLOOP at 2474H for the next character.
248CSHOWFIL
SHOWFIL: call SHOWIT at 2494H to show Removing: and the name in FILESPC.
248F
LD A,39H 3E 39
Load Register A with 39H, SVC 57, @REMOVE (19A6H, request 9CH to SYS10/SYS), which deletes the file of the open FCB at Register Pair DE (2552H): it checks the access level again, frees the file's granules in the GAT, marks its entry free, clears its HIT byte and fills the 32 bytes of the FCB with 00H.
2491
RST 28H EF
Call @REMOVE with RST 28H: Z when the file is gone; NZ with the error number in Register A.
2492
Jump to REMOV1 at 2430H to go on with the next word, or to end with the error.
2494SHOWIT
LD HL,2539H 21 39 25LD HL,SHOW$
SHOWIT: load Register Pair HL with 2539H, SHOW$, the text Removing: and a space, which runs on into FILESPC at 2543H: one line up to FILESPC's 0DH.
2497
PUSH DE D5
Push Register Pair DE onto the stack (Stack Pointer): 2552H, the FCB.
2498
LD A,0AH 3E 0A
Load Register A with 0AH, SVC 10, @DSPLY, which shows a line on the video up to its 0DH.
249A
RST 28H EF
Call @DSPLY with RST 28H to show Removing: and the name; NZ when the display failed.
249B
POP DE D1
Pop Register Pair DE from the stack (Stack Pointer): 2552H, the FCB.
249C
If the display failed (NZ), jump to REMOV1 at 2430H with the error in Register A. REMOV1 then pops SHOWIT's return address instead of the command line pointer, which does no harm: IOERR follows and SAVESP resets the Stack Pointer.
249E
RET C9
Return with the Z flag set to SHOWFIL (248FH) or to 24F7H.

249FH - RMVDVC: Removing a Device

A device may be removed when it is not a system device and is pointed NIL. RMVDVC finds its DCB with @GTDCB and asks @RENAME to rename the device to its own name: SYS2/SYS answers Protected system device (error 40) for the six DCBs below 0231H (KI, DO, PR, SI, SO and JL), and Illegal file name (error 19) for any other, because the new name is already in use. A device that is not NIL gives Device in use (error 39). The 8 bytes of the DCB are then set to 00H, which frees the slot. SCNDCB looks through all 31 DCBs for one routed directly to the removed DCB and sets its NIL bit, but leaves its route bit and vector as they were and starts the scan again, so that it finds the same DCB for ever (B64); a device linked to the removed one is not looked for at all (B65).

249FRMVDVC
PUSH DE D5
RMVDVC: push Register Pair DE onto the stack (Stack Pointer): 2552H, the FCB holding the device specification.
24A0
POP IX DD E1
Pop Index Register IX from the stack (Stack Pointer): Index Register IX = 2552H, the FCB.
24A2
LD E,(IX+01H) DD 5E 01
Load Register E with the byte at the address in Index Register IX plus 1 (IX+01H, 2553H), the first letter of the device name.
24A5
LD D,(IX+02H) DD 56 02
Load Register D with the byte at the address in Index Register IX plus 2 (IX+02H, 2554H), the second letter of the device name.
24A8
LD A,52H 3E 52
Load Register A with 52H, SVC 82, @GTDCB (SYS2/SYS GTDCB 1E5FH), which looks for the DCB whose name at +6 and +7 is Register E and Register D among the DCBs at 0208H-02F8H.
24AA
RST 28H EF
Call @GTDCB with RST 28H: Z with Register Pair HL at the DCB; NZ with Register A = 8, Device not available.
24AB
If there is no such device (NZ), jump to REMOV1 at 2430H, which ends REMOVE with Device not available.
24ADDEV4
LD (2537H),DE ED 53 37 25
DEV4: store Register Pair DE, the device name, into 2537H-2538H, RENDEV+1, after the 2AH there: RENDEV is now the device's own specification.
24B1
PUSH HL E5
Push Register Pair HL onto the stack (Stack Pointer): the address of the DCB.
24B2
LD HL,2536H 21 36 25LD HL,RENDEV
Load Register Pair HL with 2536H, RENDEV, the new name for @RENAME.
24B5
LD E,L 5D
Load Register E with Register L, 36H, the low byte of RENDEV's address 2536H in Register Pair HL.
24B6
LD D,H 54
Load Register D with Register H, 25H: Register Pair DE = 2536H, so that the old and the new name are the same text.
24B7
LD A,38H 3E 38
Load Register A with 38H, SVC 56, @RENAME, which for a device (RENDEV, SYS2 229AH) refuses a DCB below 0231H with error 40 and a new name already in use with error 19; with the same name for both it never renames.
24B9
RST 28H EF
Call @RENAME with RST 28H: NZ with Register A = 40 for a system device, 19 for any other.
24BA
POP HL E1
Pop Register Pair HL from the stack (Stack Pointer): the address of the DCB.
24BB
CP 13H FE 13
Compare Register A with 13H, error 19, Illegal file name: the answer for a device that is not a system device.
24BD
If it is any other answer (NZ), as error 40, Protected system device, jump to REMOV1 at 2430H to end REMOVE with that error. The manual names only JL, KI, DO and PR as system devices; SI and SO are refused too.
24C0CKNILL
BIT 3,(HL) CB 5E
CKNILL: test bit 3 of the DCB's type byte at Register Pair HL, the NIL bit: set when the device is pointed NIL.
24C2
If the device is NIL (NZ), jump to REMOVIT at 24CAH to remove it.
24C4
LD A,27H 3E 27
Load Register A with 27H, error 39, Device in use: the device must first be RESET.
24C6
OR A B7
OR Register A with itself to clear the Z flag: NZ with Register A = 39.
24C7
Jump to REMOV1 at 2430H, which ends REMOVE with Device in use.
24CAREMOVIT
REMOVIT: call SCND4 at 24FAH to set the 8 bytes of the DCB at Register Pair HL to 00H: its type, vector, system bytes and name go, and @GTDCB with Register Pair DE = 0000H now finds the slot free.
24CDSCNDCB
LD DE,494BH 11 4B 49
SCNDCB: load Register Pair DE with 494BH: Register E = 4BH and Register D = 49H, the letters K and I, the name of the keyboard's DCB, the first of the table.
24D0
LD A,52H 3E 52
Load Register A with 52H, SVC 82, @GTDCB, to find the KI DCB.
24D2
RST 28H EF
Call @GTDCB with RST 28H: Register Pair HL = 0208H, the KI DCB; the result is not tested, since KI is always there.
24D3SCND1
BIT 4,(HL) CB 66
SCND1: test bit 4 of the type byte at Register Pair HL, the route bit: set when this device is routed to another.
24D5
If this device is not routed (Z), jump to SCND2 at 24E8H for the next DCB.
24D7
PUSH HL E5
Push Register Pair HL onto the stack (Stack Pointer): the address of this DCB.
24D8
INC L 2C
Increment Register L to the DCB's +1, the low byte of the route vector.
24D9
LD A,(HL) 7E
Load Register A with the byte at Register Pair HL, the low byte of the address of the DCB routed to.
24DA
INC L 2C
Increment Register L to the DCB's +2, so that Register Pair HL points at the high byte of the route vector.
24DB
LD H,(HL) 66
Load Register H with the byte at Register Pair HL, the high byte of that address.
24DC
LD L,A 6F
Load Register L with Register A: Register Pair HL = the address of the DCB this device is routed to.
24DD
LD A,(HL) 7E
Load Register A with the type byte at Register Pair HL, the routed to DCB's.
24DE
POP HL E1
Pop Register Pair HL from the stack (Stack Pointer): the address of the routed DCB again.
24DF
OR A B7
OR Register A with itself: Z when the routed to DCB's type byte is 00H, the DCB just removed (or a free slot).
24E0
If the device it is routed to still exists (NZ), jump to SCND2 at 24E8H.
24E2
LD A,08H 3E 08
Load Register A with 08H, bit 3 alone, the NIL bit of a DCB's type byte.
24E4
OR (HL) B6
OR Register A with the type byte at Register Pair HL, to add the NIL bit to the routed device's type. Bit 4, the route bit, and the vector at +1 and +2 to the removed DCB are left as they are (B64).
24E5
LD (HL),A 77
Store Register A, the type byte with the NIL bit, at Register Pair HL.
24E6
Jump back to SCNDCB at 24CDH to start the scan again from KI. The device just changed is still routed to a DCB of 00H bytes, so the scan comes to it again, and again, for ever: REMOVE hangs (B64).
24E8SCND2
LD A,L 7D
SCND2: load Register A with Register L, the low byte of this DCB's address.
24E9
ADD A,08H C6 08
Add 08H, the length of a DCB, to Register A, the low byte of this DCB's address.
24EB
LD L,A 6F
Load Register L with Register A: Register Pair HL = the next DCB.
24EC
Until Register L wraps round to 00H after the DCB at 02F8H (NZ), jump back to SCND1 at 24D3H to test the next of the 31 DCBs.
24EE
PUSH IX DD E5
Push Index Register IX onto the stack (Stack Pointer): 2552H, the FCB, to move it into Register Pair HL.
24F0
POP HL E1
Pop Register Pair HL from the stack (Stack Pointer): Register Pair HL = 2552H.
24F1
Call SCND4 at 24FAH to set the first 8 bytes of the FCB, 2552H-2559H, to 00H.
24F4
Call SHOWIT at 2494H to show Removing: and the device's specification, which FILESPC still holds: for a device the line comes after the removal.
24F7
Jump to REMOV0 at 242FH to go on with the next word of the command line.
24FASCND4
LD B,08H 06 08
SCND4: load Register B with 08H, the number of bytes to clear.
24FC
XOR A AF
XOR Register A with itself: Register A = 00H.
24FDSCND5
LD (HL),A 77
SCND5: store Register A, 00H, at Register Pair HL.
24FE
INC HL 23
Increment Register Pair HL to the next byte of the 8 bytes being cleared.
24FF
Decrement Register B and, until it reaches 0 (NZ), jump back to SCND5 at 24FDH.
2501
RET C9
Return with Register Pair HL 8 bytes past the start, Register A = 00H and the Z flag set by the XOR.

2502H - MOVSPC: the Name without its Password

MOVSPC copies the FCB's text, as @FSPEC left it, to FILESPC for the Removing: line. It stops at the first character below 20H (the 03H at the end), leaves out a password with its full stop, and leaves out a slash that is not followed by a letter. A password with no drive after it is passed over up to the end, so an exclamation mark after it is left out too.

2502MOVSPC
LD A,(HL) 7E
MOVSPC: load Register A with the character at Register Pair HL, the next one of the FCB's text.
2503
CP 2FH FE 2F
Compare Register A with 2FH, a slash, which comes before an extension.
2505
If it is not a slash (NZ), jump to CKSPACE at 250FH.
2507
INC HL 23
Increment Register Pair HL to the character after the slash.
2508
LD A,(HL) 7E
Load Register A with the character at Register Pair HL.
2509
CP 41H FE 41
Compare Register A with 41H, the letter A: Carry for a digit or other character below it.
250B
If the character after the slash is below A (Carry), jump to CKSPACE at 250FH with that character: the slash is left out of FILESPC.
250D
DEC HL 2B
Decrement Register Pair HL back to the slash.
250E
LD A,(HL) 7E
Load Register A with the slash at Register Pair HL, to copy it.
250FCKSPACE
CP 20H FE 20
CKSPACE: compare Register A with 20H, a space.
2511
RET C D8
If the character is below 20H (Carry), the 03H that ends the FCB's text, return with Register Pair HL at it and Register Pair DE after the last character copied.
2512
CP 2EH FE 2E
Compare Register A with 2EH, the full stop that comes before a password.
2514
If it is not a full stop (NZ), jump to MOVSPC1 at 251FH to copy the character.
2516SKIPPW
INC HL 23
SKIPPW: increment Register Pair HL to the next character of the password.
2517
LD A,(HL) 7E
Load Register A with the character at Register Pair HL.
2518
CP 20H FE 20
Compare Register A, the character of the password, with 20H, a space: Carry for a character below it.
251A
RET C D8
If the character is below 20H (Carry), the end of the text, return: the name had no drive after its password.
251B
CP 3AH FE 3A
Compare Register A with 3AH, the colon that comes before a drive.
251D
If it is not the colon (NZ), jump back to SKIPPW at 2516H to pass over the next character of the password.
251FMOVSPC1
LDI ED A0
MOVSPC1: copy the character at Register Pair HL to Register Pair DE in FILESPC with LDI, which increments Register Pair HL and Register Pair DE and decrements Register Pair BC.
2521
Jump back to MOVSPC at 2502H for the next character.

2523H - REMOVE Data: the Messages, FILESPC and the FCB

The message File spec required, the device name RENDEV that @RENAME is given, and SHOW$, Removing: and a space, which is shown together with FILESPC after it. FILESPC and all of the FCB but its first byte are not in the file. The FCB's first byte is 00H in the file; @FSPEC writes over it before anything reads it.

2523-2535SPCREQ$
DEFM "File spec required" / DEFB 0DH 46 69 6C 65 20 73 70 65 63 20 72 65 71 75 69 72 65 64 0D
SPCREQ$, 2523H-2535H: the message SPCREQ shows (241BH) when a word of the command line is not a file or device specification, ended by its carriage return.
2536-2538RENDEV
DEFM "*RS" 2A 52 53
RENDEV, 2536H-2538H: a device specification. DEV4 writes the name of the device to be removed over its two letters (24ADH) and gives it to @RENAME as both the old and the new name. The letters RS are a 6.3.1 change, marked 631 in the source: 6.3.0 had LS.
2539-2542SHOW$
DEFM "Removing: " 52 65 6D 6F 76 69 6E 67 3A 20
SHOW$, 2539H-2542H: the start of the line SHOWIT shows (2494H); FILESPC follows at once, so @DSPLY goes on into the name.
2543-2551FILESPC
DEFS 15
FILESPC, 2543H-2551H: not loaded. MOVSPC copies the specification here without its password (2450H) and 2455H ends it with 0DH; FLOOP adds a colon and the drive digit when it has none (2479H). The longest name with a drive and an exclamation mark needs 16 bytes with its 0DH, one more than FILESPC has; a 13 character name with no drive needs 16 after FLOOP (B66).
2552FCB
DEFB 00H 00
FCB, 2552H: the first byte of the FCB, 00H in the file. @FSPEC puts the specification here (2446H), @OPEN turns it into an open FCB, and @REMOVE sets its 32 bytes to 00H; for a device SCND4 clears its first 8 bytes (24F1H).
2553-2571
DEFS 31
FCB+1 to FCB+31, 2553H-2571H: not loaded. The code reads FCB+1 (2465H, the access level) and FCB+6 (247CH, the drive), and for a device FCB+1 and FCB+2 (24A2H, 24A5H, the name).

2400H - Member 6 (RENAME): Entry Point and Exits

SYS1/SYS runs RENAME with request 53H; its header points at member 6, which the overlay loader reads to 2400H-25FFH, 263FH-2648H and 2691H-2692H. RENAME enters at 2400H with Register Pair HL at the text after the command word. It keeps the Stack Pointer it was entered with in SAVESP, so that every exit can drop whatever is still pushed. A successful rename returns 0000H; IOERR shows a DOS error through @ERROR and returns its number; SPCERR, DUPNAM and TOWHAT show RENAME's own messages through @LOGOT and return FFFFH, as ABORT does after BREAK.

2400RENAME
LD (242EH),SP ED 73 2E 24
RENAME: RENAME's entry (request 53H): store the Stack Pointer into 242EH, the operand of the LD SP at SAVESP (242DH), so that every way out of RENAME returns from this depth. A 6.3.1 change, marked 631 in the source: 6.3.0 stored it after the BREAK test (BEGINA) and returned FFFFH itself on BREAK.
2404
LD A,6AH 3E 6A
Load Register A with 6AH, SVC 106, @CKBRKC, which tests and clears the BREAK key.
2406
RST 28H EF
Call @CKBRKC with RST 28H: NZ when BREAK was pressed before RENAME began.
2407
If BREAK was pressed (NZ), jump to ABORT at 242AH to return FFFFH without renaming anything (631).
2409
Call RENAM at 2434H with Register Pair HL at the command line after the word RENAME: RENAM parses both names, makes its checks, shows the Renaming: line and returns what @RENAME returned, Z when the file or device was renamed, NZ with the error number in Register A.
240C
LD HL,0000H 21 00 00
Load Register Pair HL with 0000H, the return code of a command that worked (LD leaves the flags of RENAM's result as they were).
240F
If RENAM returned Z, the rename worked: jump to SAVESP at 242DH to return with Register Pair HL = 0000H.
2411IOERR
LD L,A 6F
IOERR: load Register L with Register A, the error number: from RENAM's return (an @OPEN of the old file at 2473H or @RENAME at 24E0H), from DEVREN directly (8 at 2511H, 40 at 2522H, 39 at 2530H).
2412
LD H,00H 26 00
Load Register H with 00H: Register Pair HL = the error number, returned to the caller.
2414
OR C0H F6 C0
OR Register A with C0H: bit 7 tells @ERROR to return to the caller instead of aborting, bit 6 asks for the message alone, without the error code, file and last SVC lines.
2416
LD C,A 4F
Load Register C with Register A, the error number with bits 7 and 6 set, the form @ERROR takes.
2417
LD A,1AH 3E 1A
Load Register A with 1AH, SVC 26, @ERROR, which shows the message of the error in Register C.
2419
RST 28H EF
Call @ERROR with RST 28H to show the error message, as File not in directory, Illegal access attempted to protected file, Protected system device or Device in use.
241A
Jump to SAVESP at 242DH to restore the Stack Pointer, clear BREAK and return with Register Pair HL = the error number.
241CSPCERR
LD HL,25BFH 21 BF 25LD HL,SPCERR$
SPCERR: load Register Pair HL with 25BFH, SPCERR$, the message Specification error: the old name is not a file or device specification (2445H), or one name is a device and the other a file (2467H, 2505H).
241F
DEFB 0DDH DD
241FH: DDH, the IX prefix: entered from 241CH, the LD HL,25D3H that follows runs as LD IX,25D3H, so Register Pair HL keeps SPCERR$.
2420DUPNAM
LD HL,25D3H 21 D3 25LD HL,DUPNAM$
DUPNAM: load Register Pair HL with 25D3H, DUPNAM$, the message Duplicate file name, when a file of the new name already exists on the old file's drive (24B8H).
2423
DEFB 0DDH DD
2423H: DDH, the IX prefix: entered from 241CH or 2420H, the LD HL,25E7H that follows runs as LD IX,25E7H, and Register Pair HL keeps the message chosen above it.
2424TOWHAT
LD HL,25E7H 21 E7 25LD HL,TOWHAT$
TOWHAT: load Register Pair HL with 25E7H, TOWHAT$, the message Rename it to what?, when no new name was given (2455H).
2427
LD A,0CH 3E 0C
Load Register A with 0CH, SVC 12, @LOGOT, which shows a line on the video and writes it to the job log.
2429
RST 28H EF
Call @LOGOT with RST 28H to show the message at Register Pair HL.
242AABORT
LD HL,FFFFH 21 FF FF
ABORT: load Register Pair HL with FFFFH, the return code of a command stopped by BREAK (2407H) or by its own message (after 2429H). The label ABORT is a 6.3.1 change, marked 631 in the source; 6.3.0 had no label here.
242DSAVESP
LD SP,0000H 31 00 00
SAVESP: load the Stack Pointer with 0000H, the operand at 242EH that the entry stores (2400H): the Stack Pointer of the entry, dropping whatever an error path left pushed.
2430
LD A,6AH 3E 6A
Load Register A with 6AH, SVC 106, @CKBRKC, to clear a BREAK that is still noted.
2432
RST 28H EF
Call @CKBRKC with RST 28H, so that a BREAK pressed during the command does not also stop what runs next.
2433
RET C9
Return with Register Pair HL = 0000H, FFFFH or the error number, through RST28's tail: to @EXIT for a typed command, or to the program that sent it through @CMNDR.

2434H - RENAM: Parsing the Names and Renaming a File

RENAM gives the old name to @FSPEC twice, once into TEMPFCB for the open and once into OLDFCB, which keeps the text, and the new name into NEWFCB; a TO between them is passed over by @FSPEC. A new name that @FSPEC refuses (a partial specification such as /OLD) is copied as typed by CVRTUC. With no new name RENAME asks Rename it to what?. A device goes to DEVREN. For a file, the old name is opened without the usual checks to learn its drive, which FLOOP adds to OLDFCB when it has none; MATCH fills the parts the new name leaves out from the old one; the new name's drive is then set to the old one's, and a file of the new name on that drive gives Duplicate file name. REN2 shows Renaming: with both names, without their passwords (but for the case of B67), and @RENAME does the work.

2434RENAM
PUSH HL E5
RENAM: push Register Pair HL onto the stack (Stack Pointer): the command line pointer at the old name.
2435
LD DE,2671H 11 71 26LD DE,TEMPFCB
Load Register Pair DE with 2671H, TEMPFCB, where the first @FSPEC is to put the old name for the @OPEN at 2472H.
2438
LD A,4EH 3E 4E
Load Register A with 4EH, SVC 78, @FSPEC, which checks the specification at Register Pair HL and copies it into the FCB at Register Pair DE, ended by 03H.
243A
RST 28H EF
Call @FSPEC with RST 28H: the old name into TEMPFCB. Its result is not looked at: the second @FSPEC (2444H) parses the same text and is tested.
243B
POP HL E1
Pop Register Pair HL from the stack (Stack Pointer): the command line pointer back at the start of the old name.
243C
LD A,65H 3E 65
Load Register A with 65H, SVC 101, @FLAGS, which points Index Register IY at the system flag table.
243E
RST 28H EF
Call @FLAGS with RST 28H: Index Register IY = 006AH, FLGTAB$, so that (IY+12H) is SFLAG$ at 007CH.
243F
LD DE,261FH 11 1F 26LD DE,OLDFCB
Load Register Pair DE with 261FH, OLDFCB, which keeps the text of the old name.
2442
LD A,4EH 3E 4E
Load Register A with 4EH, SVC 78, @FSPEC, for the old name a second time, into OLDFCB.
2444
RST 28H EF
Call @FSPEC with RST 28H: the old name into OLDFCB, ended by 03H; Z with Register Pair HL past its separator and the spaces after it, at TO or at the new name.
2445
If @FSPEC refused the old name (NZ), jump to SPCERR at 241CH to show Specification error.
2447
LD DE,25FFH 11 FF 25LD DE,NEWFCB
Load Register Pair DE with 25FFH, NEWFCB, for the new name.
244A
LD A,4EH 3E 4E
Load Register A with 4EH, SVC 78, @FSPEC, for the new name, the word after the old one.
244C
RST 28H EF
Call @FSPEC with RST 28H: the new name into NEWFCB. A word TO, ON, OVER or USING is looked up in SYS1's PREPTBL and passed over, so the word after it is taken. NZ when the text does not begin with a name or a device (as /OLD or :1), or when a password or drive field is empty; @FSPEC always stores at least 03H at NEWFCB+0 (25FFH).
244D
If @FSPEC refused the new name (NZ), call CVRTUC at 2538H with Register Pair DE = 25FFH, NEWFCB, and Register Pair HL where @FSPEC left it: after the character it stopped at, on a 03H, 0DH or opening parenthesis, or, when spaces followed an empty field (NEW: X), at the next word, which CVRTUC then copies alone (RENAME TEST/DAT TO NEW: X renames the file X/DAT). CVRTUC copies the rest of the line there in capitals, unless the line ends at Register Pair HL.
2450REN1
LD A,(25FFH) 3A FF 25LD A,(NEWFCB)
REN1: load Register A with the byte at 25FFH, NEWFCB+0: the first character of the new name, or 03H when @FSPEC found nothing and CVRTUC returned at the end of the line.
2453
CP 0FH FE 0F
Compare Register A with 0FH (CR+2 in the source): Carry for 03H and 0DH, the end marks, so for a command with no new name.
2455
If there is no new name (Carry), jump to TOWHAT at 2424H to ask Rename it to what? and return FFFFH.
2458
LD HL,261FH 21 1F 26LD HL,OLDFCB
Load Register Pair HL with 261FH, OLDFCB, the text of the old name.
245B
LD DE,25FFH 11 FF 25LD DE,NEWFCB
Load Register Pair DE with 25FFH, NEWFCB, the text of the new name.
245E
LD A,(HL) 7E
Load Register A with the first character of the old name at Register Pair HL (261FH).
245F
CP 2AH FE 2A
Compare Register A with 2AH, the character that begins a device specification.
2461
If the old name is a device (Z), jump to DEVREN at 2502H.
2464
LD A,(DE) 1A
Load Register A with the first character of the new name at Register Pair DE (25FFH).
2465
CP 2AH FE 2A
Compare Register A with 2AH, the character that begins a device specification.
2467
If the old name is a file and the new name a device (Z), jump to SPCERR at 241CH to show Specification error.
2469
LD DE,2671H 11 71 26LD DE,TEMPFCB
Load Register Pair DE with 2671H, TEMPFCB, which holds the old name from the first @FSPEC (243AH).
246C
SET 0,(IY+12H) FD CB 12 C6
Set bit 0 of the byte at Index Register IY plus 12H (IY+12H, SFLAG$ 007CH): SYS2's OPNCB then returns at once with Z, without the access, open bit and record length checks. The open of SYS2 (OPEN1 1F61H) saves SFLAG$ and clears bits 0-2, so the bit lasts for one open; the password is still compared (a NO ACCESS file with a wrong password gives File access denied).
2470
LD A,3BH 3E 3B
Load Register A with 3BH, SVC 59, @OPEN, which looks for the file named in the FCB at Register Pair DE.
2472
RST 28H EF
Call @OPEN with RST 28H, with Register Pair HL = 261FH (OLDFCB) as the buffer address, which an open with bit 0 set never uses: Z when the file is found; Register Pair HL comes back unchanged (SYS2 restores every register but AF).
2473
RET NZ C0
If the old file cannot be opened (NZ), return to 240CH with the error in Register A, as File not in directory (24), Illegal file name (19) or Illegal drive number (32): IOERR shows it.
2474
LD BC,(2677H) ED 4B 77 26
Load Register Pair BC with the word at 2677H, TEMPFCB+6 and +7: Register C = the drive on which @OPEN found the file, Register B = its DEC (not used).
2478
PUSH HL E5
Push Register Pair HL onto the stack (Stack Pointer): 261FH, OLDFCB, for DOMATCH (2496H).
2479FLOOP
LD A,(HL) 7E
FLOOP: load Register A with the character of the old name at Register Pair HL.
247A
CP 0EH FE 0E
Compare Register A with 0EH (CR+1 in the source): Carry for the 03H that ends the name in OLDFCB.
247C
If it is a character of the name (No Carry), jump to CHKDSPC at 248DH to see whether it is the colon of a drive.
247E
LD (HL),3AH 36 3A
The old name has no drive: store 3AH, a colon, at Register Pair HL over the 03H that ended it.
2480
INC HL 23
Increment Register Pair HL to the byte after the colon.
2481
LD A,C 79
Load Register A with Register C, the drive on which @OPEN found the file (2474H).
2482
ADD A,30H C6 30
Add 30H to Register A: the drive number 0-7 becomes the digit 0-7.
2484
LD (HL),A 77
Store Register A, the drive digit, at Register Pair HL after the colon.
2485
LD (24A5H),A 32 A5 24
Store Register A, the drive digit, into 24A5H, the operand of the LD A at OLD_DRV (24A4H), which F2LOOP writes into the new name.
2488
INC HL 23
Increment Register Pair HL to the byte after the digit.
2489
LD (HL),0DH 36 0D
Store 0DH at Register Pair HL: OLDFCB now ends NAME/EXT.PASSWORD:d and 0DH.
248B
Jump to DOMATCH at 2496H, the drive added and noted for F2LOOP.
248DCHKDSPC
CP 3AH FE 3A
CHKDSPC: compare Register A, the character of the old name, with 3AH, the colon that comes before a drive.
248F
INC HL 23
Increment Register Pair HL to the next character (INC of a register pair leaves the flags of the compare).
2490
If it is not the colon (NZ), jump back to FLOOP at 2479H for the next character.
2492
LD A,(HL) 7E
Load Register A with the character at Register Pair HL after the colon: the drive digit typed with the old name.
2493
LD (24A5H),A 32 A5 24
Store Register A, the drive digit, into 24A5H, the operand of the LD A at OLD_DRV (24A4H).
2496DOMATCH
POP HL E1
DOMATCH: pop Register Pair HL from the stack (Stack Pointer): 261FH, OLDFCB.
2497
LD DE,25FFH 11 FF 25LD DE,NEWFCB
Load Register Pair DE with 25FFH, NEWFCB, the new name that MATCH completes.
249A
Call MATCH at 255DH, which fills the name, extension, drive and password that the new name at Register Pair DE leaves out from the old name at Register Pair HL; it returns both pointers unchanged.
249D
PUSH DE D5
Push Register Pair DE onto the stack (Stack Pointer): 25FFH, NEWFCB.
249EF2LOOP
LD A,(DE) 1A
F2LOOP: load Register A with the character of the new name at Register Pair DE.
249F
INC DE 13
Increment Register Pair DE to the next character.
24A0
CP 3AH FE 3A
Compare Register A with 3AH, the colon of a drive; after MATCH the new name always has one, typed or taken from OLDFCB.
24A2
If it is not the colon (NZ), jump back to F2LOOP at 249EH.
24A4OLD_DRV
LD A,00H 3E 00
OLD_DRV: load Register A with 00H, the operand at 24A5H: the old name's drive digit, stored by 2485H or 2493H.
24A6
LD (DE),A 12
Store Register A, the old drive digit, at Register Pair DE, the character after the new name's colon: a drive typed with the new name is replaced without a message. When the new name was typed with a colon and nothing after it, this byte is its end mark (03H from @FSPEC, 0DH from CVRTUC) and the name runs on into whatever follows in NEWFCB, or, when the old name has a password, the full stop MATCH inserted there, so the password's letters follow the drive on the Renaming: line (B67).
24A7
POP DE D1
Pop Register Pair DE from the stack (Stack Pointer): 25FFH, NEWFCB.
24A8
PUSH HL E5
Push Register Pair HL onto the stack (Stack Pointer): 261FH, OLDFCB.
24A9
PUSH DE D5
Push Register Pair DE onto the stack (Stack Pointer): 25FFH, NEWFCB.
24AA
EX DE,HL EB
Exchange Register Pair DE and Register Pair HL: Register Pair HL = 25FFH, the new name, Register Pair DE = 261FH.
24AB
LD DE,2671H 11 71 26LD DE,TEMPFCB
Load Register Pair DE with 2671H, TEMPFCB, to try the new name.
24AE
SET 0,(IY+12H) FD CB 12 C6
Set bit 0 of the byte at Index Register IY plus 12H (IY+12H, SFLAG$ 007CH) again, for an open without the checks.
24B2
LD A,4EH 3E 4E
Load Register A with 4EH, SVC 78, @FSPEC, to parse the completed new name.
24B4
RST 28H EF
Call @FSPEC with RST 28H: the new name from NEWFCB into TEMPFCB. Its result is not looked at. @FSPEC stops after the drive, and MATCH always puts the drive before a password, the old one or one typed with the new name, so this open never has a password: a NO ACCESS file of the new name gives File access denied here instead of Z. Characters past the 8th of the name or the 3rd of the extension are passed over, though @RENAME will not pass over them (B69).
24B5
LD A,3BH 3E 3B
Load Register A with 3BH, SVC 59, @OPEN, to see whether the new name is in use.
24B7
RST 28H EF
Call @OPEN with RST 28H: Z when a file of the new name exists on the old name's drive.
24B8
If it exists (Z), jump to DUPNAM at 2420H to show Duplicate file name; this is also the answer when the new name, with its defaults, is the old file's own name.
24BB
POP DE D1
Pop Register Pair DE from the stack (Stack Pointer): 25FFH, NEWFCB.
24BC
POP HL E1
Pop Register Pair HL from the stack (Stack Pointer): 261FH, OLDFCB.
24BDREN2
PUSH HL E5
REN2: push Register Pair HL onto the stack (Stack Pointer): the old name, a file at 261FH or a device (DEVREN comes here from 2535H).
24BE
PUSH DE D5
Push Register Pair DE onto the stack (Stack Pointer): the new name, 25FFH.
24BF
LD DE,2649H 11 49 26LD DE,SPECS$
Load Register Pair DE with 2649H, SPECS$, where the text after Renaming: is built.
24C2
Call MOVSPC at 24E1H to copy the old name without its password: on return Register Pair DE is after the last character copied.
24C5
LD HL,25FAH 21 FA 25LD HL,TO$
Load Register Pair HL with 25FAH, TO$, the text " to " and 03H.
24C8
LD BC,0004H 01 04 00
Load Register Pair BC with 0004H, the four characters of " to ", without the 03H.
24CB
LDIR ED B0
Copy the 4 bytes from Register Pair HL (25FAH) to Register Pair DE in SPECS$ with LDIR, which increments Register Pair HL and Register Pair DE and counts Register Pair BC down to 0000H.
24CD
POP HL E1
Pop Register Pair HL from the stack (Stack Pointer): the new name, 25FFH.
24CE
PUSH HL E5
Push Register Pair HL onto the stack (Stack Pointer) again, for the @RENAME at 24DFH.
24CF
Call MOVSPC at 24E1H to copy the new name without its password after " to ".
24D2
LD A,0DH 3E 0D
Load Register A with 0DH, the carriage return that ends the line for @LOGOT.
24D4
LD (DE),A 12
Store Register A, 0DH, at Register Pair DE, after the new name in SPECS$.
24D5
LD HL,263FH 21 3F 26LD HL,RENAM$
Load Register Pair HL with 263FH, RENAM$: the text Renaming: and a space, which runs on into SPECS$ at 2649H.
24D8
LD A,0CH 3E 0C
Load Register A with 0CH, SVC 12, @LOGOT, which shows a line on the video and writes it to the job log.
24DA
RST 28H EF
Call @LOGOT with RST 28H to show Renaming: OLD to NEW. The line comes before the rename, so it is shown also when @RENAME then refuses.
24DB
POP HL E1
Pop Register Pair HL from the stack (Stack Pointer): the new name, 25FFH.
24DC
POP DE D1
Pop Register Pair DE from the stack (Stack Pointer): the old name, the FCB @RENAME takes (OLDFCB, or OLDFCB holding the device specification).
24DD
LD A,38H 3E 38
Load Register A with 38H, SVC 56, @RENAME (SYS2/SYS RENAME 2217H), which opens the old name in the FCB at Register Pair DE, checks that it may be renamed and gives it the name at Register Pair HL; for a device it renames the DCB (RENDEV 229AH). It parses Register Pair HL's text itself with XFRSPEC (2207H), which takes the character after the 8th of a filename or the 3rd of an extension as its separator, so a name MATCH or CVRTUC made too long loses its extension and drive there (B69).
24DF
RST 28H EF
Call @RENAME with RST 28H: Z when renamed; NZ with the error in Register A, as Illegal access attempted to protected file (37) for a file that the password given opens at a level below RENAME (WRITE, UPDATE, READ or EXEC).
24E0
RET C9
Return to 240CH with the result of @RENAME in the flags and Register A.

24E1H - MOVSPC: a Name without its Password

MOVSPC copies a name for the Renaming: line to Register Pair DE in SPECS$. It stops at the first character below 20H (the 03H or 0DH at the end), leaves out a password with its full stop, and leaves out a slash that is not followed by a letter, so that a name given an empty extension (REAL/) is shown without one. A password with no drive after it is passed over up to the end. The same routine is in member 5 (REMOVE, 2502H).

24E1MOVSPC
LD A,(HL) 7E
MOVSPC: load Register A with the character at Register Pair HL, the next one of the name.
24E2
CP 2FH FE 2F
Compare Register A with 2FH, a slash, which comes before an extension.
24E4
If it is not a slash (NZ), jump to CKSPACE at 24EEH.
24E6
INC HL 23
Increment Register Pair HL to the character after the slash.
24E7
LD A,(HL) 7E
Load Register A with the character at Register Pair HL.
24E8
CP 41H FE 41
Compare Register A with 41H, the letter A: Carry for a digit or other character below it.
24EA
If the character after the slash is below A (Carry), jump to CKSPACE at 24EEH with that character: the slash is left out of SPECS$.
24EC
DEC HL 2B
Decrement Register Pair HL back to the slash.
24ED
LD A,(HL) 7E
Load Register A with the slash at Register Pair HL, to copy it.
24EECKSPACE
CP 20H FE 20
CKSPACE: compare Register A with 20H, a space.
24F0
RET C D8
If the character is below 20H (Carry), the 03H or 0DH that ends the name, return with Register Pair HL at it and Register Pair DE after the last character copied.
24F1
CP 2EH FE 2E
Compare Register A with 2EH, the full stop that comes before a password.
24F3
If it is not a full stop (NZ), jump to MOVSPC1 at 24FEH to copy the character.
24F5SKIPPW
INC HL 23
SKIPPW: increment Register Pair HL to the next character of the password.
24F6
LD A,(HL) 7E
Load Register A with the character at Register Pair HL.
24F7
CP 20H FE 20
Compare Register A, the character of the password, with 20H, a space: Carry for a character below it.
24F9
RET C D8
If the character is below 20H (Carry), the end of the name, return: the name had no drive after its password.
24FA
CP 3AH FE 3A
Compare Register A with 3AH, the colon that comes before a drive.
24FC
If it is not the colon (NZ), jump back to SKIPPW at 24F5H to pass over the next character of the password.
24FEMOVSPC1
LDI ED A0
MOVSPC1: copy the character at Register Pair HL to Register Pair DE in SPECS$ with LDI, which increments Register Pair HL and Register Pair DE and decrements Register Pair BC. Nothing limits the copy to the 40 bytes of SPECS$.
2500
Jump back to MOVSPC at 24E1H for the next character.

2502H - DEVREN: Renaming a Device

A device may be given only a device name, and only a device that exists and is not a system device may be renamed. DEVREN finds the old device's DCB with @GTDCB and compares its address with the DCB of JL, the last of the six system devices: a DCB at 0230H or below (KI, DO, PR, SI, SO and JL) gives Protected system device (error 40). A new name that another DCB already has gives Device in use (error 39), the message the change log of the 6.2 source (1983) chose instead of Duplicate file name. Then REN2 shows the Renaming: line and @RENAME writes the new name into the DCB. Routing, links, filters and settings stay as they were.

2502DEVREN
LD A,(DE) 1A
DEVREN: load Register A with the first character of the new name at Register Pair DE (25FFH).
2503
CP 2AH FE 2A
Compare Register A with 2AH, the character that begins a device specification.
2505
If the new name is not a device (NZ), jump to SPCERR at 241CH to show Specification error.
2508
PUSH HL E5
Push Register Pair HL onto the stack (Stack Pointer): 261FH, OLDFCB, the old device specification.
2509
PUSH DE D5
Push Register Pair DE onto the stack (Stack Pointer): 25FFH, NEWFCB, the new device specification.
250A
INC HL 23
Increment Register Pair HL past the device character to 2620H, the first letter of the old name.
250B
LD E,(HL) 5E
Load Register E with the first letter of the old device name at Register Pair HL (2620H).
250C
INC HL 23
Increment Register Pair HL to 2621H, the second letter.
250D
LD D,(HL) 56
Load Register D with the second letter at Register Pair HL (2621H): Register Pair DE = the old device name, the first letter in Register E.
250E
LD A,52H 3E 52
Load Register A with 52H, SVC 82, @GTDCB (SYS2/SYS GTDCB 1E5FH), which looks for the DCB whose name at +6 and +7 is Register E and Register D among the DCBs at 0208H-02F8H.
2510
RST 28H EF
Call @GTDCB with RST 28H: Z with Register Pair HL at the DCB; NZ with Register A = 8, Device not available.
2511
If there is no such device (NZ), jump to IOERR at 2411H to show Device not available.
2514
LD B,H 44
Load Register B with Register H, the high byte of the old device's DCB address in Register Pair HL.
2515
LD C,L 4D
Load Register C with Register L: Register Pair BC = the old device's DCB.
2516
LD DE,4C4AH 11 4A 4C
Load Register Pair DE with 4C4AH: Register E = 4AH, the letter J, Register D = 4CH, the letter L, the name of the job log device.
2519
LD A,52H 3E 52
Load Register A with 52H, SVC 82, @GTDCB, to find the DCB of JL.
251B
RST 28H EF
Call @GTDCB with RST 28H: Register Pair HL = 0230H, the DCB of JL, the last system DCB. The result is not tested: JL is a system device and cannot be removed or renamed.
251C
INC HL 23
Increment Register Pair HL to 0231H, JL's DCB address plus 1: its low byte 31H is the value of DCBKL$, the limit SYS2's RENDEV compares with too (22A2H); JL's own DCB is 0230H-0237H.
251D
OR A B7
OR Register A with itself to clear the Carry flag for the SBC.
251E
SBC HL,BC ED 42
Subtract Register Pair BC, the old device's DCB, from Register Pair HL, 0231H: No Carry when the DCB is at 0231H or below, which holds for KI 0208H, DO 0210H, PR 0218H, SI 0220H, SO 0228H and JL 0230H.
2520
LD A,28H 3E 28
Load Register A with 28H, error 40, Protected system device (LD leaves the flags of the SBC).
2522
If the old device is a system device (No Carry), jump to IOERR at 2411H to show Protected system device.
2525
POP HL E1
Pop Register Pair HL from the stack (Stack Pointer): 25FFH, the new device specification.
2526
PUSH HL E5
Push Register Pair HL onto the stack (Stack Pointer) again.
2527
INC HL 23
Increment Register Pair HL past the device character to 2600H, the first letter of the new name.
2528
LD E,(HL) 5E
Load Register E with the first letter of the new device name at Register Pair HL (2600H).
2529
INC HL 23
Increment Register Pair HL to 2601H, the second letter.
252A
LD D,(HL) 56
Load Register D with the second letter at Register Pair HL (2601H), or 03H for a one letter name: Register Pair DE = the new device name.
252B
LD A,52H 3E 52
Load Register A with 52H, SVC 82, @GTDCB, to look for a DCB with the new name.
252D
RST 28H EF
Call @GTDCB with RST 28H: Z when a DCB already has the new name.
252E
LD A,27H 3E 27
Load Register A with 27H, error 39, Device in use (LD leaves the flags of @GTDCB).
2530
If the new name is in use (Z), jump to IOERR at 2411H to show Device in use.
2533
POP DE D1
Pop Register Pair DE from the stack (Stack Pointer): 25FFH, the new device specification.
2534
POP HL E1
Pop Register Pair HL from the stack (Stack Pointer): 261FH, the old device specification.
2535
Jump to REN2 at 24BDH to show Renaming: and the two device names and call @RENAME.

2538H - CVRTUC: a Partial New Name

When @FSPEC refuses the new name, as it does for a name that leaves out the filename (/OLD, :1, .PW) or ends with an empty drive or password field, CVRTUC copies the text to NEWFCB itself, in capitals, from the character @FSPEC stopped at. It copies up to the 0DH that ends the line, or to an opening parenthesis, at most 32 characters, and does not stop at a space, so any words after the new name are copied too. The 0DH is copied as the end mark; a parenthesis is copied with no end mark after it, and so are 32 characters with none among them (B68), and a partial extension is copied as long as it was typed (B69). When the line ends where @FSPEC stopped, CVRTUC copies nothing and NEWFCB keeps what @FSPEC stored there.

2538CVRTUC
LD A,(HL) 7E
CVRTUC: load Register A with the character at Register Pair HL, where @FSPEC left the command line pointer: after the character it stopped at, or on a 03H, 0DH or opening parenthesis.
2539
CP 0DH FE 0D
Compare Register A with 0DH, the carriage return that ends the line.
253B
RET Z C8
If the line ends here (Z), return: NEWFCB keeps @FSPEC's text, 03H alone when nothing was typed (TOWHAT follows at 2455H), or a name with an empty field, as NEW: or NEW. ended by 03H.
253C
DEC HL 2B
Decrement Register Pair HL back to the character @FSPEC stopped at, as the slash of /OLD (the source: backup to 1st separator).
253DCOP0
LD A,(HL) 7E
COP0: load Register A with the character at Register Pair HL.
253E
INC HL 23
Increment Register Pair HL to the next character.
253F
CP 20H FE 20
Compare Register A, the character of the command line, with 20H, a space.
2541
If it is a space (Z), jump back to COP0 at 253DH to skip it.
2543
DEC HL 2B
Decrement Register Pair HL back to the first character that is not a space.
2544
LD B,20H 06 20
Load Register B with 20H, 32, the most characters copied (NEWFCB has 32 bytes).
2546COP1
LD A,(HL) 7E
COP1: load Register A with the character at Register Pair HL.
2547COP2
CP 61H FE 61
COP2: compare Register A with 61H, the letter a: Carry below the lower case letters.
2549
If it is below a (Carry), jump to COP3 at 2551H to copy it as it is.
254B
CP 7BH FE 7B
Compare Register A with 7BH, the character after z.
254D
If it is above z (No Carry), jump to COP3 at 2551H to copy it as it is.
254F
SUB 20H D6 20
Subtract 20H from Register A: the lower case letter in Register A becomes a capital.
2551COP3
LD (DE),A 12
COP3: store Register A, the character, at Register Pair DE in NEWFCB.
2552
CP 0DH FE 0D
Compare Register A with 0DH, the carriage return that ends the line.
2554
RET Z C8
If it was the carriage return (Z), return: the partial name is in NEWFCB, ended by 0DH.
2555
CP 28H FE 28
Compare Register A with 28H, an opening parenthesis.
2557
RET Z C8
If it was a parenthesis (Z), return: the parenthesis is in NEWFCB with no 03H or 0DH after it (B68).
2558
INC HL 23
Increment Register Pair HL to the next character of the command line.
2559
INC DE 13
Increment Register Pair DE to the next byte of NEWFCB.
255A
Decrement Register B and, if it is not zero, jump back to COP1 at 2546H for the next character.
255C
RET C9
Return after 32 characters with no end mark among them: NEWFCB is full, and the byte after it is OLDFCB's first (B68).

255DH - MATCH: Defaults for the New Name from the Old

MATCH gives the new name in NEWFCB the parts it leaves out, taken from the old name in OLDFCB, which FLOOP has already given a drive. A new name that does not begin with a letter gets the old filename in front of it. Then the slash and extension, the colon and drive, and the full stop and password are looked for in that order: MATCH2 runs along the new name over letters and digits to the separator; when it finds another character first, MATCH4 looks for the separator in the old name and inserts it with the field after it at that place, shifting the rest of the new name, its end mark too, one byte along for each character. So a drive goes before a password, and the password of the old name, when the new one has none, comes after the drive. The inserts look for the end mark, 03H or 0DH, to stop the shift: with none in NEWFCB they shift OLDFCB too, and MATCH7 then inserts the same letter for ever (B68). Nothing cuts a completed field to its length (B69).

255DMATCH
PUSH DE D5
MATCH: push Register Pair DE onto the stack (Stack Pointer): 25FFH, the new name.
255E
PUSH HL E5
Push Register Pair HL onto the stack (Stack Pointer): 261FH, the old name.
255F
LD A,(DE) 1A
Load Register A with the first character of the new name at Register Pair DE (25FFH).
2560
CP 41H FE 41
Compare Register A with 41H, the letter A: Carry for a slash, colon, full stop or digit.
2562
If the new name does not begin with a letter (Carry), call MATCH7 at 259FH to insert the old filename in front of it; Register Pair HL then points at the old name's first character after the filename and Register Pair DE after the inserted characters. A new name that begins with a digit gets the old filename in front of it too (2 becomes TEST2).
2565
LD B,2FH 06 2F
Load Register B with 2FH, the slash of an extension, the first field to look for.
2567
Call MATCH2 at 2578H to find the new name's extension or insert the old one.
256A
LD B,3AH 06 3A
Load Register B with 3AH, the colon of a drive.
256C
Call MATCH2 at 2578H to find the new name's drive or insert the old one.
256F
LD B,2EH 06 2E
Load Register B with 2EH, the full stop of a password.
2571
Call MATCH2 at 2578H to find the new name's password or insert the old one.
2574
POP HL E1
Pop Register Pair HL from the stack (Stack Pointer): 261FH, the old name.
2575
POP DE D1
Pop Register Pair DE from the stack (Stack Pointer): 25FFH, the new name.
2576
RET C9
Return to DOMATCH (249DH) with both pointers as they were.
2577MATCH1
INC DE 13
MATCH1: increment Register Pair DE to the next character of the new name.
2578MATCH2
LD A,(DE) 1A
MATCH2: load Register A with the character of the new name at Register Pair DE.
2579
CP B B8
Compare Register A with Register B, the separator looked for.
257A
If it is the separator (Z), jump to MATCH3 at 258AH: the new name has this field.
257C
CP 41H FE 41
Compare Register A, the character of the new name, with 41H, the letter A.
257E
If it is A or above (No Carry), a letter, jump back to MATCH1 at 2577H to pass over it.
2580
CP 30H FE 30
Compare Register A, the character of the new name, with 30H, the digit 0.
2582
If it is below 0 (Carry), another separator or the end mark, jump to MATCH4 at 258CH: the field is not there.
2584
CP 3AH FE 3A
Compare Register A with 3AH, the character after 9.
2586
If it is a digit (Carry), jump back to MATCH1 at 2577H to pass over it.
2588
Jump to MATCH4 at 258CH: a character from 3AH to 40H, the colon among them, ends the field too.
258AMATCH3
INC DE 13
MATCH3: increment Register Pair DE past the separator, so that the next MATCH2 begins in this field.
258B
RET C9
Return to MATCH: the new name has this field, so nothing is inserted.
258CMATCH4
PUSH HL E5
MATCH4: push Register Pair HL onto the stack (Stack Pointer): the place in the old name, kept for the next field.
258DMATCH5
LD A,(HL) 7E
MATCH5: load Register A with the character of the old name at Register Pair HL.
258E
INC HL 23
Increment Register Pair HL to the next character of the old name.
258F
CP 03H FE 03
Compare Register A with 03H, the end mark of a name typed with a drive.
2591
If the old name ends here (Z), jump to MATCH6 at 259DH: the old name has no such field either.
2593
CP 0DH FE 0D
Compare Register A with 0DH, the end mark that FLOOP stores (2489H).
2595
If the old name ends here (Z), jump to MATCH6 at 259DH.
2597
CP B B8
Compare Register A with Register B, the separator looked for.
2598
If it is not the separator (NZ), jump back to MATCH5 at 258DH.
259A
Call MATCH9 at 25ABH with the separator in Register A and Register Pair HL after it in the old name: the separator and the field after it are inserted at Register Pair DE.
259DMATCH6
POP HL E1
MATCH6: pop Register Pair HL from the stack (Stack Pointer): the place in the old name before the search.
259E
RET C9
Return to MATCH, to 256AH, 256FH or 2574H, after the CALL at 2567H, 256CH or 2571H, with Register Pair HL restored.
259FMATCH7
LD A,(HL) 7E
MATCH7: load Register A with the character of the old name at Register Pair HL.
25A0
CP 30H FE 30
Compare Register A, the character of the old name, with 30H, the digit 0.
25A2
RET C D8
If it is below 0 (Carry), a separator or end mark, return: the field has been copied.
25A3
CP 3AH FE 3A
Compare Register A with 3AH, the character after 9.
25A5
If it is a digit (Carry), jump to MATCH8 at 25AAH to insert it.
25A7
CP 41H FE 41
Compare Register A, the character of the old name, with 41H, the letter A.
25A9
RET C D8
If it is from 3AH to 40H (Carry), as the colon, return: the field has been copied.
25AAMATCH8
INC HL 23
MATCH8: increment Register Pair HL past the character of the old name in Register A.
25ABMATCH9
PUSH HL E5
MATCH9: push Register Pair HL onto the stack (Stack Pointer): the place in the old name.
25AC
LD H,D 62
Load Register H with Register D, the high byte of the new name pointer in Register Pair DE.
25AD
LD L,E 6B
Load Register L with Register E: Register Pair HL = the place in the new name where the character goes.
25AEMATCH10
LD C,(HL) 4E
MATCH10: load Register C with the character of the new name at Register Pair HL, which is to move one byte along.
25AF
LD (HL),A 77
Store Register A, the character to insert or the one moved from the byte before, at Register Pair HL.
25B0
INC HL 23
Increment Register Pair HL to the next byte of the new name.
25B1
LD A,C 79
Load Register A with Register C, the character that was there.
25B2
CP 03H FE 03
Compare Register A, the character that was in the new name, with 03H, an end mark.
25B4
If it was the 03H (Z), jump to MATCH11 at 25BAH to store it after the rest.
25B6
CP 0DH FE 0D
Compare Register A with 0DH, the other end mark.
25B8
If it was not the end (NZ), jump back to MATCH10 at 25AEH to move it one byte along. Only an end mark stops the shift (B68).
25BAMATCH11
LD (HL),A 77
MATCH11: store Register A, the end mark, at Register Pair HL, one byte after where it was.
25BB
POP HL E1
Pop Register Pair HL from the stack (Stack Pointer): the place in the old name. When the shift has run into OLDFCB, the old name has moved one byte along and Register Pair HL points at the character just inserted, so MATCH7 inserts it again and again (B68).
25BC
INC DE 13
Increment Register Pair DE past the inserted character.
25BD
Jump back to MATCH7 at 259FH to insert the next character of the old field.

25BFH - RENAME Data: the Messages, the Three FCBs, RENAM$ and SPECS$

The messages of RENAME, TO$, and the three 32 byte areas the names are parsed into: NEWFCB, of which only the first byte is in the file, and OLDFCB and TEMPFCB, which are not. RENAM$, Renaming: and a space, is shown together with SPECS$ after it. The last load block holds OLD_FIL, a word that no instruction of RENAME reads or writes, in 6.2 and 6.3.0 as in 6.3.1.

25BF-25D2SPCERR$
DEFM "Specification error" / DEFB 0DH 53 70 65 63 69 66 69 63 61 74 69 6F 6E 20 65 72 72 6F 72 0D
SPCERR$, 25BFH-25D2H: the message SPCERR shows (241CH) for an old name that is not a file or device specification, or for a file and a device given together, ended by its carriage return.
25D3-25E6DUPNAM$
DEFM "Duplicate file name" / DEFB 0DH 44 75 70 6C 69 63 61 74 65 20 66 69 6C 65 20 6E 61 6D 65 0D
DUPNAM$, 25D3H-25E6H: the message DUPNAM shows (2420H) when a file of the new name already exists on the drive; the 6.2 source's change log dates it 27 April 1983.
25E7-25F9TOWHAT$
DEFM "Rename it to what?" / DEFB 0DH 52 65 6E 61 6D 65 20 69 74 20 74 6F 20 77 68 61 74 3F 0D
TOWHAT$, 25E7H-25F9H: the message TOWHAT shows (2424H) when no new name follows the old one.
25FA-25FETO$
DEFM " to " / DEFB 03H 20 74 6F 20 03
TO$, 25FAH-25FEH: the four characters REN2 copies between the two names in SPECS$ (24CBH); the 03H after them is not copied.
25FFNEWFCB
DEFB 0DH 0D
NEWFCB, 25FFH: the first byte of the new name's area, 0DH in the file (the source: init to cr). @FSPEC always stores at least a 03H here (244CH) before REN1 reads it (2450H), so the 0DH is never read; it is the last byte of the second load block.
2600-261E
DEFS 31
NEWFCB+1 to NEWFCB+31, 2600H-261EH: not loaded, so they hold whatever was there before RENAME was loaded. @FSPEC or CVRTUC puts the new name here, MATCH inserts the defaults, F2LOOP the drive (24A6H), and SYS2's RENAME writes the colon, drive and 0DH again (B18); its FCB would be built here if its own open of the new name found a file.
261F-263EOLDFCB
DEFS 32
OLDFCB, 261FH-263EH: not loaded. @FSPEC puts the old name here, ended by 03H (2444H); FLOOP adds a colon, the drive and 0DH when it has no drive (247EH-2489H); MATCH takes the defaults from it, and @RENAME is given it as the FCB of the old name (24DCH).
263F-2648RENAM$
DEFM "Renaming: " 52 65 6E 61 6D 69 6E 67 3A 20
RENAM$, 263FH-2648H: the start of the line REN2 shows (24D5H); SPECS$ follows at once, so @LOGOT goes on into the two names.
2649-2670SPECS$
DEFS 40
SPECS$, 2649H-2670H: not loaded. MOVSPC builds the old name, " to " and the new name here without their passwords (24BFH-24D4H), ended by 0DH; the longest pair, 15 characters each, needs 35 bytes.
2671-2690TEMPFCB
DEFS 32
TEMPFCB, 2671H-2690H: not loaded. The first @FSPEC puts the old name here (243AH) and @OPEN turns it into an open FCB (2472H), whose drive at +6 (2677H) FLOOP uses; later @FSPEC puts the new name here and @OPEN tries it (24B4H, 24B7H).
2691-2692OLD_FIL
DEFW 0000H 00 00
OLD_FIL, 2691H-2692H: a word 0000H in the file, the fourth load block, which no instruction of RENAME reads or writes.

2400H - Member 7 (DEVICE): Entry and the Parameters

SYS1/SYS runs DEVICE with request 61H; its header points at member 7, which the overlay loader reads to 2400H-28D0H in one run and calls at 2400H with Register Pair HL at the text after the word DEVICE. DEVICE shows three parts, each under its own parameter: the drives (DRIVES, on unless D=N), the devices (BYTEIO, off unless B is given) and the options with the resident system modules (STATUS or OPTION, on unless S=N or O=N). PRINT (P) sends everything to the printer too. Every exit after DEVICEA (2409H) goes through SAVESP, which drops the stack to the depth of the entry: 0000H when all was shown, FFFFH after BREAK, or the number of a DOS error after its short message.

2400DEVICE
LD A,6AH 3E 6A
DEVICE: DEVICE's entry (request 61H): load Register A with 6AH, SVC 106, @CKBRKC, which tests and clears the BREAK key.
2402
RST 28H EF
Call @CKBRKC with RST 28H: Z when BREAK was not pressed, NZ when it was pressed before DEVICE began.
2403
If BREAK was not pressed (Z), jump to DEVICEA at 2409H to read the parameters.
2405
LD HL,FFFFH 21 FF FF
Load Register Pair HL with FFFFH, the return code of a command stopped by BREAK. Here, before the Stack Pointer is saved, DEVICE returns by itself.
2408
RET C9
Return to RST28's tail with Register Pair HL = FFFFH: nothing has been shown.
2409DEVICEA
LD (27B2H),SP ED 73 B2 27
DEVICEA: store the Stack Pointer into 27B2H, the operand of the LD SP at SAVESP (27B1H), so that every way out of DEVICE returns from this depth.
240D
LD DE,289EH 11 9E 28LD DE,PRMTBL$
Load Register Pair DE with 289EH, PRMTBL$, DEVICE's parameter table in the 6.x form (80H first): BYTEIO, DRIVES, PRINT, STATUS and OPTION, each a flag that its first letter alone may give.
2410
LD A,11H 3E 11
Load Register A with 11H, SVC 17, @PARAM, which reads the parameters in parentheses at Register Pair HL and stores each value into the operand its table entry names.
2412
RST 28H EF
Call @PARAM with RST 28H: Z when the parameters were right or there were none; NZ with Register A = 44, Parameter error, for a word not in the table, such as the N the manual lists.
2413
If @PARAM refused the parameters (NZ), jump to IOERR at 277AH to show Parameter error and return its number.
2416
LD A,65H 3E 65
Load Register A with 65H, SVC 101, @FLAGS, which gives the address of the system flag table.
2418
RST 28H EF
Call @FLAGS with RST 28H: Index Register IY = 006AH, FLGTAB$, so that KFLAG$ is at IY+0AH, for RESKFL.
2419
Call RESKFL at 27A2H to clear the pause and ENTER bits of KFLAG$ (0074H), so that a pause key pressed before the command does not stop the first line.
241C
EI FB
Enable the interrupts (source: make sure they are on): the keyboard task that sets the BREAK and pause bits of KFLAG$ runs from the clock interrupt.

241DH - DPARM: the Drive Lines, Pack Name and Write Protection

With DRIVES on (the default), DEVICE goes through drives 0 to 7 and shows a line for each whose DCT entry begins with C3H, the JP of an enabled drive; a disabled drive (C9H, RET) gets no line. @CKDRV tests the drive and, when a diskette is in it, reads its GAT and sets the DCT's cylinder count and number of sides from it, which is the logging on the manual describes. The line begins with the colon and the drive number, then WP or two spaces, then the pack name from the GAT in brackets, or No Disk when @CKDRV found no diskette or could not read its GAT; the DCT values that follow are then those of the last diskette the drive saw.

241DDPARM
LD HL,FFFFH 21 FF FF
DPARM: load Register Pair HL with FFFFH, the operand at 241EH (DPARM+1) where @PARAM stores the value of DRIVES or D; FFFFH, on, when it was not given.
2420
LD A,H 7C
Load Register A with Register H, the high byte of the DRIVES value in Register Pair HL.
2421
OR L B5
OR Register A with Register L: Z only when DRIVES was given as N, NO, OFF, 0 or an empty value (D=).
2422
If DRIVES is off (Z), jump to BPARM at 257BH (DEND, the end of the drive part) to go on with the devices.
2425
LD C,00H 0E 00
Load Register C with 00H: the first drive is drive 0.
2427DEV1
PUSH BC C5
DEV1: push Register Pair BC onto the stack (Stack Pointer) to keep the drive number in Register C over the drive's line.
2428
XOR A AF
Clear Register A to 00H (XOR A also clears the Carry flag).
2429
LD (247AH),A 32 7A 24
Store Register A, 00H, into 247AH, the operand of the LD A at WPTEST (2479H): no write protection seen yet for this drive.
242C
LD A,51H 3E 51
Load Register A with 51H, SVC 81, @GTDCT, which gives the address of the drive code table entry of the drive in Register C.
242E
RST 28H EF
Call @GTDCT with RST 28H: Index Register IY = the DCT entry of the drive, 0470H for drive 0 and 10 bytes on for each drive after it.
242F
LD A,(IY+00H) FD 7E 00
Load Register A with the first byte of the DCT entry at Index Register IY+00H: C3H, the JP to the driver, for an enabled drive; C9H, a RET, for a disabled one.
2432
CP C3H FE C3
Compare Register A with C3H: Z for an enabled drive.
2434
If the drive is disabled (NZ), jump to POPDRV at 2573H, so that it gets no line (drives 2 to 7 of the release, whose entries begin with C9H).
2437
LD A,21H 3E 21
Load Register A with 21H, SVC 33, @CKDRV, which tests the drive in Register C for a diskette and logs it on.
2439
RST 28H EF
Call @CKDRV with RST 28H (SYS2/SYS CKDRV): Z and Register A = 00H for a ready diskette whose GAT was read, with the Carry flag set when it is write protected (by the hardware or by DCT+3 bit 7); NZ when no diskette answered or when @CKDRV could not read the GAT (Register A = the FDC status); a failed GAT read with an FDC status of 00H returns Z with the Carry flag clear (B16).
243A
If no diskette answered or its GAT could not be read (NZ), jump to DEV2 at 245EH to show No Disk in place of the pack name.
243C
RRA 1F
Rotate Register A right through the Carry flag: Register A = 80H when @CKDRV set the Carry flag for a write protected diskette, else 00H.
243D
LD (247AH),A 32 7A 24
Store Register A into 247AH, the operand of the LD A at WPTEST (2479H), for the WP test of the line.
2440
LD HL,2900H 21 00 29LD HL,BUFFER
Load Register Pair HL with 2900H, BUFFER, the page after the member where the GAT is read.
2443
LD D,(IY+09H) FD 56 09
Load Register D with the directory cylinder of the drive, DCT+9 at Index Register IY+09H, as @CKDRV's read of the GAT left it (its @RDSSC takes the cylinder from the boot sector when DCT+9 was wrong).
2446
LD E,L 5D
Load Register E with Register L, 00H: Register Pair DE = the directory cylinder and sector 0, the GAT.
2447
LD A,55H 3E 55
Load Register A with 55H, SVC 85, @RDSSC, which reads a system sector (the directory's data mark) of the drive in Register C.
2449
RST 28H EF
Call @RDSSC with RST 28H to read the GAT into 2900H-29FFH: Z when the read worked.
244A
LD A,14H 3E 14
Load Register A with 14H, error 20, GAT read error (LD leaves the flags of @RDSSC).
244C
If the GAT could not be read (NZ), jump to IOERR at 277AH: DEVICE shows GAT read error and ends; nothing of this drive's line has been shown, and the drives after it, the devices and the options are not shown. Reached only when @CKDRV returned Z: its own failed read of the GAT normally returns NZ (No Disk, 243AH), and Z only with an FDC status of 00H (B16).
244F
LD HL,29D8H 21 D8 29
Load Register Pair HL with 29D8H, GAT+D8H, the first byte of the diskette's date, after the 8 letters of the pack name at 29D0H-29D7H.
2452
LD (HL),5DH 36 5D
Store 5DH, the closing bracket, at Register Pair HL (29D8H), over the date.
2454
INC L 2C
Increment Register L: Register Pair HL = 29D9H, the next byte of the GAT's date.
2455
LD (HL),20H 36 20
Store 20H, a space, at Register Pair HL (29D9H).
2457
INC L 2C
Increment Register L: Register Pair HL = 29DAH, the next byte of the GAT's date.
2458
LD (HL),03H 36 03
Store 03H at Register Pair HL (29DAH), the end mark for LINOUT: the pack name and the bracket after it form one string, 29D0H-29DAH.
245A
LD L,D0H 2E D0
Load Register L with D0H: Register Pair HL = 29D0H, GAT+D0H, the start of the pack name (LINOUT is given 29D0H again at 2499H).
245C
Jump to DEV2A at 2469H to start the drive's line with the colon, Register Pair HL at the pack name.
245EDEV2
LD HL,27BDH 21 BD 27LD HL,NOPACK$
DEV2: load Register Pair HL with 27BDH, NOPACK$, the text No, two spaces, Disk, the bracket and a space, ended by 03H, shown in place of a pack name.
2461
LD DE,29D0H 11 D0 29
Load Register Pair DE with 29D0H, where the pack name of a GAT would be.
2464
LD BC,000CH 01 0C 00
Load Register Pair BC with 000CH, 12 bytes: NOPACK$ has 11 bytes with its 03H, so the copy also takes the I of INACT$ at 27C8H, which lands after the 03H at 29DBH and is never shown.
2467
LDIR ED B0
Copy Register Pair BC bytes from Register Pair HL (27BDH) to Register Pair DE (29D0H): 29D0H-29DAH = No Disk] and 03H.
2469DEV2A
LD A,3AH 3E 3A
DEV2A: load Register A with 3AH, the colon that begins every drive line.
246B
Call BYTOUT at 2767H to show the character in Register A on the video, and print it when PRINT is on.
246E
POP BC C1
Pop Register Pair BC from the stack (Stack Pointer): Register C = the drive number.
246F
PUSH BC C5
Push Register Pair BC onto the stack (Stack Pointer) again, for POPDRV (2573H).
2470
LD A,C 79
Load Register A with Register C, the drive number, 0 to 7.
2471
ADD A,30H C6 30
Add 30H to Register A to make the drive number the digit 0 to 7.
2473
Call BYTOUT at 2767H to show the drive digit in Register A.
2476
Call OUTSP at 2765H to show a space after the drive number (6.3.1: OUTSP in place of LD A and CALL BYTOUT; 6.3.0 showed the same space).
2479WPTEST
LD A,00H 3E 00
WPTEST: load Register A with 00H, the operand at 247AH: 80H when @CKDRV reported the diskette write protected (243DH), 00H when it did not or when no diskette answered (2429H).
247B
OR (IY+03H) FD B6 03
OR Register A with DCT+3 at Index Register IY+03H, whose bit 7 is the software write protection that SYSTEM (DRIVE=,WP) sets: for a drive with no diskette this alone decides.
247E
AND 80H E6 80
AND Register A with 80H, to keep bit 7: Z when the drive is not write protected either way.
2480
LD A,20H 3E 20
Load Register A with 20H, a space, the first of the two characters shown for a drive that may be written.
2482
LD B,20H 06 20
Load Register B with 20H, a space, the second character (LD leaves the flags of the AND).
2484
If the drive is not write protected (Z), jump to 248AH to show the two spaces.
2486DEV2B
LD A,57H 3E 57
DEV2B: load Register A with 57H, the letter W.
2488
LD B,50H 06 50
Load Register B with 50H, the letter P: WP for a write protected drive.
248A
Call BYTOUT at 2767H to show the first character in Register A, W or a space; BYTOUT keeps Register Pair BC.
248D
LD A,B 78
Load Register A with Register B, the second character, P or a space.
248E
Call BYTOUT at 2767H to show the second character in Register A.
2491
Call OUTSP at 2765H to show a space before the pack name (6.3.1, OUTSP in place of LD A and CALL BYTOUT).
2494
LD A,5BH 3E 5B
Load Register A with 5BH, the opening bracket in front of the pack name.
2496
Call BYTOUT at 2767H to show the bracket in Register A.
2499
LD HL,29D0H 21 D0 29
Load Register Pair HL with 29D0H, the pack name from the GAT with its closing bracket, or No Disk], up to the 03H at 29DAH.
249C
Call LINOUT at 2755H to show the string at Register Pair HL, and print it when PRINT is on.

249FH - The Drive Line: Size, Kind, Select Code and Cylinders

After the pack name the line shows the drive's size, 5 or 8 (DCT+3 bit 5), its kind, Floppy or Rigid (DCT+3 bit 3), and the low four bits of DCT+4 as one hexadecimal digit: for a floppy drive its select bit, 1, 2, 4 or 8, the binary place of the drive on its cable; for a hard drive whatever its driver keeps there, by the manual the starting head. Then the number of cylinders, DCT+6 + 1, doubled for a hard drive with DCT+4 bit 5 set, in three columns by @HEXD. A hard drive's line ends with Removable or Fixed (DCT+3 bit 2); a floppy drive's line goes on at FLOPPY.

249F
BIT 5,(IY+03H) FD CB 03 6E
Test bit 5 of DCT+3 at Index Register IY+03H: set for an 8 inch drive.
24A3
LD A,35H 3E 35
Load Register A with 35H, the digit 5, for a 5.25 inch drive (LD leaves the flags of the BIT).
24A5
If the drive is not an 8 inch drive (Z), jump to 24A9H to show the 5.
24A7
LD A,38H 3E 38
Load Register A with 38H, the digit 8, for an 8 inch drive.
24A9
Call BYTOUT at 2767H to show the size digit in Register A.
24AC
BIT 3,(IY+03H) FD CB 03 5E
Test bit 3 of DCT+3 at Index Register IY+03H: set for a hard (rigid) drive.
24B0
LD HL,2845H 21 45 28LD HL,FLOPY$
Load Register Pair HL with 2845H, FLOPY$, the text with the inch mark, a space, Floppy and #, for a floppy drive.
24B3
If the drive is a floppy drive (Z), jump to 24B8H with Register Pair HL at FLOPY$.
24B5
LD HL,2850H 21 50 28LD HL,RIGID$
Load Register Pair HL with 2850H, RIGID$, the text with the inch mark, a space, Rigid, two spaces and #, for a hard drive.
24B8
Call LINOUT at 2755H to show the text at Register Pair HL, up to its 03H.
24BB
LD A,(IY+04H) FD 7E 04
Load Register A with DCT+4 at Index Register IY+04H, whose bits 3-0 hold the select code of the drive.
24BE
AND 0FH E6 0F
AND Register A with 0FH to keep bits 3-0, 00H to 0FH.
24C0
ADD A,90H C6 90
Add 90H to Register A: the first half of the conversion of a 4 bit value into a hexadecimal digit.
24C2
DAA 27
Decimal adjust Register A: 90H to 99H for 0 to 9 with the Carry flag clear, 00H to 05H with the Carry flag set for 0AH to 0FH.
24C3
ADC A,40H CE 40
Add 40H and the Carry flag to Register A: D0H to D9H for 0 to 9, 41H to 46H for 0AH to 0FH.
24C5
DAA 27
Decimal adjust Register A again: 30H to 39H, the digits 0 to 9, or 41H to 46H, the letters A to F.
24C6
Call BYTOUT at 2767H to show the select digit in Register A: 1, 2, 4 or 8 for a floppy drive.
24C9DEV3
LD L,(IY+06H) FD 6E 06
DEV3: load Register L with DCT+6 at Index Register IY+06H, the highest cylinder number of the drive, as @CKDRV or the driver left it.
24CC
LD H,00H 26 00
Load Register H with 00H: Register Pair HL = the highest cylinder number.
24CE
INC HL 23
Increment Register Pair HL: the number of cylinders, 1 to 256 (cylinders count from 0).
24CF
BIT 3,(IY+03H) FD CB 03 5E
Test bit 3 of DCT+3 at Index Register IY+03H: set for a hard drive.
24D3
If the drive is a floppy drive (Z), jump to DEV4 at 24DCH: its count is shown as it is.
24D5
BIT 5,(IY+04H) FD CB 04 6E
Test bit 5 of DCT+4 at Index Register IY+04H: for a hard drive set when it has two sides (heads) to a cylinder.
24D9
If it has one (Z), jump to DEV4 at 24DCH to show the count as it is.
24DB
ADD HL,HL 29
Add Register Pair HL to itself: a two sided hard drive is shown with twice its cylinders, up to 512.
24DCDEV4
LD DE,2862H 11 62 28LD DE,COMMA$
DEV4: load Register Pair DE with 2862H, COMMA$, whose three spaces receive the number: CYLS$ at 285BH runs into it, so that one string shows Cyls= and the number.
24DF
LD B,03H 06 03
Load Register B with 03H, the width of the field for @HEXD (6.3.1: 6.3.0 called CVRTDEC, which made five digits in BUFFER with @HEXDEC and copied the last three).
24E1
LD A,5FH 3E 5F
Load Register A with 5FH, SVC 95, @HEXD (06F8H), which writes Register Pair HL in decimal into Register B columns at Register Pair DE.
24E3
RST 28H EF
Call @HEXD with RST 28H: 2862H-2864H = the number of cylinders, right aligned with spaces in front, as 40.
24E4
LD HL,285BH 21 5B 28LD HL,CYLS$
Load Register Pair HL with 285BH, CYLS$, the comma, a space and Cyls= that run on into COMMA$ at 2862H.
24E7
Call LINOUT at 2755H to show the string at Register Pair HL: , Cyls= 40, and a space, up to the 03H at 2867H.
24EA
BIT 3,(IY+03H) FD CB 03 5E
Test bit 3 of DCT+3 at Index Register IY+03H, set for a hard drive.
24EE
If the drive is a floppy drive (Z), jump to FLOPPY at 2501H for the density, sides, step rate and delay.
24F0
BIT 2,(IY+03H) FD CB 03 56
Test bit 2 of DCT+3 at Index Register IY+03H: for a hard drive set when its disk is fixed, clear when it is removable (for a floppy drive the bit is the select delay).
24F4
LD HL,2868H 21 68 28LD HL,REMOV$
Load Register Pair HL with 2868H, REMOV$, the word Removable (LD leaves the flags of the BIT).
24F7
If the disk is removable (Z), jump to 24FCH with Register Pair HL at REMOV$.
24F9
LD HL,2872H 21 72 28LD HL,FIXED$
Load Register Pair HL with 2872H, FIXED$, the word Fixed.
24FC
Call LINOUT at 2755H to show the word at Register Pair HL.
24FF
Jump to ENDLINE at 2570H to end the line: a hard drive has no density, step rate or delay to show.

2501H - FLOPPY: Density, Sides, Step Rate and Delay, and the Next Drive

For a floppy drive the line goes on with Sden or Dden (DCT+3 bit 6), the number of sides (DCT+4 bit 5, which @CKDRV sets from the GAT), the step rate and, for a 5.25 inch drive, the delay after the motor starts. The step rate comes from STPRAT$, a table of two characters for each of the eight combinations of DCT+3 bit 5 (8 inch) and bits 1-0 (the rate code): 6, 12, 20 and 30 ms for a 5.25 inch drive, 3, 6, 10 and 15 ms for an 8 inch drive, the rates of the WD1793 at its two clock speeds. The delay is .5 s when DCT+3 bit 2 is set and 1 s when it is clear; an 8 inch drive's motor always runs and gets no delay. ENDLINE ends each drive's line with a carriage return and tests BREAK and the pause key; POPDRV goes on to the next drive.

2501FLOPPY
BIT 6,(IY+03H) FD CB 03 76
FLOPPY: test bit 6 of DCT+3 at Index Register IY+03H: set when the last diskette the drive saw was double density.
2505
LD A,53H 3E 53
Load Register A with 53H, the letter S, for single density (LD leaves the flags of the BIT).
2507
If the diskette is single density (Z), jump to 250BH to show the S.
2509
LD A,44H 3E 44
Load Register A with 44H, the letter D, for double density.
250B
Call BYTOUT at 2767H to show the letter in Register A.
250E
LD HL,2878H 21 78 28LD HL,DEN$
Load Register Pair HL with 2878H, DEN$, the letters den, a comma, a space and Sides= (so the line reads Sden or Dden).
2511
Call LINOUT at 2755H to show the text at Register Pair HL.
2514
BIT 5,(IY+04H) FD CB 04 6E
Test bit 5 of DCT+4 at Index Register IY+04H: set for a two sided diskette, as @CKDRV copied it from GAT+CDH bit 5.
2518
LD A,31H 3E 31
Load Register A with 31H, the digit 1 (LD leaves the flags of the BIT).
251A
If the diskette is one sided (Z), jump to 251DH to show the 1.
251C
INC A 3C
Increment Register A to 32H, the digit 2, for a two sided diskette.
251D
Call BYTOUT at 2767H to show the number of sides in Register A.
2520
LD HL,2884H 21 84 28LD HL,STEP$
Load Register Pair HL with 2884H, STEP$, a comma, a space and Step=.
2523
Call LINOUT at 2755H to show the text at Register Pair HL.
2526
LD A,(IY+03H) FD 7E 03
Load Register A with DCT+3 at Index Register IY+03H, which holds the 8 inch bit (bit 5) and the step rate code (bits 1-0).
2529
AND 23H E6 23
AND Register A with 23H to keep bits 5, 1 and 0.
252B
LD B,A 47
Load Register B with Register A, a copy of the three bits.
252C
RRCA 0F
Rotate Register A right: bit 5 moves to bit 4, bits 1-0 to bits 0 and 7.
252D
RRCA 0F
Rotate Register A right again: bit 5 is now at bit 3.
252E
RRCA 0F
Rotate Register A right a third time: the 8 inch bit is at bit 2, the rate bits at bits 6 and 5.
252F
OR B B0
OR Register A with Register B: bit 2 = 8 inch, bits 1-0 = the rate code; the other bits hold copies that the AND at 2531H removes.
2530
RLCA 07
Rotate Register A left: the index 0 to 7 is now at bits 3-1, two bytes for each entry.
2531
AND 0EH E6 0E
AND Register A with 0EH to keep bits 3-1: the offset 00H to 0EH of the entry in STPRAT$.
2533
LD HL,2835H 21 35 28LD HL,STPRAT$
Load Register Pair HL with 2835H, STPRAT$, the table of step rates.
2536
ADD A,L 85
Add Register L to Register A: the low byte of the entry's address.
2537
LD L,A 6F
Load Register L with Register A, the low byte of the entry's address.
2538
ADC A,H 8C
Add Register H and the Carry flag of that addition to Register A.
2539
SUB L 95
Subtract Register L from Register A: Register A = Register H plus the carry, the high byte of the entry's address.
253A
LD H,A 67
Load Register H with Register A: Register Pair HL = the entry in STPRAT$, 2835H to 2843H.
253B
LD A,(HL) 7E
Load Register A with the first character of the entry at Register Pair HL, a space or the tens digit.
253C
INC HL 23
Increment Register Pair HL to the second character of the entry.
253D
Call BYTOUT at 2767H to show the first character in Register A.
2540
LD A,(HL) 7E
Load Register A with the second character of the entry at Register Pair HL, the units digit.
2541
Call BYTOUT at 2767H to show the second character in Register A.
2544
LD HL,288CH 21 8C 28LD HL,MS$
Load Register Pair HL with 288CH, MS$, the letters ms after the step rate.
2547
Call LINOUT at 2755H to show the text at Register Pair HL.
254A
BIT 5,(IY+03H) FD CB 03 6E
Test bit 5 of DCT+3 at Index Register IY+03H, set for an 8 inch drive.
254E
If the drive is an 8 inch drive (NZ), jump to ENDLINE at 2570H: its motor always runs, so no delay is shown.
2550
LD HL,288FH 21 8F 28LD HL,DLY$
Load Register Pair HL with 288FH, DLY$, a comma, a space and Dly=.
2553
Call LINOUT at 2755H to show the text at Register Pair HL.
2556
BIT 2,(IY+03H) FD CB 03 56
Test bit 2 of DCT+3 at Index Register IY+03H: set for a delay of 0.5 seconds after the motor starts, clear for 1 second (SYSTEM (DRIVE=,DELAY=)).
255A
LD A,20H 3E 20
Load Register A with 20H, a space, the first character of the 1 second delay (LD leaves the flags of the BIT).
255C
LD B,31H 06 31
Load Register B with 31H, the digit 1, its second character.
255E
If the delay is 1 second (Z), jump to 2564H to show a space and 1.
2560
LD A,2EH 3E 2E
Load Register A with 2EH, the full stop of .5.
2562
LD B,35H 06 35
Load Register B with 35H, the digit 5: .5 for a delay of 0.5 seconds.
2564
Call BYTOUT at 2767H to show the first character in Register A.
2567
LD A,B 78
Load Register A with Register B, the second character of the delay.
2568
Call BYTOUT at 2767H to show the second character in Register A.
256B
LD A,73H 3E 73
Load Register A with 73H, the letter s, for seconds.
256D
Call BYTOUT at 2767H to show the s in Register A.
2570ENDLINE
ENDLINE: call CKPAWS at 2785H to end the drive's line with a carriage return and test BREAK (an exit) and the pause key (a wait).
2573POPDRV
POP BC C1
POPDRV: pop Register Pair BC from the stack (Stack Pointer): Register C = the number of the drive just done (also the way here for a disabled drive, 2434H).
2574
INC C 0C
Increment Register C, the drive number, to the next drive.
2575
LD A,C 79
Load Register A with Register C, the next drive number.
2576
CP 08H FE 08
Compare Register A with 08H: Z after drive 7.
2578
If there are more drives (NZ), jump to DEV1 at 2427H for the next one.

257BH - BPARM: the Device Lines and their Routes

With BYTEIO on (B, B=Y; off by default in version 6), DEVICE goes through the 31 DCBs from KI's at 0208H to 02F8H, 8 bytes each, and builds a line for each whose type byte is not 00H in STRBUF at 2A00H: an asterisk and the name, then the I/O symbol (made by DCBDIR) and what the device points to. A routed device (type bit 4, not NIL) shows the device it is routed to, and that device's own route, as long as the chain goes on; the I/O symbol is that of the device routed to. A route to a file (bit 7 of the routed to block, the open file bit of an FCB) shows the symbol with input and output and the file's name. Nothing limits the chain (B70), and the route bit of a device routed to is followed even when that device is NIL (B74).

257BBPARM
LD HL,0000H 21 00 00
BPARM: load Register Pair HL with 0000H, the operand at 257CH (BPARM+1) where @PARAM stores the value of BYTEIO or B; 0000H, off, when it was not given.
257E
LD A,H 7C
Load Register A with Register H, the high byte of the BYTEIO value in Register Pair HL.
257F
OR L B5
OR Register A with Register L: Z when BYTEIO is off.
2580
If BYTEIO is off (Z), jump to SPARM at 26AFH (BEND, the end of the device part) to go on with the options.
2583
LD DE,494BH 11 4B 49
Load Register Pair DE with 494BH: Register E = 4BH, the letter K, Register D = 49H, the letter I, the name of the first DCB.
2586
LD A,52H 3E 52
Load Register A with 52H, SVC 82, @GTDCB, which looks for the DCB whose name at +6 and +7 is Register E and Register D.
2588
RST 28H EF
Call @GTDCB with RST 28H: Z with Register Pair HL = 0208H, KIDCB$, the first of the DCBs.
2589
If KI was not found (NZ), jump to IOERR at 277AH to show the error; KI is always there.
258CLOGDCB
LD A,(HL) 7E
LOGDCB: load Register A with the type byte of the DCB at Register Pair HL.
258D
OR A B7
OR Register A with itself: Z for a spare DCB, whose type byte is 00H.
258E
If the DCB is spare (Z), jump to DVRB2 at 263DH to go on to the next DCB without a line.
2591
LD DE,2A00H 11 00 2ALD DE,STRBUF
Load Register Pair DE with 2A00H, STRBUF, the page after BUFFER where the line is built.
2594
PUSH HL E5
Push Register Pair HL onto the stack (Stack Pointer): the DCB, kept over MOVNAM.
2595
Call MOVNAM at 269FH to put an asterisk and the name at +6 and +7 of the DCB at Register Pair HL into the line at Register Pair DE.
2598
POP HL E1
Pop Register Pair HL from the stack (Stack Pointer): the DCB again (MOVNAM moved Register Pair HL to its name).
2599
PUSH HL E5
Push Register Pair HL onto the stack (Stack Pointer): the DCB, kept until the line is shown (263CH).
259ALOGDCB1
BIT 3,(HL) CB 5E
LOGDCB1: test bit 3 of the type byte at Register Pair HL, the NIL bit (also the way back here for a link DCB, 25E4H).
259C
If the device is NIL (NZ), jump to DVRADDR at 25B8H: a NIL device shows its I/O symbol and Nil, no route.
259E
BIT 4,(HL) CB 66
Test bit 4 of the type byte at Register Pair HL, the route bit.
25A0
If the device is not routed (Z), jump to DVRADDR at 25B8H to show its driver, link or filter.
25A2LOGRTE
LOGRTE: call GETPTR at 2699H: Register Pair HL = the word at +1 and +2 of the DCB, the address of the DCB or FCB it is routed to (6.3.1: 6.3.0 had the five instructions INC L, LD A,(HL), INC L, LD H,(HL), LD L,A here).
25A5
BIT 7,(HL) CB 7E
Test bit 7 of the first byte at Register Pair HL: set when the route goes to a file, whose FCB has its open bit there.
25A7
If the route goes to a file (NZ), jump to RTEFCB at 2647H to show the file's name.
25AA
PUSH HL E5
Push Register Pair HL onto the stack (Stack Pointer): the DCB routed to.
25AB
Call DCBDIR at 2675H to put the I/O symbol of the DCB at Register Pair HL, the one routed to, into the line at Register Pair DE.
25AE
Call MOVNAM at 269FH to put an asterisk and the name of the DCB routed to into the line.
25B1
POP HL E1
Pop Register Pair HL from the stack (Stack Pointer): the DCB routed to.
25B2
BIT 4,(HL) CB 66
Test bit 4 of its type byte at Register Pair HL: set when that device is routed too. Its NIL bit is not tested, though @CHNIO tests NIL first (0696H) and ROUTE (NIL) keeps the route bit of a routed device (B74).
25B4
If it is routed too (NZ), jump back to LOGRTE at 25A2H to add the next device of the chain. When two devices are routed to each other the loop never ends (B70), also when one of them is NIL (B74).
25B6
Jump to DVRB1 at 2630H to end the line with a carriage return and show it.

25B8H - DVRADDR: NIL, Links and Filters

A device that is not routed shows its I/O symbol and then: Nil for a NIL device; for a linked device (type bit 5) the name of its link DCB, a vertical bar, the name of the device it is linked to and an ampersand, after which the link DCB itself is looked at from LOGDCB1 on, as LINK put the device's old type and vector there; for a filtered device (type bit 6) the name of the filter's DCB in brackets, found through the word after the name in the filter module's header, or Inactive when that word points back at the device itself, as it does for the DCB that SET made for a filter not yet attached by FILTER. Last comes the vector at +1 and +2 as X'nnnn': the driver, or the filter module where the device's I/O enters first.

25B8DVRADDR
DVRADDR: call DCBDIR at 2675H to put the I/O symbol of the DCB at Register Pair HL into the line at Register Pair DE.
25BB
BIT 3,(HL) CB 5E
Test bit 3 of the type byte at Register Pair HL, the NIL bit.
25BD
If the device is NIL (NZ), jump to MOVNIL at 266BH to put Nil in place of an address.
25C0
BIT 5,(HL) CB 6E
Test bit 5 of the type byte at Register Pair HL, the link bit that LINK sets on the device it links.
25C2
If the device is not linked (Z), jump to DVRA0 at 25E6H to look for a filter.
25C4
Call GETPTR at 2699H: Register Pair HL = the word at +1 and +2 of the DCB, the link DCB LINK made (named L0, L1 and so on).
25C7
PUSH HL E5
Push Register Pair HL onto the stack (Stack Pointer): the link DCB, for the POP IY at 25D0H.
25C8
PUSH HL E5
Push Register Pair HL onto the stack (Stack Pointer) again: the link DCB, for the POP HL at 25DBH.
25C9
Call MOVNAM at 269FH to put an asterisk and the link DCB's name into the line at Register Pair DE.
25CC
LD A,7CH 3E 7C
Load Register A with 7CH, the vertical bar between the link DCB and the device it links to.
25CE
LD (DE),A 12
Store Register A, the bar, at Register Pair DE in the line.
25CF
INC DE 13
Increment Register Pair DE to the next place in the line.
25D0
POP IY FD E1
Pop Index Register IY from the stack (Stack Pointer): IY = the link DCB. IY no longer holds the flag table; CKPAWS0 and SPARM call @FLAGS again.
25D2
LD L,(IY+04H) FD 6E 04
Load Register L with +04H of the link DCB at Index Register IY+04H, the low byte of the DCB the device is linked to (LINK stores it there).
25D5
LD H,(IY+05H) FD 66 05
Load Register H with +05H of the link DCB at Index Register IY+05H: Register Pair HL = the DCB linked to.
25D8
Call MOVNAM at 269FH to put an asterisk and the name of the DCB linked to into the line.
25DB
POP HL E1
Pop Register Pair HL from the stack (Stack Pointer): the link DCB.
25DC
EX DE,HL EB
Exchange Register Pair DE and Register Pair HL: Register Pair HL = the place in the line, Register Pair DE = the link DCB.
25DD
LD (HL),20H 36 20
Store 20H, a space, at Register Pair HL in the line.
25DF
INC HL 23
Increment Register Pair HL to the next place in the line.
25E0
LD (HL),26H 36 26
Store 26H, the ampersand that shows the link, at Register Pair HL in the line.
25E2
INC HL 23
Increment Register Pair HL to the next place in the line.
25E3
EX DE,HL EB
Exchange Register Pair DE and Register Pair HL back: Register Pair DE = the place in the line, Register Pair HL = the link DCB.
25E4
Jump to LOGDCB1 at 259AH to go on with the link DCB, which holds the device's old type and vector: its route, NIL, link, filter or driver follows on the same line.
25E6DVRA0
BIT 6,(HL) CB 76
DVRA0: test bit 6 of the type byte at Register Pair HL, the filter bit.
25E8
If the device is not filtered (Z), jump to DVRB0 at 261CH to show its vector.
25EA
PUSH HL E5
Push Register Pair HL onto the stack (Stack Pointer): the DCB, for DVRA2 (261BH).
25EB
LD A,5BH 3E 5B
Load Register A with 5BH, the opening bracket in front of the filter's DCB name.
25ED
LD (DE),A 12
Store Register A, the bracket, at Register Pair DE in the line.
25EE
INC DE 13
Increment Register Pair DE to the next place in the line.
25EF
PUSH DE D5
Push Register Pair DE onto the stack (Stack Pointer): the place in the line, kept while Register Pair DE holds the DCB.
25F0
LD D,H 54
Load Register D with Register H, the high byte of the DCB.
25F1
LD E,L 5D
Load Register E with Register L: Register Pair DE = the filtered device's DCB, for the comparison at 2600H.
25F2
Call GETPTR at 2699H: Register Pair HL = the word at +1 and +2 of the DCB, the entry of the filter module (the source: the first three bytes swapped with the filter DCB).
25F5
LD BC,0004H 01 04 00
Load Register Pair BC with 0004H, the offset of the name length byte in a module header (JR, the last address word, then the length).
25F8
ADD HL,BC 09
Add Register Pair BC to Register Pair HL: Register Pair HL = the name length byte of the filter module's header.
25F9
LD C,(HL) 4E
Load Register C with the name length byte at Register Pair HL, used whole, as FILTER uses it (@GTMOD strips bits 7-4; no filter of the release sets them).
25FA
INC C 0C
Increment Register C: the length plus 1, so that Register Pair BC (Register B = 00H) passes over the length byte and the name.
25FB
ADD HL,BC 09
Add Register Pair BC to Register Pair HL: Register Pair HL = the word after the name, the address of the filter's DCB.
25FC
Call GETPTR2 at 269AH: Register Pair HL = that word, the filter's DCB. GETPTR2 steps with INC L, so a word on the last byte of a page is read wrong (B71).
25FF
PUSH HL E5
Push Register Pair HL onto the stack (Stack Pointer): the filter's DCB.
2600
SBC HL,DE ED 52
Subtract Register Pair DE, the filtered device's DCB, and the Carry flag (clear after the ADD at 25FBH) from Register Pair HL: Z when the filter's DCB is the device itself.
2602
POP HL E1
Pop Register Pair HL from the stack (Stack Pointer): the filter's DCB (POP leaves the flags of the SBC).
2603
POP DE D1
Pop Register Pair DE from the stack (Stack Pointer): the place in the line again.
2604
If the filter's DCB is another DCB (NZ), jump to DVRA1 at 2610H to show its name.
2606
LD HL,27C8H 21 C8 27LD HL,INACT$
Load Register Pair HL with 27C8H, INACT$, the word Inactive: the module points at this DCB, so no device is attached to the filter yet.
2609
LD BC,0008H 01 08 00
Load Register Pair BC with 0008H, the 8 letters of Inactive.
260C
LDIR ED B0
Copy Register Pair BC bytes from Register Pair HL (27C8H) to the line at Register Pair DE.
260E
Jump to DVRA2 at 2613H to close the brackets.
2610DVRA1
DVRA1: call MOVNAM at 269FH to put an asterisk and the name of the filter's DCB at Register Pair HL into the line.
2613DVRA2
LD A,5DH 3E 5D
DVRA2: load Register A with 5DH, the closing bracket.
2615
LD (DE),A 12
Store Register A, the bracket, at Register Pair DE in the line.
2616
INC DE 13
Increment Register Pair DE to the next place in the line.
2617
LD A,20H 3E 20
Load Register A with 20H, a space before the address.
2619
LD (DE),A 12
Store Register A, the space, at Register Pair DE in the line.
261A
INC DE 13
Increment Register Pair DE to the next place in the line.
261B
POP HL E1
Pop Register Pair HL from the stack (Stack Pointer): the filtered device's DCB (pushed at 25EAH), whose vector comes next.

261CH - DVRB0: the Vector, the End of the Line, Routes to Files and Nil

DVRB0 puts the vector of the DCB at +1 and +2 into the line as X'nnnn' by @HEX16. DVRB1 ends every device line with a carriage return and shows it with LINOUT; CKPAWS0 then tests BREAK and the pause key, and DVRB2 steps to the next DCB, 8 bytes on, until the low byte of the address passes FFH after the DCB at 02F8H. RTEFCB shows the file a device is routed to: the symbol for input and output, then the name, extension and drive that @FNAME finds from the drive and DEC at +6 and +7 of the FCB. MOVNIL puts Nil after a NIL device's symbol.

261CDVRB0
LD A,58H 3E 58
DVRB0: load Register A with 58H, the letter X that begins the address.
261E
LD (DE),A 12
Store Register A, the X, at Register Pair DE in the line.
261F
INC DE 13
Increment Register Pair DE to the next place in the line.
2620
LD A,27H 3E 27
Load Register A with 27H, the single quote after the X.
2622
LD (DE),A 12
Store Register A, the quote, at Register Pair DE in the line.
2623
INC DE 13
Increment Register Pair DE to the next place in the line.
2624
Call GETPTR at 2699H: Register Pair HL = the word at +1 and +2 of the DCB at Register Pair HL, its vector (the driver, the filter module, or for a link DCB the old vector of the linked device).
2627
EX DE,HL EB
Exchange Register Pair DE and Register Pair HL: Register Pair DE = the vector, Register Pair HL = the place in the line.
2628
LD A,63H 3E 63
Load Register A with 63H, SVC 99, @HEX16, which writes Register Pair DE as four hexadecimal digits at Register Pair HL.
262A
RST 28H EF
Call @HEX16 with RST 28H: the four digits of the vector are in the line, Register Pair HL past them.
262B
EX DE,HL EB
Exchange Register Pair DE and Register Pair HL back: Register Pair DE = the place in the line after the digits.
262C
LD A,27H 3E 27
Load Register A with 27H, the closing single quote.
262E
LD (DE),A 12
Store Register A, the quote, at Register Pair DE in the line.
262F
INC DE 13
Increment Register Pair DE to the next place in the line.
2630DVRB1
LD A,0DH 3E 0D
DVRB1: load Register A with 0DH, the carriage return that ends the line (also the way here from the routes, 25B6H, from a route to a file, 2666H, and from MOVNIL, 2673H).
2632
LD (DE),A 12
Store Register A, the carriage return, at Register Pair DE: the line in STRBUF is complete.
2633
LD HL,2A00H 21 00 2ALD HL,STRBUF
Load Register Pair HL with 2A00H, STRBUF, the start of the line.
2636
Call LINOUT at 2755H to show the line at Register Pair HL, and print it when PRINT is on; @DSPLY stops at the first 03H or 0DH (B72).
2639
Call CKPAWS0 at 278AH to test BREAK and the pause key without another carriage return: the line has its own.
263C
POP HL E1
Pop Register Pair HL from the stack (Stack Pointer): the DCB the line was for (pushed at 2599H).
263DDVRB2
LD A,L 7D
DVRB2: load Register A with Register L, the low byte of the DCB (also the way here for a spare DCB, 258EH).
263ETABLEN
ADD A,08H C6 08
TABLEN: add 08H, the length of a DCB, to Register A: the Carry flag is set when the DCB at 02F8H, the last, was done.
2640
LD L,A 6F
Load Register L with Register A: Register Pair HL = the next DCB, 0210H to 02F8H.
2641
If all 31 DCBs are done (Carry), jump to SPARM at 26AFH for the options.
2644
Jump to LOGDCB at 258CH for the next DCB, at Register Pair HL.
2647RTEFCB
PUSH HL E5
RTEFCB: push Register Pair HL onto the stack (Stack Pointer): the FCB the device is routed to (the source: save the control block's origin).
2648
LD HL,2899H 21 99 28LD HL,IO$
Load Register Pair HL with 2899H, IO$, a space, the input and output symbol and a space: a route to a file is shown as both ways, whatever the device's bits.
264B
LD BC,0005H 01 05 00
Load Register Pair BC with 0005H, the 5 characters of IO$.
264E
LDIR ED B0
Copy Register Pair BC bytes from Register Pair HL (2899H) to the line at Register Pair DE.
2650
POP HL E1
Pop Register Pair HL from the stack (Stack Pointer): the FCB.
2651
LD A,L 7D
Load Register A with Register L, the low byte of the FCB.
2652
ADD A,06H C6 06
Add 06H to Register A, the offset of the drive number in an FCB.
2654
LD L,A 6F
Load Register L with Register A, the low byte of FCB+6.
2655
ADC A,H 8C
Add Register H and the Carry flag of that addition to Register A.
2656
SUB L 95
Subtract Register L from Register A: Register A = Register H plus the carry, the high byte of FCB+6.
2657
LD H,A 67
Load Register H with Register A: Register Pair HL = FCB+6, the address of the FCB's drive number.
2658
LD C,(HL) 4E
Load Register C with the drive number of the file at Register Pair HL (FCB+6).
2659
INC HL 23
Increment Register Pair HL to FCB+7, the file's DEC.
265A
LD B,(HL) 46
Load Register B with the file's DEC at Register Pair HL (FCB+7), the number of its directory entry.
265B
PUSH DE D5
Push Register Pair DE onto the stack (Stack Pointer): the place in the line where the name goes.
265C
LD A,50H 3E 50
Load Register A with 50H, SVC 80, @FNAME, which writes the name of the file with the DEC in Register B on the drive in Register C at Register Pair DE.
265E
RST 28H EF
Call @FNAME with RST 28H (SYS3/SYS): the name, extension and drive, as TEXTFILE/TXT:1, ended by 03H, at Register Pair DE; NZ with an error number when the directory could not be read.
265F
POP DE D1
Pop Register Pair DE from the stack (Stack Pointer): the start of the name in the line.
2660
If @FNAME failed (NZ), jump to IOERR at 277AH to show the error and end DEVICE.
2663RTEF1
LD A,(DE) 1A
RTEF1: load Register A with the character at Register Pair DE in the line.
2664
CP 03H FE 03
Compare Register A with 03H, the end mark @FNAME put after the name.
2666
If the end of the name was reached (Z), jump to DVRB1 at 2630H to put the carriage return over the 03H and show the line.
2668
INC DE 13
Increment Register Pair DE to the next character of the name.
2669
Jump to RTEF1 at 2663H to test the next character of the name.
266BMOVNIL
LD HL,2896H 21 96 28LD HL,NIL$
MOVNIL: load Register Pair HL with 2896H, NIL$, the word Nil.
266E
LD BC,0003H 01 03 00
Load Register Pair BC with 0003H, the 3 letters of Nil.
2671
LDIR ED B0
Copy Register Pair BC bytes from Register Pair HL (2896H) to the line at Register Pair DE, after the I/O symbol.
2673
Jump to DVRB1 at 2630H to end the line and show it.

2675H - DCBDIR, GETPTR and MOVNAM: the I/O Symbol, Vectors and Names

DCBDIR builds the I/O symbol of a DCB from its type byte: a space, then the less than sign when the device can give input (bit 0, GET), the equals sign, or a number sign for a filter (bit 6), the greater than sign when it can take output (bit 1, PUT), and a space. GETPTR reads the word at +1 and +2 of a DCB, GETPTR2 the word at Register Pair HL; both step with INC L, a 6.3.1 change that saves bytes and is right for a DCB but not for a word on the last byte of a page (B71). MOVNAM puts an asterisk and the device name at +6 and +7 into the line; it leaves out a second letter of 00H, but a one letter name has 03H there, as @FSPEC ended it, and the 03H goes into the line (B72).

2675DCBDIR
DCBDIR: call ADDSPA at 2694H to put a space into the line at Register Pair DE (6.3.1: 6.3.0 had the three instructions here); Register A = 20H on return.
2678
BIT 0,(HL) CB 46
Test bit 0 of the type byte at Register Pair HL, the GET bit: set for a device that can give input.
267A
If it cannot give input (Z), jump to DCBD1 at 267EH to store the space still in Register A.
267C
LD A,3CH 3E 3C
Load Register A with 3CH, the less than sign for an input device.
267EDCBD1
LD (DE),A 12
DCBD1: store Register A, the less than sign or a space, at Register Pair DE in the line.
267F
INC DE 13
Increment Register Pair DE to the next place in the line.
2680
LD A,3DH 3E 3D
Load Register A with 3DH, the equals sign that every symbol has in the middle.
2682
BIT 6,(HL) CB 76
Test bit 6 of the type byte at Register Pair HL, the filter bit.
2684
If the device is not a filter (Z), jump to 2688H to store the equals sign.
2686
LD A,23H 3E 23
Load Register A with 23H, the number sign in place of the equals sign for a filtered device or a filter's own DCB.
2688
LD (DE),A 12
Store Register A, the equals or number sign, at Register Pair DE in the line.
2689
INC DE 13
Increment Register Pair DE to the next place in the line.
268A
LD A,20H 3E 20
Load Register A with 20H, a space, for a device that takes no output.
268C
BIT 1,(HL) CB 4E
Test bit 1 of the type byte at Register Pair HL, the PUT bit: set for a device that can take output.
268E
If it cannot take output (Z), jump to DCBD2 at 2692H to store the space.
2690
LD A,3EH 3E 3E
Load Register A with 3EH, the greater than sign for an output device.
2692DCBD2
LD (DE),A 12
DCBD2: store Register A, the greater than sign or a space, at Register Pair DE in the line.
2693
INC DE 13
Increment Register Pair DE to the next place in the line.
2694ADDSPA
LD A,20H 3E 20
ADDSPA: load Register A with 20H, the space that closes the symbol, or the space DCBDIR begins with (2675H); a 6.3.1 label.
2696
LD (DE),A 12
Store Register A, the space, at Register Pair DE in the line.
2697
INC DE 13
Increment Register Pair DE to the next place in the line.
2698
RET C9
Return with Register Pair DE past the symbol and Register Pair HL still at the DCB.
2699GETPTR
INC L 2C
GETPTR: increment Register L to +1 of the DCB at Register Pair HL, the low byte of its vector (6.3.1: 6.3.0 had these instructions in each place they are used).
269AGETPTR2
LD A,(HL) 7E
GETPTR2: load Register A with the low byte of the word at Register Pair HL.
269B
INC L 2C
Increment Register L to the high byte. Register H is not changed: for a word at nnFFH the high byte is read from nn00H (B71); a DCB's vector at +1 and +2 never crosses a page.
269C
LD H,(HL) 66
Load Register H with the high byte at Register Pair HL.
269D
LD L,A 6F
Load Register L with Register A, the low byte: Register Pair HL = the word.
269E
RET C9
Return with Register Pair HL = the word read.
269FMOVNAM
LD A,L 7D
MOVNAM: load Register A with Register L, the low byte of the DCB at Register Pair HL.
26A0
ADD A,06H C6 06
Add 06H to Register A, the offset of the name: a DCB never crosses a page, so Register H stays.
26A2
LD L,A 6F
Load Register L with Register A: Register Pair HL = +6 of the DCB, the first letter of its name.
26A3
LD A,2AH 3E 2A
Load Register A with 2AH, the asterisk that begins a device specification.
26A5
LD (DE),A 12
Store Register A, the asterisk, at Register Pair DE in the line.
26A6
INC DE 13
Increment Register Pair DE to the next place in the line.
26A7
LDI ED A0
Copy the first letter from Register Pair HL to Register Pair DE and increment both; Register Pair BC is decremented, and DEVICE does not use its value here.
26A9
LD A,(HL) 7E
Load Register A with the second letter of the name at Register Pair HL (+7).
26AA
OR A B7
OR Register A with itself: Z only for 00H. A one letter name set by SET, ROUTE or RENAME has 03H here, which goes on into the line and makes @DSPLY end it there (B72).
26AB
RET Z C8
Return if the second letter is 00H (Z), with Register Pair DE after the first letter.
26AC
LD (DE),A 12
Store Register A, the second letter, at Register Pair DE in the line.
26AD
INC DE 13
Increment Register Pair DE to the next place in the line.
26AE
RET C9
Return with Register Pair DE after the name in the line.

26AFH - SPARM: the Options and the Resident System Modules

With STATUS (or OPTION, S, O) on, the default, DEVICE shows Options: after an empty line and the name of each bit of DFLAG$ (006DH) that is set, from bit 0 up: Spooler, Type, Verify, Smooth, Memdisk, Forms, KSM and Graphic, taken from DVCS$, where bit 7 marks the last letter of each word, then Fast or Slow from SFLAG$ (007CH) bit 3. Then @GTMOD looks for the module SYSRES that SYSTEM (SYSRES=) puts in high memory; when it is there, System modules resident: and the number of every SYS overlay whose word in its table has a high byte other than 00H. STATUS off ends DEVICE here, without the module line too.

26AFSPARM
LD HL,FFFFH 21 FF FF
SPARM: load Register Pair HL with FFFFH, the operand at 26B0H (SPARM+1) where @PARAM stores the value of STATUS or OPTION (both entries name it); FFFFH, on, when neither was given.
26B2
LD A,H 7C
Load Register A with Register H, the high byte of the STATUS value in Register Pair HL.
26B3
OR L B5
OR Register A with Register L: Z when STATUS is off.
26B4
If STATUS is off (Z), jump to EXIT at 27B8H to return 0000H.
26B7
LD HL,27D0H 21 D0 27LD HL,DVCHDR$
Load Register Pair HL with 27D0H, DVCHDR$: a line feed, then Options:, ended by 03H.
26BA
Call LINOUT at 2755H to show the heading at Register Pair HL: its line feed, after the carriage return that ended the last line, leaves an empty line, then Options:.
26BD
LD A,65H 3E 65
Load Register A with 65H, SVC 101, @FLAGS, for the flag table (Index Register IY may hold a link DCB from 25D0H).
26BF
RST 28H EF
Call @FLAGS with RST 28H: Index Register IY = 006AH, FLGTAB$.
26C0
LD A,(IY+03H) FD 7E 03
Load Register A with DFLAG$ at Index Register IY+03H (006DH), whose bits 0-7 tell which of the eight options are on.
26C3
OR A B7
OR Register A with itself: Z when no option is on.
26C4
PUSH AF F5
Push Register Pair AF onto the stack (Stack Pointer): Register A = DFLAG$, the bits DOD1 (26CDH) pops, rotates and pushes back for each option; the POP at DORES (270AH) takes the last copy off. SHOWIT reads DFLAG$ again.
26C5
If no option is on (Z), jump to SHOWFS at 26F2H to show only Fast or Slow.
26C7
LD HL,27DAH 21 DA 27LD HL,DVCS$
Load Register Pair HL with 27DAH, DVCS$, the eight option names in the order of the bits.
26CA
LD BC,08FFH 01 FF 08
Load Register Pair BC with 08FFH: Register B = 8 bits to test, Register C = FFH, so that the first name gets no comma in front.
26CDDOD1
POP AF F1
DOD1: pop Register Pair AF from the stack (Stack Pointer): Register A = the flags still to test, the next one at bit 0.
26CE
RRCA 0F
Rotate Register A right: the Carry flag = the bit of this option.
26CF
PUSH AF F5
Push Register Pair AF onto the stack (Stack Pointer): the rest of the bits and the Carry flag.
26D0
If the option is off (No Carry), jump to DOD3 at 26EBH to pass over its name.
26D2
INC C 0C
Increment Register C: 00H, Z, for the first name shown; NZ for every one after it.
26D3
LD A,2CH 3E 2C
Load Register A with 2CH, the comma between two names (LD leaves the flags of the INC).
26D5
If this is not the first name (NZ), call BYTOUT at 2767H to show the comma in Register A.
26D8
Call OUTSP at 2765H to show a space in front of the name (6.3.1: 6.3.0 had LD A and CALL BYTOUT).
26DBDOD2
LD A,(HL) 7E
DOD2: load Register A with the next letter of the name at Register Pair HL.
26DC
INC HL 23
Increment Register Pair HL to the letter after it.
26DD
PUSH AF F5
Push Register Pair AF onto the stack (Stack Pointer): the letter with its bit 7.
26DE
AND 7FH E6 7F
AND Register A with 7FH to drop bit 7, the mark of a name's last letter.
26E0
Call BYTOUT at 2767H to show the letter in Register A.
26E3
POP AF F1
Pop Register Pair AF from the stack (Stack Pointer): the letter with its bit 7 again.
26E4
RLCA 07
Rotate Register A left: the Carry flag = bit 7, set for the last letter of the name.
26E5
If it was not the last letter (No Carry), jump back to DOD2 at 26DBH.
26E7
Decrement Register B and, while it is not zero, jump to DOD1 at 26CDH for the next option.
26E9
Jump to SHOWFS at 26F2H after the eighth option.
26EBDOD3
LD A,(HL) 7E
DOD3: load Register A with the next letter of the name at Register Pair HL, of an option that is off.
26EC
INC HL 23
Increment Register Pair HL to the letter after it.
26ED
RLCA 07
Rotate Register A left: the Carry flag = bit 7, set on the last letter.
26EE
If it was not the last letter (No Carry), jump back to DOD3 at 26EBH.
26F0
Decrement Register B and, while it is not zero, jump to DOD1 at 26CDH for the next option.
26F2SHOWFS
BIT 3,(IY+12H) FD CB 12 5E
SHOWFS: test bit 3 of SFLAG$ at Index Register IY+12H (007CH), set while the computer runs at its fast speed (SYSTEM (FAST)).
26F6
If the fast speed bit is set (NZ), jump to FAST at 26FDH.
26F8
LD HL,280EH 21 0E 28LD HL,SLOW$
Load Register Pair HL with 280EH, SLOW$, a comma, a space and Slow.
26FB
Jump to SHOWIT at 2700H with Register Pair HL at SLOW$.
26FDFAST
LD HL,2807H 21 07 28LD HL,FAST$
FAST: load Register Pair HL with 2807H, FAST$, a comma, a space and Fast.
2700SHOWIT
LD A,(IY+03H) FD 7E 03
SHOWIT: load Register A with DFLAG$ at Index Register IY+03H (006DH), to learn whether option names were shown.
2703
OR A B7
OR Register A with itself: Z when none was shown.
2704
If names were shown (NZ), jump to COMAOK at 2707H to keep the comma in front of Fast or Slow.
2706
INC HL 23
Increment Register Pair HL past the comma: with no option on the line reads Options: Fast or Options: Slow.
2707COMAOK
COMAOK: call LINOUT at 2755H to show Fast or Slow at Register Pair HL.
270ADORES
POP AF F1
DORES: pop Register Pair AF from the stack (Stack Pointer), the DFLAG$ copy pushed at 26C4H (the source: stack integrity).
270BNOTON
NOTON: call CKPAWS at 2785H to end the Options: line with a carriage return and test BREAK and the pause key.
270E
LD DE,2815H 11 15 28LD DE,RES$
Load Register Pair DE with 2815H, RES$, the name SYSRES ended by 03H.
2711
LD A,53H 3E 53
Load Register A with 53H, SVC 83, @GTMOD, which looks for a module of that name in the low driver zone and in high memory.
2713
RST 28H EF
Call @GTMOD with RST 28H (SYS12/SYS GTMOD): Z with Register Pair HL at the module and Register Pair DE at the byte after its name; NZ when no module SYSRES is in memory.
2714
If SYSTEM (SYSRES=) has not been used (NZ), jump to EXIT at 27B8H to return 0000H.
2717
LD HL,0005H 21 05 00
Load Register Pair HL with 0005H: past the module's two words after the name, plus 1.
271A
ADD HL,DE 19
Add Register Pair DE to Register Pair HL: Register Pair HL = RESTAB$ + 1, the high byte of the table's word for SYS0 (SYSRES's header: JR, the last address, 6 and SYSRES, two words, then RESTAB$, a word for each SYS overlay).
271B
PUSH HL E5
Push Register Pair HL onto the stack (Stack Pointer): the table, kept over LINOUT.
271C
LD HL,281CH 21 1C 28LD HL,SYSRES$
Load Register Pair HL with 281CH, SYSRES$, the words System modules resident: ended by 03H.
271F
Call LINOUT at 2755H to show the heading at Register Pair HL.
2722
POP HL E1
Pop Register Pair HL from the stack (Stack Pointer): the high byte of RESTAB$'s first word.
2723
LD BC,10FFH 01 FF 10
Load Register Pair BC with 10FFH: Register B = 16 words, for SYS0 to SYS15, Register C = FFH for no comma in front of the first number.
2726DORES1
LD A,(HL) 7E
DORES1: load Register A with the high byte of the overlay's word at Register Pair HL: the address of its copy in high memory, 00H when the overlay is not resident (RESTAB$ starts with 0001H for SYS0, SYS6 and SYS7).
2727
INC HL 23
Increment Register Pair HL to the low byte of the next word.
2728
INC HL 23
Increment Register Pair HL to the high byte of the next word.
2729
OR A B7
OR Register A with itself: Z when the overlay is not resident.
272A
If it is not resident (Z), jump to DORES3 at 274EH.
272C
INC C 0C
Increment Register C: 00H, Z, for the first number; NZ after it.
272D
LD A,2CH 3E 2C
Load Register A with 2CH, the comma between two numbers (LD leaves the flags of the INC).
272F
If this is not the first number (NZ), call BYTOUT at 2767H to show the comma in Register A.
2732
Call OUTSP at 2765H to show a space in front of the number (6.3.1).
2735
LD A,10H 3E 10
Load Register A with 10H, 16, the number of words in RESTAB$.
2737
SUB B 90
Subtract Register B, the words still to test, from Register A: the number of the overlay, 0 to 15.
2738
LD D,FFH 16 FF
Load Register D with FFH, so that the first INC makes it 00H.
273ADORES2
INC D 14
DORES2: increment Register D, the tens digit.
273B
SUB 0AH D6 0A
Subtract 0AH, ten, from Register A, the overlay number.
273D
If the result did not go below 0 (No Carry), jump back to DORES2 at 273AH: Register D = the tens, Register A = the units less 10.
273F
PUSH AF F5
Push Register Pair AF onto the stack (Stack Pointer): the units less 10.
2740
LD A,D 7A
Load Register A with Register D, the tens digit, 0 or 1.
2741
ADD A,30H C6 30
Add 30H to Register A to make the tens a digit, 30H or 31H.
2743
CP 30H FE 30
Compare Register A with 30H, the digit 0: Z when the number is below 10.
2745
If the tens digit is not 0 (NZ), call BYTOUT at 2767H to show it (BYTOUT changes Register Pair DE, after Register D was read).
2748
POP AF F1
Pop Register Pair AF from the stack (Stack Pointer): Register A = the units less 10.
2749
ADD A,3AH C6 3A
Add 3AH, 30H + 10, to Register A: the units digit.
274B
Call BYTOUT at 2767H to show the units digit in Register A.
274EDORES3
DORES3: decrement Register B and, while it is not zero, jump to DORES1 at 2726H for the next overlay.
2750
Call CKPAWS at 2785H to end the line with a carriage return and test BREAK and the pause key.
2753
Jump to EXIT at 27B8H to return 0000H in Register Pair HL.

2755H - LINOUT, BYTOUT, CKPAWS and the Exits

LINOUT shows a string with @DSPLY and BYTOUT a character with @DSP; with PRINT on, LINOUT also gives the string to @PRINT and BYTOUT the character to @PRT, so the printout is the screen's. LINOUT tests only the low byte of the PRINT value, BYTOUT the whole word (B73). Any error of the video or the printer goes to IOERR, which shows its short message through @ERROR and returns its number. CKPAWS ends a line with a carriage return, CKPAWS0 tests KFLAG$: BREAK ends DEVICE with FFFFH; the pause key (SHIFT and @) waits for a key, BREAK there ends DEVICE, the pause key again keeps waiting and any other key goes on. DEVICE never pauses by itself at the end of a screen. SAVESP reloads the Stack Pointer of the entry and clears BREAK before the return.

2755LINOUT
LD A,0AH 3E 0A
LINOUT: load Register A with 0AH, SVC 10, @DSPLY, which shows the string at Register Pair HL on the video up to a 03H, or up to and with a 0DH.
2757
RST 28H EF
Call @DSPLY with RST 28H (052DH): Z when every character was shown. @DSPLY loads Register Pair DE with 0210H, DO's DCB, and keeps Register Pair HL.
2758
If the video refused a character (NZ), jump to IOERR at 277AH with the error in Register A.
275A
LD A,(276FH) 3A 6F 27
Load Register A with the byte at 276FH, the low byte of the PRINT value (PPARM+1).
275D
OR A B7
OR Register A with itself: Z when the low byte is 00H, for PRINT off, but also for a PRINT value such as 256 (B73).
275E
RET Z C8
If PRINT is off (Z), return with the string shown on the video only.
275F
LD A,0EH 3E 0E
Load Register A with 0EH, SVC 14, @PRINT, which sends the string at Register Pair HL to the printer the same way.
2761
RST 28H EF
Call @PRINT with RST 28H to print the string again: Z when the printer took it.
2762
If the printer failed (NZ), jump to IOERR at 277AH, as Device not available after the printer's time-out.
2764
RET C9
Return with the string at Register Pair HL shown and printed.
2765OUTSP
LD A,20H 3E 20
OUTSP: load Register A with 20H, a space, and go on into BYTOUT (a 6.3.1 entry, used for the spaces of the lines).
2767BYTOUT
PUSH BC C5
BYTOUT: push Register Pair BC onto the stack (Stack Pointer): BYTOUT keeps Register Pair BC for its callers.
2768
LD C,A 4F
Load Register C with Register A, the character to show.
2769
LD A,02H 3E 02
Load Register A with 02H, SVC 2, @DSP, which shows the character in Register C on the video.
276B
RST 28H EF
Call @DSP with RST 28H: Z when the character was shown.
276C
If the video refused it (NZ), jump to POPBC at 2778H, where the RET Z is not taken and IOERR follows.
276EPPARM
LD DE,0000H 11 00 00
PPARM: load Register Pair DE with 0000H, the operand at 276FH where @PARAM stores the value of PRINT or P; 0000H, off, when it was not given. BYTOUT changes Register Pair DE.
2771
LD A,E 7B
Load Register A with Register E, the low byte of the PRINT value in Register Pair DE.
2772
OR D B2
OR Register A with Register D: Z only when the whole PRINT value is 0000H.
2773
If PRINT is off (Z), jump to POPBC at 2778H to return with Z.
2775
LD A,06H 3E 06
Load Register A with 06H, SVC 6, @PRT, which sends the character in Register C to the printer.
2777
RST 28H EF
Call @PRT with RST 28H: Z when the printer took the character.
2778POPBC
POP BC C1
POPBC: pop Register Pair BC from the stack (Stack Pointer), the caller's Register Pair BC.
2779
RET Z C8
Return if the character was shown and, with PRINT on, printed (Z); otherwise go on into IOERR with the error in Register A.
277AIOERR
LD L,A 6F
IOERR: load Register L with Register A, the error number (from @PARAM, @GTDCB, @FNAME, @DSPLY, @PRINT, @DSP or @PRT, or 20 for the GAT, loaded at 244AH in place of @RDSSC's own error).
277B
LD H,00H 26 00
Load Register H with 00H: Register Pair HL = the error number, returned to the caller.
277D
OR C0H F6 C0
OR Register A with C0H: bit 7 tells @ERROR to return to the caller, bit 6 asks for the message alone (the source: abbreviate and return).
277F
LD C,A 4F
Load Register C with Register A, the error number with bits 7 and 6 set, the form @ERROR takes.
2780
LD A,1AH 3E 1A
Load Register A with 1AH, SVC 26, @ERROR, which shows the message of the error in Register C.
2782
RST 28H EF
Call @ERROR with RST 28H to show the error message, as Parameter error, GAT read error or Device not available.
2783
Jump to SAVESP at 27B1H to restore the Stack Pointer, clear BREAK and return with Register Pair HL = the error number.
2785CKPAWS
LD A,0DH 3E 0D
CKPAWS: load Register A with 0DH, the carriage return that ends a drive line, the Options: line and the module line.
2787
Call BYTOUT at 2767H to show the carriage return in Register A, and print it when PRINT is on.
278ACKPAWS0
LD A,65H 3E 65
CKPAWS0: load Register A with 65H, SVC 101, @FLAGS (also the entry after a device line, which has its own carriage return).
278C
RST 28H EF
Call @FLAGS with RST 28H: Index Register IY = 006AH, FLGTAB$, again, as Index Register IY may hold a DCT entry or a link DCB.
278D
LD A,(IY+0AH) FD 7E 0A
Load Register A with KFLAG$ at Index Register IY+0AH (0074H): bit 0 BREAK, bit 1 the pause key, bit 2 ENTER, set by the keyboard task.
2790
BIT 0,A CB 47
Test bit 0 of Register A, the BREAK bit of KFLAG$.
2792
If BREAK was pressed (NZ), jump to BREAK at 27ABH to end DEVICE with FFFFH.
2794
BIT 1,A CB 4F
Test bit 1 of Register A, the pause bit, set by SHIFT and @.
2796
RET Z C8
Return if the pause key was not pressed (Z): the display goes on.
2797CKPAW1
LD A,01H 3E 01
CKPAW1: load Register A with 01H, SVC 1, @KEY, which waits for a key.
2799
RST 28H EF
Call @KEY with RST 28H: Register A = the key pressed.
279A
CP 60H FE 60
Compare Register A with 60H, the code of SHIFT and @, the pause key.
279C
If the pause key was pressed again (Z), jump back to CKPAW1 at 2797H to keep waiting.
279E
CP 80H FE 80
Compare Register A with 80H, the code of BREAK.
27A0
If BREAK was pressed (Z), jump to BREAK at 27ABH to end DEVICE with FFFFH.
27A2RESKFL
LD A,(IY+0AH) FD 7E 0A
RESKFL: load Register A with KFLAG$ at Index Register IY+0AH (0074H) (also called from the entry, 2419H, and from BREAK, 27ABH).
27A5
AND F9H E6 F9
AND Register A with F9H to clear bit 1, the pause bit, and bit 2, the ENTER bit.
27A7
LD (IY+0AH),A FD 77 0A
Store Register A into KFLAG$ at Index Register IY+0AH (0074H).
27AA
RET C9
Return: any other key ends the pause and the display goes on.
27ABBREAK
BREAK: call RESKFL at 27A2H to clear the pause and ENTER bits of KFLAG$.
27AE
LD HL,FFFFH 21 FF FF
Load Register Pair HL with FFFFH, the return code of a command stopped by BREAK.
27B1SAVESP
LD SP,0000H 31 00 00
SAVESP: load the Stack Pointer with 0000H, the operand at 27B2H that DEVICEA stores (2409H): the Stack Pointer of the entry, dropping whatever was still pushed (the drive number, a DCB).
27B4
LD A,6AH 3E 6A
Load Register A with 6AH, SVC 106, @CKBRKC, to clear a BREAK that is still noted.
27B6
RST 28H EF
Call @CKBRKC with RST 28H, so that a BREAK that stopped DEVICE does not also stop what runs next.
27B7
RET C9
Return with Register Pair HL = 0000H, FFFFH or the error number, through RST28's tail: to @EXIT for a typed command, or to the program that sent it through @CMNDR.
27B8EXIT
LD HL,0000H 21 00 00
EXIT: load Register Pair HL with 0000H, the return code when everything asked for was shown (from 26B4H, 2714H and 2753H).
27BB
Jump to SAVESP at 27B1H to restore the Stack Pointer and return.

27BDH - DEVICE Data: the Texts of the Lines

The texts LINOUT shows, most ended by 03H so that the next piece follows on the same line. CYLS$ has no end mark: it runs on into COMMA$, whose three spaces @HEXD fills with the number of cylinders. DVCS$ holds the eight option names in the order of the DFLAG$ bits, each with bit 7 set on its last letter. STPRAT$ holds two characters for each step rate. NIL$ and IO$ are copied into the line by LDIR, so they need no end mark.

27BD-27C7NOPACK$
DEFM "No Disk] " / DEFB 03H 4E 6F 20 20 44 69 73 6B 5D 20 03
NOPACK$, 27BDH-27C7H: shown in brackets in place of the pack name for a drive in which @CKDRV found no diskette (245EH), with two spaces after No, as in the source.
27C8-27CFINACT$
DEFM "Inactive" 49 6E 61 63 74 69 76 65
INACT$, 27C8H-27CFH: the word shown in brackets for a filter whose module points at the device itself, a filter not yet attached (2606H); its I is also copied by the 12 byte LDIR at 2467H.
27D0-27D9DVCHDR$
DEFB 0AH / DEFM "Options:" / DEFB 03H 0A 4F 70 74 69 6F 6E 73 3A 03
DVCHDR$, 27D0H-27D9H: a line feed, which after the carriage return of the last line leaves an empty line before the heading, and the word Options: (26B7H).
27DA-27E4DVCS$
DEFM "Spoole" / DEFB 0F2H / DEFM "Typ" / DEFB 0E5H 53 70 6F 6F 6C 65 F2 54 79 70 E5
DVCS$, 27DAH-27E4H: Spooler (r with bit 7 set, F2H), DFLAG$ bit 0, the printer spooler; Type (e with bit 7, E5H), bit 1, type ahead.
27E5-27F0
DEFM "Verif" / DEFB 0F9H / DEFM "Smoot" / DEFB 0E8H 56 65 72 69 66 F9 53 6D 6F 6F 74 E8
27E5H-27F0H: Verify (y with bit 7, F9H), DFLAG$ bit 2, read after write; Smooth (h with bit 7, E8H), bit 3, the smooth floppy option.
27F1-27FC
DEFM "Memdis" / DEFB 0EBH / DEFM "Form" / DEFB 0F3H 4D 65 6D 64 69 73 EB 46 6F 72 6D F3
27F1H-27FCH: Memdisk (k with bit 7, EBH), DFLAG$ bit 4, which MEMDISK/DCT sets; Forms (s with bit 7, F3H), bit 5, which FORMS/FLT sets.
27FD-2806
DEFM "KS" / DEFB 0CDH / DEFM "Graphi" / DEFB 0E3H 4B 53 CD 47 72 61 70 68 69 E3
27FDH-2806H: KSM (M with bit 7, CDH), DFLAG$ bit 6, which KSM/FLT sets; Graphic (c with bit 7, E3H), bit 7, graphic characters to the printer on a screen print.
2807-280DFAST$
DEFM ", Fast" / DEFB 03H 2C 20 46 61 73 74 03
FAST$, 2807H-280DH: shown when SFLAG$ bit 3 is set (26FDH); without the comma when no option name was shown (2706H).
280E-2814SLOW$
DEFM ", Slow" / DEFB 03H 2C 20 53 6C 6F 77 03
SLOW$, 280EH-2814H: shown when SFLAG$ bit 3 is clear (26F8H).
2815-281BRES$
DEFM "SYSRES" / DEFB 03H 53 59 53 52 45 53 03
RES$, 2815H-281BH: the module name @GTMOD looks for (270EH); @GTMOD counts the name up to the 03H.
281C-2834SYSRES$
DEFM "System modules resident:" / DEFB 03H 53 79 73 74 65 6D 20 6D 6F 64 75 6C 65 73 20 72 65 73 69 64 65 6E 74 3A 03
SYSRES$, 281CH-2834H: the heading of the line of resident SYS overlays (271CH).
2835-2844STPRAT$
DEFM " 6122030 3 61015" 20 36 31 32 32 30 33 30 20 33 20 36 31 30 31 35
STPRAT$, 2835H-2844H: the step rates, two characters each, by DCT+3 bit 5 and bits 1-0: 6, 12, 20 and 30 ms for 5.25 inch drives, 3, 6, 10 and 15 ms for 8 inch drives (2533H).
2845-284FFLOPY$
DEFB 22H / DEFM " Floppy #" / DEFB 03H 22 20 46 6C 6F 70 70 79 20 23 03
FLOPY$, 2845H-284FH: the inch mark after the size digit, then Floppy and the number sign before the select digit (24B0H).
2850-285ARIGID$
DEFB 22H / DEFM " Rigid #" / DEFB 03H 22 20 52 69 67 69 64 20 20 23 03
RIGID$, 2850H-285AH: the same for a hard drive, with two spaces so that the select digit stands in the same column as for a floppy (24B5H).
285B-2861CYLS$
DEFM ", Cyls=" 2C 20 43 79 6C 73 3D
CYLS$, 285BH-2861H: shown by LINOUT at 24E4H with no end mark of its own, so that the line goes on into COMMA$.
2862-2867COMMA$
DEFM " , " / DEFB 03H 20 20 20 2C 20 03
COMMA$, 2862H-2867H: three columns that @HEXD fills with the number of cylinders at each drive line (24E3H), then a comma and a space. After a drive line the field keeps that drive's number; a space of the file stays only in front of a number of fewer than three digits.
2868-2871REMOV$
DEFM "Removable" / DEFB 03H 52 65 6D 6F 76 61 62 6C 65 03
REMOV$, 2868H-2871H: shown for a hard drive whose DCT+3 bit 2 is clear (24F4H).
2872-2877FIXED$
DEFM "Fixed" / DEFB 03H 46 69 78 65 64 03
FIXED$, 2872H-2877H: shown for a hard drive whose DCT+3 bit 2 is set (24F9H).
2878-2883DEN$
DEFM "den, Sides=" / DEFB 03H 64 65 6E 2C 20 53 69 64 65 73 3D 03
DEN$, 2878H-2883H: after S or D, so that the line shows Sden or Dden, then the label of the number of sides (250EH).
2884-288BSTEP$
DEFM ", Step=" / DEFB 03H 2C 20 53 74 65 70 3D 03
STEP$, 2884H-288BH: the label of the step rate (2520H).
288C-288EMS$
DEFM "ms" / DEFB 03H 6D 73 03
MS$, 288CH-288EH: milliseconds, after the step rate (2544H).
288F-2895DLY$
DEFM ", Dly=" / DEFB 03H 2C 20 44 6C 79 3D 03
DLY$, 288FH-2895H: the label of the motor start delay of a 5.25 inch drive (2550H).
2896-2898NIL$
DEFM "Nil" 4E 69 6C
NIL$, 2896H-2898H: copied into the line of a NIL device by the LDIR of MOVNIL (2671H), 3 bytes, so no end mark.
2899-289DIO$
DEFM " <=> " 20 3C 3D 3E 20
IO$, 2899H-289DH: the symbol for input and output with a space on each side, copied by RTEFCB (264EH) in front of the name of a file a device is routed to.

289EH - DEVICE Data: the Parameter Table

PRMTBL$ in the 6.x form that @PARAM reads: 80H, then for each parameter a type byte (bit 6 a flag, bit 4 the first letter alone will do, bits 3-0 the length of the name), the name, a response byte and the address of the operand that receives the value. @PARAM does not check the kind of value against the type byte, so a number or a string is taken too. STATUS and OPTION fill the same operand. There is no entry N: the manual's N= (non stop) gives Parameter error. 00H ends the table, the last byte of the member.

289E
DEFB 80H 80
PRMTBL$, 289EH: 80H, the mark of the 6.x table form (240DH).
289F
DEFB 56H 56
289FH: type 56H, a flag, may be abbreviated, a name of 6 characters.
28A0-28A5
DEFM "BYTEIO" 42 59 54 45 49 4F
28A0H-28A5H: the name BYTEIO (or B), to show the devices.
28A6
DEFB 00H 00
28A6H: the response byte of BYTEIO, which @PARAM clears and sets and DEVICE does not read.
28A7-28A8
DEFW 257CH 7C 25
28A7H-28A8H: 257CH, BPARM+1, the operand of the LD HL at 257BH, 0000H until a value is given.
28A9
DEFB 56H 56
28A9H: type 56H, a flag, may be abbreviated, a name of 6 characters.
28AA-28AF
DEFM "DRIVES" 44 52 49 56 45 53
28AAH-28AFH: the name DRIVES (or D), to show the drives.
28B0
DEFB 00H 00
28B0H: the response byte of DRIVES, which DEVICE does not read.
28B1-28B2
DEFW 241EH 1E 24
28B1H-28B2H: 241EH, DPARM+1, the operand of the LD HL at 241DH, FFFFH until a value is given.
28B3
DEFB 55H 55
28B3H: type 55H, a flag, may be abbreviated, a name of 5 characters.
28B4-28B8
DEFM "PRINT" 50 52 49 4E 54
28B4H-28B8H: the name PRINT (or P), to print everything that is shown.
28B9
DEFB 00H 00
28B9H: the response byte of PRINT, which DEVICE does not read.
28BA-28BB
DEFW 276FH 6F 27
28BAH-28BBH: 276FH, PPARM+1, the operand of the LD DE at 276EH, read whole by BYTOUT and by its low byte by LINOUT (275AH), 0000H until a value is given.
28BC
DEFB 56H 56
28BCH: type 56H, a flag, may be abbreviated, a name of 6 characters.
28BD-28C2
DEFM "STATUS" 53 54 41 54 55 53
28BDH-28C2H: the name STATUS (or S), to show the options and the resident modules.
28C3
DEFB 00H 00
28C3H: the response byte of STATUS, which DEVICE does not read.
28C4-28C5
DEFW 26B0H B0 26
28C4H-28C5H: 26B0H, SPARM+1, the operand of the LD HL at 26AFH, FFFFH until a value is given.
28C6
DEFB 56H 56
28C6H: type 56H, a flag, may be abbreviated, a name of 6 characters.
28C7-28CC
DEFM "OPTION" 4F 50 54 49 4F 4E
28C7H-28CCH: the name OPTION (or O), another name for STATUS, which the manual does not list.
28CD
DEFB 00H 00
28CDH: the response byte of OPTION, which DEVICE does not read.
28CE-28CF
DEFW 26B0H B0 26
28CEH-28CFH: 26B0H, SPARM+1, the same operand as STATUS: the last of the two given decides.
28D0
DEFB 00H 00
28D0H: 00H, the end of the table after its five parameters, and the last byte of member 7.

2400H - Member 8 (ROUTE): Entry and the Exits

SYS1/SYS runs ROUTE with request 64H; its header points at member 8, which the overlay loader reads to 2400H-25A5H, 25C5H and 25E5H and calls at 2400H with Register Pair HL at the text after the word ROUTE. ROUTE routes a device to another device, routes it to a file through an FCB and a buffer it puts in high memory, or makes it NIL; a device name that is not yet in the table gets a spare DCB, so ROUTE also makes new devices. ROUTE keeps the Stack Pointer of its entry, and every exit goes through SAVESP, which drops the stack to that depth and clears BREAK: 0000H when the route was made, FFFFH after one of ROUTE's own messages, or the number of a DOS error after its short message. ROUTE does not test BREAK at its entry: its source has no 631 change, and 6.2 and 6.3.0 have the same code.

2400ROUTE
LD (2427H),SP ED 73 27 24
ROUTE: ROUTE's entry (request 64H): store the Stack Pointer into 2427H, the operand of the LD SP at SAVESP (2426H), so that every exit returns from this depth to RST28's tail.
2404
Call ROUTE1 at 242DH, which reads the command line and makes the route; it returns when the route was made, and from NILDCB also when CKSRC failed (B77); every other error leaves through SAVESP.
2407EXIT
LD HL,0000H 21 00 00
EXIT: load Register Pair HL with 0000H, the return code of a command that did its work (source: clean exit).
240A
Jump to SAVESP at 2426H to reload the Stack Pointer, clear BREAK and return with Register Pair HL = 0000H.
240CPRMERR
LD A,2CH 3E 2C
PRMERR: load Register A with 2CH, error 44, Parameter error, when @PARAM refused a word in parentheses (2440H, 2466H).
240EIOERR
LD L,A 6F
IOERR: load Register L with Register A, the number of the DOS error (from PRMERR, @GTDCB, @INIT, @PEOF, CKSRC or @CLOSE).
240F
LD H,00H 26 00
Load Register H with 00H: Register Pair HL = the error number, ROUTE's return code.
2411
OR C0H F6 C0
OR Register A with C0H: bit 7 makes @ERROR return to ROUTE, bit 6 makes it show the short message alone (source: set abbrev and return).
2413
LD C,A 4F
Load Register C with Register A, the error number with bits 7 and 6 set, the form @ERROR takes.
2414
LD A,1AH 3E 1A
Load Register A with 1AH, SVC 26, @ERROR, which shows the message of the error number in Register C.
2416
RST 28H EF
Call @ERROR with RST 28H (the SYS0/SYS stub at 1B0FH, which loads SYS4/SYS) to show the short message of the error.
2417
Jump to SAVESP at 2426H to return with Register Pair HL = the error number.
2419CANT
LD HL,2555H 21 55 25LD HL,CANT$
CANT: load Register Pair HL with 2555H, CANT$, the message No memory space available, when a route to a file needs new space and HIGH$ is frozen (24C7H).
241C
DEFB 0DDH DD
241CH: DDH, the IX prefix: entered from 2419H, the LD HL,256FH that follows runs as LD IX,256FH, so Register Pair HL keeps CANT$.
241DSPCERR
LD HL,256FH 21 6F 25LD HL,SPCERR$
SPCERR: load Register Pair HL with 256FH, SPCERR$, the message Device spec required: the source is not a device (2433H, 2438H), no destination follows (245BH), or the destination device is the source itself (2476H).
2420
LD A,0CH 3E 0C
Load Register A with 0CH, SVC 12, @LOGOT, which shows a line on the video and writes it to the job log.
2422
RST 28H EF
Call @LOGOT with RST 28H to show the message at Register Pair HL, CANT$ or SPCERR$.
2423ERREXIT
LD HL,FFFFH 21 FF FF
ERREXIT: load Register Pair HL with FFFFH, the return code of a command that showed a message of its own (source: set abort code).
2426SAVESP
LD SP,0000H 31 00 00
SAVESP: load the Stack Pointer with the word at 2427H, 0000H in the file and the entry's Stack Pointer once 2400H has run, so that the stack is as it was at the entry.
2429
LD A,6AH 3E 6A
Load Register A with 6AH, SVC 106, @CKBRKC, which tests and clears the BREAK key.
242B
RST 28H EF
Call @CKBRKC with RST 28H to clear a BREAK pressed during ROUTE, so that it does not stop the next command; the flags it returns are not used.
242C
RET C9
Return to RST28's tail with Register Pair HL = 0000H, an error number or FFFFH.

242DH - ROUTE1: the Source, the Parameters and the Destination

ROUTE1 gives the first word to @FSPEC into FCBSRC; it must be a device, an asterisk and a name, or ROUTE says Device spec required. The parameters may follow the source or the destination: @PARAM reads them after each, but after the source only when nothing else follows (NIL) or the destination comes straight after the closing parenthesis, since @PARAM leaves Register Pair HL after it and @FSPEC stops at a space (ROUTE with (R) and a space before TO gives Device spec required) (PRMTBL$: NIL or N, REWIND or R), and a value it stores stays, since @PARAM clears only the response bytes. NIL is tested after the source, before any destination is read, so a NIL given after a destination is stored and then ignored: ROUTE of the printer, PR, to the video, DO, with (NIL) after them routes PR to DO. The source's two letters go into the name of the route module, RTENAM+3 (259FH). @FSPEC passes over a TO in front of the destination (PREPTBL of SYS1/SYS); a destination that begins with an asterisk is a device, any other a file.

242DROUTE1
LD DE,25E5H 11 E5 25LD DE,FCBSRC
ROUTE1: load Register Pair DE with 25E5H, FCBSRC, the 32 byte area for the source; only its first byte is in the file (source: fetch source spec).
2430
LD A,4EH 3E 4E
Load Register A with 4EH, SVC 78, @FSPEC, which copies the specification at Register Pair HL into the area at Register Pair DE, ended by 03H, and moves Register Pair HL past it.
2432
RST 28H EF
Call @FSPEC with RST 28H: Z when the first word is a file or device specification, NZ when it is not or the line is empty.
2433
If @FSPEC refused the source (NZ), jump to SPCER at 245BH, whose JP NZ goes on to SPCERR: Device spec required.
2435
LD A,(DE) 1A
Load Register A with the byte at Register Pair DE, FCBSRC+0 (25E5H), the first character of the source.
2436
CP 2AH FE 2A
Compare Register A with 2AH, the asterisk in front of a device name: Z when the source is a device.
2438
If the source is a file (NZ), jump to SPCER at 245BH, which goes on to SPCERR with the flags still NZ: only a device can be routed.
243A
LD DE,2584H 11 84 25LD DE,PRMTBL$
Load Register Pair DE with 2584H, PRMTBL$, ROUTE's parameter table in the 6.x form, with NIL and REWIND.
243D
LD A,11H 3E 11
Load Register A with 11H, SVC 17, @PARAM, which reads the parameters in parentheses at Register Pair HL and stores each value into the operand its table entry names.
243F
RST 28H EF
Call @PARAM with RST 28H: Z when the parameters were right, or at once when no opening parenthesis follows the source; NZ for a word not in the table, a bad value or field, or a missing closing parenthesis.
2440
If @PARAM refused a word (NZ), jump to PRMERR at 240CH: Parameter error.
2442
LD DE,(25E6H) ED 5B E6 25
Load Register Pair DE with the word at 25E6H, FCBSRC+1 and FCBSRC+2, the two letters of the source's name (the second is 03H for a one letter name).
2446
LD (259FH),DE ED 53 9F 25
Store Register Pair DE into 259FH, RTENAM+3: the route module's name becomes RTE and the source's two letters, RTEPR when the printer, PR, is routed to a file (source: stuff source name).
244A
LD A,65H 3E 65
Load Register A with 65H, SVC 101, @FLAGS, which gives the address of the system flag table.
244C
RST 28H EF
Call @FLAGS with RST 28H: Index Register IY = 006AH, FLGTAB$, so that CFLAG$ is at IY+02H for NOTRES (24C3H).
244DNPARM
LD BC,0000H 01 00 00
NPARM: load Register Pair BC with the value of NIL, 0000H in the file, stored into 244EH by @PARAM (table word 258AH): FFFFH for NIL, N or NIL=Y.
2450
LD A,B 78
Load Register A with Register B, the high byte of the NIL value.
2451
OR C B1
OR Register A with Register C, the low byte: Z only when the value is 0000H, NIL not given or given as NIL=N; any other value, a number too, counts as NIL.
2452
If NIL was given (NZ), jump to NILDCB at 2528H to make the source a NIL device; no destination is read.
2455
LD DE,25A5H 11 A5 25LD DE,FCBDST
Load Register Pair DE with 25A5H, FCBDST, the 32 byte area for the destination; only its first byte is in the file.
2458
LD A,4EH 3E 4E
Load Register A with 4EH, SVC 78, @FSPEC, to copy the destination at Register Pair HL into FCBDST.
245A
RST 28H EF
Call @FSPEC with RST 28H: a TO in front of the destination is passed over (SYS1's PREPTBL); NZ when no specification follows.
245BSPCER
SPCER: if there is no destination (also when a space follows the closing parenthesis of parameters given after the source, as @PARAM leaves Register Pair HL after it and @FSPEC stops at the space), or, from 2433H and 2438H, the source is not a device (NZ), jump to SPCERR at 241DH: Device spec required.
245E
PUSH DE D5
Push Register Pair DE onto the stack (Stack Pointer): 25A5H, FCBDST, which @PARAM does not keep.
245F
LD DE,2584H 11 84 25LD DE,PRMTBL$
Load Register Pair DE with 2584H, PRMTBL$, to read parameters after the destination (source: need in case REWIND).
2462
LD A,11H 3E 11
Load Register A with 11H, SVC 17, @PARAM, to read the parameters in parentheses at Register Pair HL, after the destination.
2464
RST 28H EF
Call @PARAM with RST 28H: Z when the parameters were right or there were none; a NIL read here is stored at 244EH but never tested.
2465
POP DE D1
Pop Register Pair DE from the stack (Stack Pointer): 25A5H, FCBDST, again.
2466
If @PARAM refused a word (NZ), jump to PRMERR at 240CH: Parameter error.
2468
LD A,(DE) 1A
Load Register A with the byte at Register Pair DE, FCBDST+0 (25A5H), the first character of the destination.
2469
CP 2AH FE 2A
Compare Register A with 2AH, the asterisk in front of a device name: Z when the destination is a device (source: test device/file).
246B
If the destination is a file (NZ), jump to INITFCB at 24ADH to open it and build the route module in high memory.

246DH - The Destination a Device: CKDCBS and CKDCB1

For a device destination ROUTE refuses the source's own name with Device spec required, but only that one: a device routed to a device that is routed back to it (XX routed to YY, then YY to XX) is taken, and the cycle hangs every I/O to the two, DEVICE (B) (B70) and any later ROUTE of either (B78). The destination must exist, or ROUTE says Device not available. CKDCBS, also the end of the file path with the FCB's address in Register Pair HL, finds the source's DCB or a spare one (CKSRC) and, with the interrupts off, writes the new vector into DCB+1 and +2, the old type byte's low three bits (GET, PUT, CTL) with the route bit 10H into DCB+0, and the name into DCB+6 and +7. When the source was not routed before, its old type byte and vector go into DCB+3 to +5, where RESET's FIXDCB finds them; a source routed already keeps the ones its first route saved, so RESET brings back the device as it was before any ROUTE. The NIL, link and filter bits (3, 5 and 6) of the old type are dropped from the new one; they are kept in DCB+3 only on the first route, so a NIL bit that ROUTE (NIL) added to a routed device is lost when it is routed again.

246D
LD DE,(25A6H) ED 5B A6 25
Load Register Pair DE with the word at 25A6H, FCBDST+1 and FCBDST+2, the two letters of the destination's name (source: p/u device name).
2471
LD HL,(25E6H) 2A E6 25
Load Register Pair HL with the word at 25E6H, FCBSRC+1 and FCBSRC+2, the two letters of the source's name (source: make sure SRC is not DST).
2474
SBC HL,DE ED 52
Subtract Register Pair DE from Register Pair HL with the Carry flag, which the CP 2AH at 2469H left clear (source: CF is reset): Z when the two names are the same.
2476
If the source would be routed to itself (Z), jump to SPCERR at 241DH: Device spec required. Only this direct case is refused.
2479
LD A,52H 3E 52
Load Register A with 52H, SVC 82, @GTDCB, which looks for the DCB whose name at +6 and +7 is Register Pair DE.
247B
RST 28H EF
Call @GTDCB with RST 28H (SYS2/SYS): Z with Register Pair HL = the destination's DCB; NZ with Register A = 8 when no DCB has that name.
247C
If the destination does not exist (NZ), jump to IOERR at 240EH: Device not available.
247FCKDCBS
PUSH HL E5
CKDCBS: push Register Pair HL onto the stack (Stack Pointer): the new vector, the destination's DCB, or for a file (250AH) the FCB in high memory (source: save DCB address of dest).
2480
Call CKSRC at 250DH: Register Pair HL = the source's DCB, or a spare one for a new name, and Register Pair DE = the source's name; a file at the end of the source's route is closed first.
2483
If CKSRC failed (NZ), jump to IOERR at 240EH with Register A = 33, No device space available, or the error of @CLOSE; SAVESP drops the word pushed at 247FH.
2486
DI F3
CKDCB1 (an EQU of the source): disable the interrupts, so that no I/O runs through the DCB while it is half changed.
2487
POP BC C1
Pop Register Pair BC from the stack (Stack Pointer): the new vector pushed at 247FH (source: rcvr dest route vector).
2488
PUSH HL E5
Push Register Pair HL onto the stack (Stack Pointer): the address of the source's DCB+0.
2489
INC L 2C
Increment Register L to DCB+1, the low byte of the vector; INC L is enough, as the 31 DCBs, 0208H-02FFH, lie in one page.
248A
LD A,(HL) 7E
Load Register A with the byte at Register Pair HL, DCB+1, the low byte of the old vector.
248B
LD (HL),C 71
Store Register C, the low byte of the new vector, into the byte at Register Pair HL, DCB+1 (source: stuff dest route into DCB of source).
248C
LD C,A 4F
Load Register C with Register A, the low byte of the old vector, kept for DCB+4.
248D
INC L 2C
Increment Register L to DCB+2, the high byte of the vector.
248E
LD A,(HL) 7E
Load Register A with the byte at Register Pair HL, DCB+2, the high byte of the old vector (source: it could be an FCB, for a source routed to a file before).
248F
LD (HL),B 70
Store Register B, the high byte of the new vector, into the byte at Register Pair HL, DCB+2.
2490
LD B,A 47
Load Register B with Register A: Register Pair BC = the old vector.
2491
POP HL E1
Pop Register Pair HL from the stack (Stack Pointer): the source's DCB+0 again.
2492
LD A,(HL) 7E
Load Register A with the byte at Register Pair HL, DCB+0, the old type byte (source: init the ROUTE bit).
2493
PUSH AF F5
Push Register Pair AF onto the stack (Stack Pointer): the old type byte in Register A, for 24A0H (source: save old TYPE byte).
2494
AND 07H E6 07
AND Register A with 07H: keep bits 0-2, GET, PUT and CTL; the file, filter, link, route and NIL bits are dropped (source: strip any flag bits).
2496
OR 10H F6 10
OR Register A with 10H: set bit 4, the route bit, which sends @CHNIO on to the DCB or FCB at the vector.
2498
LD (HL),A 77
Store Register A into the byte at Register Pair HL, DCB+0: the source is routed (a spare DCB gets the type 10H).
2499
LD A,L 7D
Load Register A with Register L, the low byte of the DCB's address.
249A
ADD A,07H C6 07
Add 07H to Register A, for DCB+7, the second letter of the name (source: point to name field).
249C
LD L,A 6F
Load Register L with Register A: Register Pair HL = DCB+7.
249D
LD (HL),D 72
Store Register D, the second letter of the source's name, into the byte at Register Pair HL, DCB+7 (source: and stuff in the name in case this is a new DCB block).
249E
DEC L 2D
Decrement Register L from DCB+7 to DCB+6, the first letter of the name; Register H stays the DCB's page.
249F
LD (HL),E 73
Store Register E, the first letter of the source's name, into the byte at Register Pair HL, DCB+6.
24A0
POP AF F1
Pop Register Pair AF from the stack (Stack Pointer): the old type byte back in Register A.
24A1
BIT 4,A CB 67
Test bit 4 of Register A, the route bit of the old type byte: NZ when the source was routed already.
24A3
If it was (NZ), jump to CKDCB2 at 24ABH: DCB+3 to +5 keep the type and vector the device had before its first route, for RESET.
24A5
DEC L 2D
Decrement Register L from DCB+6 to DCB+5, the high byte of the saved vector in the system bytes of the DCB.
24A6
LD (HL),B 70
Store Register B, the high byte of the old vector, into the byte at Register Pair HL, DCB+5 (source: stuff old vector for reclamation).
24A7
DEC L 2D
Decrement Register L from DCB+5 to DCB+4, the low byte of the saved vector in the system bytes of the DCB.
24A8
LD (HL),C 71
Store Register C, the low byte of the old vector, into the byte at Register Pair HL, DCB+4.
24A9
DEC L 2D
Decrement Register L from DCB+4 to DCB+3, the first system byte of the DCB, where the old type byte is saved.
24AA
LD (HL),A 77
Store Register A, the old type byte with all its bits, into the byte at Register Pair HL, DCB+3: RESET's FIXDCB copies DCB+3 to +5 back over DCB+0 to +2.
24AB
EI FB
CKDCB2 (an EQU of the source): enable the interrupts again.
24AC
RET C9
Return to EXIT at 2407H with the source routed: ROUTE returns 0000H (source: successful).

24ADH - The Destination a File: INITFCB and the Route Module

A route to a file needs an FCB and a buffer that stay in memory after ROUTE: a module of 14 bytes (a JR to itself, the word of its last byte, the name length 5, RTE and the source's two letters, two words 0000H), the 32 byte FCB after it and a page of buffer above. INITFCB first asks @GTMOD for a module of that name; when one is in memory, its last byte (the top of its buffer) is used again and HIGH$ is left alone, as the manual says ROUTE does with the unused module of an earlier ROUTE of the same device. Otherwise HIGH$ is the top, unless it is frozen (No memory space available): the buffer is the 256 bytes that end at it, the module and FCB the 46 bytes below, and HIGH$ is set below the module. Nothing compares the space with LOW$, and @HIGH$ does not either. @INIT opens or creates the file into FCBDST with the LRL 256 and the buffer; unless REWIND is given @PEOF moves it to its end, so the new data follows the old. The header with the open FCB is then copied into high memory and CKDCBS routes the source to the FCB. A module in memory is used again also while its device is still routed to its file, and its FCB is written over before CKSRC's CLSFILS runs, which then closes a copy of the new file's FCB, so the first file is never closed (B75); a one letter device never finds its module and takes a new one each time.

24ADINITFCB
PUSH DE D5
INITFCB: push Register Pair DE onto the stack (Stack Pointer): 25A5H, FCBDST, with the file's specification.
24AE
LD DE,259CH 11 9C 25LD DE,RTENAM
Load Register Pair DE with 259CH, RTENAM, the name of the route module, RTE and the source's two letters stored at 2446H, ended by the 00H at 25A1H (source: see if space already allocated).
24B1
LD A,53H 3E 53
Load Register A with 53H, SVC 83, @GTMOD, which looks through the driver zone and high memory for a module whose header holds the name at Register Pair DE.
24B3
RST 28H EF
Call @GTMOD with RST 28H (SYS12/SYS): Z with Register Pair HL = the start of the module; NZ when none has the name. It counts the name to the first byte below 21H, so the name of a one letter source, ended by its 03H, has 4 characters and never matches a header's 5.
24B4
POP DE D1
Pop Register Pair DE from the stack (Stack Pointer): 25A5H, FCBDST, again.
24B5
If no module of the name is in memory (NZ), jump to NOTRES at 24C3H to take new space below HIGH$. A module found is used again whether or not its device is still routed to its file (B75).
24B7
INC HL 23
Increment Register Pair HL to the second byte of the module, the offset of its JR.
24B8
INC HL 23
Increment Register Pair HL to the third byte, the low byte of the word of the module's last byte (source: get last byte used into HL).
24B9
LD A,(HL) 7E
Load Register A with the byte at Register Pair HL, the low byte of the module's last byte, the top of its buffer.
24BA
INC HL 23
Increment Register Pair HL to the high byte of that word.
24BB
LD H,(HL) 66
Load Register H with the byte at Register Pair HL, the high byte of the module's last byte.
24BC
LD L,A 6F
Load Register L with Register A: Register Pair HL = the last byte of the module found, the HIGH$ its first ROUTE started from.
24BD
XOR A AF
Set Register A to 00H (XOR A), the operand for CKIFRES (source: set a 0 to show already resident).
24BE
LD (24F7H),A 32 F7 24
Store Register A into 24F7H, the operand of the OR at CKIFRES (24F6H): OR 00H gives Z there, so HIGH$ is left as it is.
24C1
Jump to SETBUF at 24D1H to put the buffer, header and FCB in the module's old place.
24C3NOTRES
BIT 0,(IY+02H) FD CB 02 46
NOTRES: test bit 0 of the byte at Index Register IY+02H, CFLAG$ (006CH), set while HIGH$ is frozen and may not be changed (source: can we alter HIGH$?).
24C7
If HIGH$ is frozen (NZ), jump to CANT at 2419H: No memory space available.
24CA
LD HL,0000H 21 00 00
Load Register Pair HL with 0000H, so that @HIGH$ returns the value instead of setting it (source: get high).
24CD
LD B,L 45
Load Register B with Register L, 00H: @HIGH$ works on HIGH$ (with Register B not 0 it would be LOW$).
24CE
LD A,64H 3E 64
Load Register A with 64H, SVC 100, @HIGH$, which returns or sets HIGH$ or LOW$.
24D0
RST 28H EF
Call @HIGH$ with RST 28H (1948H): Register Pair HL = HIGH$, the word at 040EH, the highest byte free.
24D1SETBUF
LD (2599H),HL 22 99 25
SETBUF: store Register Pair HL, the top, into 2599H, RTEDVR+2, the word of the module's last byte, so that @GTMOD goes on past the buffer to the next module (source: stuff highest used).
24D4
INC HL 23
Increment Register Pair HL to the byte above the top.
24D5
DEC H 25
Decrement Register H: Register Pair HL = the top + 1 - 256, the start of the buffer, the 256 bytes that end at the top (source: reserve a page for the I/O buffer).
24D6
PUSH HL E5
Push Register Pair HL onto the stack (Stack Pointer): the start of the buffer, for INITF1 (source: don't lose it).
24D7
LD B,00H 06 00
Load Register B with 00H, the logical record length 256 for @INIT (source: LRL = 0).
24D9
LD A,3AH 3E 3A
Load Register A with 3AH, SVC 58, @INIT, which opens the file at Register Pair DE, FCBDST, or creates it when it does not exist, with the buffer at Register Pair HL.
24DB
RST 28H EF
Call @INIT with RST 28H (SYS2/SYS): Z when the file was opened or created; NZ with the error in Register A.
24DC
If @INIT failed (NZ), jump to INITF1 at 24EBH, where the error leaves through IOERR (source: what? an error?).
24DERPARM
LD BC,0000H 01 00 00
RPARM: load Register Pair BC with the value of REWIND, 0000H in the file, stored into 24DFH by @PARAM (table word 2594H): FFFFH for REWIND, R or REWIND=Y.
24E1
INC B 04
Increment Register B: Z only when the value's high byte was FFH, so a REWIND value such as 1 counts as no REWIND.
24E2
If REWIND was given (Z), jump to INITF1 at 24EBH with the file at its start: the routed data is written over the old (source: keep file at start).
24E4
LD A,41H 3E 41
Load Register A with 41H, SVC 65, @PEOF, which moves the file at Register Pair DE to its end.
24E6
RST 28H EF
Call @PEOF with RST 28H (14C9H), which always leaves the file at its end: Z when the end of file lies inside the last sector; NZ with Register A = 1CH, End of file encountered, when the file ends on a sector boundary, a new file too.
24E7
If @PEOF returned Z, go on at INITF1 at 24EBH.
24E9
CP 1CH FE 1C
Compare Register A with 1CH, error 28, End of file encountered: Z when @PEOF met only the end of file, which is what was asked for.
24EBINITF1
POP HL E1
INITF1: pop Register Pair HL from the stack (Stack Pointer): the start of the buffer pushed at 24D6H (source: get back buffer pointer).
24EC
If @INIT or @PEOF gave a real error (NZ), jump to IOERR at 240EH with the error in Register A; HIGH$ is unchanged, but a file @INIT opened is left open.
24EF
LD BC,002EH 01 2E 00
Load Register Pair BC with 002EH, 46: the 32 bytes of the FCB and the 14 of the module's header (source: back up another 32 for the FCB storage + 14 for linkage).
24F2
XOR A AF
Set Register A to 00H and clear the Carry flag (XOR A) for the subtraction.
24F3
SBC HL,BC ED 42
Subtract Register Pair BC from Register Pair HL: Register Pair HL = the start of the buffer - 46, the start of the module.
24F5
PUSH HL E5
Push Register Pair HL onto the stack (Stack Pointer): the start of the module (source: save module start).
24F6CKIFRES
OR FFH F6 FF
CKIFRES: OR Register A with FFH, for NZ, or with 00H, for Z, after 24BEH stored 00H into 24F7H for a module found in memory (source: OR 0 if ISRES).
24F8
If the module was found in memory (Z), jump to ISRES1 at 24FEH: HIGH$ stays as it is.
24FA
DEC HL 2B
Decrement Register Pair HL to the byte below the module, the new HIGH$; Register B is 00H from the 002EH at 24EFH (source: reset HIGH$, B=0).
24FB
LD A,64H 3E 64
Load Register A with 64H, SVC 100, @HIGH$, to set HIGH$ to Register Pair HL.
24FD
RST 28H EF
Call @HIGH$ with RST 28H (1948H): HIGH$ (040EH) = the start of the module - 1. The result is not tested; @HIGH$ refuses only while HIGH$ is frozen, tested at 24C3H, and does not compare the value with LOW$.
24FEISRES1
POP DE D1
ISRES1: pop Register Pair DE from the stack (Stack Pointer): the start of the module, where the copy goes (source: rcvr module pointer).
24FF
PUSH DE D5
Push Register Pair DE onto the stack (Stack Pointer): the start of the module again, for 2505H.
2500
LD HL,2597H 21 97 25LD HL,RTEDVR
Load Register Pair HL with 2597H, RTEDVR, the module's header in ROUTE, followed at once by FCBDST with the open FCB (source: move module to memory).
2503
LDIR ED B0
Copy Register Pair BC = 46 bytes (002EH) from Register Pair HL to Register Pair DE (LDIR): the header and the FCB go to high memory; for a module found in memory this writes over its FCB, which may be the open FCB of a file its device is still routed to (B75).
2505
POP DE D1
Pop Register Pair DE from the stack (Stack Pointer): the start of the module (source: now adjust to true FCB location).
2506
LD HL,000EH 21 0E 00
Load Register Pair HL with 000EH, 14, the length of the module's header.
2509
ADD HL,DE 19
Add Register Pair DE to Register Pair HL: Register Pair HL = the FCB in high memory, the new vector of the source.
250A
Jump to CKDCBS at 247FH to route the source's DCB to the FCB: @CHNIO sends the I/O of a routed device on to its vector, and one whose type byte has bit 7 set, an open FCB, to @BYTEIO (1300H, by the JP M at 0693H).

250DH - CKSRC: the Source's DCB

CKSRC looks for the source's name in the DCB table; a name not found gets the first spare DCB, one whose name is 0000H, so ROUTE can make a new device. When none is spare it returns NZ with Register A = 33, No device space available; for a route to a file this comes after the file was opened, the module put in high memory and, for a new module, HIGH$ lowered, and none of it is undone (B76). For the DCB found or given, CLSFILS closes the file at the end of its route, if there is one, before the DCB is changed.

250DCKSRC
LD DE,(25E6H) ED 5B E6 25
CKSRC: load Register Pair DE with the word at 25E6H, FCBSRC+1 and FCBSRC+2, the source's name (source: p/u source device name).
2511
PUSH DE D5
Push Register Pair DE onto the stack (Stack Pointer): the source's name, for CKSRC2 (2526H).
2512
LD A,52H 3E 52
Load Register A with 52H, SVC 82, @GTDCB, which looks for the DCB whose name is Register Pair DE.
2514
RST 28H EF
Call @GTDCB with RST 28H (SYS2/SYS): Z with Register Pair HL = the source's DCB; NZ with Register A = 8 and Register Pair HL = 0200H when no DCB has the name.
2515
If the source exists (Z), jump to CKSRC1 at 2521H to use its DCB (source: use it if found).
2517
LD DE,0000H 11 00 00
Load Register Pair DE with 0000H, the name of a spare DCB (source: else find a spare DCB block).
251A
LD A,52H 3E 52
Load Register A with 52H, SVC 82, @GTDCB, to find the first DCB whose name is 0000H.
251C
RST 28H EF
Call @GTDCB with RST 28H: Z with Register Pair HL = a spare DCB; NZ with Register A = 8 and Register Pair HL = 0200H when all 31 are in use.
251D
LD A,21H 3E 21
Load Register A with 21H, error 33, No device space available; the LD leaves the flags of @GTDCB as they are.
251F
If no DCB is spare (NZ), jump to CKSRC2 at 2526H to return NZ with Register A = 33. For a file the FCB and module are already in high memory, HIGH$ lowered for a new module, and the file open (B76).
2521CKSRC1
PUSH HL E5
CKSRC1: push Register Pair HL onto the stack (Stack Pointer): the source's DCB, or the spare one.
2522
Call CLSFILS at 2539H to close the file at the end of the source's route, if it has one (source: close any existing file routes).
2525
POP HL E1
Pop Register Pair HL from the stack (Stack Pointer): the source's DCB; the flags are those of CLSFILS, Z or the NZ of @CLOSE.
2526CKSRC2
POP DE D1
CKSRC2: pop Register Pair DE from the stack (Stack Pointer): the source's name, pushed at 2511H (source: recover source name).
2527
RET C9
Return Z with Register Pair HL = the source's DCB and Register Pair DE = its name, or NZ with the error in Register A.

2528H - NILDCB: ROUTE (NIL)

NILDCB makes the source a NIL device: @CHNIO tests the NIL bit (type bit 3) right after the open FCB bit and before the route, link and filter bits, and returns at once with Z, so output to the device is thrown away and a request for input comes back with Z and Register A = the type byte. NILDCB only ORs 08H into the type, so a routed, linked or filtered device keeps those bits and its vector, which RESET's FIXDCB restores later; DEVICE does not test the NIL bit of a device routed to (B74). A file at the end of the source's route is closed first. The result of CKSRC is not tested, so an error of @CLOSE is not shown either; when the source is a new name and all 31 DCBs are in use, NILDCB works on the 0200H that @GTDCB left in Register Pair HL, ORs 08H into BUR$ and writes the name over DVRHI$, and ROUTE returns 0000H without a message (B77).

2528NILDCB
NILDCB: call CKSRC at 250DH: Register Pair HL = the source's DCB or a spare one, Register Pair DE = its name, and a file route closed. Its NZ, for no DCB spare or an error of @CLOSE, is not tested (B77).
252B
LD A,(HL) 7E
Load Register A with the byte at Register Pair HL, DCB+0, the type byte (00H for a spare DCB; BUR$ at 0200H when none was found) (source: get type byte).
252C
OR 08H F6 08
OR Register A with 08H: set bit 3, the NIL bit; the route, link and filter bits stay set.
252E
LD (HL),A 77
Store Register A into the byte at Register Pair HL, DCB+0: the device is NIL (source: show is NIL device).
252F
LD A,L 7D
Load Register A with Register L, the low byte of the DCB's address (source: point to name field).
2530
ADD A,06H C6 06
Add 06H to Register A, for DCB+6, the first letter of the name.
2532
LD L,A 6F
Load Register L with Register A: Register Pair HL = DCB+6, or 0206H, DVRHI$, after a failed search.
2533
DI F3
Disable the interrupts while the name is written.
2534
LD (HL),E 73
Store Register E, the first letter of the source's name, into the byte at Register Pair HL, DCB+6 (source: stuff in our name).
2535
INC L 2C
Increment Register L from DCB+6 to DCB+7, the second letter of the name (from 0206H to 0207H after a failed search).
2536
LD (HL),D 72
Store Register D, the second letter of the source's name, into the byte at Register Pair HL, DCB+7 (source: in case it's a new DCB block).
2537
EI FB
Enable the interrupts again, now that the type byte and the name of the DCB are written.
2538
RET C9
Return to EXIT at 2407H: ROUTE returns 0000H, also when CKSRC found no DCB (source: successful).

2539H - CLSFILS: Close the File at the End of a Route

CLSFILS follows a route from DCB to DCB, through the vector at +1 and +2, for as long as the type byte's route bit is set; where it stops at an open FCB (type bit 7) it closes the file, by copying the 32 bytes of the FCB into FCBFIL and giving the copy to @CLOSE, so the FCB in high memory still shows the file open. Nothing but a DCB without the route bit ends the walk, and the NIL bit is not tested: a cycle of routes (B70, B74) makes CLSFILS go round for ever, so a ROUTE of any device in the cycle, ROUTE (NIL) to break it too, hangs the computer (B78). The file is closed wherever the chain ends, also when it is another device's route: after DU is routed to the file LOG/TXT and PR to DU, a ROUTE of PR to DO closes LOG/TXT while DU stays routed to it and goes on writing through its own FCB, which a RESET of DU closes again. RESET has the same routine (lbreset.asm).

2539CLSFILS
BIT 4,(HL) CB 66
CLSFILS: test bit 4 of the byte at Register Pair HL, the type byte of the DCB, the route bit: Z when the device is not routed (source: jump if no route).
253B
If it is not routed (Z), jump to CLSFIL1 at 2544H to see whether the chain ends at a file.
253D
INC HL 23
Increment Register Pair HL to DCB+1, the low byte of the vector, the DCB or FCB the device is routed to (source: else p/u link address).
253E
LD A,(HL) 7E
Load Register A with the byte at Register Pair HL, the low byte of the vector.
253F
INC HL 23
Increment Register Pair HL to DCB+2, the high byte of the vector.
2540
LD H,(HL) 66
Load Register H with the byte at Register Pair HL, the high byte of the vector.
2541
LD L,A 6F
Load Register L with Register A: Register Pair HL = the DCB or FCB the device is routed to.
2542
Jump back to CLSFILS at 2539H with the next DCB of the chain: there is no count and no NIL test, so a cycle of routes loops here for ever (B78).
2544CLSFIL1
BIT 7,(HL) CB 7E
CLSFIL1: test bit 7 of the byte at Register Pair HL, the type byte, set only in an open FCB (source: a file?).
2546
RET Z C8
If the chain ends at a device (Z), return Z: there is no file to close (source: ret if not).
2547
LD DE,25C5H 11 C5 25LD DE,FCBFIL
Load Register Pair DE with 25C5H, FCBFIL, the 32 byte area for the copy of the FCB (source: point to fcb area).
254A
PUSH DE D5
Push Register Pair DE onto the stack (Stack Pointer): 25C5H, the start of the copy.
254B
LD BC,0020H 01 20 00
Load Register Pair BC with 0020H, the 32 bytes of an FCB.
254E
LDIR ED B0
Copy Register Pair BC = 32 bytes from Register Pair HL, the FCB in high memory, to Register Pair DE, FCBFIL (LDIR) (source: fill from device vector).
2550
POP DE D1
Pop Register Pair DE from the stack (Stack Pointer): 25C5H, FCBFIL (source: recover start).
2551
LD A,3CH 3E 3C
Load Register A with 3CH, SVC 60, @CLOSE, which writes a buffer that holds changes and the end of file into the directory and ends the use of the FCB.
2553
RST 28H EF
Call @CLOSE with RST 28H (SYS3/SYS) on the copy at Register Pair DE; the FCB in high memory is not changed and still has bit 7, open, set.
2554
RET C9
Return with the flags of @CLOSE: Z, or NZ with its error in Register A (source: ret with Z, NZ status).

2555H - ROUTE Data: the Messages, PRMTBL$, the Route Module and the FCBs

The two messages, the parameter table in the 6.x form, RTEDVR (the 14 byte header that INITFCB copies into high memory in front of the file's FCB) and the three 32 byte areas: FCBDST for the destination, which @INIT turns into the FCB copied into high memory, FCBFIL for the copy of an FCB that CLSFILS closes, and FCBSRC for the source. Of each area only the first byte, 00H, is in the file, each the end of a load block; the last 31 bytes of FCBSRC, 25E6H-2604H, lie after member 8's last byte and have no row.

2555-256ECANT$
DEFM "No memory space available" / DEFB 0DH 4E 6F 20 6D 65 6D 6F 72 79 20 73 70 61 63 65 20 61 76 61 69 6C 61 62 6C 65 0D
CANT$, 2555H-256EH: the message CANT shows (2419H) when a route to a file needs new space and HIGH$ is frozen (24C7H), ended by its carriage return.
256F-2583SPCERR$
DEFM "Device spec required" / DEFB 0DH 44 65 76 69 63 65 20 73 70 65 63 20 72 65 71 75 69 72 65 64 0D
SPCERR$, 256FH-2583H: the message SPCERR shows (241DH) for a source that is not a device, a missing destination or a device routed to itself.
2584PRMTBL$
DEFB 80H 80
PRMTBL$, 2584H: 80H, the mark of the 6.x table form that @PARAM reads (243AH, 245FH).
2585
DEFB 53H 53
2585H: type 53H, a flag (bit 6), may be abbreviated (bit 4), a name of 3 characters.
2586-2588
DEFM "NIL" 4E 49 4C
2586H-2588H: the name NIL (or N), to make the source a NIL device.
2589
DEFB 00H 00
2589H: the response byte of NIL, which @PARAM clears and sets and ROUTE does not read.
258A-258B
DEFW 244EH 4E 24
258AH-258BH: 244EH, NPARM+1, the operand of the LD BC at 244DH, 0000H until a value is given.
258C
DEFB 56H 56
258CH: type 56H, a flag, may be abbreviated, a name of 6 characters.
258D-2592
DEFM "REWIND" 52 45 57 49 4E 44
258DH-2592H: the name REWIND (or R), to write the routed data from the start of the file.
2593
DEFB 00H 00
2593H: the response byte of REWIND, which ROUTE does not read.
2594-2595
DEFW 24DFH DF 24
2594H-2595H: 24DFH, RPARM+1, the operand of the LD BC at 24DEH, 0000H until a value is given; only a high byte FFH counts (24E1H).
2596
DEFB 00H 00
2596H: 00H, the end of the table after its two parameters (a NOP in the source).
2597RTEDVR
RTEDVR: a JR to 2597H, itself (18H FEH), the first two bytes of the route module's header; in high memory it is the module's start, which @GTMOD takes for a header by its 18H, and nothing runs it (source: no real jump).
2599-259A
DEFW 0000H 00 00
2599H-259AH: RTEDVR+2, the word of the module's last byte, written by SETBUF (24D1H) with the top of the buffer, so that @GTMOD goes on past the buffer to the next module (source: stuff of high).
259B
DEFB 05H 05
259BH: RTEDVR+4, the length of the name, 5, which @GTMOD compares with the length of the name it is given (24B3H).
259C-25A0RTENAM
DEFM "RTExx" 52 54 45 78 78
RTENAM, 259CH-25A0H: the module's name, RTE and two letters xx that 2446H replaces with the source's name at 259FH-25A0H, so RTEPR for a route of the printer, PR.
25A1-25A4
DEFW 0000H, 0000H 00 00 00 00
25A1H-25A4H: two words 0000H, where a driver's header has its DCB word and a spare word; the 00H at 25A1H also ends the name for @GTMOD (24AEH).
25A5FCBDST
DEFB 00H 00
FCBDST, 25A5H: the first byte of the destination's area, 00H in the file, the last byte of the second load block (2500H-25A5H). @FSPEC writes the destination here (245AH), @INIT makes it an open FCB (24DBH), and INITFCB copies it into high memory after the header (2503H).
25A6-25C4
DEFS 31
FCBDST+1 to FCBDST+31, 25A6H-25C4H: not loaded. The destination's name (read at 246DH for a device), then the rest of the FCB that @INIT builds.
25C5FCBFIL
DEFB 00H 00
FCBFIL, 25C5H: the first byte of the area for the copy that CLSFILS closes (2547H), 00H in the file, a load block of one byte.
25C6-25E4
DEFS 31
FCBFIL+1 to FCBFIL+31, 25C6H-25E4H: not loaded. The rest of the FCB copied from high memory by CLSFILS (254EH) and given to @CLOSE (2553H).
25E5FCBSRC
DEFB 00H 00
FCBSRC, 25E5H: the first byte of the source's area, 00H in the file, the last byte of member 8. @FSPEC writes the source here (2430H); its name at 25E6H-25E7H is read at 2442H, 2471H and 250DH, and the rest of the area, up to 2604H, lies after the member.

2400H - Member 9 (LINK): the Two Device Specs

SYS1/SYS runs LINK with request 62H; its header points at member 9, which the overlay loader reads to 2400H-24A9H and calls at 2400H with Register Pair HL at the text after the word LINK. LINK joins two devices: output sent to the first goes to the second as well, and input asked of the first may come from the second. Both must be devices that exist, and their names must differ. LINK keeps no Stack Pointer, tests no BREAK and calls no @CKBRKC: every exit is at the depth of the entry and ends with RET. Its source has no 631 change; 6.2 and 6.3.0 have the same code.

2400LINK
LD DE,24AAH 11 AA 24LD DE,FCB1
LINK: LINK's entry (request 62H), with Register Pair HL at the text after the word LINK: load Register Pair DE with 24AAH, FCB1, the 3 bytes after the member where @FSPEC puts the source (source: fetch source spec).
2403
LD A,4EH 3E 4E
Load Register A with 4EH, SVC 78, @FSPEC, which copies a file or device spec from the text at Register Pair HL into the buffer at Register Pair DE and moves Register Pair HL past it.
2405
RST 28H EF
Call @FSPEC with RST 28H (SYS1/SYS) to read the source spec into FCB1 at 24AAH: a device spec is stored as the asterisk and up to two letters or digits in capitals, then 03H, which after a two letter name falls on 24ADH, the first byte of FCB2; a file spec given as the source runs further into FCB2 (up to 24C2H), which the destination's @FSPEC then writes over.
2406
If @FSPEC returned NZ (no spec could be read) jump to 2418H, SPCERR1, whose JR NZ the same flags take on to SPCERR at 248BH (Device spec required).
2408
LD A,(DE) 1A
Load Register A with the byte at Register Pair DE, 24AAH, the first character of the source spec.
2409
CP 2AH FE 2A
Compare Register A with 2AH, the asterisk that marks a device spec (source: must be a device).
240B
If Register A is not 2AH (the source is a file spec) jump to SPCERR at 248BH: LINK joins devices only.
240D
LD DE,24ADH 11 AD 24LD DE,FCB2
Load Register Pair DE with 24ADH, FCB2, the 32 bytes after FCB1 where @FSPEC puts the destination (source: fetch destination spec).
2410
LD A,4EH 3E 4E
Load Register A with 4EH, SVC 78, @FSPEC, which copies the destination spec from the text at Register Pair HL into the buffer at Register Pair DE.
2412
RST 28H EF
Call @FSPEC with RST 28H to read the destination spec into FCB2 at 24ADH; a word TO before it is read as a spec, found in PREPTBL (SYS1 20B0H, looked up at 2099H) and dropped, so LINK with TO between the two devices works.
2413
If @FSPEC returned NZ (no destination on the line, or a word it cannot read) jump to SPCERR at 248BH.
2415
LD A,(DE) 1A
Load Register A with the byte at Register Pair DE, 24ADH, the first character of the destination spec.
2416
CP 2AH FE 2A
Compare Register A with 2AH, the asterisk: the destination must be a device too (source: must also be a device).
2418SPCERR1
SPCERR1: if Register A is not 2AH jump to SPCERR at 248BH; also reached from 2406H with NZ after a source that @FSPEC refused.
241A
LD HL,(24ABH) 2A AB 24
Load Register Pair HL with the word at 24ABH-24ACH, the source's name: Register L its first character, Register H its second (03H for a one letter name) (source: if devices are the same, then quit).
241D
LD DE,(24AEH) ED 5B AE 24
Load Register Pair DE with the word at 24AEH-24AFH, the destination's name, Register E its first character and Register D its second.
2421
SBC HL,DE ED 52
Subtract Register Pair DE from Register Pair HL with the Carry flag, which the CP 2AH at 2416H left clear: Z when the two names are the same.
2423
If the names are the same jump to SPCERR at 248BH: a device is not linked to itself. Only the two names are compared; a destination already linked or routed to the source, directly or through other devices, is not seen, so two devices can be linked to each other in a cycle (B79).

2425H - Member 9 (LINK): the Three DCBs

LINK finds a spare DCB for the link first, then the destination's DCB, then the source's. @GTDCB (SYS2/SYS, request B4H) walks the 31 DCBs 0208H-02FFH and compares the name at DCB+6 and DCB+7 with Register Pair DE; it returns the DCB's address in Register Pair HL with Z, or error 8 with NZ. Nothing is written before all three are found, so an error leaves the device tables as they were.

2425
LD DE,0000H 11 00 00
Load Register Pair DE with 0000H, the name of a spare DCB: all 8 bytes of an unused DCB are 00H, as SYS0's start-up clears 0238H-02FFH, REMOVE clears a removed DCB and RESET clears a link DCB when it undoes the link (source: locate a spare DCB for the link).
2428
LD A,52H 3E 52
Load Register A with 52H, SVC 82, @GTDCB, which looks for the DCB whose name at +6 and +7 is Register Pair DE.
242A
RST 28H EF
Call @GTDCB with RST 28H (SYS0's 1990H, request B4H to SYS2/SYS, which is loaded into the overlay area 1E00H-23FFH and stays there for the next calls) to find the first spare DCB: Register Pair HL = its address with Z, or NZ when all 31 are in use.
242B
LD A,21H 3E 21
Load Register A with 21H, error 33, No device space available, ready for 242DH; the LD leaves the flags of @GTDCB as they were.
242D
If no DCB is spare (NZ) jump to IOERR at 2481H with error 33.
242F
LD (244AH),HL 22 4A 24
Store Register Pair HL, the spare DCB's address, into 244AH-244BH, the operand of the LD BC at LINKDCB (2449H) (source: save pointer).
2432
LD DE,(24AEH) ED 5B AE 24
Load Register Pair DE with the word at 24AEH-24AFH, the destination's name (source: grab DCB name).
2436
LD A,52H 3E 52
Load Register A with 52H, SVC 82, @GTDCB, which looks for the DCB whose name is Register Pair DE, here the destination's.
2438
RST 28H EF
Call @GTDCB with RST 28H to find the destination's DCB: Register Pair HL = its address with Z, or Register A = 08H with NZ; a NIL device is found like any other.
2439
If the destination is not in the table (NZ, Register A = 08H, Device not available) jump to IOERR at 2481H.
243B
LD (2468H),HL 22 68 24
Store Register Pair HL, the destination's DCB address, into 2468H-2469H, the operand of the LD BC at DSTDCB (2467H) (source: save destination).
243E
LD DE,(24ABH) ED 5B AB 24
Load Register Pair DE with the word at 24ABH-24ACH, the source's name (source: get 1st DCB name).
2442
LD A,52H 3E 52
Load Register A with 52H, SVC 82, @GTDCB, which looks for the DCB whose name is Register Pair DE, here the source's.
2444
RST 28H EF
Call @GTDCB with RST 28H to find the source's DCB: Register Pair HL = its address with Z, or Register A = 08H with NZ.
2445
If the source is not in the table jump to IOERR at 2481H with Register A = 08H, error 8, Device not available.
2447
PUSH HL E5
Save Register Pair HL, the source's DCB address, on the stack for 2454H (source: save pointer we used).

2448H - Member 9 (LINK): the Link Made

With the interrupts off, so that no task does I/O through the source while its DCB is half written, the source gets the link DCB as its vector and a type of its low three bits with the link bit 20H; the link DCB gets the source's old type and vector at +0 to +2, the destination's DCB address at +4 and +5 and a name L0, L1 and on at +6 and +7. +3 is left as it was (00H in a spare DCB): @CHNIO keeps the direction of a request there while the first device runs (06A5H). After LINK *DO *PR on a system with no other devices, DO's DCB (0210H) holds 27H and 0238H, and the DCB at 0238H holds 07H, 0B88H (the video driver), 00H, 0218H (PR's DCB) and L0. Because the old type and vector move whole into the link DCB, a source that was routed, filtered, linked or NIL still works as before; the destination gets an output request only when the first device returned Z (an error ends the request at 06C0H), and an input request only when the first device returned NZ with no character (06C4H).

2448
DI F3
Disable interrupts so that no task does I/O through the source's DCB until the link is complete (source: can't interrupt). The @GTDCB calls of the name loop (2475H) find SYS2/SYS already in the overlay area, load nothing and do not enable them again.
2449LINKDCB
LD BC,0000H 01 00 00
LINKDCB: load Register Pair BC with the word at 244AH-244BH, the spare DCB's address stored by 242FH (0000H in the file) (source: p/u link DCB address).
244C
INC L 2C
Increment Register L: Register Pair HL = the source's DCB + 1, the low byte of its vector; the DCBs lie in one page, 0208H-02FFH, so Register H never changes.
244D
LD A,(HL) 7E
Load Register A with the byte at Register Pair HL, the low byte of the source's old vector (its driver, a filter module, the DCB it is routed or linked to, or the FCB of a file).
244E
LD (HL),C 71
Store Register C, the low byte of the link DCB's address, into the byte at Register Pair HL, the source's DCB + 1.
244F
LD C,A 4F
Load Register C with Register A, the low byte of the source's old vector.
2450
INC L 2C
Increment Register L: Register Pair HL = the source's DCB + 2, the high byte of its vector.
2451
LD A,(HL) 7E
Load Register A with the byte at Register Pair HL, the high byte of the source's old vector.
2452
LD (HL),B 70
Store Register B, the high byte of the link DCB's address, into the byte at Register Pair HL, the source's DCB + 2: the source's vector is now the link DCB.
2453
LD B,A 47
Load Register B with Register A: Register Pair BC = the source's old vector.
2454
POP HL E1
Restore Register Pair HL with the source's DCB address saved at 2447H (source: rcvr ptr to source DCB+0).
2455
LD A,(HL) 7E
Load Register A with the byte at Register Pair HL, the source's old type byte.
2456
PUSH AF F5
Save Register Pair AF, the source's old type in Register A, on the stack for 245FH.
2457
AND 07H E6 07
AND Register A with 07H to keep bits 2-0, CTL, PUT and GET, and drop bits 7-3: FCB, filter, link, route and NIL (source: strip flags).
2459
OR 20H F6 20
OR Register A with 20H, the link bit, bit 5 (source: set link bit).
245B
LD (HL),A 77
Store Register A into the byte at Register Pair HL, the source's DCB + 0: the source is now linked, and @CHNIO goes through the link DCB for it (06A2H).
245C
LD HL,(244AH) 2A 4A 24
Load Register Pair HL with the word at 244AH-244BH, the link DCB's address (source: p/u link DCB address).
245F
POP AF F1
Restore Register Pair AF: Register A = the source's old type byte (source: rcvr source type).
2460
LD (HL),A 77
Store Register A into the byte at Register Pair HL, the link DCB + 0: the link DCB has the source's old type, its route, link, filter, NIL or FCB bit included.
2461
INC L 2C
Increment Register L: Register Pair HL = the link DCB + 1.
2462
LD (HL),C 71
Store Register C, the low byte of the source's old vector, into the byte at Register Pair HL, the link DCB + 1.
2463
INC L 2C
Increment Register L: Register Pair HL = the link DCB + 2.
2464
LD (HL),B 70
Store Register B, the high byte of the source's old vector, into the byte at Register Pair HL, the link DCB + 2: the link DCB now does what the source did.
2465
INC L 2C
Increment Register L: Register Pair HL = the link DCB + 3, left as it is (00H in a spare DCB), where @CHNIO stores the direction of a request (06A5H) (source: bypass dest TYPE).
2466
INC L 2C
Increment Register L: Register Pair HL = the link DCB + 4.
2467DSTDCB
LD BC,0000H 01 00 00
DSTDCB: load Register Pair BC with the word at 2468H-2469H, the destination's DCB address stored by 243BH (0000H in the file) (source: p/u destination DCB addr).
246A
LD (HL),C 71
Store Register C, the low byte of the destination's DCB address, into the byte at Register Pair HL, the link DCB + 4.
246B
INC L 2C
Increment Register L: Register Pair HL = the link DCB + 5.
246C
LD (HL),B 70
Store Register B, the high byte of the destination's DCB address, into the byte at Register Pair HL, the link DCB + 5: @CHNIO goes on to that DCB after the first device (06B6H).
246D
INC L 2C
Increment Register L: Register Pair HL = the link DCB + 6, the name field.
246E
PUSH HL E5
Save Register Pair HL, the name field's address, on the stack for 2478H (source: save name field pointer).
246F
LD DE,2F4CH 11 4C 2F
Load Register Pair DE with 2F4CH: Register E = 4CH, the letter L, and Register D = 2FH, one less than the digit 0 (source: let's find a link name).
2472NAMLP
INC D 14
NAMLP: increment Register D, the second character of the name: 30H, the digit 0, the first time, then 31H and on (source: bump 2nd character).
2473
LD A,52H 3E 52
Load Register A with 52H, SVC 82, @GTDCB, which looks for the DCB whose name is Register Pair DE, the link name to be tried.
2475
RST 28H EF
Call @GTDCB with RST 28H to look for a DCB named by Register Pair DE (L0, L1 and on); the link DCB's own name is still 0000H, so it is not found.
2476
If a DCB has the name (Z) jump to NAMLP at 2472H for the next. After L9 come L:, L;, L<, L=, L>, L? and L@, names that @FSPEC cannot read back (a character that is not a letter or digit ends a device spec), so the 11th to 17th links in use at once cannot be named in a command (B80); with 31 DCBs the loop always ends.
2478
POP HL E1
Restore Register Pair HL, the link DCB + 6 (source: get name pointer).
2479
LD (HL),E 73
Store Register E, 4CH, the letter L, into the byte at Register Pair HL, the link DCB + 6.
247A
INC L 2C
Increment Register L: Register Pair HL = the link DCB + 7.
247B
LD (HL),D 72
Store Register D, the digit or character found, into the byte at Register Pair HL, the link DCB + 7: the link DCB is named and no longer spare.
247C
EI FB
Enable interrupts again (source: start tasks again).
247D
LD HL,0000H 21 00 00
Load Register Pair HL with 0000H, the return code of a command that did its work (source: show no error).
2480
RET C9
Return to RST28's tail with Register Pair HL = 0000H, the return code; Register A = 08H and NZ are left from the last @GTDCB of the name loop, which RST28's tail passes on to a program that ran LINK through @CMNDR.

2481H - Member 9 (LINK): the Exits

LINK has no SAVESP: every exit is reached at the depth of the entry and returns with RET. IOERR shows the short message of a DOS error and returns its number; SPCERR shows Device spec required and returns FFFFH. LINK neither tests nor clears BREAK.

2481IOERR
LD L,A 6F
IOERR: load Register L with Register A, the error number: 33 (No device space available) from 242DH, or 8 (Device not available) from 2439H or 2445H (source: move error # into HL).
2482
LD H,00H 26 00
Load Register H with 00H: Register Pair HL = the error number, LINK's return code.
2484
OR C0H F6 C0
OR Register A with C0H: bit 7 makes @ERROR return to LINK, bit 6 makes it show the short message alone (source: abbrev and return).
2486
LD C,A 4F
Load Register C with Register A, the error number with bits 7 and 6 set, the form @ERROR takes.
2487
LD A,1AH 3E 1A
Load Register A with 1AH, SVC 26, @ERROR, which shows the message of the error number in Register C.
2489
RST 28H EF
Call @ERROR with RST 28H (the SYS0/SYS stub at 1B0FH, which loads SYS4/SYS) to show the short message of the error.
248A
RET C9
Return to RST28's tail with Register Pair HL = the error number.
248BSPCERR
LD HL,2495H 21 95 24LD HL,SPCERR$
SPCERR: load Register Pair HL with 2495H, SPCERR$, the message Device spec required: a spec is missing or is a file (2406H, 240BH, 2413H, 2418H), or the two names are the same (2423H) (source: bad devspec found).
248E
LD A,0CH 3E 0C
Load Register A with 0CH, SVC 12, @LOGOT, which shows a line on the video and writes it to the job log.
2490
RST 28H EF
Call @LOGOT with RST 28H to show the message at Register Pair HL, SPCERR$ at 2495H.
2491
LD HL,FFFFH 21 FF FF
Load Register Pair HL with FFFFH, the return code of a command that showed a message of its own.
2494
RET C9
Return to RST28's tail with Register Pair HL = FFFFH.

2495H - Member 9 (LINK): the Message

The one message, SPCERR$, is the member's last bytes. FCB1 (24AAH-24ACH, 3 bytes, the source) and FCB2 (24ADH-24CCH, 32 bytes, the destination) follow it in the source as DS areas with no bytes in the file, so they have no rows; the 03H that @FSPEC puts after a source of two letters falls on 24ADH, which the destination's @FSPEC then writes over.

2495-24A9SPCERR$
DEFM "Device spec required" / DEFB 0DH 44 65 76 69 63 65 20 73 70 65 63 20 72 65 71 75 69 72 65 64 0D
SPCERR$, 2495H-24A9H: the message SPCERR shows (248BH), ended by its carriage return.

2400H - Member 10 (RESET): Entry and the Exits

SYS1/SYS runs RESET with request 63H; its header points at member 10, which the overlay loader reads to 2400H-2588H and 25A8H and calls at 2400H with Register Pair HL at the text after the word RESET. RESET takes one spec: a device spec undoes the routes, links and filters of the device and closes a file it is routed to; a file spec clears the file's open state in the directory or, with the 6.3.1 parameters LRL and DATE, changes its record length or its date. RESET keeps the Stack Pointer of its entry and tests BREAK (a 6.3.1 addition), and every exit goes through SAVESP, which clears BREAK: 0000H when the reset was done, FFFFH after Device spec required or BREAK, or the number of a DOS error after its short message.

2400RESET
LD (2426H),SP ED 73 26 24
RESET: RESET's entry (request 63H): store the Stack Pointer into 2426H, the operand of the LD SP at SAVESP (2425H), so that every exit returns from this depth to RST28's tail (source: save stack ptr).
2404
LD A,6AH 3E 6A
Load Register A with 6AH, SVC 106, @CKBRKC, which tests and clears the BREAK key (a 6.3.1 addition, marked 631 in the source).
2406
RST 28H EF
Call @CKBRKC with RST 28H (BOOT/SYS): NZ when BREAK has been pressed.
2407
If BREAK was pressed (NZ) jump to ABORT at 2422H, which returns FFFFH through SAVESP.
2409
Call RESET1 at 242CH, which reads the spec and resets the device or the file; it returns Z when the work was done, or NZ with Register A = the number of a DOS error (source: call reset routine).
240C
LD HL,0000H 21 00 00
Load Register Pair HL with 0000H, the return code of a command that did its work (source: init successful); the LD leaves the flags of RESET1.
240F
If RESET1 returned Z jump to SAVESP at 2425H to return with Register Pair HL = 0000H (source: Z exit clean).
2411IOERR
LD L,A 6F
IOERR: load Register L with Register A, the error number from RESET1 or from @PARAM (243FH) (source: error # to HL).
2412
LD H,00H 26 00
Load Register H with 00H: Register Pair HL = the error number, RESET's return code.
2414
OR C0H F6 C0
OR Register A with C0H: bit 7 makes @ERROR return to RESET, bit 6 makes it show the short message alone (source: abbrev, return).
2416
LD C,A 4F
Load Register C with Register A, the error number with bits 7 and 6 set, the form @ERROR takes.
2417
LD A,1AH 3E 1A
Load Register A with 1AH, SVC 26, @ERROR, which shows the message of the error number in Register C.
2419
RST 28H EF
Call @ERROR with RST 28H (the SYS0/SYS stub at 1B0FH, which loads SYS4/SYS) to show the short message of the error.
241A
Jump to SAVESP at 2425H to return with Register Pair HL = the error number (source: p/u stack and return).
241CSPCREQ
LD HL,2573H 21 73 25LD HL,SPCREQ$
SPCREQ: load Register Pair HL with 2573H, SPCREQ$, the message Device spec required, when @FSPEC finds no spec (2448H): RESET alone gives it, as 6.3.1 has no global reset.
241F
LD A,0CH 3E 0C
Load Register A with 0CH, SVC 12, @LOGOT, which shows a line on the video and writes it to the job log.
2421
RST 28H EF
Call @LOGOT with RST 28H to show the message at Register Pair HL, SPCREQ$ at 2573H.
2422ABORT
LD HL,FFFFH 21 FF FF
ABORT: load Register Pair HL with FFFFH, the return code of a command that showed a message of its own or was stopped by BREAK (source: set abort code).
2425SAVESP
LD SP,0000H 31 00 00
SAVESP: load the Stack Pointer with the word at 2426H, 0000H in the file and the entry's Stack Pointer once 2400H has run, so that the stack is as it was at the entry (source: p/u stack ptr).
2428
LD A,6AH 3E 6A
Load Register A with 6AH, SVC 106, @CKBRKC, which tests and clears the BREAK key, for the exit.
242A
RST 28H EF
Call @CKBRKC with RST 28H to clear a BREAK pressed during RESET, so that it does not stop the next command; the flags it returns are not used.
242B
RET C9
Return to RST28's tail with Register Pair HL = 0000H, an error number or FFFFH.

242CH - Member 10 (RESET): RESET1, the Parameters and the Spec

RESET1 (6.3.1) first looks along the line for an opening parenthesis; when it finds one before the end of the line it lets @PARAM read the parameters with PRMTBL$ (2562H), then goes back to the start of the text for @FSPEC. A device spec (an asterisk first) goes on to the device reset at 2450H, any other spec to RESFIL (2480H). The parameters are read for a device too, and then not used.

242CRESET1
PUSH HL E5
RESET1: save Register Pair HL, the start of the text after RESET, on the stack for ISEOL (2441H) (a 6.3.1 addition).
242DNXTCHAR
LD A,(HL) 7E
NXTCHAR: load Register A with the character at Register Pair HL.
242E
CP 28H FE 28
Compare Register A with 28H, an opening parenthesis, the start of the parameters.
2430
If it is 28H jump to ISPAREN at 2439H to read the parameters.
2432
CP 0EH FE 0E
Compare Register A with 0EH: a character below it (0DH, the carriage return, or 03H) ends the line.
2434
If Register A is below 0EH (Carry) jump to ISEOL at 2441H: there are no parameters.
2436
INC HL 23
Increment Register Pair HL to the next character.
2437
Jump back to NXTCHAR at 242DH to test the next character of the line.
2439ISPAREN
LD DE,2562H 11 62 25LD DE,PRMTBL$
ISPAREN: load Register Pair DE with 2562H, PRMTBL$, the table of the parameters LRL and DATE (a 6.3.1 addition).
243C
LD A,11H 3E 11
Load Register A with 11H, SVC 17, @PARAM, which reads the parameters in parentheses at Register Pair HL against the table at Register Pair DE.
243E
RST 28H EF
Call @PARAM with RST 28H (SYS1/SYS): the values go into the operands at 24C4H and 24D1H and the response bytes at 2567H and 256FH, which it clears first.
243F
If @PARAM returned NZ (Register A = 2CH, error 44, Parameter error) jump to IOERR at 2411H; the word saved at 242CH stays on the stack, which SAVESP drops (source: must reset something).
2441ISEOL
POP HL E1
ISEOL: restore Register Pair HL, the start of the text saved at 242CH.
2442
LD DE,2588H 11 88 25LD DE,FCBDEV
Load Register Pair DE with 2588H, FCBDEV, the 32 byte area where @FSPEC puts the spec.
2445
LD A,4EH 3E 4E
Load Register A with 4EH, SVC 78, @FSPEC, which copies a file or device spec from the text at Register Pair HL into the buffer at Register Pair DE.
2447
RST 28H EF
Call @FSPEC with RST 28H to read the spec into FCBDEV at 2588H.
2448
If @FSPEC returned NZ (no valid spec on the line: RESET alone, or a word it cannot read such as 1X) jump to SPCREQ at 241CH, Device spec required.
244A
LD A,(DE) 1A
Load Register A with the byte at Register Pair DE, 2588H, the first character of the spec (source: file reset used to reset the file open bit).
244B
CP 2AH FE 2A
Compare Register A with 2AH, the asterisk that marks a device spec.
244D
If Register A is not 2AH (a file spec) jump to RESFIL at 2480H.

2450H - Member 10 (RESET): a Device

The device's DCB is found by its name; CLSFILS (24ECH) closes a file at the end of its routes; with the interrupts off FIXDCB (2508H) undoes its routes, links and filters; then an @RENAME of the device to its own name tells a system device (error 40: KI, DO, PR, SI, SO and JL, the DCBs up to 0230H) from a device of the user (error 19). A user's device is made NIL (type 08H; its vector, +3 to +5 and name stay, so REMOVE can then remove it); a system device keeps what FIXDCB gave back and loses its NIL bit, unless its vector is 0000H.

2450
LD DE,(2589H) ED 5B 89 25
Load Register Pair DE with the word at 2589H-258AH, the device's two letters from @FSPEC (source: p/u the device name).
2454
LD A,52H 3E 52
Load Register A with 52H, SVC 82, @GTDCB, which looks for the DCB whose name at +6 and +7 is Register Pair DE.
2456
RST 28H EF
Call @GTDCB with RST 28H (SYS2/SYS): Register Pair HL = the DCB's address with Z, or Register A = 08H with NZ.
2457
RET NZ C0
If the device is not in the table return NZ with Register A = 08H to 240CH, after the CALL at 2409H, which shows Device not available.
2458
PUSH HL E5
Save Register Pair HL, the DCB's address, on the stack for 245CH.
2459
Call CLSFILS at 24ECH to follow the device's routes and close the file at the end of them, if there is one; Z when nothing was closed or the close worked (source: reset routes to files).
245C
POP HL E1
Restore Register Pair HL, the DCB's address saved at 2458H; POP leaves the flags of CLSFILS.
245D
RET NZ C0
If the @CLOSE failed (NZ) return with its error to 240CH, after the CALL at 2409H; the device is left as it was.
245E
PUSH HL E5
Save Register Pair HL, the DCB's address, on the stack for 246CH.
245F
DI F3
Disable interrupts while FIXDCB rewrites the DCB, so that no task does I/O through it half done (source: don't stop me now).
2460
Call FIXDCB at 2508H to undo the routes, links and filters of the DCB at Register Pair HL.
2463
EI FB
Enable interrupts again (source: now you can interrupt).
2464
LD HL,2588H 21 88 25LD HL,FCBDEV
Load Register Pair HL with 2588H, FCBDEV, the device spec (source: determine if system device by attempting to rename it).
2467
LD D,H 54
Load Register D with Register H, 25H, the high byte of 2588H.
2468
LD E,L 5D
Load Register E with Register L, 88H: Register Pair DE = Register Pair HL = 2588H, the new name the same as the old.
2469
LD A,38H 3E 38
Load Register A with 38H, SVC 56, @RENAME, which renames a file or a device.
246B
RST 28H EF
Call @RENAME with RST 28H: SYS2's RENDEV refuses a system device, a DCB at 0230H (JL) or below, with error 40, and any other with error 19, as the new name, its own, is in use; it never renames (source: the error code will be either 19 or 40).
246C
POP HL E1
Restore Register Pair HL, the DCB's address saved at 245EH.
246D
CP 28H FE 28
Compare Register A with 28H, error 40, Protected system device (source: protected system device?).
246F
If Register A is 40 (Z) jump to SYSDVC at 2475H: a system device keeps the type FIXDCB gave back and loses its NIL bit unless its vector is 0000H.
2471
LD (HL),08H 36 08
Store 08H into the byte at Register Pair HL, the DCB's type: the user's device is NIL; its vector, +3 to +5 and name stay (source: show device is NIL). FIXDCB finds no bit on a link DCB or on the DCB of an active filter, so RESET of one of those makes it NIL too, and the device that leads to it loses its I/O (B86).
2473
XOR A AF
XOR Register A with itself: Register A = 00H and the Z flag set (source: set Z).
2474
RET C9
Return Z to 240CH, after the CALL at 2409H: the user's device was reset.
2475SYSDVC
PUSH HL E5
SYSDVC: save Register Pair HL, the system device's DCB address, on the stack for 247AH (source: save DCB ptr).
2476
INC L 2C
Increment Register L: Register Pair HL = DCB + 1, the low byte of the vector.
2477
LD A,(HL) 7E
Load Register A with the byte at Register Pair HL, the low byte of the vector.
2478
INC L 2C
Increment Register L: Register Pair HL = DCB + 2.
2479
OR (HL) B6
OR Register A with the byte at Register Pair HL, the high byte of the vector: Z when the vector is 0000H.
247A
POP HL E1
Restore Register Pair HL, the DCB's address saved at 2475H; POP leaves the flags of the OR.
247B
RET Z C8
If the vector is 0000H return Z to 240CH, after the CALL at 2409H, and leave the NIL bit: JL stays NIL, and SI and SO, whose DCB+3 to +5 hold 0DH or 0FH and 0000H, come out of FIXDCB as NIL devices with no vector, not routed to KI and DO as BOOT/SYS holds them at start-up (source: do not reset the NIL bit).
247C
RES 3,(HL) CB 9E
Reset bit 3, the NIL bit, of the byte at Register Pair HL, the type, so that the system device works through its vector again: a ROUTE (NIL) of KI, DO or PR is undone here (source: make sure NIL is off).
247E
XOR A AF
XOR Register A with itself: Register A = 00H and Z (source: set Z and return).
247F
RET C9
Return Z to 240CH, after the CALL at 2409H: the system device was reset.

2480H - Member 10 (RESET): RESFIL, a File

RESFIL opens the file with SFLAG$ bit 0 set, so that @OPEN neither tests nor sets the open bit in its directory entry; an access below UPDATE (READ or EXEC, 5 or 6) gives error 37 (6.3.1); NO ACCESS gives error 25 at @OPEN. On a write protected diskette the access test passes (the open skips its write protect test) and the @CLOSE or the @DIRWR then fails with error 15. With no parameter it closes the file with close authority, which clears the open bit (the ? that DIR shows). With LRL or DATE (6.3.1) it reads the entry with @DIRRD, writes the new LRL into DIR+4 and, for DATE, 4296H, the hash of a blank password, into DIR+18 and DIR+19, and writes the entry back with @DIRWR; DATE=ON first closes the file as written, so that @CLOSE puts in the date, the MOD flag and, on a diskette dated in the new style, the time, but its fresh read of the entry undoes the other changes (B84). 6.3.0 had neither parameter and tested the access with LD A,(HL).

2480RESFIL
LD A,65H 3E 65
RESFIL: load Register A with 65H, SVC 101, @FLAGS, which returns Index Register IY = 006AH, the start of the system flags (source: get flag table pointer).
2482
RST 28H EF
Call @FLAGS with RST 28H (SYS0/SYS): Index Register IY = 006AH.
2483
SET 0,(IY+12H) FD CB 12 C6
Set bit 0 of SFLAG$ (IY+12H, 007CH): the next @OPEN neither tests nor sets the file's open bit in the directory, skips its write protect and LRL tests too (OPNCB returns at 205DH), and clears the bit again. Index Register IY holds 006AH from @FLAGS (source: inhibit file open bit).
2487
LD A,3BH 3E 3B
Load Register A with 3BH, SVC 59, @OPEN, which opens the file named in the FCB at Register Pair DE, 2588H, with the buffer at Register Pair HL, here the text after the spec, which nothing reads or writes.
2489
RST 28H EF
Call @OPEN with RST 28H (SYS2/SYS): Z when the file was found and its password allows it, with the access level in FCB+1.
248A
RET NZ C0
If @OPEN failed (NZ) return its error to 240CH, after the CALL at 2409H (File not in directory, a password error and the like).
248B
PUSH DE D5
Save Register Pair DE, 2588H, the FCB, on the stack (a 6.3.1 addition, as is everything up to 24EBH).
248C
POP IX DD E1
Pop it into Index Register IX: IX = 2588H, the FCB.
248E
LD A,(IX+01H) DD 7E 01
Load Register A with FCB+1 (IX+01H, 2589H), whose bits 2-0 are the access the password gave; Index Register IX holds 2588H, the FCB (source: make sure access level is at least UPDATE).
2491
AND 07H E6 07
AND Register A with 07H to keep the access level, 0 FULL to 7 NO ACCESS.
2493
CP 05H FE 05
Compare Register A with 05H, READ: Carry for FULL, REMOVE, RENAME, WRITE or UPDATE.
2495
If the access is READ or less (5 or more, no Carry) jump to L24AD at 24ADH, error 37.
2497
LD A,(2567H) 3A 67 25LD A,(LRLBYT)
Load Register A with the byte at 2567H, LRLBYT, the response byte of LRL.
249A
AND 80H E6 80
AND Register A with 80H, bit 7: a number was given for LRL.
249C
LD B,A 47
Load Register B with Register A, 80H when a number was given for LRL, else 00H.
249D
LD A,(256FH) 3A 6F 25LD A,(DATBYT)
Load Register A with the byte at 256FH, DATBYT, the response byte of DATE.
24A0
AND 40H E6 40
AND Register A with 40H, bit 6: DATE was given as a flag (ON, OFF, Y, N, or alone for ON).
24A2
OR B B0
OR Register A with Register B: not zero when either parameter was given.
24A3
If LRL or DATE was given (NZ) jump to L24B1 at 24B1H.
24A5L24A5
SET 6,(IX+00H) DD CB 00 F6
L24A5: set bit 6 of FCB+0 (IX+00H, 2588H), close authority, so that @CLOSE rewrites the directory entry and clears its open bit; Index Register IX holds 2588H (also called from 24E4H).
24A9
LD A,3CH 3E 3C
Load Register A with 3CH, SVC 60, @CLOSE, which closes the file of the FCB at Register Pair DE, 2588H.
24AB
RST 28H EF
Call @CLOSE with RST 28H (SYS3/SYS): with close authority it clears the open bit, DIR+1 bit 5, gives back the granules past the end of file (unless DIR+1 bit 7, CREATED, is set) and, when FCB+0 bit 2 is set (24E0H), writes the date, the MOD flag and, on a diskette dated in the new style, the time; it keeps every register but AF. On a write protected diskette it fails with error 15.
24AC
RET C9
Return to 240CH, after the CALL at 2409H, or to 24E7H, with the flags and Register A of @CLOSE.
24ADL24AD
LD A,25H 3E 25
L24AD: load Register A with 25H, error 37, Illegal access attempted to protected file (source: init illegal access).
24AF
OR A B7
OR Register A with Register A: NZ, as 25H is not 0.
24B0
RET C9
Return NZ with error 37 to 240CH, after the CALL at 2409H; the FCB opened at 2489H is not closed, which leaves nothing on the disk, as the open set no open bit.
24B1L24B1
LD BC,(258EH) ED 4B 8E 25
L24B1: load Register Pair BC with the word at 258EH-258FH, FCB+6 and FCB+7: Register C = the drive, Register B = the file's DEC (source: get DEC and drive number info).
24B5
LD A,57H 3E 57
Load Register A with 57H, SVC 87, @DIRRD, which reads the directory sector of the DEC in Register B on the drive in Register C into SBUFF$ (1D00H) and points Register Pair HL at the entry.
24B7
RST 28H EF
Call @DIRRD with RST 28H (SYS0/SYS): Register Pair HL = the entry in 1D00H-1DFFH with Z, or error 17 with NZ.
24B8
RET NZ C0
If the read failed return NZ with error 17 to 240CH, after the CALL at 2409H.
24B9
PUSH HL E5
Save Register Pair HL, the entry's address, on the stack.
24BA
POP IY FD E1
Pop it into Index Register IY: IY = the directory entry in SBUFF$. The source writes the FDH prefix as DB 0FDH before a POP HL labelled L24BB, which no branch reaches.
24BC
LD A,(2567H) 3A 67 25LD A,(LRLBYT)
Load Register A with the byte at 2567H, LRLBYT, the response byte of LRL.
24BF
AND 80H E6 80
AND Register A with 80H: a number was given for LRL.
24C1
If no number was given (Z) jump to L24C9 at 24C9H.
24C3LRLPRM
LD DE,0000H 11 00 00
LRLPRM: load Register Pair DE with the word at 24C4H-24C5H, the value of LRL that @PARAM stored there (0000H in the file).
24C6
LD (IY+04H),E FD 73 04
Store Register E, the low byte of the value, into DIR+4 (IY+04H), the record length (0 for 256); Index Register IY holds the entry's address in SBUFF$. A value above 255 is taken modulo 256 without a message.
24C9L24C9
LD A,(256FH) 3A 6F 25LD A,(DATBYT)
L24C9: load Register A with the byte at 256FH, DATBYT, the response byte of DATE.
24CC
AND 40H E6 40
AND Register A with 40H: DATE was given as a flag.
24CE
If DATE was not given (Z) jump to L24E8 at 24E8H to write the entry.
24D0DATPRM
LD DE,0000H 11 00 00
DATPRM: load Register Pair DE with the word at 24D1H-24D2H, the value of DATE: FFFFH for ON, Y or DATE alone, 0000H for OFF or N (0000H in the file).
24D3
LD (IY+12H),96H FD 36 12 96
Store 96H into DIR+18 (IY+12H), the low byte of 4296H, the hash of a blank password; Index Register IY holds the entry's address in SBUFF$ (source: default password).
24D7
LD (IY+13H),42H FD 36 13 42
Store 42H into DIR+19 (IY+13H): DIR+18 and DIR+19, the old user password field that 6.3 uses for the time and the year, hold 4296H again, as in the old style. Index Register IY holds the entry's address.
24DB
PUSH IX DD E5
Save Index Register IX, 2588H, the FCB, on the stack.
24DD
LD A,D 7A
Load Register A with Register D, the high byte of the DATE value.
24DE
OR E B3
OR Register A with Register E, its low byte: NZ for DATE=ON.
24DF
POP DE D1
Pop the FCB address into Register Pair DE: DE = 2588H for @CLOSE.
24E0
SET 2,(IX+00H) DD CB 00 D6
Set bit 2 of FCB+0 (IX+00H, 2588H), the bit that tells @CLOSE that the file was written, so that it sets the date, the time and the MOD flag; Index Register IX holds 2588H. With DATE=OFF the FCB is not closed and the bit does nothing.
24E4
If DATE=ON (NZ) call L24A5 at 24A5H to close the file with close authority; @CLOSE reads the entry from the disk again (SAWBLK, @DIRRD) before it writes the date, so the changes made in SBUFF$ at 24C6H and 24D3H-24D7H are lost (B84).
24E7
RET NZ C0
If the close failed return NZ with its error to 240CH, after the CALL at 2409H.
24E8L24E8
LD A,58H 3E 58
L24E8: load Register A with 58H, SVC 88, @DIRWR, which writes SBUFF$ back to the directory sector of the DEC in Register B on the drive in Register C.
24EA
RST 28H EF
Call @DIRWR with RST 28H (SYS0/SYS): the entry is written, after DATE=ON again as @CLOSE left it; Register Pair BC still holds the drive and DEC of 24B1H, as @CLOSE keeps them.
24EB
RET C9
Return to 240CH, after the CALL at 2409H with the flags of @DIRWR. The FCB opened at 2489H is left open, which leaves nothing on the disk, and with LRL or DATE=OFF the file's open bit is not cleared: only RESET with no parameter, or with DATE=ON, clears it.

24ECH - Member 10 (RESET): CLSFILS

CLSFILS follows the device's route vector as long as the route bit is set and, when the last DCB of the chain is an open FCB (type bit 7, the file the device is routed to), copies its 32 bytes to FCBFIL (25A8H) and closes the copy. It is the same routine as ROUTE's (member 8, 2539H): no count, no NIL test and no BREAK test, so a chain of routes that closes on itself never ends (B81); and it does not follow links, so a file whose route LINK has moved into a link DCB is not closed (B82).

24ECCLSFILS
BIT 4,(HL) CB 66
CLSFILS: test bit 4, the route bit, of the byte at Register Pair HL, the type of the DCB or FCB in hand (source: jump if no route). The NIL bit is not tested, so a device made NIL by ROUTE (NIL) still leads here to the FCB of a file that ROUTE has already closed (B87).
24EE
If it is not routed (Z) jump to CLSFIL1 at 24F7H.
24F0
INC HL 23
Increment Register Pair HL to the low byte of the vector, the DCB or FCB routed to (source: else p/u link address).
24F1
LD A,(HL) 7E
Load Register A with the byte at Register Pair HL, the low byte of the vector.
24F2
INC HL 23
Increment Register Pair HL to the high byte of the vector.
24F3
LD H,(HL) 66
Load Register H with the byte at Register Pair HL, the high byte of the vector.
24F4
LD L,A 6F
Load Register L with Register A: Register Pair HL = the DCB or FCB the device is routed to.
24F5
Jump back to CLSFILS at 24ECH to test that one: with no end test, a cycle of routes (B70, B78) keeps RESET here for ever (B81).
24F7CLSFIL1
BIT 7,(HL) CB 7E
CLSFIL1: test bit 7 of the byte at Register Pair HL: set in an open FCB, the end of a route to a file (source: a file?).
24F9
RET Z C8
If it is not a file (Z) return Z: nothing to close. The link bit (bit 5) is not followed, so a file routed to before a LINK of the device stays open (B82).
24FA
LD DE,25A8H 11 A8 25LD DE,FCBFIL
Load Register Pair DE with 25A8H, FCBFIL, the 32 byte area for the copy (source: pt to fcb area).
24FD
PUSH DE D5
Save Register Pair DE, 25A8H, the copy's address, on the stack for 2503H.
24FE
LD BC,0020H 01 20 00
Load Register Pair BC with 0020H, the 32 bytes of an FCB.
2501
LDIR ED B0
Copy Register Pair BC = 32 bytes from Register Pair HL, the FCB in high memory, to Register Pair DE, FCBFIL at 25A8H-25C7H (LDIR) (source: fill from device vector).
2503
POP DE D1
Restore Register Pair DE, 25A8H, the copy (source: recover start).
2504
LD A,3CH 3E 3C
Load Register A with 3CH, SVC 60, @CLOSE, which closes the file of the FCB at Register Pair DE.
2506
RST 28H EF
Call @CLOSE with RST 28H (SYS3/SYS) to write the buffer and update the directory entry through the copy; the FCB in high memory keeps its bit 7, and the route module stays below HIGH$ for a later ROUTE of the device.
2507
RET C9
Return with the flags and Register A of @CLOSE (source: ret with Z, NZ status).

2508H - Member 10 (RESET): FIXDCB

FIXDCB undoes what ROUTE, LINK and FILTER did to the DCB at Register Pair HL, one step at a time, and starts again after each step until no route, link or filter bit is left. A route: the type and vector that ROUTE kept at DCB+3 to +5 come back to +0 to +2, and the route bit is reset. A link: the link DCB's +0 to +2, the type and vector the device had before LINK, come back, and the 8 bytes of the link DCB are cleared, even when another device is still linked or routed to it (B83). A filter: the DCB word of the filter module, after the module's name, names the filter's DCB; when that is the device's own DCB, +3 to +5 come back as for a route (source: bring in the NIL), else the first three bytes of the two DCBs are swapped back.

2508FIXDCB
BIT 4,(HL) CB 66
FIXDCB: test bit 4, the route bit, of the byte at Register Pair HL, the DCB's type (source: if routed, recover the original data from DCB+3 to DCB+5).
250A
If it is not routed (Z) jump to FIX1 at 251CH.
250C
PUSH HL E5
Save Register Pair HL, the DCB's address, on the stack for 2517H.
250D
LD D,H 54
Load Register D with Register H, the high byte of the DCB's address.
250E
LD E,L 5D
Load Register E with Register L: Register Pair DE = the DCB, where the copy goes (source: DCB start to DE).
250FFIX0
INC L 2C
FIX0: increment Register L; also reached from 2552H with Register Pair HL and Register Pair DE both at the DCB.
2510
INC L 2C
Increment Register L: Register Pair HL = DCB + 2.
2511
INC L 2C
Increment Register L: Register Pair HL = DCB + 3, the type and vector kept there (source: pt to old stored information).
2512
LD BC,0003H 01 03 00
Load Register Pair BC with 0003H, the three bytes to copy.
2515
LDIR ED B0
Copy Register Pair BC = 3 bytes from Register Pair HL, DCB+3 to DCB+5, to Register Pair DE, DCB+0 to DCB+2 (LDIR): the type and vector before the route come back (source: xfer to DCB).
2517
POP HL E1
Restore Register Pair HL, the DCB's address saved at 250CH or 253BH.
2518
RES 4,(HL) CB A6
Reset bit 4 of the byte at Register Pair HL, the route bit of the type just brought back (source: reset routed bit).
251A
Jump back to FIXDCB at 2508H to test the type brought back.
251CFIX1
BIT 5,(HL) CB 6E
FIX1: test bit 5, the link bit, of the byte at Register Pair HL (source: if linked, recover the original data from the LINK DCB source and clear the LINK DCB).
251E
If it is not linked (Z) jump to FIX2 at 2538H.
2520
PUSH HL E5
Save Register Pair HL, the DCB's address, on the stack.
2521
INC L 2C
Increment Register L: Register Pair HL = DCB + 1.
2522
LD E,(HL) 5E
Load Register E with the byte at Register Pair HL, the low byte of the vector, the link DCB's address (source: p/u the LINK vector).
2523
INC L 2C
Increment Register L: Register Pair HL = DCB + 2.
2524
LD D,(HL) 56
Load Register D with the byte at Register Pair HL: Register Pair DE = the link DCB.
2525
POP HL E1
Restore Register Pair HL, the DCB's address (source: recover DCB ptr).
2526
PUSH HL E5
Save Register Pair HL, the DCB's address, again, for 2535H.
2527
EX DE,HL EB
Exchange Register Pair DE and Register Pair HL: Register Pair HL = the link DCB, Register Pair DE = the device's DCB (source: link to HL, DCB to DE).
2528
PUSH HL E5
Save Register Pair HL, the link DCB, on the stack for 252EH (source: save for clearing).
2529
LD BC,0003H 01 03 00
Load Register Pair BC with 0003H, the three bytes to copy.
252C
LDIR ED B0
Copy Register Pair BC = 3 bytes (LDIR) from Register Pair HL, the link DCB's +0 to +2 (the device's type and vector before LINK), to Register Pair DE, the device's +0 to +2; Register Pair BC ends at 0000H, so Register C = 00H.
252E
POP HL E1
Restore Register Pair HL, the link DCB's address saved at 2528H.
252F
LD B,08H 06 08
Load Register B with 08H, the 8 bytes of a DCB.
2531FIX1A
LD (HL),C 71
FIX1A: store Register C, 00H, into the byte at Register Pair HL, a byte of the link DCB (631: LD (HL),C in place of LD (HL),0, one byte shorter) (source: clear the LINK DCB).
2532
INC L 2C
Increment Register L to the next byte of the link DCB.
2533
Decrement Register B and jump back to FIX1A at 2531H until the 8 bytes are 00H: the link DCB is spare again, even when another device's link or route still points at it (B83).
2535
POP HL E1
Restore Register Pair HL, the device's DCB (source: rcvr DCB pointer).
2536
Jump back to FIXDCB at 2508H to test the type brought back: a route, or an earlier link, comes off next; a route brought back here is undone from DCB+3 to +5, which a ROUTE after the LINK has overwritten (B85).
2538FIX2
BIT 6,(HL) CB 76
FIX2: test bit 6, the filter bit, of the byte at Register Pair HL (source: if filtered, recover the original data by swapping back the 1st three bytes with the FILTER DCB).
253A
RET Z C8
If it is not filtered (Z) return: no route, link or filter bit is left.
253B
PUSH HL E5
Save Register Pair HL, the DCB's address, on the stack for 255FH.
253C
LD D,H 54
Load Register D with Register H, the high byte of the DCB's address.
253D
LD E,L 5D
Load Register E with Register L: Register Pair DE = the device's DCB.
253E
INC L 2C
Increment Register L: Register Pair HL = DCB + 1.
253F
LD A,(HL) 7E
Load Register A with the byte at Register Pair HL, the low byte of the vector, the filter module's entry.
2540
INC L 2C
Increment Register L: Register Pair HL = DCB + 2.
2541
LD H,(HL) 66
Load Register H with the byte at Register Pair HL, the high byte of the vector.
2542
LD L,A 6F
Load Register L with Register A: Register Pair HL = the filter module's entry, its header (a JR, the word of its last byte, the name's length, the name, the DCB word).
2543
LD BC,0004H 01 04 00
Load Register Pair BC with 0004H (source: HL now points to the entry point).
2546
ADD HL,BC 09
Add Register Pair BC to Register Pair HL: Register Pair HL = module + 4, the length of the module's name.
2547
LD C,(HL) 4E
Load Register C with the byte at Register Pair HL, the name's length (source: get its DCB address by peeking past the name field).
2548
INC C 0C
Increment Register C to count the length byte itself; Register B is still 00H.
2549
ADD HL,BC 09
Add Register Pair BC to Register Pair HL: Register Pair HL = module + 5 + the name's length, the module's DCB word.
254A
LD A,(HL) 7E
Load Register A with the byte at Register Pair HL, the low byte of the DCB word (source: get low-order).
254B
INC HL 23
Increment Register Pair HL to the high byte of the DCB word: INC HL, so a word whose low byte is at nnFFH is read right (unlike DEVICE's GETPTR2, INC L, B71).
254C
LD H,(HL) 66
Load Register H with the byte at Register Pair HL, the high byte (source: get hi-order).
254D
LD L,A 6F
Load Register L with Register A: Register Pair HL = the filter's DCB.
254E
PUSH HL E5
Save Register Pair HL, the filter's DCB, on the stack (source: if DCB is itself, then bring in the NIL).
254F
SBC HL,DE ED 52
Subtract Register Pair DE, the device's DCB, from Register Pair HL with the Carry flag, which the ADD at 2549H left clear: Z when the filter's DCB is the device's own.
2551
POP HL E1
Restore Register Pair HL, the filter's DCB; POP leaves the flags of the SBC.
2552
If it is the device's own DCB (Z) jump to FIX0 at 250FH, which brings back DCB+3 to +5, with Register Pair HL and Register Pair DE both at the DCB.
2554
LD B,03H 06 03
Load Register B with 03H, the three bytes to swap (source: else swap the 1st three bytes of the DCBs).
2556FIX2A
LD C,(HL) 4E
FIX2A: load Register C with the byte at Register Pair HL, a byte of the filter's DCB.
2557
LD A,(DE) 1A
Load Register A with the byte at Register Pair DE, the same byte of the device's DCB.
2558
LD (HL),A 77
Store Register A into the byte at Register Pair HL, the filter's DCB.
2559
LD A,C 79
Load Register A with Register C, the filter DCB's byte.
255A
LD (DE),A 12
Store Register A into the byte at Register Pair DE, the device's DCB.
255B
INC L 2C
Increment Register L to the next byte of the filter's DCB.
255C
INC E 1C
Increment Register E to the next byte of the device's DCB.
255D
Decrement Register B and jump back to FIX2A at 2556H until +0 to +2 of the two DCBs are swapped.
255F
POP HL E1
Restore Register Pair HL, the device's DCB saved at 253BH.
2560
Jump back to FIXDCB at 2508H to test what the swap brought back; two filter modules whose DCB words name the same DCB swap it back and forth here for ever, with the interrupts off (B88).

2562H - Member 10 (RESET): PRMTBL$, the Message and the FCBs

The parameter table of 6.3.1 (LRL and DATE), the message, and two 32 byte areas: FCBDEV, where @FSPEC puts the spec and @OPEN builds the FCB of a file, and FCBFIL, for the copy of the FCB that CLSFILS closes. Of each area only the first byte, 00H, is in the file, each the end of a load block; FCBDEV's other 31 bytes have a DEFS row, FCBFIL's lie after the member and have none.

2562PRMTBL$
DEFB 80H 80
PRMTBL$, 2562H: 80H, the mark of the 6.x table form that @PARAM reads (243EH); the whole table is a 6.3.1 addition.
2563
DEFB 93H 93
2563H: type 93H, a number (bit 7), may be abbreviated (bit 4), a name of 3 characters.
2564-2566
DEFM "LRL" 4C 52 4C
2564H-2566H: the name LRL (or L), the record length to give the file.
2567LRLBYT
DEFB 00H 00
LRLBYT, 2567H: the response byte of LRL, which @PARAM clears and sets; bit 7, a number given, is tested at 2497H and 24BCH.
2568-2569
DEFW 24C4H C4 24
2568H-2569H: 24C4H, LRLPRM+1, the operand of the LD DE at 24C3H, where @PARAM stores the value.
256A
DEFB 54H 54
256AH: type 54H, a flag (bit 6), may be abbreviated, a name of 4 characters.
256B-256E
DEFM "DATE" 44 41 54 45
256BH-256EH: the name DATE (or D), the date to give the file, ON or OFF.
256FDATBYT
DEFB 00H 00
DATBYT, 256FH: the response byte of DATE; bit 6, a flag given, is tested at 249DH and 24C9H.
2570-2571
DEFW 24D1H D1 24
2570H-2571H: 24D1H, DATPRM+1, the operand of the LD DE at 24D0H: FFFFH for ON, 0000H for OFF.
2572
DEFB 00H 00
2572H: 00H, the end of the table after its two parameters.
2573-2587SPCREQ$
DEFM "Device spec required" / DEFB 0DH 44 65 76 69 63 65 20 73 70 65 63 20 72 65 71 75 69 72 65 64 0D
SPCREQ$, 2573H-2587H: the message SPCREQ shows (241CH), ended by its carriage return.
2588FCBDEV
DEFB 00H 00
FCBDEV, 2588H: the first byte of the spec's area, 00H in the file, the last byte of the first load run. @FSPEC writes the spec here (2447H); for a device its name is read at 2450H, for a file @OPEN makes the area its FCB (2489H), whose +0, +1, +6 and +7 RESFIL uses.
2589-25A7
DEFS 31
FCBDEV+1 to FCBDEV+31, 2589H-25A7H: not loaded. The device's two letters at 2589H-258AH; for a file the rest of the FCB from @OPEN, with the access level at 2589H and the drive and DEC at 258EH-258FH (24B1H).
25A8FCBFIL
DEFB 00H 00
FCBFIL, 25A8H: the first byte of the area for the copy that CLSFILS closes (24FAH), 00H in the file, a load block of one byte and the member's last; the other 31 bytes, 25A9H-25C7H, lie after the member.

2C00H - Member 11 (FILTER and SET): the Entries and SET's Specs

SYS1/SYS runs FILTER with request 66H and SET with request 65H; both headers point at member 11, which the overlay loader reads to 2C00H-2DACH, high enough that a driver or filter program loading at 2400H does not overwrite it (the source's ORG note), and enters at 2C00H for FILTER and at 2C03H for SET, with Register Pair HL at the text after the command's name. SET refuses to work when HIGH$ is frozen, reads a device spec into DEVFCB (2DCDH) and a file spec into PGMFCB (2DEDH), keeps a copy of the file spec in SAVSPEC (2DADH) for a second try with /DVR, and gives the file spec the default extension /FLT. The three 32 byte areas lie after the member: none of their bytes is in the file. Neither entry keeps its Stack Pointer or acts on BREAK (only FILTER's EXIT clears it); a BREAK still pending under SET reaches the program, which may refuse for it, as FORMS does. Every exit returns from the entry's depth.

2C00
FILTER's entry (request 66H): jump to FILTER at 2CB2H (source: filter entry point).
2C03SET
LD A,65H 3E 65
SET: SET's entry (request 65H): load Register A with 65H, SVC 101, @FLAGS, which points Index Register IY at the flag table (source: flag table pointer).
2C05
RST 28H EF
Call @FLAGS with RST 28H (SYS0/SYS): Index Register IY = 006AH, FLGTAB$.
2C06
BIT 0,(IY+02H) FD CB 02 46
Test bit 0 of CFLAG$ (IY+02H, 006CH), set while HIGH$ is frozen, as the program or job that froze it needs the memory above HIGH$ kept as it is. Index Register IY holds 006AH from @FLAGS (source: can't use if memory is frozen).
2C0A
If HIGH$ is frozen (NZ) jump to CANT at 2D27H, which shows No memory space available, even for a program that would install itself in the low I/O zone without moving HIGH$, as FORMS can (B93).
2C0D
LD DE,2DCDH 11 CD 2DLD DE,DEVFCB
Load Register Pair DE with 2DCDH, DEVFCB, the area for the device spec (source: get filespec).
2C10
LD A,4EH 3E 4E
Load Register A with 4EH, SVC 78, @FSPEC, which reads a file or device spec from the line at Register Pair HL into the area at Register Pair DE.
2C12
RST 28H EF
Call @FSPEC with RST 28H (SYS1/SYS): Z with the spec at 2DCDH and Register Pair HL past it, NZ when no valid spec stands there (none, or a malformed one).
2C13
If there is no valid spec (NZ) jump to DEVREQ at 2D23H, which shows Device spec required (source: quit if bad name).
2C16
LD A,(DE) 1A
Load Register A with the byte at Register Pair DE, 2DCDH, the first character of the spec (source: ck on devicespec).
2C17
CP 2AH FE 2A
Compare Register A with 2AH, the asterisk that begins a device spec.
2C19
If the first spec is a file spec (NZ) jump to DEVREQ at 2D23H: SET needs a device first (source: must have device).
2C1C
LD DE,2DEDH 11 ED 2DLD DE,PGMFCB
Load Register Pair DE with 2DEDH, PGMFCB, the area for the driver or filter file spec (source: get driver or filter filespec).
2C1F
LD A,4EH 3E 4E
Load Register A with 4EH, SVC 78, @FSPEC; a TO, ON, OVER or USING between the specs is passed over by SYS1 (PREPTBL).
2C21
RST 28H EF
Call @FSPEC with RST 28H (SYS1/SYS): Z with the file spec at 2DEDH and Register Pair HL past it, at the parameters for the program.
2C22
If there is no second spec (NZ) jump to SPCREQ at 2D2BH, which shows File spec required (source: must be entered).
2C25
LD A,(DE) 1A
Load Register A with the byte at Register Pair DE, 2DEDH, the first character of the second spec (source: target cannot be device).
2C26
CP 2AH FE 2A
Compare Register A with 2AH, the asterisk of a device spec (source: since this is SET).
2C28
If the second spec names a device (Z) jump to SPCREQ at 2D2BH: SET takes a program file, not a device.
2C2B
PUSH HL E5
Save Register Pair HL, the line pointer after the file spec, on the stack for 2C3DH (source: save INBUF$ pointer).
2C2C
PUSH DE D5
Save Register Pair DE, 2DEDH, the start of PGMFCB, on the stack for 2C36H (source: and FCB start).
2C2D
LD HL,2DADH 21 AD 2DLD HL,SAVSPEC
Load Register Pair HL with 2DADH, SAVSPEC, the area for a copy of the file spec (source: save the filter/driver filespec to try /DVR).
2C30
EX DE,HL EB
Exchange Register Pair DE and Register Pair HL: Register Pair HL = 2DEDH, the source of the copy, Register Pair DE = 2DADH, its destination.
2C31
LD BC,0020H 01 20 00
Load Register Pair BC with 0020H, the 32 bytes of the area (source: if /FLT is not found).
2C34
LDIR ED B0
Copy Register Pair BC = 32 bytes from Register Pair HL, PGMFCB at 2DEDH-2E0CH, to Register Pair DE, SAVSPEC at 2DADH-2DCCH (LDIR): the spec as typed, before /FLT is added.
2C36
POP DE D1
Restore Register Pair DE, 2DEDH, PGMFCB, saved at 2C2CH (source: recover FCB).
2C37
LD HL,2D0BH 21 0B 2DLD HL,FLTEXT
Load Register Pair HL with 2D0BH, FLTEXT, the 3 letters FLT (source: default extension is FLT).
2C3A
LD A,4FH 3E 4F
Load Register A with 4FH, SVC 79, @FEXT, which gives the spec in the FCB at Register Pair DE the extension at Register Pair HL when it has none.
2C3C
RST 28H EF
Call @FEXT with RST 28H (SYS1/SYS): a spec without an extension gets /FLT in front of its password or drive (source: use default EXT if none).
2C3D
POP HL E1
Restore Register Pair HL, the line pointer saved at 2C2BH (source: recover cmdline posn).

2C3EH - Member 11 (FILTER and SET): SET Finds the DCB

The device named in the first spec must be new or a NIL device of the user's. A device in the table that is not NIL gives Device in use (error 39); a NIL one is tried with an @RENAME to its own name, the trick of RESET, which tells a system device (error 40, Protected system device: KI, DO, PR, SI, SO and JL, the DCBs up to 0230H) from one of the user's (error 19). A device not in the table takes the first spare DCB, or gives No device space available (error 33). Nothing is written into the DCB before the program is loaded.

2C3E
PUSH HL E5
Save Register Pair HL, the line pointer at the program's parameters, on the stack for 2CACH (source: save INBUF$ pointer).
2C3F
LD DE,(2DCEH) ED 5B CE 2D
Load Register Pair DE with the word at 2DCEH-2DCFH, DEVFCB+1 and DEVFCB+2, the device's two letters: Register E = the first, Register D = the second (03H for a name of one letter) (source: p/u device name).
2C43
LD A,52H 3E 52
Load Register A with 52H, SVC 82, @GTDCB, which looks for the DCB whose name at +6 and +7 is Register Pair DE (source: find device DCB address).
2C45
RST 28H EF
Call @GTDCB with RST 28H (SYS2/SYS): Register Pair HL = the DCB's address with Z, or Register A = 08H with NZ.
2C46
If the device is not in the table (NZ) jump to NEWDCB at 2C5EH for a spare DCB (source: go if not found).
2C48
BIT 3,(HL) CB 5E
Test bit 3 of the byte at Register Pair HL, the DCB's type: set for a NIL device (source: else check if NIL).
2C4A
LD A,27H 3E 27
Load Register A with 27H, error 39, Device in use; the LD leaves the flags of the BIT (source: init device in use).
2C4C
If the device is not NIL (Z) jump to ERRPOP at 2C8EH with error 39: SET does not replace a driver, route, link or filter (source: error if not NIL).
2C4E
PUSH HL E5
Save Register Pair HL, the NIL device's DCB address, on the stack for 2C57H (source: save DCB pointer).
2C4F
LD HL,2DCDH 21 CD 2DLD HL,DEVFCB
Load Register Pair HL with 2DCDH, DEVFCB, the device spec (source: determine if system device by attempting to rename it).
2C52
LD D,H 54
Load Register D with Register H, 2DH, the high byte of 2DCDH.
2C53
LD E,L 5D
Load Register E with Register L, CDH: Register Pair DE = Register Pair HL = 2DCDH, the new name the same as the old.
2C54
LD A,38H 3E 38
Load Register A with 38H, SVC 56, @RENAME, which renames a file or a device (source: the error code will be).
2C56
RST 28H EF
Call @RENAME with RST 28H: SYS2's RENDEV refuses a system device, a DCB at 0230H (JL) or below, with error 40, and any other with error 19, as the new name, its own, is in use; it never renames.
2C57
POP HL E1
Restore Register Pair HL, the DCB's address saved at 2C4EH; POP leaves the flags (source: either 19 or 40).
2C58
CP 28H FE 28
Compare Register A with 28H, error 40, Protected system device (source: protected system device?).
2C5A
If it is a system device (Z) jump to ERRPOP at 2C8EH with error 40: a NIL system device (JL, or KI, DO, PR, SI or SO made NIL by RESET or by ROUTE (NIL)) cannot be set.
2C5C
Jump to GOTDCB at 2C68H with Register Pair HL = the DCB of the user's NIL device, which SET uses again (source: else we have it); that may be the DCB of a filter in use whose device was NIL (B94), or one whose type keeps a link or filter bit (B95).
2C5ENEWDCB
LD DE,0000H 11 00 00
NEWDCB: load Register Pair DE with 0000H, the name of a spare DCB, whose +6 and +7 are 0000H (source: find spare device table position).
2C61
LD A,52H 3E 52
Load Register A with 52H, SVC 82, @GTDCB, which with Register Pair DE = 0000H finds the first DCB not in use.
2C63
RST 28H EF
Call @GTDCB with RST 28H (SYS2/SYS): Register Pair HL = the first spare DCB with Z, or NZ when all 31 DCBs are in use.
2C64
LD A,21H 3E 21
Load Register A with 21H, error 33, No device space available; the LD leaves the flags of @GTDCB (source: no device space available).
2C66
If no DCB is spare (NZ) jump to ERRPOP at 2C8EH with error 33 (source: exit on error).

2C68H - Member 11 (FILTER and SET): SET Loads the Program

@LOAD reads the program file into memory: first the name with /FLT (or with the extension typed), and when that file is not found (error 31, Program not found) the copy in SAVSPEC with /DVR. Bit 2 of SFLAG$ is set before each load so that a file of EXEC protection can be opened. Any other load error, or a second Program not found, ends SET with its message; the DCB is left as it was.

2C68GOTDCB
PUSH HL E5
GOTDCB: save Register Pair HL, the DCB's address, on the stack for 2C92H (source: save table address).
2C69
SET 2,(IY+12H) FD CB 12 D6
Set bit 2 of SFLAG$ (IY+12H, 007CH), the bit @RUN sets: the next @OPEN lets a file of EXEC protection be opened, with access READ, and clears the bit. Index Register IY holds 006AH from @FLAGS (source: allow use with EXEC only).
2C6D
LD DE,2DEDH 11 ED 2DLD DE,PGMFCB
Load Register Pair DE with 2DEDH, PGMFCB, the file spec with /FLT (source: load the target file).
2C70
LD A,4CH 3E 4C
Load Register A with 4CH, SVC 76, @LOAD, which opens the file in the FCB at Register Pair DE (record length 256, SFLAG$ bit 0 set so that its open bit is not set, the buffer at 1D00H) and loads its blocks.
2C72
RST 28H EF
Call @LOAD with RST 28H (SYS0/SYS): Z with Register Pair HL = the program's transfer address, or NZ with Register A = the error number OR C0H (error 24, File not in directory, turned into 31) and Register Pair HL = the error number as @OPEN gave it (0018H for File not in directory) (source: transfer address in HL).
2C73
If the file was loaded (Z) jump to LOADOK at 2C92H (source: go if file found).
2C75
AND 3FH E6 3F
AND Register A with 3FH, which leaves the error number without the two flag bits of @LOAD (source: strip flags).
2C77
CP 1FH FE 1F
Compare Register A with 1FH, error 31, Program not found (source: program not found?).
2C79
If the error is another (NZ) jump to LOADERR at 2C8DH to end SET with it (source: abort on any other).
2C7B
LD DE,2DADH 11 AD 2DLD DE,SAVSPEC
Load Register Pair DE with 2DADH, SAVSPEC, the copy of the file spec as typed (source: original filename).
2C7E
LD HL,2D0EH 21 0E 2DLD HL,DVREXT
Load Register Pair HL with 2D0EH, DVREXT, the 3 letters DVR (source: try with /DVR).
2C81
LD A,4FH 3E 4F
Load Register A with 4FH, SVC 79, @FEXT, which gives the spec in the FCB at Register Pair DE the extension at Register Pair HL, 2D0EH.
2C83
RST 28H EF
Call @FEXT with RST 28H (SYS1/SYS): the copy at 2DADH gets /DVR when it has no extension; a spec typed with one is tried again as it is.
2C84
SET 2,(IY+12H) FD CB 12 D6
Set bit 2 of SFLAG$ (IY+12H, 007CH) again, as the failed @OPEN cleared it; Index Register IY holds 006AH (source: allow use with EXEC only).
2C88
LD A,4CH 3E 4C
Load Register A with 4CH, SVC 76, @LOAD, with Register Pair DE = 2DADH.
2C8A
RST 28H EF
Call @LOAD with RST 28H (SYS0/SYS): Z with Register Pair HL = the transfer address, or NZ with Register A = the error number OR C0H.
2C8B
If the file was loaded (Z) jump to LOADOK at 2C92H (source: go if file found); a failure falls into LOADERR with Register A = the error number OR C0H, which is not stripped as at 2C75H (B90).
2C8DLOADERR
POP HL E1
LOADERR: discard the DCB's address saved at 2C68H into Register Pair HL (source: clean the stack).
2C8EERRPOP
POP HL E1
ERRPOP: discard the line pointer saved at 2C3EH into Register Pair HL; the stack is at the entry's depth.
2C8F
Jump to IOERR at 2D11H with Register A = the error number, to show its message and return it (source: abort on load error). After the second @LOAD Register A still has bits 7 and 6 set, so SET returns Register Pair HL = 00DFH for Program not found, not 001FH (B90).

2C92H - Member 11 (FILTER and SET): SET Claims the DCB and Enters the Program

With the interrupts off the DCB becomes a NIL device of the typed name: type 08H at +0 and 08H at +3, so that a later RESET of a filter set here makes it NIL again (RESET's FIX0 brings back +3 to +5), and the two letters at +6 and +7; the vector at +1 and +2 and the bytes at +4 and +5 are left as they were. SET then puts the program's transfer address on the stack, sets the system request bit of CFLAG$ and returns into the program, which gets Register Pair DE = the DCB and Register Pair HL = its parameters, installs itself (it writes the DCB's type and vector) and returns to SET's caller with its own return code. A program that refuses (FORMS returns FFFFH when a BREAK is still pending, or shows Filter already attached to the DCB its resident module serves) leaves the DCB a NIL device of that name. Writing 08H over the whole type also drops a link or filter bit that a NIL user device kept, which orphans its link DCB or filter DCB (B95).

2C92LOADOK
POP DE D1
LOADOK: restore Register Pair DE, the DCB's address saved at 2C68H (source: rcvr table address).
2C93
PUSH DE D5
Save Register Pair DE, the DCB's address, on the stack again for 2CABH.
2C94
DI F3
Disable interrupts while the DCB is written, so that no task does I/O through it half done (source: don't interrupt me).
2C95
LD A,08H 3E 08
Load Register A with 08H, the type of a NIL device (source: set up as NIL first).
2C97
LD (DE),A 12
Store Register A, 08H, into the byte at Register Pair DE, DCB+0, the type: the device is NIL.
2C98NOSET
INC E 1C
NOSET: increment Register E: Register Pair DE = DCB + 1. A DCB lies in 0208H-02FFH, so Register E never passes FFH within one (source: transfer device name entered in command).
2C99
INC E 1C
Increment Register E: Register Pair DE = DCB + 2 (source: to the device table).
2C9A
INC E 1C
Increment Register E: Register Pair DE = DCB + 3.
2C9B
LD A,08H 3E 08
Load Register A with 08H (source: show RESET as NIL).
2C9D
LD (DE),A 12
Store Register A, 08H, into DCB+3 at Register Pair DE, the type that RESET brings back from +3 to +5 (FIX0) when it undoes a filter set here.
2C9E
INC E 1C
Increment Register E: Register Pair DE = DCB + 4.
2C9F
INC E 1C
Increment Register E: Register Pair DE = DCB + 5 (source: point to name field).
2CA0
INC E 1C
Increment Register E: Register Pair DE = DCB + 6, the name.
2CA1
LD A,(2DCEH) 3A CE 2D
Load Register A with the byte at 2DCEH, DEVFCB+1, the first letter of the device (source: move name to DCB).
2CA4
LD (DE),A 12
Store Register A into DCB+6 at Register Pair DE.
2CA5
INC E 1C
Increment Register E: Register Pair DE = DCB + 7.
2CA6
LD A,(2DCFH) 3A CF 2D
Load Register A with the byte at 2DCFH, DEVFCB+2, the second letter, or 03H for a name of one letter.
2CA9
LD (DE),A 12
Store Register A into DCB+7 at Register Pair DE: the DCB now has the typed name.
2CAA
EI FB
Enable interrupts again (source: interrupts back on).
2CABGODOIT
POP DE D1
GODOIT: restore Register Pair DE, the DCB's address saved at 2C93H, for the program (source: recover DCB address).
2CAC
EX (SP),HL E3
Exchange Register Pair HL, the program's transfer address from @LOAD, with the word at the top of the stack (the Stack Pointer's word), the line pointer saved at 2C3EH: the transfer address is on the stack, Register Pair HL = the parameters (source: stack prog's TRAADR).
2CAD
SET 3,(IY+02H) FD CB 02 DE
Set bit 3 of CFLAG$ (IY+02H, 006CH), the system request bit, which a driver or filter tests to know that SET installed it (the FORMS, KSM and CLICK sources: else Must install via SET); SYS1's CLEANUP clears it at 1E7CH (only bit 5 kept), which every @EXIT and @CMNDI runs; under @CMNDR it stays set until the caller's @EXIT or a @CMNDI. Index Register IY holds 006AH from @FLAGS (source: set system request).
2CB1
RET C9
Return into the program at its transfer address with Register Pair DE = the DCB and Register Pair HL = the parameters; its own RET goes to RST28's tail, SET's return (source: and go to it).

2CB2H - Member 11 (FILTER and SET): FILTER

FILTER takes two device specs: the device to filter and a filter device, a DCB that SET gave a filter module. The filter's DCB must have the filter bit (bit 6) and its module's DCB word, the word after the module's name, must point at that DCB; then the first three bytes (type and vector) of the two DCBs are swapped: the device's I/O goes into the filter module, and the filter's DCB holds what the device was before, where the module sends it on. The swap runs with the interrupts on. The in-use test reads the module that the named DCB's vector leads to now: once a filter is on a device that was not filtered before, the filter's DCB holds the device's old type without bit 6, so a second FILTER with it gives Device is not a filter, while naming the filtered device as the filter gives FILTER module is in use: the two messages are swapped (B89).

2CB2FILTER
LD DE,2DCDH 11 CD 2DLD DE,DEVFCB
FILTER: load Register Pair DE with 2DCDH, DEVFCB, the area for the device to filter (source: get first spec).
2CB5
LD A,4EH 3E 4E
Load Register A with 4EH, SVC 78, @FSPEC, which reads the spec at Register Pair HL into the area at Register Pair DE, 2DCDH.
2CB7
RST 28H EF
Call @FSPEC with RST 28H (SYS1/SYS): Z with the spec at 2DCDH and Register Pair HL past it, NZ when no valid spec stands there.
2CB8
If there is no valid spec (NZ) jump to DEVREQ at 2D23H, which shows Device spec required (source: quit on bad name).
2CBB
LD A,(DE) 1A
Load Register A with the byte at Register Pair DE, 2DCDH, the first character of the spec (source: ck on devicespec).
2CBC
CP 2AH FE 2A
Compare Register A with 2AH, the asterisk of a device spec.
2CBE
If the first spec is a file spec (NZ) jump to DEVREQ at 2D23H (source: must have device).
2CC1
LD DE,2DEDH 11 ED 2DLD DE,PGMFCB
Load Register Pair DE with 2DEDH, PGMFCB, the area for the filter device (source: get filter device spec).
2CC4
LD A,4EH 3E 4E
Load Register A with 4EH, SVC 78, @FSPEC; a TO, ON, OVER or USING between the specs is passed over by SYS1 (PREPTBL).
2CC6
RST 28H EF
Call @FSPEC with RST 28H (SYS1/SYS): Z with the second spec at 2DEDH.
2CC7
If there is no second spec (NZ) jump to SPCREQ at 2D2BH, which shows File spec required, though FILTER takes only a device here (source: must be entered).
2CCA
LD A,(DE) 1A
Load Register A with the byte at Register Pair DE, 2DEDH (source: target must be a device).
2CCB
CP 2AH FE 2A
Compare Register A with 2AH, the asterisk (source: since this is FILTER).
2CCD
If the second spec is a file spec (NZ) jump to DEVREQ at 2D23H: the version 5 form with a filter program file is refused with Device spec required.
2CD0
LD DE,(2DEEH) ED 5B EE 2D
Load Register Pair DE with the word at 2DEEH-2DEFH, the filter device's two letters (source: get filter DCB address).
2CD4
LD A,52H 3E 52
Load Register A with 52H, SVC 82, @GTDCB, which looks for the DCB named by Register Pair DE, the filter device.
2CD6
RST 28H EF
Call @GTDCB with RST 28H (SYS2/SYS): Register Pair HL = the filter's DCB with Z, or Register A = 08H with NZ.
2CD7
If the filter device is not in the table (NZ) jump to IOERR at 2D11H with error 8, Device not available (source: quit if not found).
2CD9
BIT 6,(HL) CB 76
Test bit 6 of the byte at Register Pair HL, the filter DCB's type: the filter bit (source: must be a filter).
2CDB
If the bit is clear (Z) jump to NOTFLT at 2D1FH, which shows Device is not a filter; a filter put on a device that had no filter bit holds that device's old type here and is refused with this message too (B89) (source: quit if not).
2CDD
LD D,H 54
Load Register D with Register H: the high byte of the filter DCB's address (source: xfer FILTER DCB pointer).
2CDE
LD E,L 5D
Load Register E with Register L: Register Pair DE = the filter DCB's address (source: to DE and locate the).
2CDF
INC L 2C
Increment Register L: Register Pair HL = DCB + 1, the low byte of the vector (source: DCB pointer in the).
2CE0
LD A,(HL) 7E
Load Register A with the byte at Register Pair HL, the low byte of the vector (source: the FILTER module).
2CE1
INC L 2C
Increment Register L: Register Pair HL = DCB + 2.
2CE2
LD H,(HL) 66
Load Register H with the byte at Register Pair HL, the high byte of the vector.
2CE3
LD L,A 6F
Load Register L with Register A: Register Pair HL = the vector, the filter module's entry.
2CE4
LD BC,0004H 01 04 00
Load Register Pair BC with 0004H: Register B = 00H for the ADDs that follow (source: HL now points to the).
2CE7
ADD HL,BC 09
Add Register Pair BC to Register Pair HL: Register Pair HL = module + 4, the length byte of the module's name, after the JR at +0 and the end address at +2 (source: entry point. Get its).
2CE8
LD C,(HL) 4E
Load Register C with the byte at Register Pair HL, the name's length (source: DCB address by peeking).
2CE9
INC C 0C
Increment Register C: the length and the length byte itself (source: past the name field).
2CEA
ADD HL,BC 09
Add Register Pair BC to Register Pair HL: Register Pair HL = module + 5 + the length, the module's DCB word; the Carry flag is clear, as the sum stays below 10000H.
2CEB
LD A,(HL) 7E
Load Register A with the byte at Register Pair HL, the low byte of the DCB word (source: get low-order).
2CEC
INC HL 23
Increment Register Pair HL to the high byte of the module's DCB word.
2CED
LD H,(HL) 66
Load Register H with the byte at Register Pair HL, the high byte (source: get hi-order).
2CEE
LD L,A 6F
Load Register L with Register A: Register Pair HL = the DCB address the module names.
2CEF
SBC HL,DE ED 52
Subtract Register Pair DE, the filter DCB's address, from Register Pair HL with the Carry flag (clear): Z when the module names this DCB (source: if DCB is NOT pointing to itself, then it is an active filter).
2CF1
If the module names another DCB (NZ) jump to ACTFLT at 2D1BH, which shows FILTER module is in use: when the filtered device is named as the filter, as in FILTER with the printer named second after a FILTER of the printer, or when the filter's DCB holds another filter's type after a second FILTER of one device; a filter in use on a device that had no filter bit is caught at 2CDBH instead (B89).
2CF3
PUSH DE D5
Save Register Pair DE, the filter DCB's address, on the stack for 2CFBH (source: save filter DCB).
2CF4
LD DE,(2DCEH) ED 5B CE 2D
Load Register Pair DE with the word at 2DCEH-2DCFH, the device's two letters (source: find the device DCB).
2CF8
LD A,52H 3E 52
Load Register A with 52H, SVC 82, @GTDCB, which looks for the DCB named by Register Pair DE, the device to filter.
2CFA
RST 28H EF
Call @GTDCB with RST 28H (SYS2/SYS): Register Pair HL = the device's DCB with Z, or Register A = 08H with NZ.
2CFB
POP DE D1
Restore Register Pair DE, the filter DCB's address saved at 2CF3H; POP leaves the flags.
2CFC
If the device is not in the table (NZ) jump to IOERR at 2D11H with error 8, Device not available (source: quit if not found).
2CFE
LD B,03H 06 03
Load Register B with 03H, the type and the two bytes of the vector. Nothing tests whether the device is routed (B82 then leaves its file open at RESET), linked, NIL, already filtered, the filter device itself or another unused filter DCB (B96); the interrupts stay on for the swap, where SET, ROUTE, LINK and RESET write a DCB under DI.
2D00SWAP
LD C,(HL) 4E
SWAP: load Register C with the byte at Register Pair HL, a byte of the device's DCB.
2D01
LD A,(DE) 1A
Load Register A with the byte at Register Pair DE, the same byte of the filter's DCB.
2D02
LD (HL),A 77
Store Register A into the byte at Register Pair HL: the device's DCB gets the filter's byte.
2D03
LD A,C 79
Load Register A with Register C, the device's old byte.
2D04
LD (DE),A 12
Store Register A into the byte at Register Pair DE: the filter's DCB gets the device's old byte.
2D05
INC L 2C
Increment Register L: the next byte of the device's DCB.
2D06
INC E 1C
Increment Register E: the next byte of the filter's DCB.
2D07
Decrement Register B and jump to SWAP at 2D00H until the 3 bytes are swapped: the device's type and vector now lead into the filter module, and the filter's DCB holds the device's old type and vector.
2D09
Jump to EXIT at 2D35H to return Register Pair HL = 0000H.

2D0BH - Member 11 (FILTER and SET): the Extensions and the Exits

The two default extensions, then the exits. IOERR shows the short message of a DOS error and returns its number; the message exits (a DDH chain) show their line through @LOGOT and return FFFFH; EXIT returns 0000H after a FILTER, clearing BREAK. SET's successful path does not come here: it returns into the program (2CB1H).

2D0B-2D0DFLTEXT
DEFM "FLT" 46 4C 54
FLTEXT, 2D0BH-2D0DH: FLT, the extension @FEXT gives first (2C37H), as LS-DOS 6 filters are set with SET too.
2D0E-2D10DVREXT
DEFM "DVR" 44 56 52
DVREXT, 2D0EH-2D10H: DVR, the extension of the second try (2C7EH), the one the manual names.
2D11IOERR
LD L,A 6F
IOERR: load Register L with Register A, the error number (source: transfer error code to HL).
2D12
LD H,00H 26 00
Load Register H with 00H: Register Pair HL = the error number, the return code.
2D14
OR C0H F6 C0
OR Register A with C0H: bit 7 makes @ERROR return to the caller, bit 6 makes it show the short message alone (source: set abbrev and return).
2D16
LD C,A 4F
Load Register C with Register A, the error number with bits 7 and 6 set, the form @ERROR takes.
2D17
LD A,1AH 3E 1A
Load Register A with 1AH, SVC 26, @ERROR, which shows the message of the error number in Register C.
2D19
RST 28H EF
Call @ERROR with RST 28H (the SYS0/SYS stub at 1B0FH, which loads SYS4/SYS) to show the short message.
2D1A
RET C9
Return with Register Pair HL = the error number, without the @CKBRKC of EXIT.
2D1BACTFLT
LD HL,2D95H 21 95 2DLD HL,ACTFLT$
ACTFLT: load Register Pair HL with 2D95H, ACTFLT$, the message FILTER module is in use (2CF1H).
2D1E
DEFB 0DDH DD
2D1EH: DDH, the IX prefix: entered from 2D1BH, the LD HL,2D7EH that follows runs as LD IX,2D7EH, so Register Pair HL keeps ACTFLT$ and Index Register IX is changed.
2D1FNOTFLT
LD HL,2D7EH 21 7E 2DLD HL,NOTFLT$
NOTFLT: load Register Pair HL with 2D7EH, NOTFLT$, the message Device is not a filter (2CDBH).
2D22
DEFB 0DDH DD
2D22H: DDH, the IX prefix: the LD HL,2D4FH that follows runs as LD IX,2D4FH.
2D23DEVREQ
LD HL,2D4FH 21 4F 2DLD HL,DEVREQ$
DEVREQ: load Register Pair HL with 2D4FH, DEVREQ$, the message Device spec required (2C13H, 2C19H, 2CB8H, 2CBEH, 2CCDH).
2D26
DEFB 0DDH DD
2D26H: DDH, the IX prefix: the LD HL,2D64H that follows runs as LD IX,2D64H.
2D27CANT
LD HL,2D64H 21 64 2DLD HL,CANT$
CANT: load Register Pair HL with 2D64H, CANT$, the message No memory space available, when HIGH$ is frozen (2C0AH).
2D2A
DEFB 0DDH DD
2D2AH: DDH, the IX prefix: the LD HL,2D3CH that follows runs as LD IX,2D3CH, the last of the chain.
2D2BSPCREQ
LD HL,2D3CH 21 3C 2DLD HL,SPCREQ$
SPCREQ: load Register Pair HL with 2D3CH, SPCREQ$, the message File spec required (2C22H, 2C28H, 2CC7H).
2D2E
LD A,0CH 3E 0C
Load Register A with 0CH, SVC 12, @LOGOT, which shows a line on the video and writes it to the job log.
2D30
RST 28H EF
Call @LOGOT with RST 28H (BOOT/SYS) to show the message at Register Pair HL.
2D31
LD HL,FFFFH 21 FF FF
Load Register Pair HL with FFFFH, the return code of a command that showed a message of its own.
2D34
RET C9
Return with Register Pair HL = FFFFH to RST28's tail, SET's or FILTER's return.
2D35EXIT
LD HL,0000H 21 00 00
EXIT: load Register Pair HL with 0000H, the return code of a FILTER that was done.
2D38
LD A,6AH 3E 6A
Load Register A with 6AH, SVC 106, @CKBRKC, which tests and clears the BREAK key (source: clear out break).
2D3A
RST 28H EF
Call @CKBRKC with RST 28H (BOOT/SYS) to clear a BREAK pressed during FILTER; the flags it returns are not used.
2D3B
RET C9
Return with Register Pair HL = 0000H to RST28's tail; FILTER is done.

2D3CH - Member 11 (FILTER and SET): the Messages

The five messages, each ended by its carriage return; the last byte, 2DACH, is the member's last. The three FCB areas that follow, SAVSPEC (2DADH-2DCCH), DEVFCB (2DCDH-2DECH) and PGMFCB (2DEDH-2E0CH), are not in the file and have no rows; a program loaded by SET must keep its load blocks out of 2C00H-2E0CH: PGMFCB or SAVSPEC is the FCB the loader is reading through while the blocks come in, and DEVFCB is read after the load (2CA1H, 2CA6H).

2D3C-2D4ESPCREQ$
DEFM "File spec required" / DEFB 0DH 46 69 6C 65 20 73 70 65 63 20 72 65 71 75 69 72 65 64 0D
SPCREQ$, 2D3CH-2D4EH: the message SPCREQ shows (2D2BH), ended by its carriage return.
2D4F-2D63DEVREQ$
DEFM "Device spec required" / DEFB 0DH 44 65 76 69 63 65 20 73 70 65 63 20 72 65 71 75 69 72 65 64 0D
DEVREQ$, 2D4FH-2D63H: the message DEVREQ shows (2D23H).
2D64-2D7DCANT$
DEFM "No memory space available" / DEFB 0DH 4E 6F 20 6D 65 6D 6F 72 79 20 73 70 61 63 65 20 61 76 61 69 6C 61 62 6C 65 0D
CANT$, 2D64H-2D7DH: the message CANT shows (2D27H).
2D7E-2D94NOTFLT$
DEFM "Device is not a filter" / DEFB 0DH 44 65 76 69 63 65 20 69 73 20 6E 6F 74 20 61 20 66 69 6C 74 65 72 0D
NOTFLT$, 2D7EH-2D94H: the message NOTFLT shows (2D1FH).
2D95-2DACACTFLT$
DEFM "FILTER module is in use" / DEFB 0DH 46 49 4C 54 45 52 20 6D 6F 64 75 6C 65 20 69 73 20 69 6E 20 75 73 65 0D
ACTFLT$, 2D95H-2DACH: the message ACTFLT shows (2D1BH); 2DACH, its carriage return, is the last byte of member 11.

2400H - Member 12 (LIST): Entry and the Exits

SYS1/SYS runs LIST with request 41H; its header points at member 12, which the overlay loader reads to 2400H-27BAH and calls at 2400H with Register Pair HL at the text after the word LIST. LIST shows a file on the video, or prints it with P, as text (ASCII) or in hex. A BREAK pressed before the command ends it at once; then the Stack Pointer is kept for SAVESP, and every later exit goes there: 0000H at the end of the file, FFFFH after File spec required or BREAK, or the number of a DOS error after its short message.

2400START
LD A,6AH 3E 6A
START: load Register A with 6AH, SVC 106, @CKBRKC, which tests and clears the BREAK key (source: check break).
2402
RST 28H EF
Call @CKBRKC with RST 28H (BOOT/SYS): NZ when BREAK has been pressed.
2403
If BREAK was not pressed (Z) jump to LISTA at 2409H (source: continue if not).
2405
LD HL,FFFFH 21 FF FF
Load Register Pair HL with FFFFH, the return code of a command that was stopped (source: else abort).
2408
RET C9
Return to RST28's tail with Register Pair HL = FFFFH, before the Stack Pointer is kept.
2409LISTA
LD (2411H),SP ED 73 11 24
LISTA: store the Stack Pointer into 2411H, the operand of the LD SP at SAVESP (2410H), so that every exit returns from this depth (source: save SP).
240D
Call LIST at 242DH, which lists the file; it never returns: every path ends at SAVESP (source: list a file).
2410SAVESP
LD SP,0000H 31 00 00
SAVESP: load the Stack Pointer with the word at 2411H, 0000H in the file and the entry's Stack Pointer once 2409H has run (source: p/u SP address).
2413
LD A,6AH 3E 6A
Load Register A with 6AH, SVC 106, @CKBRKC, for the exit (source: reset if user pressed break).
2415
RST 28H EF
Call @CKBRKC with RST 28H to clear a BREAK pressed during LIST, so that it does not stop the next command.
2416
RET C9
Return to RST28's tail with Register Pair HL = 0000H, an error number or FFFFH.
2417IOERR
LD H,00H 26 00
IOERR: load Register H with 00H (source: set HL = error number).
2419
LD L,A 6F
Load Register L with Register A, the error number: Register Pair HL = the error number, LIST's return code.
241A
OR C0H F6 C0
OR Register A with C0H: bit 7 makes @ERROR return to LIST, bit 6 makes it show the short message alone (source: short error message).
241C
LD C,A 4F
Load Register C with Register A, the error number with bits 7 and 6 set, the form @ERROR takes (source: stuff error number in C).
241D
LD A,1AH 3E 1A
Load Register A with 1AH, SVC 26, @ERROR, which shows the message of the error number in Register C.
241F
RST 28H EF
Call @ERROR with RST 28H (the SYS0/SYS stub at 1B0FH, which loads SYS4/SYS) to show the short message.
2420
Jump to SAVESP at 2410H to return with Register Pair HL = the error number (source: abort).
2422SPCREQ
LD HL,2748H 21 48 27LD HL,SPCREQ$
SPCREQ: load Register Pair HL with 2748H, SPCREQ$, the message File spec required, when there is no spec or it names a device (2454H, 245AH).
2425
LD A,0CH 3E 0C
Load Register A with 0CH, SVC 12, @LOGOT, which shows a line on the video and writes it to the job log.
2427
RST 28H EF
Call @LOGOT with RST 28H (BOOT/SYS) to show the message at Register Pair HL, 2748H (source: log error message).
2428ABORT
LD HL,FFFFH 21 FF FF
ABORT: load Register Pair HL with FFFFH, the return code of a command that showed a message of its own or was stopped by BREAK (source: internal error = -1).
242B
Jump to SAVESP at 2410H to return with Register Pair HL = FFFFH (source: p/u stack and return).

242DH - Member 12 (LIST): the Parameters, the Spec and the Open

LIST clears the pause and ENTER bits of KFLAG$, lets @PARAM read the parameters of PRMTBL$ (2773H) when an opening parenthesis is on the line, reads the file spec into FCB1 (27CCH) and keeps a copy in FCB2 (27ECH). The spec gets the extension /TXT when it has none; when that file is not in the directory the spec as typed is opened instead. The file is opened with record length 256 and SFLAG$ bit 0, so that its open bit is neither tested nor set.

242DLIST
LIST: call RESKFL at 26DFH, which clears the pause and ENTER bits of KFLAG$ (source: reset pause and enter).
2430
PUSH HL E5
Save Register Pair HL, the line pointer, on the stack for 2446H (source: save command ptr).
2431FPLP
LD A,(HL) 7E
FPLP: load Register A with the byte at Register Pair HL, a character of the line (source: p/u character).
2432
CP 28H FE 28
Compare Register A with 28H, the opening parenthesis of the parameters (source: parameters?).
2434
If it is the parenthesis (Z) jump to GETPRM at 243DH (source: yes, go get them).
2436
CP 0EH FE 0E
Compare Register A with 0EH: Carry for a control character below 0EH, the 0DH that ends the line (source: end of line?).
2438
If the line ended (Carry) jump to RESTPTR at 2446H without parameters (source: yes, restore ptr).
243A
INC HL 23
Increment Register Pair HL to the next character (source: no, bump til end).
243B
Jump back to FPLP at 2431H until the end of the line or a parenthesis (source: do til eol or paren).
243DGETPRM
LD DE,2773H 11 73 27LD DE,PRMTBL$
GETPRM: load Register Pair DE with 2773H, PRMTBL$, the parameter table (source: DE points to the parameter table).
2440
LD A,11H 3E 11
Load Register A with 11H, SVC 17, @PARAM, which reads the parameters at Register Pair HL by the table at Register Pair DE.
2442
RST 28H EF
Call @PARAM with RST 28H (SYS1/SYS): each parameter's response byte and value word are stored; NZ with Register A = 44, Parameter error, for a name not in the table, a bad value or a bad separator.
2443
If @PARAM failed (NZ) jump to IOERR at 2417H with Parameter error (source: NZ, Parameter Error); SAVESP drops the HL still on the stack.
2446RESTPTR
POP HL E1
RESTPTR: restore Register Pair HL, the line pointer saved at 2430H, at the spec (source: recover ptr).
2447IGSPC
LD A,(HL) 7E
IGSPC: load Register A with the byte at Register Pair HL (source: p/u character).
2448
INC HL 23
Increment Register Pair HL (source: bump ptr).
2449
CP 20H FE 20
Compare Register A with 20H, a space (source: space?).
244B
If it is a space (Z) jump back to IGSPC at 2447H to pass over it (source: yes, ignore them).
244D
DEC HL 2B
Decrement Register Pair HL: Register Pair HL = the first character that is not a space (source: HL points to first non-space).
244E
LD DE,27CCH 11 CC 27LD DE,FCB1
Load Register Pair DE with 27CCH, FCB1, after the member (source: fetch file spec).
2451
LD A,4EH 3E 4E
Load Register A with 4EH, SVC 78, @FSPEC, which reads a file or device spec from the line at Register Pair HL into the area at Register Pair DE.
2453
RST 28H EF
Call @FSPEC with RST 28H (SYS1/SYS): Z with the spec at 27CCH (source: filespec legal?).
2454
If there is no spec (NZ) jump to SPCREQ at 2422H, which shows File spec required (source: no, filespec required).
2457
LD A,(DE) 1A
Load Register A with the byte at Register Pair DE, 27CCH, the first character of the spec (source: is this a device?).
2458
CP 2AH FE 2A
Compare Register A with 2AH, the asterisk that begins a device spec.
245A
If the spec names a device (Z) jump to SPCREQ at 2422H: LIST lists files only (source: yes, filespec req).
245D
EX DE,HL EB
Exchange Register Pair DE and Register Pair HL: Register Pair HL = 27CCH, FCB1 (source: HL points to source FCB).
245E
LD DE,27ECH 11 EC 27LD DE,FCB2
Load Register Pair DE with 27ECH, FCB2, the area for the copy (source: DE points to duplicate FCB).
2461
LD BC,0020H 01 20 00
Load Register Pair BC with 0020H, the 32 bytes of an FCB (source: 32 bytes to xfer).
2464
PUSH HL E5
Save Register Pair HL, 27CCH, on the stack for 2467H (source: save source ptr).
2465
LDIR ED B0
Copy Register Pair BC = 32 bytes from Register Pair HL, FCB1 at 27CCH-27EBH, to Register Pair DE, FCB2 at 27ECH-280BH (LDIR): the spec as typed (source: xfer).
2467
POP DE D1
Restore Register Pair DE, 27CCH, FCB1, saved at 2464H (source: DE points to source FCB).
2468
LD HL,2770H 21 70 27LD HL,TXTEXT
Load Register Pair HL with 2770H, TXTEXT, the 3 letters TXT (source: HL points to TXT).
246B
LD A,4FH 3E 4F
Load Register A with 4FH, SVC 79, @FEXT, which gives the spec in the FCB at Register Pair DE the extension at Register Pair HL when it has none.
246D
RST 28H EF
Call @FEXT with RST 28H (SYS1/SYS): FCB1 gets /TXT unless an extension was typed (source: stuff TXT if no ext).
246E
LD B,00H 06 00
Load Register B with 00H, the record length 256 for @OPEN (source: set LRL (B) = 256).
2470
Call OPEN at 273AH, which opens FCB1 at Register Pair DE with the buffer 2900H; Z when the file is open (source: open file with LRL=256).
2473
If the file was opened (Z) jump to INITLRL at 248BH (source: good, LIST it).
2475
CP 18H FE 18
Compare Register A with 18H, error 24, File not in directory (source: File not Found?).
2477
If the error is another (NZ) jump to IOERR at 2417H with it (source: no, I/O error).
247A
LD C,20H 0E 20
Load Register C with 20H: Register Pair BC = 0020H, 32 bytes, as @OPEN keeps Register B, 00H from 246EH (source: BC = 32 bytes to xfer).
247C
PUSH DE D5
Save Register Pair DE, 27CCH, FCB1, on the stack for 2484H (source: DE points to FCB1).
247D
PUSH HL E5
Save Register Pair HL, 2900H, the buffer, on the stack for 2483H (source: save I/O buff ptr).
247E
LD HL,27ECH 21 EC 27LD HL,FCB2
Load Register Pair HL with 27ECH, FCB2, the spec as typed (source: HL points to filespec).
2481
LDIR ED B0
Copy Register Pair BC = 32 bytes from Register Pair HL, FCB2 at 27ECH, to Register Pair DE, FCB1 at 27CCH (LDIR): the /TXT is taken off again; Register Pair BC ends at 0000H, so Register B = 00H, the record length 256 (source: xfer original filespec).
2483
POP HL E1
Restore Register Pair HL, 2900H, the buffer, saved at 247DH (source: HL points to I/O buffer).
2484
POP DE D1
Restore Register Pair DE, 27CCH, FCB1, saved at 247CH (source: DE points to unopen FCB).
2485
Call OPEN at 273AH to open the spec as typed: a name without an extension is looked for with a blank one, as the manual says; a typed extension is tried a second time (source: open the file).
2488
If the file cannot be opened (NZ) jump to IOERR at 2417H with the error (source: I/O error, abort).

248BH - Member 12 (LIST): the Record Length, TAB, P and HEX

The record length is LRL=n or, when it was not given, the file's own from DIR+4 of its directory entry; it goes into FCB+9 for the ASCII listing too, where it has no effect: only @POSN, in the hex listing, reads FCB+9 and FCB+1 bit 7, so the manual is right that LRL is used only with HEX. TAB sets the tab stops: a number from 1 to 32, TAB or TAB=ON for every 8 columns, TAB=OFF for no expansion; the default is 8. P sends the output to the printer (@PRT for @DSP) and turns the page pause off. HEX goes to the hex listing at RPARM (258DH); the ASCII listing sets up its 23 line pages (6.3.1) and passes over the lines before LINE.

248BINITLRL
PUSH DE D5
INITLRL: save Register Pair DE, 27CCH, FCB1, on the stack (source: xfer FCB to IX).
248C
POP IX DD E1
Restore it into Index Register IX: Index Register IX = 27CCH, the open FCB.
248E
LD B,(IX+07H) DD 46 07
Load Register B with FCB+7 (IX+07H, 27D3H), the file's directory entry code (DEC); Index Register IX holds 27CCH (source: p/u DEC).
2491
LD C,(IX+06H) DD 4E 06
Load Register C with FCB+6 (IX+06H, 27D2H), the drive number; Index Register IX holds 27CCH (source: and drive number).
2494
LD A,57H 3E 57
Load Register A with 57H, SVC 87, @DIRRD, which reads the directory entry of DEC Register B on drive Register C.
2496
RST 28H EF
Call @DIRRD with RST 28H (SYS0/SYS): Register Pair HL = the entry in SBUFF$ (1D00H-1DFFH); the result is not tested (source: read in directory record).
2497
LD A,(27ABH) 3A AB 27LD A,(LRESP)
Load Register A with the byte at 27ABH, LRESP, the response byte of LRL in PRMTBL$ (source: p/u response).
249A
OR A B7
OR Register A with itself: Z when LRL was not given.
249B
If LRL was given (NZ) jump to SKIPLRL at 24A5H, keeping its value at 25ADH (source: go if entered).
249D
LD A,L 7D
Load Register A with Register L, the low byte of the entry's address (source: position to DIR+4).
249E
ADD A,04H C6 04
Add 04H to Register A; the entries lie on 32 byte bounds in SBUFF$, so there is no carry.
24A0
LD L,A 6F
Load Register L with Register A: Register Pair HL = DIR+4, the record length of the file (source: HL points to LRL byte DIR+4).
24A1
LD A,(HL) 7E
Load Register A with the byte at Register Pair HL, the file's record length, 00H for 256 (source: p/u LRL).
24A2
LD (25ADH),A 32 AD 25
Store Register A into 25ADH, the low byte of LPARM+1, the operand of the LD BC at 25ACH, where LRL=n would have put its value (source: set dir LRL into parm).
24A5SKIPLRL
LD A,(25ADH) 3A AD 25
SKIPLRL: load Register A with the byte at 25ADH, the record length, given or from the directory (source: p/u possible new LRL).
24A8
LD (IX+09H),A DD 77 09
Store Register A into FCB+9 (IX+09H, 27D5H), the FCB's record length, in ASCII and hex listings alike, though only @POSN of the hex listing reads it; Index Register IX holds 27CCH (source: put into FCB).
24AB
SET 7,(IX+01H) DD CB 01 FE
Set bit 7 of FCB+1 (IX+01H, 27CDH), the bit of a record length other than 256, which @POSN tests (1462H) to position by FCB+9 byte records; @GET's @BYTEIO sets the bit itself and never reads FCB+9. Index Register IX holds 27CCH (source: mark for byte I/O).
24AF
LD A,(27B7H) 3A B7 27LD A,(TRESP)
Load Register A with the byte at 27B7H, TRESP, the response byte of TAB (source: p/u response byte).
24B2
AND 40H E6 40
AND Register A with 40H, the bit of a flag (TAB, TAB=ON, TAB=OFF): Z for a number or no TAB (source: flag response?).
24B4
LD A,(2543H) 3A 43 25
Load Register A with the byte at 2543H, the low byte of TPARM+1: 08H by default, the number given, or FFH for ON and 00H for OFF; the LD leaves the flags (source: p/u value).
24B7
If TAB was a number or not given (Z) jump to NOTFLG at 24BEH with it (source: no, numeric).
24B9
INC A 3C
Increment Register A: Z for ON (FFH), NZ with Register A = 01H for OFF (source: TAB=OFF (NZ) or ON (Z)?).
24BA
If TAB=OFF (NZ) jump to NOTFLG at 24BEH with Register A = 01H; TPARM's low byte, 00H, turns the expansion off at 2547H (source: TAB=OFF gives TABEXP=1).
24BC
LD A,08H 3E 08
Load Register A with 08H: TAB or TAB=ON expands to every 8 columns (source: TAB=ON gives TABEXP=8).
24BENOTFLG
LD (254DH),A 32 4D 25
NOTFLG: store Register A into 254DH, the operand of the LD C at TABEXP (254CH), the width of a tab stop (source: stuff away).
24C1
DEC A 3D
Decrement Register A: 0 to 31 for a width of 1 to 32, FFH for 0 (source: range can).
24C2
CP 20H FE 20
Compare Register A with 20H: no Carry for a width of 0 or above 32 (source: only be between 1-32).
24C4
LD A,2CH 3E 2C
Load Register A with 2CH, error 44, Parameter error; the LD leaves the flags (source: greater, parm error).
24C6
If the width is out of range (no Carry) jump to IOERR at 2417H with error 44; the test is made with HEX too, where tabs are not used. A number is taken modulo 256 (TAB=257 is 1).
24C9PPARM
LD BC,0000H 01 00 00
PPARM: load Register Pair BC with the word at 24CAH, P's value: 0000H, or FFFFH when P was given (source: p/u P parameter).
24CC
LD A,B 78
Load Register A with Register B (source: was it specified?).
24CD
OR C B1
OR Register A with Register C: Z when P was not given.
24CE
If P was not given (Z) jump to HPARM at 24D9H: the output goes to the video by @DSP (source: no, use @DSP).
24D0
LD (268AH),BC ED 43 8A 26
Store Register Pair BC, FFFFH, into 268AH, SPARM+1, the operand of the LD DE at 2689H: no page pause while printing, as for NS (a 6.3.1 addition).
24D4
LD A,06H 3E 06
Load Register A with 06H, SVC 6, @PRT (source: @PRT SVC number).
24D6
LD (266AH),A 32 6A 26
Store Register A into 266AH, the operand of the LD A at PUTOUT1 (2669H): every byte goes to the printer instead of the video (source: overwrite @DSP).
24D9HPARM
LD BC,0000H 01 00 00
HPARM: load Register Pair BC with the word at 24DAH, HEX's value: 0000H, or FFFFH when HEX was given (source: p/u hex parm).
24DC
LD A,B 78
Load Register A with Register B (source: entered?).
24DD
OR C B1
OR Register A with Register C: Z for the ASCII listing, with Register A = 00H.
24DE
If HEX was given (NZ) jump to RPARM at 258DH, the hex listing; LINE, NUM, ASCII8 and TAB are then not used (source: yes, check out records).
24E1
LD (27BBH),A 32 BB 27LD (BYTCTR),A
Store Register A, 00H, into 27BBH, BYTCTR, the column counter, after the member (source: init counter to 0).
24E4
LD (26ACH),A 32 AC 26LD (L26AC),A
Store Register A, 00H, into 26ACH, the RST 28H of the @CLS at the page pause: in the ASCII listing a NOP, so the screen is not cleared (a 6.3.1 addition).
24E7
LD A,17H 3E 17
Load Register A with 17H, 23 lines a page for the ASCII listing (a 6.3.1 addition).
24E9
LD (2690H),A 32 90 26LD (L2690),A
Store Register A into 2690H, the operand of the LD A at 268FH, the count of lines left on the page.
24EC
LD (26AEH),A 32 AE 26LD (L26AE),A
Store Register A into 26AEH, the operand of the LD A at 26ADH, the count the pause starts each page with; the hex listing keeps 11H, 17 lines, from the file.

24EFH - Member 12 (LIST): the ASCII Listing

LINE=n passes over n - 1 lines, each ended by a carriage return, without a BREAK test; LINE=0 (or LINE=N, NO, OFF, an empty value: all 0000H) is counted down from 65535 and so passes over the whole file, and a LINE more than one past the last carriage return gives End of file encountered (B91). Each line may begin with its number (NUM), in the 00001 form the manual shows. Each byte read by @GET loses bit 7 unless ASCII8 is given; a tab is expanded to the next tab stop of the column counter unless TAB=OFF. At each new line, and after each byte with bit 7 set, CKPAWS tests BREAK and the pause key; CKPAWS changes Register A, so a byte 8DH is sent as a carriage return but does not end LIST's line (B97). The file's end ends the listing with a carriage return and the return code 0000H.

24EFLINPRM
LD BC,0001H 01 01 00
LINPRM: load Register Pair BC with the word at 24F0H, LINE's value, 0001H by default (source: p/u start line parm).
24F2
DEC BC 0B
Decrement Register Pair BC: the number of lines to pass over; LINE=0 gives FFFFH (source: count down for start).
24F3
LD A,B 78
Load Register A with Register B (source: ready to list?).
24F4
OR C B1
OR Register A with Register C: Z when no line is to be passed over.
24F5
If no line is to be passed over (Z) jump to BGNLIN at 2509H (source: go list/print if ready).
24F7
LD DE,27CCH 11 CC 27LD DE,FCB1
Load Register Pair DE with 27CCH, FCB1 (source: DE points to FCB).
24FAFND1ST
LD A,03H 3E 03
FND1ST: load Register A with 03H, SVC 3, @GET, which reads the next byte of the file in the FCB at Register Pair DE (source: get a character).
24FC
RST 28H EF
Call @GET with RST 28H (BOOT/SYS): Z with the byte in Register A, or NZ with Register A = the error.
24FD
If @GET failed (NZ) jump to IOERR at 2417H: a file with fewer carriage returns than LINE - 1 ends with End of file encountered (error 28) and that return code, not 0000H (source: error, abort).
2500
CP 0DH FE 0D
Compare Register A with 0DH, the carriage return that ends a line (source: end of line?).
2502
If it is not the end of a line (NZ) jump back to FND1ST at 24FAH (source: keep reading).
2504
DEC BC 0B
Decrement Register Pair BC, the lines left to pass over (source: dec line counter).
2505
LD A,B 78
Load Register A with Register B (source: finished).
2506
OR C B1
OR Register A with Register C: Z when all are passed over (source: ignoring lines?).
2507
If lines are left (NZ) jump back to FND1ST at 24FAH; after LINE=0 that is 65535 lines (B91) (source: no, loop until LINES=0).
2509BGNLIN
LD HL,(24F0H) 2A F0 24
BGNLIN: load Register Pair HL with the word at 24F0H, LINE's value, the number of the first line listed (source: p/u original line number).
250C
LD BC,275BH 01 5B 27LD BC,VARDOT
Load Register Pair BC with 275BH, VARDOT, the 5 digits of the line number (source: convert to decimal ASCII).
250F
Call CVTDEC at 26F3H to write Register Pair HL as 5 decimal digits at Register Pair BC, 275BH-275FH (source: and stuff into string).
2512GETCHR
LD DE,27CCH 11 CC 27LD DE,FCB1
GETCHR: load Register Pair DE with 27CCH, FCB1, at the start of each line (source: DE points to FCB).
2515
LD A,03H 3E 03
Load Register A with 03H, SVC 3, @GET (source: get a byte).
2517
RST 28H EF
Call @GET with RST 28H (BOOT/SYS): Z with the first byte of the line in Register A.
2518
If @GET failed (NZ) jump to GOTERR at 2577H, which ends the listing at the end of the file (source: go if read error).
251A
LD (2530H),A 32 30 25
Store Register A into 2530H, the operand of the LD A at PUCHAR (252FH), while the line number is shown (source: hang on to char).
251DNPARM
LD BC,0000H 01 00 00
NPARM: load Register Pair BC with the word at 251EH, NUM's value: 0000H in the file, FFFFH when NUM was given (source: p/u N parameter).
2520
LD A,B 78
Load Register A with Register B (source: was it entered?).
2521
OR C B1
OR Register A with Register C: Z when NUM was not given.
2522
If NUM was not given (Z) jump to PUCHAR at 252FH (source: no, do not print line number).
2524
LD HL,275BH 21 5B 27LD HL,VARDOT
Load Register Pair HL with 275BH, VARDOT, the line number, a full stop and a space, ended by 03H (source: HL points to buffer with line number).
2527
PUSH HL E5
Save Register Pair HL, 275BH, on the stack for 252BH (source: save ptr).
2528
Call PUTLINE at 26BDH to show the line number up to its 03H (source: output line at HL).
252B
POP HL E1
Restore Register Pair HL, 275BH, saved at 2527H (source: restore line number ptr).
252C
Call INCNUM at 2729H to add one to the line number at 275BH-275FH for the next line (source: increment line number).
252FPUCHAR
LD A,00H 3E 00
PUCHAR: load Register A with 00H, the operand at 2530H, which holds the first byte of the line stored at 251AH (source: p/u character).
2531DLOOP
RLCA 07
DLOOP: rotate Register A left: its bit 7 goes into the Carry flag and bit 0 (source: get HB into Carry flag).
2532A8PARM
LD DE,0000H 11 00 00
A8PARM: load Register Pair DE with the word at 2533H, the value of ASCII8 or A8: 0000H in the file, FFFFH when given (source: p/u A8 parm).
2535
INC D 14
Increment Register D (source: was it entered?).
2536
DEC D 15
Decrement Register D: Z when Register D is 00H, ASCII8 not given.
2537
If ASCII8 was given (NZ) jump to A8BIT at 253CH, which rotates the byte back whole (source: yes, do not change byte).
2539
SRL A CB 3F
Shift Register A right: the byte without its bit 7, with the old bit 7 in the Carry flag (source: reset bit 7).
253B
DEFB 1EH 1E
253BH: 1EH, the opcode of LD E,n: with the next byte, 0FH, it runs as LD E,0FH, which passes over the RRCA at A8BIT (source: LD E,nn instruction).
253CA8BIT
RRCA 0F
A8BIT: rotate Register A right: the byte back whole, its bit 7 in the Carry flag (source: use all 8 bits).
253D
PUSH AF F5
Save Register Pair AF on the stack for 2567H: Register A = the byte to show, the Carry flag = its bit 7 (source: save C flag).
253E
CP 09H FE 09
Compare Register A with 09H, the tab character (source: was it a tab?).
2540
If it is not a tab (NZ) jump to NOTTAB at 255DH (source: no, do not check TAB).
2542TPARM
LD DE,0008H 11 08 00
TPARM: load Register Pair DE with the word at 2543H, TAB's value, 0008H by default (source: p/u TAB parm (default=8)).
2545
INC E 1C
Increment Register E, the low byte of TAB's value (source: TAB = N?).
2546
DEC E 1D
Decrement Register E: Z when Register E is 00H, after TAB=OFF (or N, NO, an empty value: all 0000H).
2547
If tabs are not expanded (Z) jump to NOTTAB at 255DH, which sends the 09H on as it is (source: yes, do not expand).
2549
LD A,(27BBH) 3A BB 27LD A,(BYTCTR)
Load Register A with the byte at 27BBH, BYTCTR, the column, 0 to 79 (source: p/u column number).
254CTABEXP
LD C,08H 0E 08
TABEXP: load Register C with 08H, the width of a tab stop, stored at 254DH by 24BEH (source: p/u TAB expansion number).
254ECLOOP
SUB C 91
CLOOP: subtract Register C, the width of a tab stop, from Register A, the column.
254F
If no borrow (no Carry) jump back to CLOOP at 254EH: Register A ends as the column modulo the width, less the width.
2551
NEG ED 44
Negate Register A: the width less the column modulo the width, 1 to the width, the spaces to the next tab stop (source: subtract A from col number).
2553
LD B,A 47
Load Register B with Register A, the number of spaces (source: put number of spaces in B).
2554TP1
LD A,20H 3E 20
TP1: load Register A with 20H, a space (source: pad with a space).
2556
Call PUTOUT at 2667H to send the space and count its column (source: output character).
2559
Decrement Register B and jump back to TP1 at 2554H until all the spaces are sent (source: B spaces to output).
255B
Jump to WASTAB at 2560H (source: check byte counter).
255DNOTTAB
NOTTAB: call PUTOUT at 2667H to send the byte in Register A (source: print the character).
2560WASTAB
LD A,(27BBH) 3A BB 27LD A,(BYTCTR)
WASTAB: load Register A with the byte at 27BBH, BYTCTR, the column (source: p/u byte counter).
2563
OR A B7
OR Register A with itself: Z at column 0, after a carriage return, a line feed or the 80th column (source: if C/R printed).
2564
At column 0 (Z) call CKPAWS at 26C7H, which tests BREAK and the pause key (source: then check for PAUSE).
2567
POP AF F1
Restore Register Pair AF saved at 253DH: Register A = the byte, the Carry flag = its bit 7 (source: get back char).
2568
If the byte had bit 7 set (Carry) call CKPAWS at 26C7H too, which returns with Register A changed: Register C (the dispatcher enters each SVC with A = C) or, after a SHIFT-@ pause, KFLAG$ (source: if high bit was set).
256B
CP 0DH FE 0D
Compare Register A with 0DH, the carriage return. After a byte with bit 7 set Register A no longer holds the byte, so 8DH, sent as 0DH without ASCII8, starts a new screen line but not a new LIST line (no GETCHR, no number) (B97) (source: was it C/R?).
256D
If it was the end of a line (Z) jump back to GETCHR at 2512H for the next line and its number (source: yes, get new line).
256F
LD DE,27CCH 11 CC 27LD DE,FCB1
Load Register Pair DE with 27CCH, FCB1 (source: DE points to FCB).
2572
LD A,03H 3E 03
Load Register A with 03H, SVC 3, @GET (source: get a byte).
2574
RST 28H EF
Call @GET with RST 28H (BOOT/SYS): Z with the next byte of the line in Register A.
2575
If a byte was read (Z) jump back to DLOOP at 2531H (source: good, check character).
2577GOTERR
PUSH AF F5
GOTERR: save Register Pair AF, the error of @GET, on the stack for 257DH (source: save error code).
2578
LD A,0DH 3E 0D
Load Register A with 0DH, a carriage return, to end the last line: after a file whose last line has its own the listing ends with an empty line, which goes through the page count and can make LIST wait at a page pause before it ends (B98) (source: write end of line).
257A
Call PUTOUT at 2667H to send the carriage return.
257D
POP AF F1
Restore Register Pair AF, the error of @GET, saved at 2577H (source: rcvr error code).
257E
LD HL,0000H 21 00 00
Load Register Pair HL with 0000H, the return code at the end of the file (source: set HL = 0 (normal exit)).
2581
CP 1CH FE 1C
Compare Register A with 1CH, error 28, End of file encountered (source: EOF?).
2583GTBK
GTBK: if it is the end of the file (Z) jump to SAVESP at 2410H to return with Register Pair HL = 0000H (source: exit if so).
2586
CP 1DH FE 1D
Compare Register A with 1DH, error 29, Record number out of range (source: NRN > ERN?).
2588
If it is (Z) jump back to GTBK at 2583H, whose JP Z ends the listing with 0000H too (source: yes, leave).
258A
Jump to IOERR at 2417H with any other error of @GET (source: other, abort).

258DH - Member 12 (LIST): the Hex Listing

HEX positions the file to record REC (0 by default) and shows each record by lines of 16 bytes: a space, the record number and the offset in hex, an equals sign, the bytes in hex with an extra space after the eighth, and then the same bytes as characters, a full stop for one below 20H or above 7EH, on the same line, 79 columns in all (the manual's sample is the two line form of version 5). After the last line of a record comes a line with one space. A record of LRL bytes (only the low byte of LRL: 0 for 256, 300 for 44) is followed by the next until the end of the file. Each line's heading is shown before its first byte is read, so a file whose end falls on the end of a hex line shows one more heading with no bytes (B92). A REC at or past the end gives End of file encountered or Record number out of range from @POSN.

258DRPARM
LD BC,0000H 01 00 00
RPARM: load Register Pair BC with the word at 258EH, REC's value, 0000H by default (source: p/u starting record number).
2590
LD DE,27CCH 11 CC 27LD DE,FCB1
Load Register Pair DE with 27CCH, FCB1 (source: DE points to FCB).
2593
LD A,42H 3E 42
Load Register A with 42H, SVC 66, @POSN, which positions the file in the FCB at Register Pair DE to record Register Pair BC of FCB+9 bytes.
2595
RST 28H EF
Call @POSN with RST 28H (SYS0/SYS): Z when the file is positioned (source: position to record BC).
2596
If @POSN failed (NZ) jump to IOERR at 2417H with its error (source: abort on position error).
2599DOHEX
XOR A AF
DOHEX: XOR Register A with itself: Register A = 00H, the offset of the first line of a record (source: init byte counter to 0).
259A
LD (25B1H),A 32 B1 25
Store Register A, 00H, into 25B1H, the operand of the LD C at DOHEX1 (25B0H), the offset shown.
259D
LD DE,(258EH) ED 5B 8E 25
Load Register Pair DE with the word at 258EH, REC's value, the number of the record about to be shown (source: p/u record number).
25A1
LD HL,2764H 21 64 27
Load Register Pair HL with 2764H, the 4 hex digits in VARCLN (source: HL points to hex ASCII dest).
25A4
LD A,63H 3E 63
Load Register A with 63H, SVC 99, @HEX16, which writes Register Pair DE as 4 hex digits at Register Pair HL.
25A6
RST 28H EF
Call @HEX16 with RST 28H (BOOT/SYS): the record number at 2764H-2767H (source: convert DE to ASCII).
25A7
INC DE 13
Increment Register Pair DE, the number of the next record (source: bump by one).
25A8
LD (258EH),DE ED 53 8E 25
Store Register Pair DE into 258EH for the next record (source: and store for next time).
25ACLPARM
LD BC,0000H 01 00 00
LPARM: load Register Pair BC with the word at 25ADH, 0000H in the file: the record length, given by LRL or from DIR+4 (24A2H); Register C counts the bytes of the record left, 0 for 256 (source: p/u LRL).
25AFDISBYTE
PUSH BC C5
DISBYTE: save Register Pair BC, the bytes left, on the stack for 25B8H (source: save bytes left in rec).
25B0DOHEX1
LD C,00H 0E 00
DOHEX1: load Register C with 00H, the operand at 25B1H, the offset of the line in the record (source: p/u byte counter).
25B2
LD HL,2769H 21 69 27LD HL,VAREQU
Load Register Pair HL with 2769H, the 2 hex digits in VAREQU (source: HL points to hex ASCII dest).
25B5
LD A,62H 3E 62
Load Register A with 62H, SVC 98, @HEX8, which writes Register C as 2 hex digits at Register Pair HL.
25B7
RST 28H EF
Call @HEX8 with RST 28H (BOOT/SYS): the offset at 2769H-276AH (source: cvrt C to ASCII at HL).
25B8
POP BC C1
Restore Register Pair BC, the bytes left, saved at 25AFH (source: BC = bytes left in rec).
25B9
LD HL,2763H 21 63 27LD HL,VARCLN
Load Register Pair HL with 2763H, VARCLN, the heading of the line: a space, the record number, a colon, the offset and an equals sign, ended by 03H (source: HL points to display buffer).
25BC
Call PUTLINE at 26BDH to show the heading (source: display rec number byte).
25BF
LD A,(25B1H) 3A B1 25
Load Register A with the byte at 25B1H, the offset of this line (source: p/u byte counter).
25C2
LD B,10H 06 10
Load Register B with 10H, the 16 bytes of a line (source: set B = 16 bytes).
25C4
ADD A,B 80
Add Register B to Register A: the offset of the next line (source: add 16 to byte count).
25C5
LD (25B1H),A 32 B1 25
Store Register A into 25B1H for the next line (source: and stuff into LD C inst).
25C8
LD HL,27BCH 21 BC 27LD HL,LINBUF
Load Register Pair HL with 27BCH, LINBUF, after the member, where the bytes of the line are kept for their characters (source: HL points to line buffer).
25CBDOHEX2
LD DE,27CCH 11 CC 27LD DE,FCB1
DOHEX2: load Register Pair DE with 27CCH, FCB1 (source: DE points to FCB).
25CE
LD A,03H 3E 03
Load Register A with 03H, SVC 3, @GET (source: get a byte).
25D0
RST 28H EF
Call @GET with RST 28H (BOOT/SYS): Z with the next byte in Register A.
25D1
If a byte was read (Z) jump to DOHEX4 at 25DEH, whose JR NZ falls through (source: good, stuff byte).
25D3
PUSH AF F5
Save Register Pair AF, the error, on the stack for 25DDH (source: save error code).
25D4
CP 1CH FE 1C
Compare Register A with 1CH, error 28, End of file encountered (source: EOF?).
25D6
If it is the end of the file (Z) jump to DOHEX3 at 25DDH (source: yes, okay).
25D8
CP 1DH FE 1D
Compare Register A with 1DH, error 29, Record number out of range (source: NRN > ERN?).
25DA
If it is another error (NZ) jump to IOERR at 2417H with it; SAVESP drops what is on the stack (source: another error).
25DDDOHEX3
POP AF F1
DOHEX3: restore Register Pair AF, the error with NZ, saved at 25D3H (source: recover error code).
25DEDOHEX4
DOHEX4: at the end of the file (NZ) jump to DOHEX5 at 25F8H to end the line (source: bypass if at end of file).
25E0
LD (HL),A 77
Store Register A, the byte, into the line buffer at Register Pair HL (source: stuff byte in buffer).
25E1
INC HL 23
Increment Register Pair HL to the next place of the line buffer (source: bump ptr).
25E2
Call CVTHEX at 2656H to send the byte as 2 hex digits (source: output the byte in hex).
25E5
LD A,20H 3E 20
Load Register A with 20H, a space (source: followed by a space).
25E7
Call PUTOUT at 2667H to send the space that follows each hex byte.
25EA
LD A,B 78
Load Register A with Register B, the bytes of the line left, this one included (source: p/u byte counter).
25EB
CP 09H FE 09
Compare Register A with 09H: Z after the eighth byte (source: halfway yet?).
25ED
After the eighth byte (Z) call WR1SPA at 26B9H to send one more space (source: yes, display space).
25F0
DEC B 05
Decrement Register B, the bytes of the line left (source: count down).
25F1
DEC C 0D
Decrement Register C, the bytes of the record left; from 0 it goes to FFH, so a record length of 0 gives 256 (source: count down the LRL).
25F2
If the record is done (Z) jump to DOHEX5 at 25F8H (source: done, get next record).
25F4
LD A,B 78
Load Register A with Register B (source: done with line?).
25F5
OR A B7
OR Register A with itself: Z when the 16 bytes of the line are done.
25F6
If bytes of the line are left (NZ) jump back to DOHEX2 at 25CBH (source: no, do til 16 chars).
25F8DOHEX5
PUSH AF F5
DOHEX5: save Register Pair AF on the stack for 2629H: NZ at the end of the file, Z otherwise (source: end the line).
25F9
LD A,B 78
Load Register A with Register B, the places of the line not filled (source: p/u byte counter).
25FA
CP 10H FE 10
Compare Register A with 10H: Z when the line has no byte at all.
25FC
If the line is empty (Z) jump to PRTLIN2 at 2624H to end it at once (source: yes, get another record).
25FEPRTLIN
PUSH BC C5
PRTLIN: save Register Pair BC, the counters, on the stack for 260DH (source: save counters).
25FF
LD A,B 78
Load Register A with Register B, the places not filled (source: p/u number of chars not printed).
2600
ADD A,A 87
Add Register A to itself: twice the places (source: x 2).
2601
ADD A,B 80
Add Register B to Register A: three times, the width of the missing hex bytes (source: x 3).
2602
LD B,A 47
Load Register B with Register A (source: stuff in B).
2603
CP 1BH FE 1B
Compare Register A with 1BH: Carry when fewer than 9 places are empty, so that the extra space after the eighth byte was sent (source: need extra space if).
2605
CCF 3F
Complement the Carry flag: Carry when 9 or more places are empty and the extra space is missing (source: not halfway).
2606
LD A,01H 3E 01
Load Register A with 01H, one space before the characters (source: plus 1 more space).
2608
ADC A,B 88
Add Register B and the Carry flag to Register A: the spaces to send (source: carry set for 3 spaces).
2609
LD B,A 47
Load Register B with Register A, the count for WRSPA (source: set loop counter).
260A
Call WRSPA at 26B3H to send Register B spaces (source: output B spaces).
260D
POP BC C1
Restore Register Pair BC, the counters, saved at 25FEH (source: recover the counters).
260E
LD A,10H 3E 10
Load Register A with 10H (source: get number to print).
2610
SUB B 90
Subtract Register B, the places not filled, from Register A: the bytes of the line.
2611
LD B,A 47
Load Register B with Register A, the count for the DJNZ (source: xfer to B for DJNZ).
2612
LD HL,27BCH 21 BC 27LD HL,LINBUF
Load Register Pair HL with 27BCH, LINBUF, the bytes of the line (source: HL points to line buffer).
2615
PUSH BC C5
Save Register Pair BC on the stack for 2623H, as Register C is used for the space after 8 characters (source: save C).
2616
LD C,08H 0E 08
Load Register C with 08H, a space after the eighth character (source: space after 8).
2618PRTLIN1
LD A,(HL) 7E
PRTLIN1: load Register A with the byte at Register Pair HL, a byte of the line (source: p/u character).
2619
INC HL 23
Increment Register Pair HL (source: bump ptr).
261A
Call CVTDOT at 264AH to send it as a character, or as a full stop (source: output each char).
261D
DEC C 0D
Decrement Register C, the characters before the space after the eighth (source: space yet?).
261E
After the eighth character (Z) call WR1SPA at 26B9H to send a space (source: yes, display space).
2621
Decrement Register B and jump back to PRTLIN1 at 2618H until the bytes of the line are sent (source: output line).
2623
POP BC C1
Restore Register Pair BC saved at 2615H: Register C = the bytes of the record left (source: recover C).
2624PRTLIN2
LD A,0DH 3E 0D
PRTLIN2: load Register A with 0DH, a carriage return (source: output C/R).
2626
Call PUTOUT at 2667H to end the line, which counts a line of the page.
2629
POP AF F1
Restore Register Pair AF saved at 25F8H: NZ at the end of the file (source: recover @GET ret code).
262A
LD A,1CH 3E 1C
Load Register A with 1CH, error 28, End of file encountered; the LD leaves the flags (source: init to EOF).
262C
At the end of the file (NZ) jump to GOTERR at 2577H, which sends one more carriage return and returns 0000H (source: end of file, abort).
262F
Call CKPAWS at 26C7H to test BREAK and the pause key after each line (source: PAUSE or BREAK?).
2632
LD A,C 79
Load Register A with Register C, the bytes of the record left (source: p/u number of bytes left).
2633
OR A B7
OR Register A with itself: Z when the record is done (source: finished?).
2634
If bytes of the record are left (NZ) jump back to DISBYTE at 25AFH for the next line, whose heading is shown before its first byte is read, even when the file has ended there (B92) (source: no, get next line).
2637
LD A,20H 3E 20
Load Register A with 20H, a space (source: space).
2639
Call PUTOUT at 2667H to send it: the line after a record holds one space.
263C
LD A,0DH 3E 0D
Load Register A with 0DH, a carriage return (source: carriage return).
263E
Call PUTOUT at 2667H to end that line, the blank line after each record.
2641
LD HL,2763H 21 63 27LD HL,VARCLN
Load Register Pair HL with 2763H, VARCLN (source: HL points to line number).
2644
Call INCNUM at 2729H, which adds one, as a decimal digit, to the last record digit at 2767H and carries left over every digit 9 to F; DOHEX writes 2764H-2767H with @HEX16 again, but when all four digits are 9 to F (first after record 9999H) the carry reaches 2763H, VARCLN's leading space, and the headings read 1999A, 2999B (B99) (source: increment).
2647
Jump to DOHEX at 2599H for the next record, whose heading is shown before its first byte is read, even when the file has ended (B92) (source: loop for more).

264AH - Member 12 (LIST): the Output and the Page Pause

PUTOUT sends every byte, by @DSP or, with P, by @PRT, and keeps the column counter BYTCTR: 6.3.1 wraps it at 80 and sets it to 0 at a carriage return or a line feed. At column 0 the 6.3.1 page pause counts a line, unless P or NS put a value other than 0000H into SPARM+1: after 23 lines of the ASCII listing (17 of the hex one, a record of 256 bytes and its blank line) it waits for a key. BREAK ends the listing; C or c turns the rest of it to non-stop, as @KEY returns Register Pair DE = 0208H, the keyboard's DCB, which is stored over the 0000H; any other key goes on. After any key but BREAK the hex listing clears the screen with @CLS, whose RST 28H the ASCII listing has turned into a NOP. The pause also counts the carriage returns that end the listing (B98). The 6.3.1 PUTOUT returns with Register A changed, so PUTLINE no longer stops at a carriage return.

264ACVTDOT
CP 20H FE 20
CVTDOT: compare Register A with 20H: Carry for a control character (source: do not print controls).
264C
If it is below 20H (Carry) jump to CVTDOT1 at 2652H to show a full stop.
264E
CP 7FH FE 7F
Compare Register A with 7FH: Carry for 20H-7EH (source: print X'20' thru X'7E').
2650
If it can be shown (Carry) jump to PUTOUT at 2667H to send it.
2652CVTDOT1
LD A,2EH 3E 2E
CVTDOT1: load Register A with 2EH, a full stop, for 7FH-FFH and the control characters (source: otherwise change to full stop).
2654
Jump to PUTOUT at 2667H to send the full stop.
2656CVTHEX
PUSH AF F5
CVTHEX: save Register Pair AF, the byte, on the stack for 265EH (source: save lower digit).
2657
RRCA 0F
Rotate Register A right (source: get most sig nibble).
2658
RRCA 0F
Rotate Register A right, the second of four rotations.
2659
RRCA 0F
Rotate Register A right, the third of four rotations.
265A
RRCA 0F
Rotate Register A right: the high 4 bits of the byte are now its low 4 bits.
265B
Call CVTH1 at 265FH to send them as a hex digit (source: output upper nibble).
265E
POP AF F1
Restore Register Pair AF, the byte, saved at 2656H, and fall into CVTH1 for the low digit (source: recover number).
265FCVTH1
AND 0FH E6 0F
CVTH1: AND Register A with 0FH, which leaves the low 4 bits (source: mask off upper nibble).
2661
ADD A,90H C6 90
Add 90H to Register A: 90H-99H for 0-9, 9AH-9FH for 0AH-0FH (source: convert to hex digit).
2663
DAA 27
Decimal adjust Register A: 0-9 give 90H-99H with no Carry, 0AH-0FH give 00H-05H with Carry.
2664
ADC A,40H CE 40
Add 40H and the Carry flag to Register A: D0H-D9H, or 41H-46H.
2666
DAA 27
Decimal adjust Register A: 30H-39H for 0-9, 41H-46H (A to F) for 0AH-0FH, and fall into PUTOUT.
2667PUTOUT
PUSH BC C5
PUTOUT: save Register Pair BC on the stack for 2687H (source: save BC).
2668
LD C,A 4F
Load Register C with Register A, the byte to send (source: xfer char to C).
2669PUTOUT1
LD A,02H 3E 02
PUTOUT1: load Register A with 02H, SVC 2, @DSP, the operand at 266AH that P changes to 06H, @PRT (source: @DSP or @PRT SVC number).
266B
RST 28H EF
Call @DSP or @PRT with RST 28H (BOOT/SYS) to send Register C to the video or the printer.
266C
If the device failed (NZ) jump to IOERR at 2417H with its error, as Device not available from the printer (source: NZ, I/O error).
266F
PUSH HL E5
Save Register Pair HL on the stack for 2686H (source: save HL).
2670
LD HL,27BBH 21 BB 27LD HL,BYTCTR
Load Register Pair HL with 27BBH, BYTCTR, the column counter, after the member (source: HL points to byte counter).
2673
INC (HL) 34
Increment the byte at Register Pair HL, the column (source: bump counter).
2674
LD A,(HL) 7E
Load Register A with the byte at Register Pair HL, the new column (a 6.3.1 addition: the column wraps at 80).
2675
SUB 50H D6 50
Subtract 50H, 80, the width of a screen line, from Register A, the column.
2677
If the column is below 80 (Carry) jump to L267A at 267AH.
2679
LD (HL),A 77
Store Register A, the column less 80, into BYTCTR at Register Pair HL: the screen line wraps, 0 after the 80th column.
267AL267A
LD A,C 79
L267A: load Register A with Register C, the byte sent.
267B
SUB 0AH D6 0A
Subtract 0AH, the line feed, from Register A.
267D
If it was a line feed (Z) jump to L2683 at 2683H with Register A = 00H.
267F
SUB 03H D6 03
Subtract 03H from Register A: Z for 0DH, the carriage return, with Register A = 00H.
2681
If it was not a carriage return (NZ) jump to L2684 at 2684H.
2683L2683
LD (HL),A 77
L2683: store Register A, 00H, into BYTCTR at Register Pair HL: a line feed or a carriage return starts column 0.
2684L2684
INC (HL) 34
L2684: increment the byte at Register Pair HL, BYTCTR.
2685
DEC (HL) 35
Decrement the byte at Register Pair HL, BYTCTR, again: Z when the column is 0, a new line on the screen or the printer.
2686
POP HL E1
Restore Register Pair HL saved at 266FH; POP leaves the flags.
2687
POP BC C1
Restore Register Pair BC saved at 2667H, with Register C = the byte sent.
2688
RET NZ C0
Return when the column is not 0 (NZ), with Register A changed, no longer the byte sent.
2689SPARM
LD DE,0000H 11 00 00
SPARM: load Register Pair DE with the word at 268AH: 0000H, or a value other than 0000H after NS (FFFFH), P (24D0H) or the key C at a pause (26A6H) (a 6.3.1 addition).
268C
LD A,D 7A
Load Register A with Register D, the high byte of the value at 268AH.
268D
OR E B3
OR Register A with Register E: Z when the listing pauses by pages.
268E
RET NZ C0
Return in non-stop mode (NZ): no pause after NS, P or the key C.
268F
LD A,11H 3E 11
Load Register A with 11H, the operand at 2690H: the lines left on this page (17 in the file for the hex listing; 23 stored by 24E9H for the ASCII listing).
2691
DEC A 3D
Decrement Register A, for the line just ended.
2692
LD (2690H),A 32 90 26LD (L2690),A
Store Register A into 2690H, the operand of the LD A at 268FH, the lines left on the page.
2695
RET NZ C0
Return while lines are left on the page (NZ).
2696
LD A,01H 3E 01
Load Register A with 01H, SVC 1, @KEY, which waits for a key.
2698
RST 28H EF
Call @KEY with RST 28H (BOOT/SYS): Register A = the key; @KBD leaves Register Pair DE = 0208H, the keyboard's DCB.
2699
CP 80H FE 80
Compare Register A with 80H, the BREAK key, which ends the listing at the pause.
269B
If BREAK was pressed (Z) jump to GOTBRK at 26EBH, which ends the listing.
269E
SUB 43H D6 43
Subtract 43H, the letter C, from Register A, the key: Z for C.
26A0
If the key was C (Z) jump to L26A6 at 26A6H, which turns the pause off.
26A2
SUB 20H D6 20
Subtract 20H from Register A: Z for 63H, the letter c.
26A4
If the key was not c (NZ) jump to L26AA at 26AAH: the next page.
26A6L26A6
LD (268AH),DE ED 53 8A 26
L26A6: store Register Pair DE, 0208H, into 268AH, SPARM+1: the rest of the listing runs non-stop, as the manual says of the key C; it falls into L26AA, so the hex listing clears the screen for C too.
26AAL26AA
LD A,69H 3E 69
L26AA: load Register A with 69H, SVC 105, @CLS, which clears the screen.
26ACL26AC
RST 28H EF
L26AC: call @CLS with RST 28H for the hex listing; in the ASCII listing this byte is 00H (24E4H), a NOP, and the screen is not cleared.
26AD
LD A,11H 3E 11
Load Register A with 11H, the operand at 26AEH: the lines of a page, 17 for the hex listing, 23 (17H) stored by 24ECH for the ASCII listing.
26AF
LD (2690H),A 32 90 26LD (L2690),A
Store Register A into 2690H, the lines left, for the new page.
26B2
RET C9
Return to the caller of PUTOUT after the pause, with the new page begun.
26B3WRSPA
WRSPA: call WR1SPA at 26B9H to send a space (source: write a space).
26B6
Decrement Register B and jump back to WRSPA at 26B3H until Register B spaces are sent (source: do it B times).
26B8
RET C9
Return to the caller of WRSPA once Register B spaces are sent.
26B9WR1SPA
LD A,20H 3E 20
WR1SPA: load Register A with 20H, a space (source: space character).
26BB
Jump to PUTOUT at 2667H to send it; PUTOUT's RET returns to the caller of WR1SPA.
26BDPUTLINE
LD A,(HL) 7E
PUTLINE: load Register A with the byte at Register Pair HL (source: p/u byte).
26BE
INC HL 23
Increment Register Pair HL (source: prepare for next).
26BF
CP 03H FE 03
Compare Register A with 03H, the end of the text (source: check if done).
26C1
RET Z C8
Return at the 03H (Z) that ends the text at Register Pair HL.
26C2
Call PUTOUT at 2667H to send the byte (source: char OK output it).
26C5
Jump back to PUTLINE at 26BDH for the next byte; the 6.3.0 test for a carriage return is left out, as PUTOUT now changes Register A.
26C7CKPAWS
LD A,65H 3E 65
CKPAWS: load Register A with 65H, SVC 101, @FLAGS, which points Index Register IY at the flag table (source: IY points to system flags).
26C9
RST 28H EF
Call @FLAGS with RST 28H (SYS0/SYS): Index Register IY = 006AH.
26CA
LD A,6AH 3E 6A
Load Register A with 6AH, SVC 106, @CKBRKC, which tests and clears the BREAK key (source: BREAK hit?).
26CC
RST 28H EF
Call @CKBRKC with RST 28H (BOOT/SYS): NZ when BREAK has been pressed.
26CD
If BREAK was pressed (NZ) jump to GOTBRK at 26EBH (source: quit if so).
26CF
BIT 1,(IY+0AH) FD CB 0A 4E
Test bit 1 of KFLAG$ (IY+0AH, 0074H), the pause bit, which SHIFT-@ sets. Index Register IY holds 006AH from @FLAGS (source: is the PAUSE bit set?).
26D3
RET Z C8
Return when no pause was asked for (Z) (source: return if not SHIFT-@).
26D4CKWAIT
LD A,01H 3E 01
CKWAIT: load Register A with 01H, SVC 1, @KEY (source: wait for key press).
26D6
RST 28H EF
Call @KEY with RST 28H (BOOT/SYS): Register A = the key.
26D7CKWAIT1
CP 60H FE 60
CKWAIT1: compare Register A with 60H, SHIFT-@ (source: was key a SHIFT-@?).
26D9
If it was SHIFT-@ again (Z) jump back to CKWAIT at 26D4H (source: ignore if it was).
26DB
CP 80H FE 80
Compare Register A with 80H, the BREAK key (source: was key a break?).
26DD
If BREAK was pressed (Z) jump to GOTBRK at 26EBH (source: quit if so).
26DFRESKFL
LD A,65H 3E 65
RESKFL: load Register A with 65H, SVC 101, @FLAGS (source: IY points to flag table).
26E1
RST 28H EF
Call @FLAGS with RST 28H (SYS0/SYS): Index Register IY = 006AH.
26E2
LD A,(IY+0AH) FD 7E 0A
Load Register A with KFLAG$ (IY+0AH, 0074H). Index Register IY holds 006AH (source: p/u KFLAG$).
26E5
AND F9H E6 F9
AND Register A with F9H, which clears bit 1 (pause) and bit 2 (ENTER) (source: reset pause and enter).
26E7
LD (IY+0AH),A FD 77 0A
Store Register A into KFLAG$ (IY+0AH, 0074H). Index Register IY holds 006AH (source: stuff into KFLAG$).
26EA
RET C9
Return to the caller of RESKFL with the pause and ENTER bits clear.
26EBGOTBRK
LD A,0DH 3E 0D
GOTBRK: load Register A with 0DH, a carriage return, to end the line on the screen (source: send end of line).
26ED
Call PUTOUT at 2667H to send it (source: output byte); the carriage return goes through the page count, so a BREAK on the last line of a page first waits at a page pause (B98).
26F0
Jump to ABORT at 2428H to return FFFFH (source: and abort due to BREAK).

26F3H - Member 12 (LIST): CVTDEC, INCNUM and OPEN

CVTDEC writes a line number as 5 decimal digits. It means to blank a leading 0 whose place before it holds a space, but the place before the first digit is 275AH, the carriage return of SPCREQ$, so every 0 is kept and the numbers read 00001, as the manual shows them. INCNUM adds one to the last digit of a number in place, carrying into the digits before it (a space counts as 0). OPEN opens FCB1 with SFLAG$ bit 0 set and the buffer at 2900H.

26F3CVTDEC
LD DE,2710H 11 10 27
CVTDEC: load Register Pair DE with 2710H, 10000, the divisor of the first digit (source: divide by 10000).
26F6
Call CVD1 at 270EH to write the ten thousands at Register Pair BC.
26F9
LD DE,03E8H 11 E8 03
Load Register Pair DE with 03E8H, 1000 (source: divide by 1000).
26FC
Call CVD1 at 270EH to write the thousands at Register Pair BC.
26FF
LD DE,0064H 11 64 00
Load Register Pair DE with 0064H, 100 (source: divide by 100).
2702
Call CVD1 at 270EH to write the hundreds at Register Pair BC.
2705
LD DE,000AH 11 0A 00
Load Register Pair DE with 000AH, 10 (source: divide by 10).
2708
Call CVD1 at 270EH to write the tens at Register Pair BC.
270B
LD DE,0001H 11 01 00
Load Register Pair DE with 0001H, 1, and fall into CVD1 for the units (source: divide by 1).
270ECVD1
XOR A AF
CVD1: XOR Register A with itself: Register A = 00H, the digit, and the Carry flag clear (source: clear carry set A=0).
270FCVD2
SBC HL,DE ED 52
CVD2: subtract Register Pair DE, the divisor, from Register Pair HL with the Carry flag (source: subtract divisor).
2711
If it went below 0 (Carry) jump to CVD3 at 2716H.
2713
INC A 3C
Increment Register A, the digit (source: bump counter).
2714
Jump back to CVD2 at 270FH; the Carry flag is clear after the SBC that did not borrow (source: subtract until a carry).
2716CVD3
ADD HL,DE 19
CVD3: add Register Pair DE back to Register Pair HL: the remainder (source: HL = new quotient).
2717
ADD A,30H C6 30
Add 30H to Register A: the digit's character (source: A = ASCII numeric digit).
2719
CP 30H FE 30
Compare Register A with 30H, the digit 0 (source: zero?).
271B
If the digit is not 0 (NZ) jump to CVD4 at 2726H to store it (source: no, stuff in buff (BC)).
271D
DEC BC 0B
Decrement Register Pair BC to the place before (source: backspace buff ptr).
271E
LD A,(BC) 0A
Load Register A with the byte at Register Pair BC, the place before: for the first digit 275AH, the carriage return that ends SPCREQ$, never a space (source: p/u last char).
271F
INC BC 03
Increment Register Pair BC back to the digit's place (source: bump to current).
2720
CP 20H FE 20
Compare Register A with 20H, a space (source: last char a space?).
2722
If the place before is a space (Z) jump to CVD4 at 2726H to store that space for the 0; this never happens (source: yes, do not use lead 0).
2724
LD A,30H 3E 30
Load Register A with 30H, the digit 0 (source: no, use zero).
2726CVD4
LD (BC),A 02
CVD4: store Register A, the digit, into the place at Register Pair BC (source: stuff char in buff).
2727
INC BC 03
Increment Register Pair BC to the next place (source: bump ptr).
2728
RET C9
Return to CVTDEC, or from the units to its caller.
2729INCNUM
INC HL 23
INCNUM: increment Register Pair HL (source: point to lo-order digit).
272A
INC HL 23
Increment Register Pair HL, the third place of the number.
272B
INC HL 23
Increment Register Pair HL, the fourth place of the number.
272C
INC HL 23
Increment Register Pair HL: Register Pair HL = the fifth place, the last digit.
272DINCNUM1
LD A,(HL) 7E
INCNUM1: load Register A with the byte at Register Pair HL, a digit (source: p/u digit).
272E
OR 30H F6 30
OR Register A with 30H: a space becomes the digit 0 (source: start with possible 0).
2730
INC A 3C
Increment Register A, the digit plus one (source: add 1).
2731
LD (HL),A 77
Store Register A into the place at Register Pair HL (source: restuff).
2732
SUB 3AH D6 3A
Subtract 3AH from Register A: Carry when the digit is 9 or less (source: see if went to 10).
2734
RET C D8
Return when there is no carry into the place before (Carry).
2735
LD (HL),30H 36 30
Store 30H, the digit 0, into the place at Register Pair HL (source: make it 0).
2737
DEC HL 2B
Decrement Register Pair HL to the place before (source: back up one).
2738
Jump back to INCNUM1 at 272DH to carry into it; after line 99999 the carry runs on into SPCREQ$ at 275AH and before.
273AOPEN
LD A,65H 3E 65
OPEN: load Register A with 65H, SVC 101, @FLAGS, which points Index Register IY at the flag table (source: IY points to system flags).
273C
RST 28H EF
Call @FLAGS with RST 28H (SYS0/SYS): Index Register IY = 006AH.
273D
SET 0,(IY+12H) FD CB 12 C6
Set bit 0 of SFLAG$ (IY+12H, 007CH): the next @OPEN neither tests nor sets the file's open bit (OPNCB returns at once) and clears the bit again. Index Register IY holds 006AH from @FLAGS (source: p/u SFLAG$).
2741
LD HL,2900H 21 00 29LD HL,IOBUFF
Load Register Pair HL with 2900H, IOBUFF, the file's buffer, after the member on the next page boundary (source: HL points to I/O buffer).
2744
LD A,3BH 3E 3B
Load Register A with 3BH, SVC 59, @OPEN, which opens the file in the FCB at Register Pair DE with the record length Register B and the buffer at Register Pair HL.
2746
RST 28H EF
Call @OPEN with RST 28H (SYS2/SYS): Z when the file is open, NZ with Register A = the error (source: open the file).
2747
RET C9
Return with the flags of @OPEN (source: and return with condition).

2748H - Member 12 (LIST): the Texts and PRMTBL$

The message, the line number and hex heading texts, the default extension and the parameter table of 6.3.1, with NS added and NUM no longer abbreviated to N (which now means NS). Each entry is a type byte (bit 7 a number, bit 6 a flag, bit 4 may be abbreviated, bits 3-0 the length of the name), the name, a response byte that @PARAM sets, and the address where @PARAM stores the value: the operand of an LD in the code. BYTCTR (27BBH), LINBUF (27BCH-27CBH), FCB1 (27CCH-27EBH), FCB2 (27ECH-280BH) and IOBUFF (2900H-29FFH) lie after the member and have no rows.

2748-275ASPCREQ$
DEFM "File spec required" / DEFB 0DH 46 69 6C 65 20 73 70 65 63 20 72 65 71 75 69 72 65 64 0D
SPCREQ$, 2748H-275AH: the message SPCREQ shows (2422H); its carriage return at 275AH is the byte CVTDEC finds before the first digit of a line number (271EH).
275B-2762VARDOT
DEFM " . " / DEFB 03H 20 20 20 20 20 2E 20 03
VARDOT, 275BH-2762H: 5 places for the line number (CVTDEC, INCNUM), a full stop and a space, ended by 03H for PUTLINE (2528H).
2763-2768VARCLN
DEFM " :" 20 20 20 20 20 3A
VARCLN, 2763H-2768H: a space, 4 places for the record number (@HEX16 at 2764H) and a colon; PUTLINE runs on into VAREQU (25BCH).
2769-276FVAREQU
DEFM "XX = " / DEFB 03H 58 58 20 3D 20 20 03
VAREQU, 2769H-276FH: 2 places for the offset (@HEX8 at 2769H), a space, an equals sign and 2 spaces, ended by 03H.
2770-2772TXTEXT
DEFM "TXT" 54 58 54
TXTEXT, 2770H-2772H: TXT, the default extension @FEXT gives the spec (2468H).
2773PRMTBL$
DEFB 80H 80
PRMTBL$, 2773H: 80H, the mark of the 6.x table form that @PARAM reads (2440H).
2774
DEFB 46H 46
2774H: type 46H, a flag, a name of 6 characters, not abbreviated.
2775-277A
DEFM "ASCII8" 41 53 43 49 49 38
2775H-277AH: the name ASCII8, all 8 bits of each byte shown.
277B
DEFB 00H 00
277BH: the response byte of ASCII8, cleared and set by @PARAM.
277C-277D
DEFW 2533H 33 25
277CH-277DH: 2533H, A8PARM+1, the operand of the LD DE at 2532H.
277E
DEFB 42H 42
277EH: type 42H, a flag, a name of 2 characters.
277F-2780
DEFM "A8" 41 38
277FH-2780H: the name A8, the same parameter.
2781
DEFB 00H 00
2781H: the response byte of A8, cleared and set by @PARAM.
2782-2783
DEFW 2533H 33 25
2782H-2783H: 2533H, A8PARM+1 again, the same value word as ASCII8's.
2784
DEFB 84H 84
2784H: type 84H, a number, a name of 4 characters.
2785-2788
DEFM "LINE" 4C 49 4E 45
2785H-2788H: the name LINE, the first line to list.
2789
DEFB 00H 00
2789H: the response byte of LINE, cleared and set by @PARAM.
278A-278B
DEFW 24F0H F0 24
278AH-278BH: 24F0H, LINPRM+1, the operand of the LD BC at 24EFH.
278C
DEFB 43H 43
278CH: type 43H, a flag, a name of 3 characters, no longer abbreviated in 6.3.1 (6.3.0: 53H).
278D-278F
DEFM "NUM" 4E 55 4D
278DH-278FH: the name NUM, line numbers at the start of each line.
2790
DEFB 00H 00
2790H: the response byte of NUM, cleared and set by @PARAM.
2791-2792
DEFW 251EH 1E 25
2791H-2792H: 251EH, NPARM+1, the operand of the LD BC at 251DH.
2793
DEFB 52H 52
2793H: type 52H, a flag that may be abbreviated (N), a name of 2 characters (a 6.3.1 addition).
2794-2795
DEFM "NS" 4E 53
2794H-2795H: the name NS, non-stop: no page pause (6.3.1).
2796
DEFB 00H 00
2796H: the response byte of NS, cleared and set by @PARAM.
2797-2798
DEFW 268AH 8A 26
2797H-2798H: 268AH, SPARM+1, the operand of the LD DE at 2689H.
2799
DEFB 53H 53
2799H: type 53H, a flag that may be abbreviated (H), a name of 3 characters.
279A-279C
DEFM "HEX" 48 45 58
279AH-279CH: the name HEX, the hex listing of the records.
279D
DEFB 00H 00
279DH: the response byte of HEX, cleared and set by @PARAM.
279E-279F
DEFW 24DAH DA 24
279EH-279FH: 24DAH, HPARM+1, the operand of the LD BC at 24D9H.
27A0
DEFB 93H 93
27A0H: type 93H, a number that may be abbreviated (R), a name of 3 characters.
27A1-27A3
DEFM "REC" 52 45 43
27A1H-27A3H: the name REC, the first record of the hex listing.
27A4
DEFB 00H 00
27A4H: the response byte of REC, cleared and set by @PARAM.
27A5-27A6
DEFW 258EH 8E 25
27A5H-27A6H: 258EH, RPARM+1, the operand of the LD BC at 258DH.
27A7
DEFB 93H 93
27A7H: type 93H, a number that may be abbreviated (L), a name of 3 characters.
27A8-27AA
DEFM "LRL" 4C 52 4C
27A8H-27AAH: the name LRL, the record length.
27ABLRESP
DEFB 00H 00
LRESP, 27ABH: the response byte of LRL, tested at 2497H.
27AC-27AD
DEFW 25ADH AD 25
27ACH-27ADH: 25ADH, LPARM+1, the operand of the LD BC at 25ACH.
27AE
DEFB 41H 41
27AEH: type 41H, a flag, a name of 1 character.
27AF
DEFM "P" 50
27AFH: the name P, the output to the printer instead of the video.
27B0
DEFB 00H 00
27B0H: the response byte of P, cleared and set by @PARAM.
27B1-27B2
DEFW 24CAH CA 24
27B1H-27B2H: 24CAH, PPARM+1, the operand of the LD BC at 24C9H.
27B3
DEFB 53H 53
27B3H: type 53H, a flag that may be abbreviated (T), a name of 3 characters; a number is taken as well, as @PARAM does not test the kind.
27B4-27B6
DEFM "TAB" 54 41 42
27B4H-27B6H: the name TAB, the width of the tab stops.
27B7TRESP
DEFB 00H 00
TRESP, 27B7H: the response byte of TAB, tested at 24AFH.
27B8-27B9
DEFW 2543H 43 25
27B8H-27B9H: 2543H, TPARM+1, the operand of the LD DE at 2542H.
27BA
DEFB 00H 00
27BAH: 00H, the end of the table, the last byte of member 12.

2400H - Member 13 (DO): the Entry, the Control Character and the Compile Set-up

SYS1/SYS runs DO with request 91H; its header points at member 13, which the overlay loader reads to 2400H-298BH, 29DDH-2ACDH, 2B6EH-2B70H, 2B90H-2B9DH and 2E00H (1679 bytes) and enters at 2400H with Register Pair HL at the first character after DO and its spaces. DO keeps its Stack Pointer for EXTERR's exit, reads the control character (an asterisk runs SYSTEM/JCL again, an equal sign runs the file without compiling it, a dollar sign compiles it only), reads the spec of the JCL file into DOFCB and opens it, then looks for the first drive that is ready and not write protected (6.3.1), puts its number into SYSTEM/JCL:d and creates or opens that file through JFCB$ (00C0H) for the compiled lines. The first 100 bytes, 2400H-2463H, run once: from then on they are the buffer of the compiled line.

2400DO
LD (2982H),SP ED 73 82 29
DO (the source also names 2400H JCLBUF2, the buffer of the compiled line): store the Stack Pointer into SPSAV+1, 2982H-2983H, the operand of the LD SP at SPSAV (2981H), so that every exit through EXTERR or IOERR returns from the entry's depth (source: save stack pointer).
2404
LD (2480H),HL 22 80 24
Store Register Pair HL, the pointer to the text after DO, into INBUF+1, 2480H-2481H, the operand of the LD HL at 247FH, where a continuation line is read (source: save start of command).
2407
LD A,65H 3E 65
Load Register A with 65H, SVC 101, @FLAGS, which returns Index Register IY at the system flags (source: get flag table pointer).
2409
RST 28H EF
Call @FLAGS with RST 28H (SYS0/SYS): Index Register IY = 006AH, for the SET 0,(IY+12H) of the opens.
240A
LD A,(HL) 7E
Load Register A with the byte at Register Pair HL, the first character after DO and the spaces SYS1's @FSPEC passed over: the control character, if there is one.
240B
CP 2AH FE 2A
Compare Register A with 2AH, the asterisk of DO followed by an asterisk, which runs the SYSTEM/JCL compiled last (source: execute last DO file?).
240D
If it is the asterisk (Z) jump to NOCPL2 at 24FEH; whatever follows the asterisk on the line is not read.
2410
CP 3DH FE 3D
Compare Register A with 3DH, the equal sign of DO = spec, which runs the file without compiling it (source: execute without compile?).
2412
If it is the equal sign (Z) jump to NOCPL at 24EAH, which reads the spec after it straight into JFCB$.
2415
CP 24H FE 24
Compare Register A with 24H, the dollar sign of DO $ spec, which compiles without running (source: compile only?).
2417
If it is not the dollar sign (NZ) jump to GETSPEC at 2423H: the line holds the spec itself.
2419
LD (24C6H),A 32 C6 24
Store Register A, 24H, into NOEXEC?+1, 24C6H, the operand of the LD A at 24C5H, 00H in the file: CPLFIN then returns after the close instead of running SYSTEM/JCL.
241C
INC HL 23
Increment Register Pair HL past the dollar sign to the next character.
241D
LD A,(HL) 7E
Load Register A with the byte at Register Pair HL, the character after the dollar sign.
241E
CP 20H FE 20
Compare Register A with 20H, a space between the dollar sign and the spec (source: bypass space separator).
2420
If it is not a space (NZ) jump to GETSPEC at 2423H: DO $X works too, the space is not required after the dollar sign.
2422
INC HL 23
Increment Register Pair HL past one space only; a second space stops @FSPEC, and DO gives File spec required.
2423GETSPEC
LD DE,298CH 11 8C 29LD DE,DOFCB
GETSPEC: load Register Pair DE with 298CH, DOFCB, the FCB of the JCL file: the 32 unloaded bytes 298CH-29ABH, just after the member's first load range (source: get DO filespec).
2426
LD A,4EH 3E 4E
Load Register A with 4EH, SVC 78, @FSPEC, which reads a file spec at Register Pair HL into the FCB at Register Pair DE.
2428
RST 28H EF
Call @FSPEC with RST 28H (SYS1/SYS): Z with the spec in DOFCB and Register Pair HL after it and its spaces; Register Pair DE = 298CH again.
2429
If there is no valid spec (NZ) jump to SPCREQ at 2951H, File spec required (source: go if bad/missing filespec).
242C
PUSH HL E5
Save Register Pair HL, the pointer to the text after the spec (the parameters), on the stack for 2463H (source: save INBUF$ pointer).
242D
Call DOFEXT at 2985H, which gives the spec in DOFCB (Register Pair DE) the extension JCL when it has none (6.3.1: a subroutine shared with NOCPL1 and INCLUD; source: default ext to JCL).
2430
LD HL,2C00H 21 00 2CLD HL,INPBUF
Load Register Pair HL with 2C00H, INPBUF, the 256 byte buffer of the JCL file (source: open DO file).
2433
LD B,L 45
Load Register B with Register L, 00H: the record length 256 for @OPEN.
2434
SET 0,(IY+12H) FD CB 12 C6
Set bit 0 of SFLAG$ (IY+12H, 007CH), Index Register IY holding 006AH: @OPEN does not set the open bit in the directory entry and gives no close authority, and clears the bit again (source: inhibit file open bit).
2438
LD A,3BH 3E 3B
Load Register A with 3BH, SVC 59, @OPEN, which opens the file named in the FCB at Register Pair DE with the buffer at Register Pair HL.
243A
RST 28H EF
Call @OPEN with RST 28H (SYS2/SYS): Z when the JCL file is open through DOFCB, NZ with Register A = the error.
243B
If the open failed (NZ) jump to IOERR at 2946H with the error in Register A, such as File not in directory for a JCL file that is not on any drive (source: jump on open error).
243E
LD C,FFH 0E FF
Load Register C with 0FFH, one below drive 0, for the drive search that follows (6.3.1, the search for a drive SYSTEM/JCL can be written on).
2440L2440
INC C 0C
L2440: increment Register C to the next drive number, 0 to 8.
2441
LD A,C 79
Load Register A with Register C, the drive number, to test it against the last drive.
2442
CP 08H FE 08
Compare Register A with 08H: Carry while the drive number is 0 to 7.
2444
If every drive was tried (NC) jump to DSKFUL at 2965H, Can't create SYSTEM/JCL file: no drive is ready and writable.
2447
LD A,21H 3E 21
Load Register A with 21H, SVC 33, @CKDRV, which tests the drive in Register C.
2449
RST 28H EF
Call @CKDRV with RST 28H (SYS2/SYS): Z when a formatted diskette is ready in the drive, NZ when not; Carry when it is write protected.
244A
If the drive is not ready (NZ) jump back to L2440 at 2440H to try the next drive.
244C
If the drive is write protected (Carry) jump back to L2440 at 2440H to try the next drive.
244E
LD A,C 79
Load Register A with Register C, the number of the first drive that is ready and not write protected.
244F
ADD A,30H C6 30
Add 30H to Register A: the drive's digit, 0 to 7.
2451
Call P631G1 at 2AACH (Level 1G), which stores a colon and this digit at 29EAH-29EBH: the name SYSJCL becomes SYSTEM/JCL:d. Only this compile path does so; DO followed by an asterisk opens the name without a drive (B105).
2454
Call MOVFCB at 2503H to copy 32 bytes from SYSJCL into JFCB$ (00C0H): 29E0H-29FFH, SYSJCL and DRVNUM, SYSTEM/JCL:d and its 03H (13 bytes), then all of SPCREQ$ with its 0DH (19 bytes); MOVFCB's LDIR leaves Register B = 00H for the @INIT (source: move SYSTEM/JCL into FCB).
2457
LD DE,00C0H 11 C0 00LD DE,JFCB$
Load Register Pair DE with 00C0H, JFCB$, the system's FCB of the JCL being run (source: init FCB pointer).
245A
LD HL,2D00H 21 00 2DLD HL,OUTBUF
Load Register Pair HL with 2D00H, OUTBUF, the 256 byte buffer of SYSTEM/JCL while it is written.
245D
LD A,3AH 3E 3A
Load Register A with 3AH, SVC 58, @INIT, which opens the file named in the FCB at Register Pair DE, or creates it, with the buffer at Register Pair HL and the record length in Register B (00H, 256).
245F
RST 28H EF
Call @INIT with RST 28H (SYS2/SYS): Z with SYSTEM/JCL open for writing through JFCB$ (SFLAG$ bit 0 was cleared by the @OPEN above, so this open is a full one).
2460
If @INIT failed (NZ) jump to DSKFUL at 2965H; the error number is dropped, so a full diskette, a protected SYSTEM/JCL or any other error all show Can't create SYSTEM/JCL file.
2463
POP HL E1
Restore Register Pair HL, the pointer to the parameters, saved at 242CH (source: rcvr pointer to INBUF$).

2464H - Member 13 (DO): PARSINP, the Rest of the DO Line

PARSINP reads what follows the spec: spaces and commas are passed over, an opening parenthesis starts the parameters (PARAM, 250FH), a semicolon asks for a continuation line with a question mark, and the carriage return ends the line (TSTLBL, 2556H). Anything else is Parameter error. The continuation line is read with @KEYIN into the command buffer, two bytes before the place INBUF+1 kept; as Register Pair HL comes in at least at 0423H, a line of the full 79 characters puts its carriage return on 0470H, the first byte of DCT$, or later with more spaces after DO (B106). A semicolon written straight after the spec (DO X;) is passed over by @FSPEC as the name's separator and asks for nothing.

2464PARSINP
LD A,(HL) 7E
PARSINP: load Register A with the byte at Register Pair HL, the next character of the DO line (source: p/u line char).
2465
CP 0DH FE 0D
Compare Register A with 0DH, the carriage return at the end of the line (source: end of line?).
2467
If it is the end of the line (Z) jump to TSTLBL at 2556H, which starts the label search or the compile.
246A
INC HL 23
Increment Register Pair HL past the character (source: bump pointer).
246B
Call CKSPCOM at 2936H: Z when Register A is a space or a comma (source: ignore spaces and commas).
246E
If it was a space or a comma (Z) jump back to PARSINP at 2464H for the next character.
2470
CP 28H FE 28
Compare Register A with 28H, the opening parenthesis of the parameters (source: beginning of parms?).
2472
If it is the opening parenthesis (Z) jump to PARAM at 250FH, with Register Pair HL after it.
2475
CP 3BH FE 3B
Compare Register A with 3BH, the semicolon that asks for a continuation line (source: line continuation?).
2477
If it is neither (NZ) jump to PRMERR at 2969H, Parameter error.
247A
LD C,3FH 0E 3F
Load Register C with 3FH, the question mark of the continuation prompt (source: prompt for line continue).
247C
LD A,02H 3E 02
Load Register A with 02H, SVC 2, @DSP, which sends the character in Register C to the video.
247E
RST 28H EF
Call @DSP with RST 28H (BOOT/SYS): the question mark is shown where the cursor stands.
247FINBUF
LD HL,0000H 21 00 00
INBUF: load Register Pair HL with the word stored at 2480H-2481H by the entry (2404H): the pointer DO came in with, at least 0423H when DO and its spec were typed at LS-DOS Ready (0000H in the file; source: input continuation line).
2482
DEC L 2D
Decrement Register L, the low byte of the pointer, to start the buffer two bytes back; with no borrow into Register H (source: backup to start).
2483
DEC L 2D
Decrement Register L again: Register Pair HL = the pointer less 2, 0421H after DO X, not 0420H, the start of INBUF$; so 80 bytes from it end at 0470H, the first byte of DCT$ (B106).
2484
LD BC,4F00H 01 00 4F
Load Register Pair BC with 4F00H: Register B = 79 characters at most, Register C = 0 (source: max 79 chars input).
2487
LD A,09H 3E 09
Load Register A with 09H, SVC 9, @KEYIN, which reads a line from the keyboard into the buffer at Register Pair HL, Register B characters at most.
2489
RST 28H EF
Call @KEYIN with RST 28H (BOOT/SYS): the line and its carriage return are stored from Register Pair HL; with the buffer full each further key is stored over the next byte, and the carriage return too (05C4H), so a line of 79 characters writes 80 bytes, the last at 0470H after DO X, the drive 0 JP of DCT$ (B106); Carry after BREAK; Register Pair HL = the start of the buffer.
248A
If BREAK was pressed (Carry) jump to PRMERR at 2969H, Parameter error (source: jump if break).
248D
LD A,0BH 3E 0B
Load Register A with 0BH, SVC 11, @LOGER, which writes the line at Register Pair HL to the job log (source: log the line).
248F
RST 28H EF
Call @LOGER with RST 28H (BOOT/SYS): the continuation line is logged as typed.
2490
Jump back to PARSINP at 2464H to read the continuation line from its start, Register Pair HL; it may hold a parenthesis of parameters, another semicolon or only the carriage return (source: go parse it).

2492H - Member 13 (DO): UNNEST, CKNEST, CPLFIN, CPLFIN1, NOCPL and MOVFCB

UNNEST takes back the FCB of the file that held an //INCLUDE when the included file ends and reads its current sector again. CKNEST runs at each end of file (or label line): inside an included file it goes back to the outer one, at the first level it ends the compile. CPLFIN closes SYSTEM/JCL; with the dollar sign DO returns 0000H. CPLFIN1 opens the JCL to run (SYSTEM/JCL, or the file of DO = spec) through JFCB$ with the buffer page of SBUFF$ and hands over to SYS11/SYS (request 9DH), which never returns to the member. NOCPL reads the spec of DO = spec into JFCB$; NOCPL2 puts SYSTEM/JCL there for DO followed by an asterisk. MOVFCB copies SYSJCL into JFCB$.

2492UNNEST
LD HL,(2ACCH) 2A CC 2ALD HL,(NESTPTR)
UNNEST: load Register Pair HL with the word at NESTPTR, 2ACCH-2ACDH, the pointer to the next free FCB save area: just after the save of the file that held the //INCLUDE (source: shift the last nest's FCB into FCB area).
2495
DEC HL 2B
Decrement Register Pair HL to the last byte of that saved FCB.
2496
LD DE,29ABH 11 AB 29
Load Register Pair DE with 29ABH, DOFCB+31, the last byte of the FCB of the JCL file.
2499
LD BC,0020H 01 20 00
Load Register Pair BC with 0020H, the 32 bytes of an FCB.
249C
LDDR ED B8
Copy Register Pair BC = 32 bytes backwards from Register Pair HL to Register Pair DE (LDDR): the outer file's FCB is back in DOFCB, 298CH-29ABH; Register Pair HL ends one below the save area.
249E
INC HL 23
Increment Register Pair HL to the start of the save area just emptied.
249F
LD (2ACCH),HL 22 CC 2ALD (NESTPTR),HL
Store Register Pair HL into NESTPTR, 2ACCH-2ACDH: the save area is free again (source: reset current FCB ptr).
24A2
LD DE,298CH 11 8C 29LD DE,DOFCB
Load Register Pair DE with 298CH, DOFCB, now the outer file's FCB (source: reread last sector of nested FCB).
24A5
LD A,45H 3E 45
Load Register A with 45H, SVC 69, @RREAD, which reads again the sector the FCB at Register Pair DE is in, into its buffer.
24A7
RST 28H EF
Call @RREAD with RST 28H (SYS0/SYS): INPBUF, 2C00H, which the included file used, holds the outer file's sector again, so its lines go on after the //INCLUDE line.
24A8
RET Z C8
Return if the read was good (Z) (6.3.1: the RET and the jump below replace a JP NZ and a RET).
24A9NIOERR
NIOERR: jump to IOERR at 2946H with the error in Register A (6.3.1, a jump shared by 24C3H and 24DAH).
24ACCKNEST
LD HL,(2ACCH) 2A CC 2ALD HL,(NESTPTR)
CKNEST: load Register Pair HL with the word at NESTPTR, 2ACCH-2ACDH, the pointer to the next free save area (source: p/u current FCB pointer).
24AF
LD DE,2ACEH 11 CE 2ALD DE,NESTFCB
Load Register Pair DE with 2ACEH, NESTFCB, the first save area (source: is it the first nest?).
24B2
XOR A AF
Exclusive OR Register A with itself: Register A = 00H and the Carry flag clear for the SBC.
24B3
SBC HL,DE ED 52
Subtract Register Pair DE from Register Pair HL: Z when NESTPTR still points at the first save area, when no //INCLUDE is open.
24B5
If no //INCLUDE is open (Z) jump to CPLFIN at 24BDH to end the compile (source: jump if so and exit).
24B7
Call UNNEST at 2492H to go back to the file that held the //INCLUDE.
24BA
Jump to CPLJCL at 258CH to compile the outer file's next line.
24BDCPLFIN
LD DE,00C0H 11 C0 00LD DE,JFCB$
CPLFIN: load Register Pair DE with 00C0H, JFCB$, the FCB of SYSTEM/JCL (source: close SYSTEM/JCL file).
24C0
LD A,3CH 3E 3C
Load Register A with 3CH, SVC 60, @CLOSE, which closes the file of the FCB at Register Pair DE.
24C2
RST 28H EF
Call @CLOSE with RST 28H (SYS3/SYS): the compiled lines are written out and the directory entry updated; JFCB$ holds SYSTEM/JCL:d and 03H again (RCVNAM). When no line was written the old end of file stays, so an empty compile leaves the previous SYSTEM/JCL to be run.
24C3
If the close failed (NZ) jump to NIOERR at 24A9H (6.3.1).
24C5NOEXEC?
LD A,00H 3E 00
NOEXEC?: load Register A with the byte at 24C6H: 00H in the file, 24H when DO $ was typed (2419H) (source: set to nonzero on compile only).
24C7
OR A B7
OR Register A with itself: NZ for compile only.
24C8
LD HL,0000H 21 00 00
Load Register Pair HL with 0000H, the return code of a compile only.
24CB
RET NZ C0
Return (NZ) with Register Pair HL = 0000H after DO $, to the caller DO came from: the stack holds only that return address here.
24CCCPLFIN1
LD DE,00C0H 11 C0 00LD DE,JFCB$
CPLFIN1: load Register Pair DE with 00C0H, JFCB$, the FCB of the JCL to run (source: point to SYSTEM/JCL FCB).
24CF
LD HL,0000H 21 00 00
Load Register Pair HL with 0000H as the buffer for now; its page is put into JFCB$+4 at 24E4H (source: correct bufptr later).
24D2
LD B,L 45
Load Register B with Register L, 00H: the record length 256 for @OPEN.
24D3
SET 0,(IY+12H) FD CB 12 C6
Set bit 0 of SFLAG$ (IY+12H, 007CH), Index Register IY holding 006AH: the JCL is opened without the open bit and without close authority (source: inhibit file open bit).
24D7
LD A,3BH 3E 3B
Load Register A with 3BH, SVC 59, @OPEN, which opens the file named in the FCB at Register Pair DE.
24D9
RST 28H EF
Call @OPEN with RST 28H (SYS2/SYS): Z with the JCL open through JFCB$; NZ with Register A = the error, as File not in directory when DO followed by an asterisk finds no SYSTEM/JCL.
24DA
If the open failed (NZ) jump to NIOERR at 24A9H (6.3.1).
24DC
LD BC,(00C6H) ED 4B C6 00
Load Register Pair BC with the word at 00C6H-00C7H, JFCB$+6 and +7: Register C = the drive, Register B = the directory entry code (source: get SBUFF$).
24E0
LD A,57H 3E 57
Load Register A with 57H, SVC 87, @DIRRD, which reads the directory sector of the entry in Register Pair BC into SBUFF$.
24E2
RST 28H EF
Call @DIRRD with RST 28H (SYS0/SYS): Register Pair HL = the entry in SBUFF$, whose page is 1DH; the result is not tested.
24E3
LD A,H 7C
Load Register A with Register H, the page of SBUFF$ (source: stuff high order to use for JFCB$ buffer).
24E4
LD (00C4H),A 32 C4 00
Store Register A into 00C4H, JFCB$+4: the JCL's buffer is SBUFF$, xx00H with the low byte 00H from 24CFH, as the member's own buffers are gone once SYS11 runs.
24E7
LD A,9DH 3E 9D
Load Register A with 9DH, the request for SYS11/SYS with function 1 (bits 6-4 = 1), the start of a DO (source: call SYS11, entry 1).
24E9
RST 28H EF
Call SYS11 with RST 28H: SYS11 sets SFLAG$ bit 5 (DO active), points @EXIT at itself, sets the Stack Pointer to 0380H, STACK$, and runs the first line by @CMNDI; it never returns here, so a program that ran DO through @CMNDR does not get control back.
24EANOCPL
INC HL 23
NOCPL: increment Register Pair HL past the equal sign, or past a space (source: DO = spec).
24EBNOCPLS
LD A,(HL) 7E
NOCPLS: load Register A with the byte at Register Pair HL, the next character of the line (source: bypass space separator).
24EC
CP 20H FE 20
Compare Register A with 20H, a space between the equal sign and the spec.
24EE
If it is a space (Z) jump back to NOCPL at 24EAH: any number of spaces is passed over here.
24F0NOCPL1
LD DE,00C0H 11 C0 00LD DE,JFCB$
NOCPL1: load Register Pair DE with 00C0H, JFCB$: the spec of DO = spec goes straight into the system's FCB (source: fetch DO filespec).
24F3
LD A,4EH 3E 4E
Load Register A with 4EH, SVC 78, @FSPEC, which reads a file spec at Register Pair HL into the FCB at Register Pair DE.
24F5
RST 28H EF
Call @FSPEC with RST 28H (SYS1/SYS): Z with the spec in JFCB$; the parameters after it are not read, as only the compile uses them.
24F6
If there is no valid spec (NZ) jump to SPCREQ at 2951H, File spec required.
24F9
Call DOFEXT at 2985H to give the spec the extension JCL when it has none (6.3.1).
24FC
Jump to CPLFIN1 at 24CCH to open the file and run it (source: go execute file).
24FENOCPL2
NOCPL2: call MOVFCB at 2503H to put the name SYSJCL into JFCB$: SYSTEM/JCL and 03H with no drive, as 29EAH still holds the file's 03H, so @OPEN takes the first SYSTEM/JCL in drive order, not the one the last compile wrote (B105) (source: execute SYSTEM/JCL file).
2501
Jump to CPLFIN1 at 24CCH to open SYSTEM/JCL and run it.
2503MOVFCB
LD HL,29E0H 21 E0 29LD HL,SYSJCL
MOVFCB: load Register Pair HL with 29E0H, SYSJCL, the name SYSTEM/JCL (source: move SYSTEM/JCL into FCB area).
2506
LD DE,00C0H 11 C0 00LD DE,JFCB$
Load Register Pair DE with 00C0H, JFCB$, the system's FCB of the JCL.
2509DOLDIR
LD BC,0020H 01 20 00
DOLDIR: load Register Pair BC with 0020H, the 32 bytes of an FCB; DOLDIR is the 6.3.1 entry INCLUD uses with its own Register Pair HL and DE (27C8H).
250C
LDIR ED B0
Copy Register Pair BC = 32 bytes from Register Pair HL to Register Pair DE (LDIR); Register Pair DE ends 32 bytes on and Register Pair BC at 0000H.
250E
RET C9
Return to the caller with Register B = 00H and Register Pair DE 32 bytes past where it began.

250FH - Member 13 (DO): PARAM, the Parameters of the DO Line, and the Label Search

PARAM reads the parameters between the parentheses: each is a token, up to 8 characters, put into the symbol table at 2E00H (a token given twice is Multiply defined Parameter error), with an equal sign and a value of up to 32 characters (PARSVAL), or the @LABEL, kept in LBLSAV (29D5H) for the search. The closing parenthesis goes back to PARSINP, the carriage return to TSTLBL. TSTLBL: without a label the compile starts at the first line; with one, FINDLBL reads the file's lines until one begins with the at sign and LBLSAV's name, and the compile starts after it. The end of the file first gives Procedure not found.

250FPARAM
PARAM: call PARSNAM at 27F0H to read a token into CURSYM, 29ACH-29B3H: Z when it holds at least one character, Register A = the character that ended it (source: parse symbol into current).
2512
If no character of a token was found (NZ) jump to PARAM1 at 2528H to look at the separator (source: jump if bad symbol).
2514
PUSH AF F5
Save Register Pair AF, the separator in Register A, on the stack for 2523H or 2540H (source: save separator char).
2515FNDLBL
LD A,00H 3E 00
FNDLBL: load Register A with the byte at 2516H, the operand of this LD: 00H in the file, 40H after PARSER met an at sign (2865H) (source: test if a label was found).
2517
OR A B7
OR Register A with itself: NZ when the token was marked by an at sign, a label.
2518
If it is the label (NZ) jump to MOVLBL at 2543H to keep its name in LBLSAV.
251A
Call FINDSYM at 28BAH to look the token up in the symbol table at 2E00H: Z when it is there, Register Pair DE = its length byte; NZ with Register Pair DE at the first free entry (source: search symbol table).
251D
If the token is already in the table (Z) jump to MULDEF at 296DH, Multiply defined Parameter error (source: multiply defined if in).
2520
Call MOVNAME at 289DH to put CURSYM into the free entry at Register Pair DE with a length of 0, and mark the entry after it as the end of the table (source: add symbol to table).
2523
POP AF F1
Restore Register Pair AF: Register A = the separator saved at 2514H (source: recover separator).
2524
CP 3DH FE 3D
Compare Register A with 3DH, the equal sign before a value (source: assignment?).
2526
If a value follows (Z) jump to PARAM2 at 2539H, with Register Pair DE still at the new entry's length byte.
2528PARAM1
PARAM1: call CKSPCOM at 2936H: Z when Register A, the separator, is a space or a comma (source: ck space or comma).
252B
If it was a space or a comma (Z) jump back to PARAM at 250FH for the next parameter.
252D
CP 29H FE 29
Compare Register A with 29H, the closing parenthesis (source: exit parm scan on closing paren).
252F
If it is the closing parenthesis (Z) jump to PARSINP at 2464H, to read what follows it on the line; a value that ends with a substitution just before the parenthesis comes back with Register Pair HL still on it, so PARSINP reads it again and gives Parameter error (B118).
2532
CP 0DH FE 0D
Compare Register A with 0DH, the carriage return: the closing parenthesis may be left out (source: also accept closing CR).
2534
If the line ends here (Z) jump to TSTLBL at 2556H.
2536
Jump to PRMERR at 2969H, Parameter error, for any other separator (source: else parm error).
2539PARAM2
PARAM2: call PARSVAL at 27FBH to read the value after the equal sign into STRLEN and VALBUF, 29B4H-29D4H; Register Pair DE, the entry's length byte, is kept (source: parse value into buf).
253C
PUSH AF F5
Save Register Pair AF, the separator after the value in Register A, on the stack for 2540H (source: save separator char).
253D
Call MOVALUE at 28AFH to copy the length and the 32 bytes of the value, 29B4H-29D4H, into the entry at Register Pair DE (source: symbol value into table).
2540GETSEP
POP AF F1
GETSEP: restore Register Pair AF: Register A = the separator saved at 2514H or 253CH (source: recover separator).
2541
Jump back to PARAM1 at 2528H to act on the separator (source: loop).
2543MOVLBL
PUSH HL E5
MOVLBL: save Register Pair HL, the line pointer, on the stack for 2553H.
2544
LD HL,29ACH 21 AC 29LD HL,CURSYM
Load Register Pair HL with 29ACH, CURSYM, the label's name without its at sign (source: pt to current sym buf).
2547
LD DE,29D5H 11 D5 29LD DE,LBLSAV
Load Register Pair DE with 29D5H, LBLSAV, where the label is kept for the search (source: and save label for later testing).
254A
LD BC,0008H 01 08 00
Load Register Pair BC with 0008H, the 8 bytes of a name.
254D
LDIR ED B0
Copy Register Pair BC = 8 bytes from Register Pair HL, CURSYM, to Register Pair DE, LBLSAV 29D5H-29DCH (LDIR).
254F
XOR A AF
Exclusive OR Register A with itself: Register A = 00H (source: turn off found label).
2550
LD (2516H),A 32 16 25
Store Register A, 00H, into 2516H, the operand of FNDLBL's LD (2515H): the next token is a token again; 285EH stays 40H, so a second at sign is Too many Proc labels.
2553
POP HL E1
Restore Register Pair HL, the line pointer, saved at 2543H (source: rcvr line ptr).
2554
Jump back to GETSEP at 2540H to take the separator (source: back for more).
2556TSTLBL
LD A,(285EH) 3A 5E 28
TSTLBL: load Register A with the byte at 285EH, the operand of the SUB at GOTLBL: 00H in the file, 40H when an at sign was met in the parameters (source: was @LABEL a parm?).
2559
OR A B7
OR Register A with itself: Z when no label was given.
255A
If no label was given (Z) jump to CPLJCL at 258CH: the compile starts at the first line and ends at the first label line (source: if not, don't look).
255CFINDLBL
FINDLBL: call RDJCL at 266FH to read the next line of the JCL file into JCLBUF1, 2B9EH: Z with a line, NZ at the end of the file (source: read JCL line).
255F
If a line was read (Z) jump to GOTLIN at 2572H.
2561
LD HL,(2ACCH) 2A CC 2ALD HL,(NESTPTR)
Load Register Pair HL with the word at NESTPTR, 2ACCH-2ACDH, to see whether an //INCLUDE is open; during the label search none ever is, as INCLUD runs only in the compile (source: see if nested in an Include file).
2564
LD DE,2ACEH 11 CE 2ALD DE,NESTFCB
Load Register Pair DE with 2ACEH, NESTFCB, the first save area.
2567
XOR A AF
Exclusive OR Register A with itself: Register A = 00H and the Carry flag clear for the SBC.
2568
SBC HL,DE ED 52
Subtract Register Pair DE from Register Pair HL: Z when no //INCLUDE is open, always here.
256A
If no //INCLUDE is open (Z) jump to NOFIND at 295DH, Procedure not found: the label is not in the file (source: if not, label not found).
256D
Call UNNEST at 2492H to go back to the outer file; never reached, as NESTPTR is still 2ACEH (source: else continue search).
2570
Jump back to FINDLBL at 255CH to read the next line.
2572GOTLIN
LD HL,2B9EH 21 9E 2BLD HL,JCLBUF1
GOTLIN: load Register Pair HL with 2B9EH, JCLBUF1, the line just read (source: pt to start).
2575
LD A,(HL) 7E
Load Register A with the byte at Register Pair HL, the line's first character.
2576
CP 40H FE 40
Compare Register A with 40H, the at sign that begins a label line (source: is 1st char a label indicator?).
2578
If the line is not a label line (NZ) jump back to FINDLBL at 255CH for the next line.
257A
INC HL 23
Increment Register Pair HL past the at sign to the label's first character (source: pt to 1st char).
257B
EX DE,HL EB
Exchange Register Pair DE and Register Pair HL: Register Pair DE = the label in the line (source: ptr to DE).
257C
LD HL,29D5H 21 D5 29LD HL,LBLSAV
Load Register Pair HL with 29D5H, LBLSAV, the label given on the DO line, as a table of one entry that the zero at 29DDH ends.
257F
LD BC,0808H 01 08 08
Load Register Pair BC with 0808H: Register B = 8 characters to compare, Register C = 8 bytes an entry (source: symbol and field len = 8).
2582
Call FNDPRM at 28E6H to compare the line's label with LBLSAV: Z when the names match up to the end of the line's label (a space, a carriage return or another character that is not a letter or digit) (source: a match?).
2585
If the labels differ (NZ) jump back to FINDLBL at 255CH for the next line (source: no match? look for next).
2587
Jump to CPLJCL at 258CH: the compile starts with the line after the label (source: else you're the one).

2589H - Member 13 (DO): CPLJCL, the Compile of a Line

CPLJCL reads a line of the JCL file into JCLBUF1 (2B9EH) and builds the compiled line at 2400H, over the member's own entry code: a line that begins with the at sign ends the procedure (and an included file); a line that begins with two slashes goes to MACRO; in other lines each #token# is replaced by the token's value (SUBSYM; a token not given, or given without a value, is left as written), ## gives one number sign, %xx gives the byte of the hex digits xx and %% one percent sign. At the line's carriage return CONDCPL writes the line to SYSTEM/JCL when the conditional state is true. Nothing limits the length of the compiled line: past 2491H it runs over the member's code (B114).

2589CONDCPL
CONDCPL: call TSTCOND at 26A0H, which writes the compiled line at 2400H to SYSTEM/JCL when the conditional state is true, or shows it when it is a //. comment; then fall into CPLJCL for the next line.
258CCPLJCL
CPLJCL: call RDJCL at 266FH to read the next line into JCLBUF1, 2B9EH: Z with a line, NZ at the end of the file (source: read line from JCL file).
258F
At the end of the file (NZ) jump to CKNEST at 24ACH, which goes back to an outer file or ends the compile (source: exit on end of file).
2592
LD HL,2B9EH 21 9E 2BLD HL,JCLBUF1
Load Register Pair HL with 2B9EH, JCLBUF1, the line just read (source: parse the line just read).
2595
LD DE,2400H 11 00 24LD DE,JCLBUF2
Load Register Pair DE with 2400H, the buffer of the compiled line, over the entry code that ran once.
2598
LD A,(HL) 7E
Load Register A with the byte at Register Pair HL, the line's first character.
2599
INC HL 23
Increment Register Pair HL to the second character.
259A
CP 40H FE 40
Compare Register A with 40H, the at sign of a label line (source: end procedure if found another label).
259C
If the line is a label (Z) jump to CKNEST at 24ACH: the procedure ends here, in a false block too, and in an included file the outer file goes on.
259F
CP 2FH FE 2F
Compare Register A with 2FH, a slash (source: slash?).
25A1
If it is not a slash (NZ) jump to CPLJCL1 at 25A7H to take the character.
25A3
CP (HL) BE
Compare Register A, the first slash, with the byte at Register Pair HL, the second character (source: double slash?).
25A4
If the line begins with two slashes (Z) jump to MACRO at 2641H, with Register Pair HL at the second slash.
25A7CPLJCL1
CP 23H FE 23
CPLJCL1: compare Register A with 23H, the number sign of a substitution (source: substitution?).
25A9
If it is a number sign (Z) jump to CPLJCL4 at 25D0H.
25AB
CP 25H FE 25
Compare Register A with 25H, the percent sign of a hex value (source: hex value?).
25AD
If it is not a percent sign (NZ) jump to CPLJCL2 at 25C6H to copy the character as it is.
25AF
Call CPLJCL7 at 25B4H, which stores the byte of the two hex digits at Register Pair HL, or one percent sign for %%, at Register Pair DE.
25B2
Jump to CPLJCL3 at 25CCH for the next character.
25B4CPLJCL7
CP (HL) BE
CPLJCL7: compare Register A, the percent sign, with the byte at Register Pair HL, the next character (source: double %?).
25B5
If it is a second percent sign (Z) jump to CPLJCL6 at 25D8H, which passes over it and stores one percent sign.
25B7
Call CVRTHEX at 25DCH to turn the character at Register Pair HL, the first hex digit, into its value in Register A (source: convert digit).
25BA
INC HL 23
Increment Register Pair HL to the second hex digit (source: bump to next char).
25BB
RLCA 07
Rotate Register A left: the first digit's value moves towards the high nibble.
25BC
RLCA 07
Rotate Register A left again, the second of four.
25BD
RLCA 07
Rotate Register A left a third time, the third of the four rotations.
25BE
RLCA 07
Rotate Register A left a fourth time: the first digit is in the high nibble, the low nibble 0 (source: rotate into left nybble).
25BF
LD C,A 4F
Load Register C with Register A, the high nibble, for the OR at 25C3H (source: save for now).
25C0
Call CVRTHEX at 25DCH to turn the second hex digit at Register Pair HL into its value in Register A; Register Pair HL is not moved past it here, CPLJCL6 does that (source: convert 2nd digit).
25C3
OR C B1
OR Register A with Register C: Register A = the byte of the two digits (source: merge left nybble).
25C4
Jump to CPLJCL6 at 25D8H to pass over the second digit and store the byte. A byte 0DH stored so is not tested as the end of the line: WRCPLD stops at it and the rest of the line is lost.
25C6CPLJCL2
LD (DE),A 12
CPLJCL2: store Register A, the character, at Register Pair DE in the compiled line (source: nothing special, xfer).
25C7
INC DE 13
Increment Register Pair DE to the next byte of the compiled line.
25C8
CP 0DH FE 0D
Compare Register A with 0DH, the carriage return at the end of the line.
25CA
If the line is complete (Z) jump to CONDCPL at 2589H to write it out and read the next (source: exit on end of line).
25CCCPLJCL3
LD A,(HL) 7E
CPLJCL3: load Register A with the byte at Register Pair HL, the next character of the line (source: grab next input char).
25CD
INC HL 23
Increment Register Pair HL past the character just read, to the one after it.
25CE
Jump back to CPLJCL1 at 25A7H to act on it (source: and loop).
25D0CPLJCL4
CPLJCL4: call CPLJCL5 at 25D5H, which stores one number sign for ## or substitutes the token of #token# (source: ck on double #).
25D3
Jump to CPLJCL3 at 25CCH for the next character.
25D5CPLJCL5
CP (HL) BE
CPLJCL5: compare Register A, the number sign, with the byte at Register Pair HL, the next character (source: double #?).
25D6
If it is not a second number sign (NZ) jump to SUBSYM at 25EDH to substitute the token (source: jump to substitute if only single #).
25D8CPLJCL6
INC HL 23
CPLJCL6: increment Register Pair HL past the second number sign, percent sign or hex digit (source: else xfer the char).
25D9
LD (DE),A 12
Store Register A, the character or byte, at Register Pair DE in the compiled line or the value buffer.
25DA
INC DE 13
Increment Register Pair DE to the next byte of the compiled line or of the value buffer.
25DB
RET C9
Return to the caller, Register Pair HL at the next character.
25DCCVRTHEX
LD A,(HL) 7E
CVRTHEX: load Register A with the byte at Register Pair HL, a hex digit (source: p/u the digit).
25DD
SUB 30H D6 30
Subtract 30H from Register A: 00H-09H for the digits 0 to 9 (source: start conversion).
25DF
If the character was below 30H (Carry) jump to CVRTHE1 at 25EBH, Bad JCL format (source: error if less than 0).
25E1
CP 0AH FE 0A
Compare Register A with 0AH: Carry for the digits 0 to 9.
25E3
RET C D8
Return with the value of a digit 0 to 9 in Register A (Carry) (source: go if 0-9).
25E4
RES 5,A CB AF
Reset bit 5 of Register A, for the small letters a to f (source: in case l/c).
25E6
SUB 07H D6 07
Subtract 07H from Register A: 0AH-0FH for the letters A to F (source: adjust A-F to 10-15).
25E8
CP 10H FE 10
Compare Register A with 10H: Carry for a value 0AH to 0FH; also for the characters : ; less than, equal, greater than, question mark and at sign (3 to 9), W X Y Z (0 to 3) and the six from left bracket to grave accent (4 to 9), as nothing tests for the gaps between 9, A, F and a (B112).
25EA
RET C D8
Return with the value of the digit in Register A (Carry) (source: go if 10-15).
25EBCVRTHE1
CVRTHE1: jump to BADHDR at 262CH, Bad JCL format, with the line shown.
25EDSUBSYM
PUSH HL E5
SUBSYM: save Register Pair HL, the position after the first number sign, on the stack for SUBSYM1 (260EH).
25EE
PUSH DE D5
Save Register Pair DE, the place in the compiled line or the value buffer, on the stack.
25EF
Call PARSNAM at 27F0H to read the token's name into CURSYM, 29ACH-29B3H: Register A = the character that ended it (source: parse symbol).
25F2
CP 23H FE 23
Compare Register A with 23H, the closing number sign (source: must have closing #).
25F4
If the name did not end with a number sign (NZ) jump to BADHDR at 262CH, Bad JCL format.
25F6
EX (SP),HL E3
Exchange Register Pair HL with the word at the top of the stack, the place saved at 25EEH: the position after the closing number sign stays on the stack, at the Stack Pointer, Register Pair HL = the place to substitute at (source: put new posn on stack).
25F7
PUSH HL E5
Save Register Pair HL, the place to substitute at, on the stack for 2605H (source: and get HL=start posn).
25F8
Call FINDSYM at 28BAH: Z when the token is in the symbol table, Register Pair DE = its length byte (source: get symbol value).
25FB
If the token was not given (NZ) jump to SUBSYM1 at 260CH, which leaves #token# as it is (source: bypass if not in table).
25FD
LD A,(DE) 1A
Load Register A with the byte at Register Pair DE, the length of the token's value (source: get symbol length).
25FE
OR A B7
OR Register A with itself: Z for a token given without a value.
25FF
If the value is empty (Z) jump to SUBSYM1 at 260CH: a token set by name alone or by //SET is left as #token# too (source: bypass if zero length).
2601
LD B,00H 06 00
Load Register B with 00H, the high byte of the count for the LDIR.
2603
LD C,A 4F
Load Register C with Register A, the length: Register Pair BC = the bytes of the value.
2604
INC DE 13
Increment Register Pair DE to the value's first character (source: point to 1st symbol char).
2605
POP HL E1
Restore Register Pair HL, the place to substitute at, saved at 25F7H (source: rcvr where we need to substitute).
2606
EX DE,HL EB
Exchange Register Pair DE and Register Pair HL: Register Pair HL = the value, Register Pair DE = the place.
2607
LDIR ED B0
Copy Register Pair BC = the value's length from Register Pair HL to Register Pair DE (LDIR): the value replaces #token#, with no test of the room left (B114 in the line, B109 in a value); Register Pair DE ends after it (source: move symbol value into pos).
2609
POP HL E1
Restore Register Pair HL, the position after the closing number sign, saved at 25F6H.
260A
POP AF F1
Restore Register Pair AF from the stack: the word saved at 25EDH is dropped, Register A changed.
260B
RET C9
Return to CPLJCL4 (25D3H) or XFRSTR (2834H) with Register Pair HL after the closing number sign and Register Pair DE after the value.
260CSUBSYM1
POP DE D1
SUBSYM1: restore Register Pair DE, the place in the compiled line, saved at 25F7H (source: symbol not in table, so leave as is in the DO file).
260D
POP AF F1
Restore Register Pair AF from the stack: the position after the closing number sign is dropped.
260E
POP HL E1
Restore Register Pair HL, the position after the first number sign, saved at 25EDH.
260F
LD A,23H 3E 23
Load Register A with 23H, the opening number sign, to copy (source: starting #).
2611SUBSYM2
LD (DE),A 12
SUBSYM2: store Register A at Register Pair DE in the compiled line.
2612
INC DE 13
Increment Register Pair DE to the next byte (source: inc buffer).
2613
LD A,(HL) 7E
Load Register A with the byte at Register Pair HL, the next character of the token as written (source: get a char from line).
2614
INC HL 23
Increment Register Pair HL past the character just read, to the one after it.
2615
CP 0DH FE 0D
Compare Register A with 0DH, the carriage return (source: if a CR before closing #).
2617
If the line ends before the closing number sign (Z) jump to BADHDR at 262CH, Bad JCL format (source: abort).
2619
CP 23H FE 23
Compare Register A with 23H, the closing number sign (source: end of substitution?).
261B
If it is not the closing number sign (NZ) jump back to SUBSYM2 at 2611H to copy the character (source: get more if not).
261D
LD (DE),A 12
Store Register A, the closing number sign, at Register Pair DE.
261E
INC DE 13
Increment Register Pair DE past the closing number sign, to the next byte to fill.
261F
RET C9
Return to the caller with #token# copied as written.
2620CKCOND
LD DE,(2B6EH) ED 5B 6E 2BLD DE,(CONDPTR)
CKCOND: load Register Pair DE with the word at CONDPTR, 2B6EH-2B6FH, the pointer to the current conditional level (source: p/u conditional pointer).
2624
LD HL,2B70H 21 70 2BLD HL,CONDFLG
Load Register Pair HL with 2B70H, CONDFLG, the first level, outside every //IF (source: test if still on 1st one).
2627
XOR A AF
Exclusive OR Register A with itself: Register A = 00H and the Carry flag clear for the SBC.
2628
SBC HL,DE ED 52
Subtract Register Pair DE from Register Pair HL: Z when no //IF is open.
262A
EX DE,HL EB
Exchange Register Pair DE and Register Pair HL: Register Pair HL = the current level's pointer again (source: pointer back to HL).
262B
RET NZ C0
Return (NZ) to ELSE1 or END1 when an //IF is open; with none, fall into BADHDR: //ELSE or //END without //IF is Bad JCL format (source: OK if nested else error).
262CBADHDR
LD DE,2B95H 11 95 2B
BADHDR: load Register Pair DE with 2B95H, the five x of BADHDR$ Line xxxxx (source: show bad JCL line found).
262F
LD HL,(29DEH) 2A DE 29LD HL,(LINENO)
Load Register Pair HL with the word at LINENO, 29DEH-29DFH, the number of the line read last (source: put decimal line # into message).
2632
LD A,61H 3E 61
Load Register A with 61H, SVC 97, @HEXDEC, which writes the value of Register Pair HL as 5 decimal digits at Register Pair DE.
2634
RST 28H EF
Call @HEXDEC with RST 28H (BOOT/SYS): the line number replaces xxxxx at 2B95H-2B99H.
2635
LD HL,2B90H 21 90 2BLD HL,BADHDR$
Load Register Pair HL with 2B90H, BADHDR$ Line nnnnn and an arrow, which has no end mark and so runs on into JCLBUF1 (source: display bad line #).
2638
LD A,0CH 3E 0C
Load Register A with 0CH, SVC 12, @LOGOT, which shows and logs the text at Register Pair HL up to 0DH or 03H.
263A
RST 28H EF
Call @LOGOT with RST 28H (BOOT/SYS): Line nnnnn, the arrow and the line as read from the file, to its carriage return.
263BBADH1
LD HL,2A8CH 21 8C 2ALD HL,BADJCL$
BADH1: load Register Pair HL with 2A8CH, BADJCL$, Bad JCL format, process aborted; RDJCL changes this operand, 263CH-263DH, to 2A00H, LINLNG$, for a line too long (2692H) (source: and abort message).
263E
Jump to EXTERR at 2970H to show the message and end DO with Register Pair HL = FFFFH.
2641MACRO
INC HL 23
MACRO: increment Register Pair HL past the second slash to the name (source: //).
2642
Call PARSNAM at 27F0H to read the name after the slashes into CURSYM, 29ACH-29B3H: Z when it holds a character (source: get symbol name).
2645
If no name follows (NZ) jump to MACRO2 at 265CH to copy the line as it is (source: go if not JCL macro).
2647
Call CK4COND at 28CBH: Z when the name is IF, ELSE or END, Register Pair DE = its routine (source: ck for IF, ELSE, END).
264A
PUSH DE D5
Save Register Pair DE, the routine's address, on the stack (source: stack the routine entry).
264B
RET Z C8
Return to the routine (Z) when the name is IF, ELSE or END: they act in a false block too, as nested blocks must be counted (source: and branch if found).
264C
POP DE D1
Restore Register Pair DE: the address is taken off the stack again (source: else remove RET).
264D
LD DE,(2B6EH) ED 5B 6E 2BLD DE,(CONDPTR)
Load Register Pair DE with the word at CONDPTR, 2B6EH-2B6FH, the pointer to the current conditional level (source: p/u conditional pointer).
2651
LD A,(DE) 1A
Load Register A with the byte at Register Pair DE, the current state: 00H true, FFH false (source: and conditional state).
2652
OR A B7
OR Register A with itself: NZ when the state is false.
2653
If the state is false (NZ) jump to CPLJCL at 258CH: //SET, //RESET, //ASSIGN, //INCLUDE, //QUIT and the execution macros of a false block are dropped (source: jump if logic FALSE).
2656
Call CK4ASSN at 28D4H: Z when the name is SET, RESET, ASSIGN, INCLUDE or QUIT, Register Pair DE = its routine (source: test for SET, RESET, ASSIGN, INCLUDE, QUIT).
2659
PUSH DE D5
Save Register Pair DE, the routine's address, on the stack (source: stack the routine entry).
265A
RET Z C8
Return to the routine (Z) when the name is one of the five, with Register Pair HL after the name and its separator.
265B
POP DE D1
Restore Register Pair DE: the address is taken off the stack again; the line is an execution macro (//PAUSE, //STOP, //KEYIN and so on) or a //. comment.
265CMACRO2
LD DE,2B9EH 11 9E 2BLD DE,JCLBUF1
MACRO2: load Register Pair DE with 2B9EH, JCLBUF1, the start of the line (source: point to where we left off and continue to parse the input line).
265F
XOR A AF
Exclusive OR Register A with itself: Register A = 00H and the Carry flag clear for the SBC.
2660
SBC HL,DE ED 52
Subtract Register Pair DE from Register Pair HL: Register Pair HL = the number of characters PARSNAM passed over, the slashes, the name and its separator.
2662
LD B,H 44
Load Register B with Register H, the high byte of the count (00H).
2663
LD C,L 4D
Load Register C with Register L: Register Pair BC = the count.
2664
LD HL,2B9EH 21 9E 2BLD HL,JCLBUF1
Load Register Pair HL with 2B9EH, JCLBUF1, the start of the line, to copy from.
2667
LD DE,2400H 11 00 24LD DE,JCLBUF2
Load Register Pair DE with 2400H, the compiled line.
266A
LDIR ED B0
Copy Register Pair BC bytes from Register Pair HL to Register Pair DE (LDIR): the part already read is copied as written (from the file, not in capitals), and Register Pair HL ends at the next character to compile.
266C
Jump to CPLJCL3 at 25CCH to compile the rest of the line with its substitutions.

266FH - Member 13 (DO): RDJCL, TSTCOND and WRCPLD

RDJCL counts the line in LINENO and reads one line of the JCL file, byte by byte through DOFCB, into JCLBUF1 (2B9EH): Z when its carriage return is read. A line of 80 characters with no carriage return is Line too long; the end of the file, and also a byte 00H, give NZ with Register A = 1CH, so a last line with no carriage return, and everything after a 00H byte, are dropped. TSTCOND writes the compiled line at 2400H to SYSTEM/JCL (WRCPLD) when the current conditional state is true; a line that begins with //. is a compile comment, shown and not written.

266FRDJCL
LD HL,(29DEH) 2A DE 29LD HL,(LINENO)
RDJCL: load Register Pair HL with the word at LINENO, 29DEH-29DFH, the count of lines read, in all files (source: bump line counter).
2672
INC HL 23
Increment Register Pair HL: the number of the line about to be read; it is never set back, so an included file's lines go on with the outer file's numbers.
2673
LD (29DEH),HL 22 DE 29LD (LINENO),HL
Store Register Pair HL into LINENO, 29DEH-29DFH, for BADHDR (262FH).
2676
LD HL,2B9EH 21 9E 2BLD HL,JCLBUF1
Load Register Pair HL with 2B9EH, JCLBUF1, the line buffer (source: point to line buffer).
2679
LD DE,298CH 11 8C 29LD DE,DOFCB
Load Register Pair DE with 298CH, DOFCB, the FCB of the JCL file being compiled (source: point to FCB).
267C
LD B,50H 06 50
Load Register B with 50H, 80 characters at most (source: permit only 80 chars).
267ERDJCL1
LD A,03H 3E 03
RDJCL1: load Register A with 03H, SVC 3, @GET, which reads one byte from the file of the FCB at Register Pair DE (source: get a char).
2680
RST 28H EF
Call @GET with RST 28H (BOOT/SYS): Z with the byte in Register A, NZ with the error in Register A, 1CH at the end of the file.
2681
If @GET gave an error (NZ) jump to RDJCL2 at 2697H (source: jump on error).
2683
OR A B7
OR Register A with itself, the byte just read: Z for a byte 00H.
2684
If the byte is 00H (Z) jump to RDJCL3 at 269CH, which returns as at the end of the file: the line so far and the rest of the file are not compiled (source: bypass on null byte).
2686
LD (HL),A 77
Store Register A, the byte, at Register Pair HL in JCLBUF1 (source: xfer byte to line buf).
2687
INC HL 23
Increment Register Pair HL to the next byte of the buffer.
2688
CP 0DH FE 0D
Compare Register A with 0DH, the carriage return (source: end of line?).
268A
RET Z C8
Return with Z when the line is complete, its carriage return stored in JCLBUF1.
268B
Decrement Register B and, while it is not zero, jump back to RDJCL1 at 267EH for the next byte (source: loop if not).
268D
LD (HL),0DH 36 0D
Store 0DH, a carriage return, at the byte at Register Pair HL, 2BEEH, after the 80 characters, so that BADHDR's @LOGOT ends there (source: stuff CR and provide error log message).
268F
LD HL,2A00H 21 00 2ALD HL,LINLNG$
Load Register Pair HL with 2A00H, LINLNG$, Line too long.
2692
LD (263CH),HL 22 3C 26
Store Register Pair HL into 263CH-263DH, the operand of BADH1's LD HL (263BH): the message is now Line too long.
2695
Jump to BADHDR at 262CH to show the line and Line too long, and end DO.
2697RDJCL2
CP 1CH FE 1C
RDJCL2: compare Register A, the error of @GET, with 1CH, End of file encountered (source: EOF?).
2699
If it is another error (NZ) jump to IOERR at 2946H (source: jump on any other error).
269CRDJCL3
LD A,1CH 3E 1C
RDJCL3: load Register A with 1CH, the end of file code.
269E
OR A B7
OR Register A with itself: NZ, the end of the file, for the caller.
269F
RET C9
Return NZ with Register A = 1CH; a line not ended by a carriage return is dropped.
26A0TSTCOND
LD HL,(2B6EH) 2A 6E 2BLD HL,(CONDPTR)
TSTCOND: load Register Pair HL with the word at CONDPTR, 2B6EH-2B6FH, the pointer to the current conditional level (source: grab conditional pointer).
26A3
LD A,(HL) 7E
Load Register A with the byte at Register Pair HL, the state of the current level: 00H true, FFH false (source: grab conditional state).
26A4
OR A B7
OR Register A with itself: NZ when the state is false.
26A5
RET NZ C0
Return without writing the line when the state is false (NZ) (source: return if logic FALSE).
26A6
LD HL,2400H 21 00 24LD HL,JCLBUF2
Load Register Pair HL with 2400H, the compiled line (source: point to processed line).
26A9
LD DE,00C0H 11 C0 00LD DE,JFCB$
Load Register Pair DE with 00C0H, JFCB$, the FCB of SYSTEM/JCL (source: SYSTEM/JCL FCB).
26AC
LD A,(HL) 7E
Load Register A with the byte at Register Pair HL, the line's first character (source: ck on double /).
26AD
CP 2FH FE 2F
Compare Register A, the compiled line's first character, with 2FH, a slash.
26AF
If the line does not begin with a slash (NZ) jump to WRCPLD at 26C1H to write it (source: done if not /).
26B1
INC HL 23
Increment Register Pair HL to the second character.
26B2
CP (HL) BE
Compare Register A, the slash, with the byte at Register Pair HL, the second character (source: check for double /).
26B3
DEC HL 2B
Decrement Register Pair HL back to the first character, 2400H; the flags of the compare are kept.
26B4
If the line does not begin with two slashes (NZ) jump to WRCPLD at 26C1H (source: jump if not //).
26B6
LD A,(2402H) 3A 02 24
Load Register A with the byte at 2402H, the third character of the compiled line (source: ck on comment).
26B9
CP 2EH FE 2E
Compare Register A with 2EH, the full stop of a //. comment.
26BB
If it is not a //. comment (NZ) jump to WRCPLD at 26C1H: an execution macro is written (source: bypass if not comment).
26BD
LD A,0AH 3E 0A
Load Register A with 0AH, SVC 10, @DSPLY, which shows the text at Register Pair HL up to its carriage return.
26BF
RST 28H EF
Call @DSPLY with RST 28H (BOOT/SYS): the //. comment, slashes and full stop included, is shown now, in the compile, and not written to SYSTEM/JCL (source: else display the comment).
26C0
RET C9
Return to 258CH, CPLJCL, after the CALL at CONDCPL (2589H), for the next line: the //. comment is not written.
26C1WRCPLD
LD C,(HL) 4E
WRCPLD: load Register C with the byte at Register Pair HL, a character of the compiled line (source: p/u a char).
26C2
LD A,04H 3E 04
Load Register A with 04H, SVC 4, @PUT, which writes the byte in Register C to the file of the FCB at Register Pair DE (source: put it out).
26C4
RST 28H EF
Call @PUT with RST 28H (BOOT/SYS): the byte goes to SYSTEM/JCL through JFCB$ and OUTBUF.
26C5
If the write failed (NZ) jump to IOERR at 2946H, such as Disk space full (source: jump on error).
26C8
LD A,(HL) 7E
Load Register A with the byte at Register Pair HL, the character just written (source: grab again to test).
26C9
INC HL 23
Increment Register Pair HL to the next character (source: bump pointer).
26CA
CP 0DH FE 0D
Compare Register A with 0DH, the carriage return, the line's last byte (source: end of line?).
26CC
If the line goes on (NZ) jump back to WRCPLD at 26C1H; a byte 0DH made by %0D ends the line here too (source: loop if not).
26CE
RET C9
Return to 258CH, CPLJCL, after the CALL at CONDCPL (2589H), for the next line, this one written to SYSTEM/JCL.

26CFH - Member 13 (DO): CONDTBL and ASSNTBL, the Names of the Compile Macros

Two tables that FNDPRM (28E6H) searches for the name after the two slashes: CONDTBL holds IF, ELSE and END, 5 characters and the routine's address each (7 bytes an entry, CK4COND 28CBH); ASSNTBL holds SET, RESET, ASSIGN, INCLUDE and QUIT, 8 characters and the address each (10 bytes an entry, CK4ASSN 28D4H). A 00H ends each table. The names are padded with spaces, and FNDPRM takes a name that ends where the table has a space, and PARSER passes over the character that ends the name, so //IF A finds IF and tests A, and //IF-A finds IF but tests A, not -A: the minus is taken as the name's end.

26CF-26D3CONDTBL
DEFM "IF " 49 46 20 20 20
CONDTBL, 26CFH-26D3H: the name IF and three spaces.
26D4-26D5
DEFW 2718H 18 27
26D4H-26D5H: 2718H, the address of IF01, the //IF routine.
26D6-26DA
DEFM "ELSE " 45 4C 53 45 20
26D6H-26DAH: the name ELSE and a space, the second entry of CONDTBL.
26DB-26DC
DEFW 2741H 41 27
26DBH-26DCH: 2741H, the address of ELSE1, the //ELSE routine.
26DD-26E1
DEFM "END " 45 4E 44 20 20
26DDH-26E1H: the name END and two spaces, the last entry of CONDTBL.
26E2-26E3
DEFW 274CH 4C 27
26E2H-26E3H: 274CH, the address of END1, the //END routine.
26E4
DEFB 00H 00
26E4H: 00H, the end of CONDTBL, where FNDPRM returns NZ.
26E5-26ECASSNTBL
DEFM "SET " 53 45 54 20 20 20 20 20
ASSNTBL, 26E5H-26ECH: the name SET and five spaces.
26ED-26EE
DEFW 277BH 7B 27
26EDH-26EEH: 277BH, the address of SET1, the //SET routine.
26EF-26F6
DEFM "RESET " 52 45 53 45 54 20 20 20
26EFH-26F6H: the name RESET and three spaces.
26F7-26F8
DEFW 278AH 8A 27
26F7H-26F8H: 278AH, the address of RESET1, the //RESET routine.
26F9-2700
DEFM "ASSIGN " 41 53 53 49 47 4E 20 20
26F9H-2700H: the name ASSIGN and two spaces, the third entry of ASSNTBL.
2701-2702
DEFW 279CH 9C 27
2701H-2702H: 279CH, the address of ASSIGN, the //ASSIGN routine.
2703-270A
DEFM "INCLUDE " 49 4E 43 4C 55 44 45 20
2703H-270AH: the name INCLUDE and a space, the fourth entry of ASSNTBL.
270B-270C
DEFW 27B7H B7 27
270BH-270CH: 27B7H, the address of INCLUD, the //INCLUDE routine.
270D-2714
DEFM "QUIT " 51 55 49 54 20 20 20 20
270DH-2714H: the name QUIT and four spaces, the last entry of ASSNTBL.
2715-2716
DEFW 27EAH EA 27
2715H-2716H: 27EAH, the address of QUIT, the //QUIT routine.
2717
DEFB 00H 00
2717H: 00H, the end of ASSNTBL, where FNDPRM returns NZ.

2718H - Member 13 (DO): the Compile Macros //IF, //ELSE, //END, //SET, //RESET, //ASSIGN, //INCLUDE and //QUIT

//IF reads its expression from left to right: a token is true when it is in the symbol table; a minus before it makes NOT; a false term before an ampersand makes the whole expression false; a true term not followed by an ampersand makes it true, whatever follows (B107). The result, ORed with the state of the level around it, is pushed as a new level at CONDPTR, with no limit (B108). //ELSE turns the current level over, //END drops it; either with no //IF open is Bad JCL format. //SET puts a token into the table, //RESET blanks the first character of its name, //ASSIGN sets a token and its value. //INCLUDE keeps the current file's FCB in one of the 5 save areas of NESTFCB and opens the included file through DOFCB; //QUIT shows its line and ends DO.

2718IF01
IF01: call IF05 at 2755H to read the terms joined by ampersands: Z when they are all true, NZ with Register A = the separator after the first false term (source: parse expression).
271B
If the terms were all true (Z) jump to IF02 at 2731H: the //IF is true, and the rest of the line is not read (source: Z = true, NZ = false).
271D
CP 0DH FE 0D
Compare Register A with 0DH: a false term ends the line (source: false and end of line?).
271F
If the line ends here (Z) jump to IF03 at 2734H: the //IF is false.
2721
CP 2BH FE 2B
Compare Register A with 2BH, the plus of OR (source: logical OR?).
2723
If it is OR (Z) jump back to IF01 at 2718H to try the terms after the plus.
2725
CP 26H FE 26
Compare Register A with 26H, the ampersand of AND (source: separator AND?).
2727
If the separator is none of these (NZ) jump to BADHDR0 at 277EH, Bad JCL format: a space or other character after a false term is refused, though after a true term the line's rest is never read (B107) (source: invalid format if not).
2729IF01A
INC HL 23
IF01A: increment Register Pair HL: a false term before an ampersand makes the //IF false, so the rest of the line is passed over; with the ampersand the line's last character (//IF A&), this steps past the carriage return before it is tested and runs on to the next 0DH in memory, harmless as the result is false all the same (source: ignore rest of line).
272A
LD A,(HL) 7E
Load Register A with the byte at Register Pair HL, the next character.
272B
CP 0DH FE 0D
Compare Register A with 0DH, the carriage return.
272D
If the line goes on (NZ) jump back to IF01A at 2729H.
272F
Jump to IF03 at 2734H: the //IF is false, the rest of its line passed over.
2731IF02
XOR A AF
IF02: exclusive OR Register A with itself: Register A = 00H, true (source: logic = true).
2732
Jump to IF04 at 2736H to push the state, true, as a new conditional level.
2734IF03
LD A,FFH 3E FF
IF03: load Register A with 0FFH, false (source: logic = false).
2736IF04
LD HL,(2B6EH) 2A 6E 2BLD HL,(CONDPTR)
IF04: load Register Pair HL with the word at CONDPTR, 2B6EH-2B6FH, the pointer to the current level (source: get conditional pointer).
2739
OR (HL) B6
OR Register A with the byte at Register Pair HL, the current level's state: inside a false block the new level is false too (source: set logic state).
273A
INC HL 23
Increment Register Pair HL to the next level; nothing tests it against the 32 bytes of CONDFLG, 2B70H-2B8FH (B108) (source: bump pointer).
273B
LD (HL),A 77
Store Register A, the new level's state, at the byte at Register Pair HL (source: stuff state result).
273C
LD (2B6EH),HL 22 6E 2BLD (CONDPTR),HL
Store Register Pair HL into CONDPTR, 2B6EH-2B6FH: the new level is current (source: save pointer).
273F
Jump to GOJCL at 2787H for the next line: an //IF line is not written.
2741ELSE1
ELSE1: call CKCOND at 2620H: Register Pair HL = the current level's pointer, or Bad JCL format when no //IF is open (source: ck nest of conditional).
2744
LD A,(HL) 7E
Load Register A with the byte at Register Pair HL, the current level's state (source: flip state of flag based on previous test).
2745
CPL 2F
Complement Register A: true becomes false and false true.
2746
DEC HL 2B
Decrement Register Pair HL to the level around the //IF.
2747
OR (HL) B6
OR Register A with the byte at Register Pair HL, that level's state: an //ELSE inside a false block stays false (source: OR in previous state).
2748
INC HL 23
Increment Register Pair HL back to the current level.
2749
LD (HL),A 77
Store Register A, the turned state, at the byte at Register Pair HL; a second //ELSE turns it back, nothing stops it (source: store new value).
274A
Jump to GOJCL at 2787H for the next line: an //ELSE line is not written.
274CEND1
END1: call CKCOND at 2620H: Register Pair HL = the current level's pointer, or Bad JCL format when no //IF is open (source: ck nest level).
274F
DEC HL 2B
Decrement Register Pair HL to the level around the //IF (source: backup conditional one level and reset pointer).
2750
LD (2B6EH),HL 22 6E 2BLD (CONDPTR),HL
Store Register Pair HL into CONDPTR, 2B6EH-2B6FH: the level is dropped. An //IF left open at the end of the file is not reported.
2753
Jump to GOJCL at 2787H for the next line: an //END line is not written.
2755IF05
IF05: call IF06 at 275FH to evaluate one term: Z true, NZ false, Register A = the separator after it (source: get if symbol is true or false).
2758
RET NZ C0
Return NZ when the term is false, with Register A = its separator (source: and ret if false).
2759
CP 26H FE 26
Compare Register A with 26H, the ampersand: a true term before AND (source: logical AND separator?).
275B
If it is AND (Z) jump back to IF05 at 2755H to evaluate the next term (source: if TRUE AND, ck next).
275D
XOR A AF
Exclusive OR Register A with itself: Register A = 00H and Z, true; the separator is dropped, so what follows a true term is never looked at (source: true and not AND).
275E
RET C9
Return Z, true, with Register A = 00H in place of the separator.
275FIF06
LD A,(HL) 7E
IF06: load Register A with the byte at Register Pair HL, the term's first character.
2760
CP 2DH FE 2D
Compare Register A with 2DH, the minus of NOT (source: logical NOT?).
2762
If there is no minus (NZ) jump to IF08 at 276EH, whose return is the term's.
2764
INC HL 23
Increment Register Pair HL past the minus (source: bypass -).
2765
Call IF08 at 276EH to look the token up: Z when it is in the table (source: grab symbol logic state).
2768
If the token is not in the table (NZ) jump to IF07 at 276BH: NOT false is true (source: Z = true, NZ = false).
276A
DEFB 0F6H F6
276AH: F6H, the opcode of OR n: entered here (Z) it runs as OR 0AFH with the XOR A at 276BH as its operand: Register A becomes non zero, NZ, false: NOT true is false (source: was true, not then false).
276BIF07
XOR A AF
IF07: exclusive OR Register A with itself: Register A = 00H and Z, true, for NOT false (source: was false, not then true).
276C
LD A,B 78
Load Register A with Register B, the separator IF08 left there; when IF08 found no token Register B is PARSER's 00H, which is why //IF - is true; the flags are kept (source: rcvr separator).
276D
RET C9
Return to IF05 with Z true or NZ false and Register A = the separator.
276EIF08
IF08: call PARSNAM at 27F0H to read the token into CURSYM, 29ACH-29B3H: Z when it holds a character, Register A = the separator (source: get symbol name into buf).
2771
RET NZ C0
Return NZ when no token follows (source: ret if bad symbol).
2772
PUSH AF F5
Save Register Pair AF, the separator in Register A, on the stack for 2778H.
2773
PUSH HL E5
Save Register Pair HL, the line pointer, on the stack for 2777H.
2774
Call FINDSYM at 28BAH: Z when the token is in the symbol table, given on the DO line or by //SET or //ASSIGN, and not blanked by //RESET (source: find symbol in table).
2777
POP HL E1
Restore Register Pair HL, the line pointer, saved at 2773H.
2778
POP BC C1
Restore Register Pair BC: Register B = the separator saved at 2772H.
2779
LD A,B 78
Load Register A with Register B, the separator; the flags of FINDSYM are kept (source: put zero in A and use flag).
277A
RET C9
Return Z when the token is true, NZ when false (source: from search).
277BSET1
SET1: call PARSNAM at 27F0H to read the token after //SET into CURSYM, 29ACH-29B3H (source: parse symbol name).
277EBADHDR0
BADHDR0: if no token was found (NZ) jump to BADHDR at 262CH, Bad JCL format; other macros jump here with NZ for any fault (source: jump if bad symbol).
2781
Call FINDSYM at 28BAH: Z when the token is already in the table, NZ with Register Pair DE at the first free entry (source: find in table).
2784
Call MOVNAME at 289DH when the token is new (NZ): it goes into the table with an empty value; an existing token keeps its value (source: move name into table).
2787GOJCL
GOJCL: jump to CPLJCL at 258CH for the next line.
278ARESET1
RESET1: call PARSNAM at 27F0H to read the token after //RESET into CURSYM, 29ACH-29B3H (source: parse symbol name).
278D
If no token was found (NZ) jump to BADHDR0 at 277EH, Bad JCL format.
278F
Call FINDSYM at 28BAH: Z when the token is in the table, Register Pair DE = its length byte (source: find symbol in table).
2792
If the token is not in the table (NZ) jump to GOJCL at 2787H: nothing to reset (source: no problem if not there).
2794
LD HL,FFF8H 21 F8 FF
Load Register Pair HL with 0FFF8H, minus 8 (source: point to start of name and put in a blank).
2797
ADD HL,DE 19
Add Register Pair DE, the length byte, to Register Pair HL: Register Pair HL = the start of the entry, its name.
2798
LD (HL),20H 36 20
Store 20H, a space, at the byte at Register Pair HL, the name's first character: no token begins with a space, so the entry never matches again; its 41 bytes stay in the table, and a //SET of the same token adds a new entry (source: to remove symbol).
279A
Jump to GOJCL at 2787H for the next line: a //RESET line is not written.
279CASSIGN
ASSIGN: call PARSNAM at 27F0H to read the token after //ASSIGN into CURSYM, 29ACH-29B3H (source: parse symbol name).
279F
If no token was found (NZ) jump to BADHDR0 at 277EH, Bad JCL format (source: jump on bad name).
27A1
PUSH AF F5
Save Register Pair AF, the separator in Register A, on the stack for 27A8H (source: save separator char).
27A2
Call FINDSYM at 28BAH: Z when the token is in the table, Register Pair DE = its length byte; NZ with Register Pair DE at the first free entry (source: find in table).
27A5
Call MOVNAME at 289DH when the token is new (NZ), so that Register Pair DE is its length byte either way (source: add to table if not in).
27A8
POP AF F1
Restore Register Pair AF: Register A = the separator after the token (source: recover separator).
27A9
CP 3DH FE 3D
Compare Register A with 3DH, the equal sign (source: error if not =).
27AB
If there is no equal sign (NZ) jump to BADHDR0 at 277EH: //ASSIGN ALL is Bad JCL format, as the manual says.
27AD
Call PARSVAL at 27FBH to read the value into STRLEN and VALBUF, 29B4H-29D4H (source: parse value of symbol).
27B0
If PARSVAL returned NZ jump to BADHDR0 at 277EH; it never does, as XFRSTR returns only with Z and PARSVAL gives back its flags, so //ASSIGN A= with no value is taken with length 0 (B113).
27B2
Call MOVALUE at 28AFH to copy the length and the 32 bytes of the value into the entry at Register Pair DE (source: place value into table).
27B5
Jump to GOJCL at 2787H for the next line: an //ASSIGN line is not written.
27B7INCLUD
PUSH HL E5
INCLUD: save Register Pair HL, the pointer to the included file's spec, on the stack for 27CFH.
27B8
LD DE,(2ACCH) ED 5B CC 2ALD DE,(NESTPTR)
Load Register Pair DE with the word at NESTPTR, 2ACCH-2ACDH, the next free save area (source: point to next FCB save area and check if room).
27BC
LD HL,2B6EH 21 6E 2BLD HL,NESTEND
Load Register Pair HL with 2B6EH, NESTEND, just after the fifth save area (source: to store another FCB).
27BF
XOR A AF
Exclusive OR Register A with itself: Register A = 00H and the Carry flag clear for the SBC.
27C0
SBC HL,DE ED 52
Subtract Register Pair DE from Register Pair HL: Z when all 5 save areas are in use.
27C2
If 5 //INCLUDEs are open (Z) jump to NESTS at 2955H, Too many nested INCLUDEs; the manual says ten may be open (source: error if 5 nests already).
27C5
LD HL,298CH 21 8C 29LD HL,DOFCB
Load Register Pair HL with 298CH, DOFCB, the FCB of the file being compiled (source: shift current FCB into INCLUDE FCB save area).
27C8
Call DOLDIR at 2509H to copy Register Pair BC = 32 bytes from Register Pair HL, DOFCB, to the save area at Register Pair DE (6.3.1); Register Pair DE ends at the next save area.
27CB
LD (2ACCH),DE ED 53 CC 2ALD (NESTPTR),DE
Store Register Pair DE into NESTPTR, 2ACCH-2ACDH: the save area is taken (source: update new nest pointer).
27CF
POP HL E1
Restore Register Pair HL, the pointer to the spec, saved at 27B7H.
27D0
LD DE,298CH 11 8C 29LD DE,DOFCB
Load Register Pair DE with 298CH, DOFCB, now for the included file (source: point to FCB).
27D3
LD A,4EH 3E 4E
Load Register A with 4EH, SVC 78, @FSPEC, which reads a file spec at Register Pair HL into the FCB at Register Pair DE (source: fetch included file).
27D5
RST 28H EF
Call @FSPEC with RST 28H (SYS1/SYS): Z with the included file's spec in DOFCB; anything after it on the line is ignored.
27D6
If there is no valid spec (NZ) jump to BADHDR0 at 277EH, Bad JCL format.
27D8
Call DOFEXT at 2985H to give the spec the extension JCL when it has none (6.3.1).
27DB
LD HL,2C00H 21 00 2CLD HL,INPBUF
Load Register Pair HL with 2C00H, INPBUF, the buffer the outer file used too: UNNEST reads its sector again (source: open the included file).
27DE
LD B,L 45
Load Register B with Register L, 00H: the record length 256.
27DF
SET 0,(IY+12H) FD CB 12 C6
Set bit 0 of SFLAG$ (IY+12H, 007CH), Index Register IY holding 006AH: no open bit, no close authority (source: inhibit file open bit).
27E3
LD A,3BH 3E 3B
Load Register A with 3BH, SVC 59, @OPEN, which opens the file named in the FCB at Register Pair DE.
27E5
RST 28H EF
Call @OPEN with RST 28H (SYS2/SYS): Z with the included file open through DOFCB.
27E6
If the open failed (NZ) jump to BADHDR0 at 277EH: a missing included file shows Bad JCL format, not File not in directory.
27E8
Jump to GOJCL at 2787H: the next lines come from the included file, until its end or a label line.
27EAQUIT
LD HL,2B9EH 21 9E 2BLD HL,JCLBUF1
QUIT: load Register Pair HL with 2B9EH, JCLBUF1, the //QUIT line as read (source: log the //QUIT command).
27ED
Jump to EXTERR at 2970H, which shows and logs the //QUIT line, closes SYSTEM/JCL with the lines compiled so far (B116) and ends DO with Register Pair HL = FFFFH.

27F0H - Member 13 (DO): PARSNAM, PARSVAL, XFRSTR, PARSER and the Symbol Table

PARSNAM reads a token of up to 8 characters into CURSYM (29ACH), PARSVAL a value of up to 32 into VALBUF (29B5H) with its length in STRLEN (29B4H). PARSER takes the digits, the letters (made capitals), the full stop, the slash and the colon, any character at all between double quotes (the quotes dropped), passes over the characters past the maximum, fills the rest of the field with spaces and stops at any other character with Register Pair HL after it (at a carriage return or 03H, on it). An at sign marks the label. The quote flag (284BH) and the label mark (285EH) are kept from field to field and line to line (B110, B111). PARSER always returns with Register B = 00H. XFRSTR substitutes a #token# in a value and goes on past a separator other than a space, comma, carriage return, equal sign or parenthesis by calling PARSER again with Register B as it was left, so the rest of the value after a dropped separator or a found substitution is lost, and after a token not given up to 8 more characters are taken (B109, B117, B118). The symbol table at 2E00H grows upward by 41 bytes a token with no limit (B115).

27F0PARSNAM
PUSH DE D5
PARSNAM: save Register Pair DE on the stack for 27F9H.
27F1
LD B,08H 06 08
Load Register B with 08H, the 8 characters of a token (source: 8 chars max).
27F3
LD DE,29ACH 11 AC 29LD DE,CURSYM
Load Register Pair DE with 29ACH, CURSYM, the buffer of the token's name (source: symbol buffer area).
27F6
Call PARSER at 2837H to read the name into CURSYM, filled to 8 with spaces: Z when it holds at least one character, Register A = the character that ended it (source: parse it).
27F9
POP DE D1
Restore Register Pair DE saved at 27F0H; the flags of PARSER are kept.
27FA
RET C9
Return to the caller with Z or NZ and the separator in Register A.
27FBPARSVAL
PUSH DE D5
PARSVAL: save Register Pair DE, the entry's length byte in the callers, on the stack for 2818H.
27FC
LD B,20H 06 20
Load Register B with 20H, the 32 characters of a value (source: 32 chars max).
27FE
LD DE,29B5H 11 B5 29LD DE,VALBUF
Load Register Pair DE with 29B5H, VALBUF, the buffer of the value (source: value buffer).
2801
Call XFRSTR at 281AH to read the value into VALBUF: Register Pair DE ends after its last character, Register A = the separator, always with Z (source: transfer from input).
2804
PUSH AF F5
Save Register Pair AF, the separator and XFRSTR's Z flag, on the stack for 2817H.
2805
PUSH HL E5
Save Register Pair HL, the line pointer, on the stack for 2816H.
2806
EX DE,HL EB
Exchange Register Pair DE and Register Pair HL: Register Pair HL = the end of the value (source: calculate length of the string).
2807
LD DE,29B5H 11 B5 29LD DE,VALBUF
Load Register Pair DE with 29B5H, VALBUF, its start.
280A
XOR A AF
Exclusive OR Register A with itself: Register A = 00H and the Carry flag clear for the SBC.
280B
SBC HL,DE ED 52
Subtract Register Pair DE from Register Pair HL: Register Pair HL = the value's length.
280D
LD A,L 7D
Load Register A with Register L, the length's low byte; a value of 256 or more characters cannot be read from a line of 80.
280E
CP 21H FE 21
Compare Register A with 21H: no Carry for a value of more than 32 characters.
2810
If the value is longer than 32 characters (NC) jump to TOOLNG at 2959H, Symbol string too long; the bytes are already written past VALBUF by then (B109) (source: jump if more than 32 chars).
2813
LD (29B4H),A 32 B4 29LD (STRLEN),A
Store Register A, the length, into STRLEN, 29B4H, just before VALBUF (source: stuff string length).
2816
POP HL E1
Restore Register Pair HL, the line pointer, saved at 2805H.
2817
POP AF F1
Restore Register Pair AF saved at 2804H: Register A = the separator, and the Z flag of XFRSTR, so PARSVAL always returns Z.
2818
POP DE D1
Restore Register Pair DE saved at 27FBH, the caller's entry pointer.
2819
RET C9
Return to the caller with Register Pair DE, Register Pair HL and the separator as they were.
281AXFRSTR
XFRSTR: call PARSER at 2837H to read characters into the buffer at Register Pair DE, at most Register B: 32 on the first call, and on a later one what the last PARSER or substitution left, 00H or 08H (source: xfer max of 32 chars).
281DXFRSTR1
XFRSTR1: call CKSPCOM at 2936H: Z when Register A, the separator, is a space or a comma.
2820
RET Z C8
Return Z at a space or a comma (source: return on space or comma).
2821
CP 0DH FE 0D
Compare Register A with 0DH, the carriage return.
2823
RET Z C8
Return Z at the end of the line (source: ret on end of line).
2824
CP 3DH FE 3D
Compare Register A, the separator, with 3DH, the equal sign.
2826
RET Z C8
Return Z at an equal sign (source: ret on =).
2827
CP 28H FE 28
Compare Register A with 28H, an opening parenthesis.
2829
RET Z C8
Return Z at an opening parenthesis (source: ret on left paren).
282A
CP 29H FE 29
Compare Register A with 29H, a closing parenthesis.
282C
RET Z C8
Return Z at a closing parenthesis (source: ret on right paren).
282D
CP 23H FE 23
Compare Register A, the separator, with 23H, a number sign.
282F
At any other separator (NZ) jump back to XFRSTR at 281AH: the separator is dropped, and PARSER is called again with Register B as it left it, 00H, so the rest of the value up to the next ending character is read and dropped (A=1-2 gives 1) (B109) (source: loop if not #).
2831
Call CPLJCL5 at 25D5H with the number sign: ## gives one number sign, #token# the token's value copied to Register Pair DE with no length test; after a value found Register B is 00H (2601H and the LDIR), so the rest of the value is dropped; after a token not given Register B is 08H from FINDSYM, so up to 8 more characters are taken and filled out with spaces past them (B109) (source: ck on substitution).
2834
LD A,(HL) 7E
Load Register A with the byte at Register Pair HL, the character after the substitution, without moving Register Pair HL past it: a number sign there is compared with itself by CPLJCL5 and taken as ##, so #F##E# in a value gives F's value and a number sign and then fails (B117); on the DO line the closing parenthesis right after a substitution is read twice (B118).
2835
Jump back to XFRSTR1 at 281DH to test it as a separator; when it is not one, XFRSTR reads on (source: then loop).
2837PARSER
LD A,B 78
PARSER: load Register A with Register B, the field's length: 8 or 32 on a first call, 00H or 08H when XFRSTR calls again (source: set max length of field).
2838
LD (2899H),A 32 99 28
Store Register A into PAR6+1, 2899H, the operand of the LD A at 2898H: a non zero length means no character found yet; when Register B is 00H the call returns Z though it stores nothing.
283B
INC B 04
Increment Register B: one more than the field, the count PAR3 decrements.
283CPAR2
LD A,(HL) 7E
PAR2: load Register A with the byte at Register Pair HL, the next character (source: p/u entry char).
283D
CP 03H FE 03
Compare Register A with 03H, the end of text mark (source: ETX?).
283F
If it is 03H (Z) jump to PAR5 at 288DH with Register Pair HL on it.
2841
CP 0DH FE 0D
Compare Register A with 0DH, the carriage return.
2843
If it is the end of the line (Z) jump to PAR5 at 288DH with Register Pair HL on it.
2845
INC HL 23
Increment Register Pair HL past the character: any other character that ends the field is passed over (source: not ending char, bump).
2846
CP 22H FE 22
Compare Register A with 22H, a double quote (source: ck on string quote).
2848
If it is not a double quote (NZ) jump to NOTQT at 2851H.
284A
XOR 22H EE 22
Exclusive OR Register A, 22H, with the byte at 284BH, this instruction's operand: 22H outside quotes, 00H inside (source: ck if opening or closing).
284C
LD (284BH),A 32 4B 28LD (STUFQT),A
Store Register A into 284BH: an opening quote makes it 00H, a closing one 22H again; it is kept from field to field and line to line, so an unclosed quote leaves every later field of the compile read as if quoted (B111).
284F
Jump back to PAR2 at 283CH: the quote itself is not stored and not counted (source: loop until terminator).
2851NOTQT
LD C,A 4F
NOTQT: load Register C with Register A, the character (source: save char and test if within quoted string).
2852
LD A,(284BH) 3A 4B 28LD A,(STUFQT)
Load Register A with the byte at 284BH, the quote flag: 00H inside quotes.
2855
OR A B7
OR Register A with itself, the quote flag: Z inside quotes.
2856
LD A,C 79
Load Register A with Register C, the character again; the flags are kept (source: get back the char).
2857
Inside quotes (Z) jump to PAR3 at 287FH: any character but 03H and the carriage return is taken as it is (source: allow all within quotes).
2859
CP 40H FE 40
Compare Register A with 40H, the at sign of a label (source: start of label?).
285B
If it is not an at sign (NZ) jump to NOLBL at 286AH.
285DGOTLBL
SUB 00H D6 00
GOTLBL: subtract the byte at 285EH, this instruction's operand, from Register A: 00H in the file, so 40H stays; 40H after an at sign, so the result is 0 (source: make sure only one).
285F
If an at sign was met before (Z) jump to LBLERR at 2961H, Too many Proc labels: an at sign anywhere outside quotes, in a value on the DO line or in any field of the JCL file, counts as a second label (B110).
2862
LD (285EH),A 32 5E 28
Store Register A, 40H, into 285EH, the operand above and the byte TSTLBL reads (2556H): a label was given (source: stuff into test).
2865
LD (2516H),A 32 16 25
Store Register A, 40H, into 2516H, the operand of FNDLBL's LD (2515H): the token being read is the label; an at sign inside a value marks the next token instead (B110) (source: and also for check).
2868
Jump back to PAR2 at 283CH: the at sign itself is not stored (source: loop through start).
286ANOLBL
CP 2EH FE 2E
NOLBL: compare Register A with 2EH, the full stop, the first of the full stop, the slash, the digits and the colon (source: accept . / 0-9 :).
286C
If the character is below 2EH (Carry) jump to PAR5 at 288DH: it ends the field.
286E
CP 3BH FE 3B
Compare Register A with 3BH, one past the colon.
2870
If it is the full stop, the slash, a digit or the colon (Carry) jump to PAR3 at 287FH to take it.
2872
CP 41H FE 41
Compare Register A with 41H, the letter A (source: test for A-Z).
2874
If it is 3BH-3FH (Carry) jump to PAR5 at 288DH: it ends the field (an at sign outside quotes went to GOTLBL).
2876
CP 5BH FE 5B
Compare Register A with 5BH, one past the letter Z.
2878
If it is a capital letter (Carry) jump to PAR3 at 287FH to take it.
287A
Call CKLCA2Z at 293CH: a small letter is made a capital with no Carry; Carry for anything else (source: test for a-z).
287D
If it is not a letter (Carry) jump to PAR5 at 288DH: it ends the field.
287FPAR3
DEC B 05
PAR3: decrement Register B, the room left in the field (source: char count down).
2880
If the field is full (Z) jump to PAR4 at 288AH: the character is passed over.
2882
LD (DE),A 12
Store Register A, the character, at Register Pair DE (source: save the char).
2883
XOR A AF
Exclusive OR Register A with itself: Register A = 00H (source: show we found at least one valid char).
2884
LD (2899H),A 32 99 28
Store Register A, 00H, into 2899H, PAR6's operand: a character was found.
2887
INC DE 13
Increment Register Pair DE to the next byte of the field (source: bump receiving buffer).
2888
Jump back to PAR2 at 283CH for the next character (source: loop).
288APAR4
INC B 04
PAR4: increment Register B back to 1: characters past the field's length are read and dropped (source: ignore trailing chars past max length).
288B
Jump back to PAR2 at 283CH for the next character of the line.
288DPAR5
LD C,A 4F
PAR5: load Register C with Register A, the character that ended the field (source: found char out of range).
288E
PUSH DE D5
Save Register Pair DE, the end of the characters stored, on the stack for 2897H (source: save current end of buf).
288F
Jump to PAR5B at 2895H to fill the field's rest.
2891PAR5A
LD A,20H 3E 20
PAR5A: load Register A with 20H, a space (source: fill out remaining field with blanks).
2893
LD (DE),A 12
Store Register A, the space, at Register Pair DE.
2894
INC DE 13
Increment Register Pair DE to the next byte of the field to fill.
2895PAR5B
PAR5B: decrement Register B and, while it is not zero, jump back to PAR5A at 2891H: the field's rest is filled with spaces, and PARSER always returns with Register B = 00H; called again with 00H it fills nothing, with 08H (after a token not given) up to 7 spaces past the characters taken (B109).
2897
POP DE D1
Restore Register Pair DE, the end of the characters stored, saved at 288EH (source: recover pointer to last char xfered).
2898PAR6
LD A,00H 3E 00
PAR6: load Register A with the byte at 2899H, this instruction's operand: 00H when a character was stored, else the field's length (source: get max len).
289A
OR A B7
OR Register A with itself: Z when at least one character was found (source: note if we found a char).
289B
LD A,C 79
Load Register A with Register C, the separator; the flags are kept (source: xfer separator char).
289C
RET C9
Return Z when the field holds a character, NZ when it is empty; Register Pair HL after the separator (on it at a carriage return or 03H).
289DMOVNAME
PUSH HL E5
MOVNAME: save Register Pair HL, the line pointer, on the stack for 28ADH.
289E
LD HL,29ACH 21 AC 29LD HL,CURSYM
Load Register Pair HL with 29ACH, CURSYM, the token's name (source: current symbol buffer).
28A1
LD BC,0008H 01 08 00
Load Register Pair BC with 0008H, the 8 bytes of a name (source: 8 chars to move).
28A4
LDIR ED B0
Copy Register Pair BC = 8 bytes from Register Pair HL, CURSYM, to Register Pair DE, the free entry of the table (LDIR): Register Pair DE ends at the entry's length byte.
28A6
XOR A AF
Exclusive OR Register A with itself: Register A = 00H (source: zero accumulator).
28A7
LD (DE),A 12
Store Register A, 00H, at Register Pair DE, the length byte: the value is empty (source: show symbol length = 0).
28A8
LD HL,0021H 21 21 00
Load Register Pair HL with 0021H, 33, the length byte and the 32 bytes of the value (source: point to 1st byte of next symbol pos).
28AB
ADD HL,DE 19
Add Register Pair DE to Register Pair HL: Register Pair HL = the first byte of the next entry, 41 bytes after this one's start; nothing tests it against HIGH$ (B115).
28AC
LD (HL),A 77
Store Register A, 00H, at the byte at Register Pair HL: the new end of the table (source: and show it spare).
28AD
POP HL E1
Restore Register Pair HL, the line pointer, saved at 289DH.
28AE
RET C9
Return with Register Pair DE at the new entry's length byte.
28AFMOVALUE
PUSH HL E5
MOVALUE: save Register Pair HL, the line pointer, on the stack for 28B8H.
28B0
LD HL,29B4H 21 B4 29LD HL,STRLEN
Load Register Pair HL with 29B4H, STRLEN, the value's length and then VALBUF (source: current value buffer).
28B3
LD BC,0021H 01 21 00
Load Register Pair BC with 0021H, 33 bytes: the length and the 32 bytes of the value (source: length and value).
28B6
LDIR ED B0
Copy Register Pair BC = 33 bytes from Register Pair HL, 29B4H-29D4H, to Register Pair DE, the entry's length byte and value (LDIR).
28B8
POP HL E1
Restore Register Pair HL, the line pointer, saved at 28AFH.
28B9
RET C9
Return to the caller with the value in the symbol table.
28BAFINDSYM
PUSH HL E5
FINDSYM: save Register Pair HL, the line pointer, on the stack for 28C9H.
28BB
LD DE,29ACH 11 AC 29LD DE,CURSYM
Load Register Pair DE with 29ACH, CURSYM, the token to look for (source: symbol buffer).
28BE
LD HL,2E00H 21 00 2ELD HL,SYMTAB
Load Register Pair HL with 2E00H, SYMTAB, the start of the symbol table (source: start of table).
28C1
LD BC,0829H 01 29 08
Load Register Pair BC with 0829H: Register B = 8 characters to compare, Register C = 41 bytes an entry, the name 8, the length 1 and the value 32 (source: field 8, 1, 32).
28C4
Call FNDPRM at 28E6H: Z with Register Pair HL at the entry's length byte, NZ with Register Pair HL at the table's end mark, the first free entry (source: search in progress).
28C7
LD D,H 54
Load Register D with Register H (source: xfer pointer of symbol or to spare slot).
28C8
LD E,L 5D
Load Register E with Register L: Register Pair DE = the length byte of the token found, or the free entry.
28C9
POP HL E1
Restore Register Pair HL, the line pointer, saved at 28BAH; the flags of FNDPRM are kept.
28CA
RET C9
Return Z when the token is in the table, NZ when it is not.
28CBCK4COND
PUSH HL E5
CK4COND: save Register Pair HL, the line pointer, on the stack for 28E4H.
28CC
LD HL,26CFH 21 CF 26LD HL,CONDTBL
Load Register Pair HL with 26CFH, CONDTBL, the table of IF, ELSE and END (source: parm table).
28CF
LD BC,0507H 01 07 05
Load Register Pair BC with 0507H: Register B = 5 characters to compare, Register C = 7 bytes an entry (source: 5 chars, 7-char field).
28D2
Jump to CK4AS1 at 28DBH to search CONDTBL for the name in CURSYM.
28D4CK4ASSN
PUSH HL E5
CK4ASSN: save Register Pair HL, the line pointer, on the stack for 28E4H.
28D5
LD HL,26E5H 21 E5 26LD HL,ASSNTBL
Load Register Pair HL with 26E5H, ASSNTBL, the table of SET, RESET, ASSIGN, INCLUDE and QUIT (source: parm table).
28D8
LD BC,080AH 01 0A 08
Load Register Pair BC with 080AH: Register B = 8 characters to compare, Register C = 10 bytes an entry (source: parm length, field len).
28DBCK4AS1
LD DE,29ACH 11 AC 29LD DE,CURSYM
CK4AS1: load Register Pair DE with 29ACH, CURSYM, the name after the slashes (source: buffer area).
28DE
Call FNDPRM at 28E6H: Z with Register Pair HL at the entry's address word (source: ck for match).
28E1
LD E,(HL) 5E
Load Register E with the byte at Register Pair HL, the low byte of the routine's address; after NZ the table's 00H (source: xfer vector address).
28E2
INC HL 23
Increment Register Pair HL to the address's high byte.
28E3
LD D,(HL) 56
Load Register D with the byte at Register Pair HL: Register Pair DE = the routine; after NZ a byte past the table, not used.
28E4
POP HL E1
Restore Register Pair HL, the line pointer, saved at 28CBH or 28D4H.
28E5
RET C9
Return Z with Register Pair DE = the routine, or NZ when the name is not in the table.

28E6H - Member 13 (DO): FNDPRM, CKSPCOM and CKLCA2Z

FNDPRM, the member's own table search (SYS1's @FNDPRM is not used), compares the name at Register Pair DE with each entry of the table at Register Pair HL, Register B characters, Register C bytes an entry, until an entry that begins with 00H: the name's characters are made capitals, a space or carriage return in the name ends the comparison, and a mismatch matches when the name's character is not a letter or digit and the entry has a space there, so a name with a full stop, slash or colon matches an earlier entry that ends where that character is (A.B finds A when A is in the table; otherwise A.B is a token of its own). It returns Z with Register Pair HL at the entry's byte after the name, or NZ with Register Pair HL at the end mark. It serves the symbol table, the label search and the two macro tables.

28E6FNDPRM
LD A,(HL) 7E
FNDPRM: load Register A with the byte at Register Pair HL, the first byte of the entry (source: end of parm table?).
28E7
OR A B7
OR Register A with itself: Z at the 00H that ends the table.
28E8
If the entry is not the end (NZ) jump to FND1 at 28ECH (source: jump if not).
28EA
INC A 3C
Increment Register A, 00H, to 01H: NZ, not found (source: else show not found).
28EB
RET C9
Return NZ with Register Pair HL at the end mark.
28ECFND1
LD A,(DE) 1A
FND1: load Register A with the byte at Register Pair DE, the name's first character (source: char match?).
28ED
Call CKLCA2Z at 293CH to make a small letter a capital (source: convert a-z to A-Z).
28F0
CP (HL) BE
Compare Register A with the byte at Register Pair HL, the entry's first character.
28F1
If the first characters are equal (Z) jump to FND3 at 28FAH to compare the rest (source: jump if 1st matches).
28F3FND2
PUSH BC C5
FND2: save Register Pair BC, the counts, on the stack for 28F7H (source: else bypass complete field and go to next one).
28F4
LD B,00H 06 00
Load Register B with 00H: Register Pair BC = Register C, the bytes of an entry.
28F6
ADD HL,BC 09
Add Register Pair BC to Register Pair HL: Register Pair HL = the next entry.
28F7
POP BC C1
Restore Register Pair BC, the counts, saved at 28F3H.
28F8
Jump back to FNDPRM at 28E6H to test the next entry.
28FAFND3
PUSH HL E5
FND3: save Register Pair HL, the entry, on the stack for 2913H or 2933H (source: 1st matches, ck rest).
28FB
PUSH DE D5
Save Register Pair DE, the name, on the stack.
28FC
PUSH BC C5
Save Register Pair BC, the counts, on the stack.
28FD
DEC B 05
Decrement Register B: the characters left to compare after the first (source: adj for 1st match).
28FEFND4
INC DE 13
FND4: increment Register Pair DE to the name's next character.
28FF
INC HL 23
Increment Register Pair HL to the entry's next character.
2900
LD A,(DE) 1A
Load Register A with the byte at Register Pair DE, the name's character.
2901
CP 20H FE 20
Compare Register A with 20H, a space: the end of the name in CURSYM or in a label line.
2903
If it is a space (Z) jump to FND7 at 292CH to test the entry there (source: stop checking on space).
2905
CP 0DH FE 0D
Compare Register A with 0DH, the carriage return at the end of a label line.
2907
If it is the end of the line (Z) jump to FND7 at 292CH (source: or end of line).
2909
Call CKLCA2Z at 293CH to make a small letter a capital (source: ck and convert a-z to A-Z).
290C
CP (HL) BE
Compare Register A with the byte at Register Pair HL, the entry's character (source: compare remaining chars).
290D
If they differ (NZ) jump to FND6 at 291CH (source: jump on mismatch).
290F
Decrement Register B and, while it is not zero, jump back to FND4 at 28FEH for the next character (source: loop to count).
2911FND5
POP BC C1
FND5: restore Register Pair BC, the counts, saved at 28FCH (source: must have matched).
2912
POP DE D1
Restore Register Pair DE, the name, saved at 28FBH (source: bypass remaining part of field and point to address vector of parm in parm table).
2913
POP HL E1
Restore Register Pair HL, the entry's start, saved at 28FAH.
2914
PUSH BC C5
Save Register Pair BC, the counts, on the stack for 2919H.
2915
LD C,B 48
Load Register C with Register B, the characters of a name.
2916
LD B,00H 06 00
Load Register B with 00H: Register Pair BC = the name's length.
2918
ADD HL,BC 09
Add Register Pair BC to Register Pair HL: Register Pair HL = the entry's byte after the name, the length byte or the routine's address.
2919
POP BC C1
Restore Register Pair BC, the counts, saved at 2914H.
291A
XOR A AF
Exclusive OR Register A with itself: Register A = 00H and Z, found.
291B
RET C9
Return Z with Register Pair HL past the entry's name.
291CFND6
CP 30H FE 30
FND6: compare Register A, the name's character, with 30H: is it a letter or digit (source: no match, is it ASCII?).
291E
If it is below 30H (Carry) jump to FND7 at 292CH: the name ends here.
2920
CP 3AH FE 3A
Compare Register A with 3AH, one past 9 (source: 0-9?).
2922
If it is a digit (Carry) jump to FND8 at 2931H: a real mismatch.
2924
CP 41H FE 41
Compare Register A with 41H, the letter A (source: A-Z?).
2926
If it is 3AH-40H (Carry) jump to FND7 at 292CH: the name ends here.
2928
CP 5BH FE 5B
Compare Register A with 5BH, one past the letter Z.
292A
If it is a capital letter (Carry) jump to FND8 at 2931H: a real mismatch.
292CFND7
LD A,(HL) 7E
FND7: load Register A with the byte at Register Pair HL, the entry's character where the name ended (source: if table entry also a space, we have a match).
292D
CP 20H FE 20
Compare Register A, the entry's character, with 20H, a space.
292F
If the entry ends there too (Z) jump to FND5 at 2911H: found.
2931FND8
POP BC C1
FND8: restore Register Pair BC, the counts, saved at 28FCH.
2932
POP DE D1
Restore Register Pair DE, the name, saved at 28FBH.
2933
POP HL E1
Restore Register Pair HL, the entry's start, saved at 28FAH.
2934
Jump to FND2 at 28F3H to go on to the next entry.
2936CKSPCOM
CP 20H FE 20
CKSPCOM: compare Register A with 20H, a space.
2938
RET Z C8
Return Z when Register A is a space, the first of the two separators.
2939
CP 2CH FE 2C
Compare Register A with 2CH, a comma, the other separator passed over.
293B
RET C9
Return Z for a comma, NZ for any other character.
293CCKLCA2Z
CP 61H FE 61
CKLCA2Z: compare Register A with 61H, the letter a (source: back with C-flag if not a-z).
293E
RET C D8
Return with Carry for a character below a, unchanged.
293F
CP 7BH FE 7B
Compare Register A with 7BH, one past the letter z.
2941
CCF 3F
Complement the Carry flag: Carry for a character above z, no Carry for a small letter.
2942
RET C D8
Return with Carry for a character above z, unchanged.
2943
XOR 20H EE 20
Exclusive OR Register A with 20H: the small letter becomes a capital, and the Carry flag is cleared (source: make U/C and reset CF).
2945
RET C9
Return with no Carry and the capital in Register A.

2946H - Member 13 (DO): IOERR, the Messages' Exits, EXTERR, ERREXIT and DOFEXT

IOERR shows a DOS error briefly and returns its number; the chain from SPCREQ to MULDEF loads the address of one message each, the DDH bytes turning the loads after the first into LD IX, and EXTERR shows and logs it and returns FFFFH. ERREXIT closes JFCB$ when it is open, which keeps the lines of SYSTEM/JCL compiled so far (B116), and returns through SPSAV from the entry's depth. DOFEXT (6.3.1) gives a spec the extension JCL.

2946IOERR
LD L,A 6F
IOERR: load Register L with Register A, the error number (source: xfer errnum to HL).
2947
LD H,00H 26 00
Load Register H with 00H: Register Pair HL = the error number, DO's return code.
2949
OR C0H F6 C0
OR Register A with 0C0H: bit 7, return to the caller, and bit 6, the short form of the message (source: set brief, return).
294B
LD C,A 4F
Load Register C with Register A, the error number and the two bits, for @ERROR.
294C
LD A,1AH 3E 1A
Load Register A with 1AH, SVC 26, @ERROR, which shows the message of the error in Register C (source: display error).
294E
RST 28H EF
Call @ERROR with RST 28H (the SYS0/SYS stub that loads SYS4/SYS): the message is shown and logged.
294F
Jump to ERREXIT at 2976H with Register Pair HL = the error number.
2951SPCREQ
LD HL,29EDH 21 ED 29LD HL,SPCREQ$
SPCREQ: load Register Pair HL with 29EDH, SPCREQ$, File spec required (source: filespec required).
2954
DEFB 0DDH DD
2954H: DDH, the IX prefix: entered from 2951H, the LD HL,2AB3H that follows runs as LD IX,2AB3H, so Register Pair HL keeps SPCREQ$ and Index Register IX is changed.
2955NESTS
LD HL,2AB3H 21 B3 2ALD HL,NESTS$
NESTS: load Register Pair HL with 2AB3H, NESTS$, Too many nested INCLUDEs.
2958
DEFB 0DDH DD
2958H: DDH, the IX prefix: the LD HL,2A0EH that follows runs as LD IX,2A0EH.
2959TOOLNG
LD HL,2A0EH 21 0E 2ALD HL,TOOLNG$
TOOLNG: load Register Pair HL with 2A0EH, TOOLNG$, Symbol string too long.
295C
DEFB 0DDH DD
295CH: DDH, the IX prefix: the LD HL,2A25H that follows runs as LD IX,2A25H.
295DNOFIND
LD HL,2A25H 21 25 2ALD HL,NOFIND$
NOFIND: load Register Pair HL with 2A25H, NOFIND$, Procedure not found.
2960
DEFB 0DDH DD
2960H: DDH, the IX prefix: the LD HL,2A39H that follows runs as LD IX,2A39H.
2961LBLERR
LD HL,2A39H 21 39 2ALD HL,LBLERR$
LBLERR: load Register Pair HL with 2A39H, LBLERR$, Too many Proc labels.
2964
DEFB 0DDH DD
2964H: DDH, the IX prefix: the LD HL,2A4EH that follows runs as LD IX,2A4EH.
2965DSKFUL
LD HL,2A4EH 21 4E 2ALD HL,DSKFUL$
DSKFUL: load Register Pair HL with 2A4EH, DSKFUL$, Can't create SYSTEM/JCL file.
2968
DEFB 0DDH DD
2968H: DDH, the IX prefix: the LD HL,2A7CH that follows runs as LD IX,2A7CH.
2969PRMERR
LD HL,2A7CH 21 7C 2ALD HL,PRMERR$
PRMERR: load Register Pair HL with 2A7CH, PRMERR$, Parameter error.
296C
DEFB 0DDH DD
296CH: DDH, the IX prefix: the LD HL,2A6BH that follows runs as LD IX,2A6BH, the last of the chain.
296DMULDEF
LD HL,2A6BH 21 6B 2ALD HL,MULDEF$
MULDEF: load Register Pair HL with 2A6BH, MULDEF$, Multiply defined, which has no end mark and runs on into PRMERR$: Multiply defined Parameter error.
2970EXTERR
LD A,0CH 3E 0C
EXTERR: load Register A with 0CH, SVC 12, @LOGOT, which shows and logs the text at Register Pair HL up to its carriage return.
2972
RST 28H EF
Call @LOGOT with RST 28H (BOOT/SYS): the message, the line of BADHDR or the //QUIT line is shown and logged.
2973
LD HL,FFFFH 21 FF FF
Load Register Pair HL with 0FFFFH, the return code of an error DO reports itself (source: set error exit).
2976ERREXIT
LD DE,00C0H 11 C0 00LD DE,JFCB$
ERREXIT (an EQU in the source): load Register Pair DE with 00C0H, JFCB$, the system FCB of the JCL (source: if the output JCL file is open, then we need to close it).
2979
LD A,(DE) 1A
Load Register A with the byte at Register Pair DE, JFCB$+0: bit 7 set when an FCB is open there: SYSTEM/JCL being written, or the JCL being run when DO came from a JCL file.
297A
BIT 7,A CB 7F
Test bit 7 of Register A, the open bit of the FCB.
297C
If JFCB$ is not open (Z) jump to SPSAV at 2981H.
297E
LD A,3CH 3E 3C
Load Register A with 3CH, SVC 60, @CLOSE, which closes the file of the FCB at Register Pair DE.
2980
RST 28H EF
Call @CLOSE with RST 28H (SYS3/SYS): SYSTEM/JCL keeps the lines written before the error or the //QUIT, and a later DO followed by an asterisk runs them (B116); Register Pair HL is kept.
2981SPSAV
LD SP,0000H 31 00 00
SPSAV: load the Stack Pointer with the word at 2982H-2983H, stored by the entry (2400H): 0000H in the file; the stack is back at the entry's depth.
2984
RET C9
Return to the caller DO came from with Register Pair HL = the error number or FFFFH.
2985DOFEXT
LD HL,29E7H 21 E7 29
DOFEXT: load Register Pair HL with 29E7H, SYSJCL+7, the three letters JCL of SYSTEM/JCL (6.3.1; source: default to JCL).
2988
LD A,4FH 3E 4F
Load Register A with 4FH, SVC 79, @FEXT, which gives the spec in the FCB at Register Pair DE the extension at Register Pair HL when it has none.
298A
RST 28H EF
Call @FEXT with RST 28H (SYS1/SYS): the spec in DOFCB or JFCB$ gets /JCL unless an extension was typed.
298B
RET C9
Return to the caller, the member's last loaded byte of this block.

298CH - Member 13 (DO): the Work Areas, SYSJCL and the Messages

After DOFEXT the member's first gap: DOFCB, CURSYM, STRLEN, VALBUF and LBLSAV, 81 bytes not in the file. Then the zero byte that ends LBLSAV as a table, the line counter, the name SYSTEM/JCL with the room for its drive, the messages and P631G1, the Level 1G routine that puts the drive into the name, and NESTS$ and NESTPTR.

298C-29ABDOFCB
DEFS 32
DOFCB, 298CH-29ABH: not loaded. The FCB of the JCL file read in the compile: the spec from @FSPEC (2428H, 27D5H) with /JCL (2985H), opened at 243AH and 27E5H with INPBUF 2C00H as its buffer, read byte by byte by RDJCL (2680H) and again by @RREAD (24A7H); copied into a save area by INCLUD (27C8H) and back by UNNEST (249CH).
29AC-29B3CURSYM
DEFS 8
CURSYM, 29ACH-29B3H: not loaded. The token or name PARSNAM reads (27F3H), filled with spaces to 8 bytes; compared by FINDSYM (28BBH) and CK4AS1 (28DBH), copied to the table by MOVNAME (289EH) and to LBLSAV by MOVLBL (2544H).
29B4STRLEN
DEFS 1
STRLEN, 29B4H: not loaded. The length of the value PARSVAL read (2813H), copied with VALBUF by MOVALUE (28B0H).
29B5-29D4VALBUF
DEFS 32
VALBUF, 29B5H-29D4H: not loaded. The value PARSVAL reads (27FEH), filled with spaces to 32 bytes by the first PARSER call; bytes past it come only from substitutions: the value copied, an unknown #name# copied as written, and the refill of up to 8 characters and 7 spaces after it, which can reach LBLSAV (B109).
29D5-29DCLBLSAV
DEFS 8
LBLSAV, 29D5H-29DCH: not loaded. The label of the DO line without its at sign, written by MOVLBL (254DH) and compared with each label line by FNDPRM (2582H) as a table of one entry.
29DD
DEFB 00H 00
29DDH: 00H, the end of the one entry table LBLSAV for FNDPRM, which tests it after a label line that does not match (source: must be zero).
29DE-29DFLINENO
DEFW 0000H 00 00
LINENO, 29DEH-29DFH: 0000H in the file; incremented by RDJCL for each line read, in the label search and in included files too (2672H), and shown by BADHDR (262FH).
29E0-29EASYSJCL
DEFM "SYSTEM/JCL" / DEFB 03H 53 59 53 54 45 4D 2F 4A 43 4C 03
SYSJCL, 29E0H-29EAH: the name SYSTEM/JCL and 03H, copied into JFCB$ by MOVFCB (2503H); 29E7H-29E9H, JCL, are also DOFEXT's extension (2985H). P631G1 writes a colon over the 03H at 29EAH in the compile (2AAFH); for DO followed by an asterisk it stays 03H, a name with no drive (B105).
29EB-29ECDRVNUM
DEFM "0" / DEFB 03H 30 03
DRVNUM, 29EBH-29ECH: the digit 0 and 03H; P631G1 writes the digit of the drive found over the 0 (2AAFH), so the name reads SYSTEM/JCL:d and 03H.
29ED-29FFSPCREQ$
DEFM "File spec required" / DEFB 0DH 46 69 6C 65 20 73 70 65 63 20 72 65 71 75 69 72 65 64 0D
SPCREQ$, 29EDH-29FFH: the message of SPCREQ (2951H).
2A00-2A0DLINLNG$
DEFM "Line too long" / DEFB 0DH 4C 69 6E 65 20 74 6F 6F 20 6C 6F 6E 67 0D
LINLNG$, 2A00H-2A0DH: the message RDJCL puts into BADH1's operand (268FH) for a line of 80 characters without its carriage return.
2A0E-2A24TOOLNG$
DEFM "Symbol string too long" / DEFB 0DH 53 79 6D 62 6F 6C 20 73 74 72 69 6E 67 20 74 6F 6F 20 6C 6F 6E 67 0D
TOOLNG$, 2A0EH-2A24H: the message of TOOLNG (2959H), for a value of more than 32 characters.
2A25-2A38NOFIND$
DEFM "Procedure not found" / DEFB 0DH 50 72 6F 63 65 64 75 72 65 20 6E 6F 74 20 66 6F 75 6E 64 0D
NOFIND$, 2A25H-2A38H: the message of NOFIND (295DH), when no line holds the label.
2A39-2A4DLBLERR$
DEFM "Too many Proc labels" / DEFB 0DH 54 6F 6F 20 6D 61 6E 79 20 50 72 6F 63 20 6C 61 62 65 6C 73 0D
LBLERR$, 2A39H-2A4DH: the message of LBLERR (2961H), for a second at sign (B110).
2A4E-2A6ADSKFUL$
DEFM "Can't create SYSTEM/JCL file" / DEFB 0DH 43 61 6E 27 74 20 63 72 65 61 74 65 20 53 59 53 54 45 4D 2F 4A 43 4C 20 66 69 6C 65 0D
DSKFUL$, 2A4EH-2A6AH: the message of DSKFUL (2965H), when no drive is ready and writable or @INIT fails.
2A6B-2A7BMULDEF$
DEFM "Multiply defined " 4D 75 6C 74 69 70 6C 79 20 64 65 66 69 6E 65 64 20
MULDEF$, 2A6BH-2A7BH: the start of the message of MULDEF (296DH), with no end mark: @LOGOT runs on into PRMERR$ (source: follow with PRMERR$).
2A7C-2A8BPRMERR$
DEFM "Parameter error" / DEFB 0DH 50 61 72 61 6D 65 74 65 72 20 65 72 72 6F 72 0D
PRMERR$, 2A7CH-2A8BH: the message of PRMERR (2969H), and the end of MULDEF's.
2A8C-2AABBADJCL$
DEFM "Bad JCL format, process aborted" / DEFB 0DH 42 61 64 20 4A 43 4C 20 66 6F 72 6D 61 74 2C 20 70 72 6F 63 65 73 73 20 61 62 6F 72 74 65 64 0D
BADJCL$, 2A8CH-2AABH: the message BADH1 shows after the line (263BH) (Level 1G; 6.3.0: Invalid JCL format, processing aborted).
2AACP631G1
LD H,A 67
P631G1: load Register H with Register A, the digit of the drive found (2451H) (Level 1G).
2AAD
LD L,3AH 2E 3A
Load Register L with 3AH, the colon before the drive (Level 1G).
2AAF
LD (29EAH),HL 22 EA 29
Store Register Pair HL into 29EAH-29EBH: the colon over SYSJCL's 03H and the digit over DRVNUM's 0, so the name is SYSTEM/JCL:d and 03H (Level 1G; source: 29EAH).
2AB2
RET C9
Return to the compile set-up at 2454H (Level 1G).
2AB3-2ACBNESTS$
DEFM "Too many nested INCLUDEs" / DEFB 0DH 54 6F 6F 20 6D 61 6E 79 20 6E 65 73 74 65 64 20 49 4E 43 4C 55 44 45 73 0D
NESTS$, 2AB3H-2ACBH: the message of NESTS (2955H), for a sixth //INCLUDE.
2ACC-2ACDNESTPTR
DEFW 2ACEH CE 2A
NESTPTR, 2ACCH-2ACDH: 2ACEH in the file, NESTFCB's first save area; moved on 32 bytes by INCLUD (27CBH), back by UNNEST (249FH), tested by CKNEST (24ACH), FINDLBL (2561H) and INCLUD (27B8H).

2ACEH - Member 13 (DO): NESTFCB, the Conditional Levels, BADHDR$, the Buffers and SYMTAB

The save areas of 5 //INCLUDE levels, the conditional pointer and its 32 levels, BADHDR$, which runs on into JCLBUF1, the line buffer, then from 2C00H the buffers of the JCL file and of SYSTEM/JCL, and at 2E00H the 00H that begins the symbol table, the member's last byte. The table grows from there by 41 bytes a token.

2ACE-2B6DNESTFCB
DEFS 160
NESTFCB, 2ACEH-2B6DH: not loaded. Five save areas of 32 bytes for the FCB of a file that holds an open //INCLUDE (INCLUD 27C8H, UNNEST 249CH); 2B6EH, just after them, is NESTEND for INCLUD's test (27BCH). The manual says ten //INCLUDEs may be open.
2B6E-2B6FCONDPTR
DEFW 2B70H 70 2B
CONDPTR, 2B6EH-2B6FH: 2B70H in the file, the pointer to the current conditional level: moved up by IF04 (273CH), down by END1 (2750H), read by CKCOND (2620H), MACRO (264DH) and TSTCOND (26A0H).
2B70CONDFLG
DEFB 00H 00
CONDFLG, 2B70H: 00H, the state outside every //IF, true (source: init 1st state to TRUE); //ELSE and //END are refused at this level (CKCOND).
2B71-2B8F
DEFS 31
2B71H-2B8FH: not loaded. The states of the levels of 31 nested //IFs, 00H true or FFH false (IF04 273BH, ELSE1 2749H); a 32nd nested //IF writes on into BADHDR$ and from the 46th into JCLBUF1 (B108) (source: 32 conditional levels).
2B90-2B9DBADHDR$
DEFM "Line xxxxx -->" 4C 69 6E 65 20 78 78 78 78 78 20 2D 2D 3E
BADHDR$, 2B90H-2B9DH: Line, five x that @HEXDEC replaces with the line number (2634H), and the arrow; with no end mark @LOGOT runs on into JCLBUF1 and shows the line (263AH).
2B9E-2BEDJCLBUF1
DEFS 80
JCLBUF1, 2B9EH-2BEDH: not loaded. The line RDJCL reads from the JCL file (2686H), with its carriage return; the compile reads it (2592H), MACRO2 copies its start (266AH), BADHDR and QUIT show it.
2BEE-2BFF
DEFS 18
2BEEH-2BFFH: not loaded. The rest of the page up to INPBUF (the source's ORG to the next page); RDJCL stores the carriage return of a line too long at 2BEEH (268DH).
2C00-2CFFINPBUF
DEFS 256
INPBUF, 2C00H-2CFFH: not loaded. The buffer of DOFCB: the JCL file's sectors (2430H) and an included file's (27DBH).
2D00-2DFFOUTBUF
DEFS 256
OUTBUF, 2D00H-2DFFH: not loaded. The buffer of JFCB$ while SYSTEM/JCL is written (245AH).
2E00SYMTAB
DEFB 00H 00
SYMTAB, 2E00H: 00H, the end mark of the empty symbol table, the member's last byte. Each token is an entry of 41 bytes from here up, its name (8), its length (1) and its value (32), and a 00H after the last; nothing tests the table against HIGH$ (B115).

2400H - Member 14 (RUN and LOAD): the Entries, LOAD and PMTSYS

SYS1/SYS runs RUN with request 82H and LOAD with request 81H; both headers point at member 14, which the overlay loader reads to 2400H-2594H and enters at 2400H for RUN and 2403H for LOAD, with Register Pair HL at the text after the command's name. Both read the parameter X and the program's spec in COMMON (24C9H). LOAD loads the program with @LOAD and returns 0000H without running it; with X it first asks for the source diskette, loads, and then asks for the system diskette again. Neither keeps its Stack Pointer: every exit returns from the entry's depth, and the program the member loads must lie at 3000H or above, as the manual says: nothing tests its load blocks against the member and its FCB (2400H-25B3H), and LOAD and both (X) forms still run member code after the load.

2400RUN
RUN: RUN's entry (request 82H): jump to RUN0 at 2429H (source: RUN entry point).
2403LOAD
LOAD: LOAD's entry (request 81H): call COMMON at 24C9H, which reads X and the spec into the FCB at 2594H; Z when both are good (source: parse parms and filespec).
2406
If COMMON failed (NZ) jump to IOERR at 2447H with the error, or 3FH and a message at Register Pair HL.
2408
LD A,(24FCH) 3A FC 24
Load Register A with the byte at 24FCH, the low byte of X's value, the operand of the LD DE at XPARM (24FBH): FFH for a plain X; X=256 leaves 00H here though XPARM's test of the whole word shows the source prompt (source: if not (X), go to it).
240B
OR A B7
OR Register A with itself: Z when X was not given.
240C
If X was given (NZ) jump to NEEDPR at 2418H, which loads and then asks for the system diskette.
240E
LD DE,2594H 11 94 25LD DE,FCB
Load Register Pair DE with 2594H, the FCB of the program (source: pt to fcb).
2411
LD A,4CH 3E 4C
Load Register A with 4CH, SVC 76, @LOAD, which loads the program file in the FCB at Register Pair DE; SFLAG$ bit 2 is not set here, as it is for LOAD (X) (2512H), so an EXEC-only file opens with access EXEC and LOADER's first read fails with error 37.
2413
RST 28H EF
Call @LOAD with RST 28H (SYS0/SYS): Z when the program is loaded, NZ with Register A = the error number OR C0H.
2414
If the load failed (NZ) jump to IOERR at 2447H, which returns the error with bits 7 and 6 still set (B100) (source: go on error).
2416
Jump to EXIT at 245CH to return 0000H without running the program (source: or just exit).
2418NEEDPR
NEEDPR: call LOADIT at 250FH, which loads the program from the source diskette and, on an error, asks for the system diskette (source: load the file).
241B
If the load failed (NZ) jump to IOERR at 2447H (B100) (source: exit if error).
241D
LD HL,0000H 21 00 00
Load Register Pair HL with 0000H, LOAD's return code, and fall into PMTSYS (source: init no error).
2420PMTSYS
PUSH HL E5
PMTSYS: save Register Pair HL on the stack for 2427H: 0000H for LOAD, @LOAD's plain error number in HL (0018H for a missing file) when LOADIT calls, or the line pointer when RUN (X) enters here (source: save cmd line ptr).
2421
LD HL,253AH 21 3A 25LD HL,PMTSYS$
Load Register Pair HL with 253AH, PMTSYS$, Insert SYSTEM disk ENTER.
2424
Call FLASH at 2463H to blink the prompt until ENTER or BREAK; its result is not tested, so BREAK here ends the prompt as ENTER does (B101).
2427
POP HL E1
Restore Register Pair HL saved at 2420H (source: rcvr cmnd line ptr).
2428
RET C9
Return: from LOAD to RST28's tail with Register Pair HL = 0000H; from LOADIT to 251EH; after RUN (X) into the program at the transfer address put on the stack at 2443H.

2429H - Member 14 (RUN and LOAD): RUN and the Exits

RUN without X hands the FCB and the line pointer to @RUN by a jump to the SVC dispatcher, so that @RUN returns to RUN's caller and the program may load over the member. RUN (X) loads the program itself with LOADIT after the source prompt, asks for the system diskette, and returns into the program from PMTSYS: Register Pair HL is the line pointer, but the program gets neither Register Pair BC = 0420H nor Register Pair DE = the FCB, as @RUN gives them, nor the debugger entry @RUN gives when DEBUG is on; and as it runs inside the member's RST28 call, whose @DBGHK stays C9H, BREAK cannot reach the debugger either (B102). IOERR shows a DOS error's short message, or with Register A = 3FH the message at Register Pair HL through @LOGOT.

2429RUN0
RUN0: call COMMON at 24C9H to read X and the spec (source: parse common args).
242C
If COMMON failed (NZ) jump to IOERR at 2447H (source: go on error).
242E
LD A,(24FCH) 3A FC 24
Load Register A with the byte at 24FCH, the low byte of X's value.
2431
OR A B7
OR Register A with itself: Z when X was not given.
2432
LD DE,2594H 11 94 25LD DE,FCB
Load Register Pair DE with 2594H, the FCB of the program; the LD leaves the flags.
2435
If X was given (NZ) jump to RUN1 at 243CH (source: prompt if (X)).
2437
LD A,4DH 3E 4D
Load Register A with 4DH, SVC 77, @RUN, which loads the program in the FCB at Register Pair DE and enters it with Register Pair HL = the line pointer and Register Pair BC = 0420H (source: RUN SVC number).
2439
Jump to RST28 at 0028H: @RUN runs as if RUN's caller had called it, and the program's RET goes back to that caller; a load error is shown by @RUN itself.
243CRUN1
PUSH HL E5
RUN1: save Register Pair HL, the line pointer, on the stack for 2443H (source: save cmnd line ptr).
243D
LD DE,2594H 11 94 25LD DE,FCB
Load Register Pair DE with 2594H, the FCB of the program.
2440
Call LOADIT at 250FH to load the program from the source diskette: Z with Register Pair HL = the transfer address; on an error LOADIT has asked for the system diskette.
2443
EX (SP),HL E3
Exchange Register Pair HL with the word at the top of the stack (the Stack Pointer's word): Register Pair HL = the line pointer, the stack holds the transfer address, or the error number (source: get cmd ptr and save ept).
2444
If the program was loaded (Z) jump to PMTSYS at 2420H, which asks for the system diskette and returns into the program (source: run if prog OK).
2446
POP HL E1
Discard the word saved at 2443H, @LOAD's plain error number, into Register Pair HL (source: pop TRAADR and error).
2447IOERR
CP 3FH FE 3F
IOERR: compare Register A with 3FH, the mark of a message of the member's own at Register Pair HL (source: if extended error).
2449
If it is that mark (Z) jump to EXTERR at 2455H (source: handle by @LOGOT).
244B
LD L,A 6F
Load Register L with Register A, the error number; after @LOAD it still has bits 7 and 6 set, so the return code is the number plus C0H (B100) (source: put error number into HL).
244C
LD H,00H 26 00
Load Register H with 00H: Register Pair HL = the return code.
244E
OR C0H F6 C0
OR Register A with C0H: bit 7 makes @ERROR return to the caller, bit 6 makes it show the short message alone (source: set short error and ret).
2450
LD C,A 4F
Load Register C with Register A, the error number with bits 7 and 6 set, the form @ERROR takes.
2451
LD A,1AH 3E 1A
Load Register A with 1AH, SVC 26, @ERROR, which shows the message of the error number in Register C.
2453
RST 28H EF
Call @ERROR with RST 28H (the SYS0/SYS stub at 1B0FH, which loads SYS4/SYS) to show the short message.
2454
RET C9
Return with Register Pair HL = the return code: the error number, or for a load error the number OR C0H (B100).
2455EXTERR
LD A,0CH 3E 0C
EXTERR: load Register A with 0CH, SVC 12, @LOGOT, which shows a line on the video and writes it to the job log.
2457
RST 28H EF
Call @LOGOT with RST 28H (BOOT/SYS) to show the message at Register Pair HL: File spec required or Command aborted.
2458
LD HL,FFFFH 21 FF FF
Load Register Pair HL with FFFFH, the return code of a command that showed a message of its own.
245B
RET C9
Return with Register Pair HL = FFFFH to the entry's caller, RST28's tail.
245CEXIT
LD HL,0000H 21 00 00
EXIT: load Register Pair HL with 0000H, the return code of a LOAD that was done.
245F
RET C9
Return to RST28's tail with Register Pair HL = 0000H; the program is in memory and is not run.

2460H - Member 14 (RUN and LOAD): FLASH, the Blinking Prompt

FLASH shows the prompt at Register Pair HL and blinks it until ENTER or BREAK. It first waits, by @PAUSE, until neither BREAK nor ENTER is noted in KFLAG$, clearing bits 0 to 2 each time, so that a key still noted from before does not answer it (unlike COPY's FLASH, which clears only bits 1 and 2: B56). Each blink shows the line, waits, erases it and waits again, testing BREAK with @CKBRKC and ENTER by KFLAG$ bit 2. ENTER empties the type-ahead buffer, erases the line, turns the cursor on and returns Z; BREAK erases the line and returns NZ with Register A = 3FH and Register Pair HL = STOP$, Command aborted, which turns the cursor on again when it is shown. An error of @DSPLY or @DSP jumps to IOERR from inside FLASH, whose RET then returns to FLASH's caller or into FLASH itself: the plain video driver does not fail, but with DO routed to a device that can (ROUTE to a printer that is off) the prompt is taken as answered and the error code is lost at PMTSYS.

2460FLASH0
FLASH0: call RESKFLG at 24B9H to clear bits 0 to 2 of KFLAG$, BREAK, pause and ENTER (source: reset 3-bit field).
2463FLASH
LD BC,41FDH 01 FD 41
FLASH: load Register Pair BC with 41FDH, the count of @PAUSE (source: delay for 250 ms).
2466
LD A,10H 3E 10
Load Register A with 10H, SVC 16, @PAUSE, which waits Register Pair BC times its inner loop.
2468
RST 28H EF
Call @PAUSE with RST 28H (BOOT/SYS) to wait about a quarter of a second.
2469
LD A,(IY+0AH) FD 7E 0A
Load Register A with KFLAG$ (IY+0AH, 0074H). Index Register IY holds 006AH from @FLAGS in COMMON (24D2H).
246C
AND 05H E6 05
AND Register A with 05H, which leaves bit 0 (BREAK) and bit 2 (ENTER): Z when neither is noted (source: wait for no ENTER or BREAK).
246E
If either is still noted (NZ) jump back to FLASH0 at 2460H to clear them and wait again.
2470
Call RESKFLG at 24B9H to clear bits 0 to 2 of KFLAG$ once more (source: reset in case BREAK).
2473FLS1
LD A,0AH 3E 0A
FLS1: load Register A with 0AH, SVC 10, @DSPLY, which shows the text at Register Pair HL up to its 03H and keeps Register Pair HL.
2475
RST 28H EF
Call @DSPLY with RST 28H (BOOT/SYS): the prompt, which turns the cursor off (0FH), goes to the start of the line (1DH), erases to its end (1EH) and goes back to the start after the text (1DH) (source: display the message).
2476
If the video failed (NZ) jump to IOERR at 2447H with the error (source: abort on error).
2479
LD BC,4000H 01 00 40
Load Register Pair BC with 4000H, the count of the time the prompt is shown.
247C
Call FLS2 at 2490H to wait while it is shown, testing BREAK and ENTER: Z at the end of the count (source: blink start).
247F
If BREAK was pressed (NZ) jump to GOTBRK at 24C3H (source: handle BREAK).
2481
LD C,1EH 0E 1E
Load Register C with 1EH, the code that erases to the end of the line (source: cursor erase to EOL).
2483
Call DSP at 2520H to send it: the prompt disappears, as the cursor is at the start of its line.
2486
LD BC,3333H 01 33 33
Load Register Pair BC with 3333H, the count of the time the line stays empty (source: wait).
2489
Call FLS2 at 2490H to wait, testing BREAK and ENTER (source: wait and ck enter).
248C
If BREAK was pressed (NZ) jump to GOTBRK at 24C3H (source: handle BREAK).
248E
Jump back to FLS1 at 2473H to show the prompt again, until ENTER (source: loop until ENTER).
2490FLS2
LD A,6AH 3E 6A
FLS2: load Register A with 6AH, SVC 106, @CKBRKC, which tests and clears the BREAK bit and, after BREAK, waits for the key to be released and empties the type-ahead buffer (source: BREAK hit?).
2492
RST 28H EF
Call @CKBRKC with RST 28H (BOOT/SYS): NZ when BREAK has been pressed.
2493
If BREAK was not pressed (Z) jump to CKENT at 249DH (source: no, check ENTER).
2495
LD C,1EH 0E 1E
Load Register C with 1EH, the code that erases to the end of the line (source: erase line).
2497
Call DSP at 2520H to erase the prompt (source: output byte).
249A
XOR A AF
XOR Register A with itself: Register A = 00H (source: set NZ).
249B
INC A 3C
Increment Register A: Register A = 01H and the Z flag clear.
249C
RET C9
Return NZ to 247FH or 248CH: BREAK was pressed (source: and return).
249DCKENT
BIT 2,(IY+0AH) FD CB 0A 56
CKENT: test bit 2 of KFLAG$ (IY+0AH, 0074H), the ENTER bit that the keyboard driver sets. Index Register IY holds 006AH (source: ck ENTER bit).
24A1
If ENTER was pressed (NZ) jump to FLS4 at 24A9H (source: go on ENTER down).
24A3
DEC BC 0B
Decrement Register Pair BC, the count (source: count down).
24A4
LD A,B 78
Load Register A with Register B, the high byte of the count.
24A5
OR C B1
OR Register A with Register C: Z at the end of the count.
24A6
If the count is not done (NZ) jump back to FLS2 at 2490H.
24A8
RET C9
Return Z to FLS1's loop at 247FH or 248CH: the time is up with no key (source: return with Z-flag).
24A9FLS4
POP AF F1
FLS4: discard the return address of the CALL to FLS2 into Register Pair AF, so that the RET at 24C2H goes back to FLASH's caller (source: pop return code).
24AAFLS5
LD A,08H 3E 08
FLS5: load Register A with 08H, SVC 8, @KBD, which takes a character from the keyboard without waiting (source: clear type ahead buffer).
24AC
RST 28H EF
Call @KBD with RST 28H (BOOT/SYS): Z when a character was taken.
24AD
If a character was taken (Z) jump back to FLS5 at 24AAH, until the type-ahead buffer is empty; an @KBD error also ends the loop, untested, where COPY's FLASH tests it (source: loop if have character).
24AF
LD C,1EH 0E 1E
Load Register C with 1EH, the code that erases to the end of the line (source: wipe line).
24B1
Call DSP at 2520H to erase the prompt from the line.
24B4
LD C,0EH 0E 0E
Load Register C with 0EH, the code that turns the cursor on (source: cursor on).
24B6
Call DSP at 2520H to send it, turning the cursor on again.
24B9RESKFLG
LD A,(IY+0AH) FD 7E 0A
RESKFLG: load Register A with KFLAG$ (IY+0AH, 0074H). Index Register IY holds 006AH (source: reset 3-bit field).
24BC
AND F8H E6 F8
AND Register A with F8H, which clears bit 0 (BREAK), bit 1 (pause) and bit 2 (ENTER).
24BE
LD (IY+0AH),A FD 77 0A
Store Register A into KFLAG$ (IY+0AH, 0074H). Index Register IY holds 006AH.
24C1
XOR A AF
XOR Register A with itself: Register A = 00H and the Z flag set (source: set Z-flag).
24C2
RET C9
Return Z: to FLASH's caller after ENTER, or to the caller of RESKFLG (2460H, 2470H).
24C3GOTBRK
LD HL,2578H 21 78 25LD HL,STOP$
GOTBRK: load Register Pair HL with 2578H, STOP$, the message Command aborted, which begins by turning the cursor on (source: point to error message).
24C6
LD A,3FH 3E 3F
Load Register A with 3FH, the mark of a message of the member's own; the Z flag stays clear from FLS2 (source: init extended error).
24C8
RET C9
Return NZ to FLASH's caller with Register A = 3FH and Register Pair HL = STOP$; PMTSYS ignores it, so the cursor stays off (B101) (source: and return NZ).

24C9H - Member 14 (RUN and LOAD): COMMON, LOADIT and DSP

COMMON lets @PARAM read the parameter X, which comes before the spec (LOAD (X) filespec, RUN (X) filespec (parameters)), reads the spec into the FCB at 2594H (a device or no spec gives File spec required), gives it the extension /CMD and loads SYS2/SYS with request 84H, so that the @OPEN of the program finds SYS2 already in memory while the source diskette is in the drive. With X it then shows Insert SOURCE disk ENTER. LOADIT sets SFLAG$ bit 2, as @RUN does, and loads the program with @LOAD; after an error it asks for the system diskette. DSP sends one byte to the video.

24C9COMMON
LD DE,258AH 11 8A 25LD DE,PRMTBL
COMMON: load Register Pair DE with 258AH, PRMTBL, the parameter table with X alone (source: parm of X?).
24CC
LD A,11H 3E 11
Load Register A with 11H, SVC 17, @PARAM, which reads the parameters at Register Pair HL by the table at Register Pair DE.
24CE
RST 28H EF
Call @PARAM with RST 28H (SYS1/SYS): Z at once when the line does not begin with an opening parenthesis, so an X typed after the spec is not read here; NZ with Register A = 44 for a bad parameter.
24CF
RET NZ C0
Return NZ to the entry with Register A = 44, Parameter error (source: ret with error code).
24D0COMM1
LD A,65H 3E 65
COMM1: load Register A with 65H, SVC 101, @FLAGS (source: get flag table pointer).
24D2
RST 28H EF
Call @FLAGS with RST 28H (SYS0/SYS): Index Register IY = 006AH, for FLASH and LOADIT.
24D3COMM1A
LD A,(HL) 7E
COMM1A: load Register A with the byte at Register Pair HL, a character of the line (source: skip past spaces).
24D4
CP 20H FE 20
Compare Register A with 20H, a space between the parameter and the spec.
24D6
If it is not a space (NZ) jump to COMM2 at 24DBH.
24D8
INC HL 23
Increment Register Pair HL past the space to the next character.
24D9
Jump back to COMM1A at 24D3H to test the next character.
24DBCOMM2
LD DE,2594H 11 94 25LD DE,FCB
COMM2: load Register Pair DE with 2594H, the FCB of the program (source: get filespec).
24DE
LD A,4EH 3E 4E
Load Register A with 4EH, SVC 78, @FSPEC, which reads a file or device spec from the line at Register Pair HL into the area at Register Pair DE.
24E0
RST 28H EF
Call @FSPEC with RST 28H (SYS1/SYS): Z with the spec at 2594H and Register Pair HL past it, at the program's parameters.
24E1
If there is no valid spec (NZ) jump to COMM3 at 24E8H (source: go on error).
24E3
LD A,(DE) 1A
Load Register A with the byte at Register Pair DE, 2594H, the first character of the spec (source: device specs not allowed).
24E4
CP 2AH FE 2A
Compare Register A with 2AH, the asterisk that begins a device spec.
24E6
If the spec is a file spec (NZ) jump to COMM4 at 24EFH (source: go if OK).
24E8COMM3
LD HL,2527H 21 27 25LD HL,SPCREQ$
COMM3: load Register Pair HL with 2527H, SPCREQ$, the message File spec required (source: point to error message).
24EB
LD A,3FH 3E 3F
Load Register A with 3FH, the mark of a message of the member's own (source: init extended error).
24ED
OR A B7
OR Register A with itself: the Z flag clear (source: set NZ condition).
24EE
RET C9
Return NZ to the entry, which goes to IOERR and EXTERR to show the message.
24EFCOMM4
PUSH HL E5
COMM4: save Register Pair HL, the line pointer, on the stack for 24F9H (source: save cmdline ptr).
24F0
LD HL,2591H 21 91 25LD HL,CMDEXT
Load Register Pair HL with 2591H, CMDEXT, the 3 letters CMD (source: default to CMD).
24F3
LD A,4FH 3E 4F
Load Register A with 4FH, SVC 79, @FEXT, which gives the spec in the FCB at Register Pair DE the extension at Register Pair HL when it has none.
24F5
RST 28H EF
Call @FEXT with RST 28H (SYS1/SYS): the spec gets /CMD unless an extension was typed.
24F6
Call GOSYS2 at 250CH to bring SYS2/SYS into the overlay area, so that the @OPEN of the program does not read it from the source diskette (source: get SYS2 for open).
24F9
POP HL E1
Restore Register Pair HL, the line pointer, saved at 24EFH (source: pop the INBUF$ pointer).
24FA
RET NZ C0
Return NZ: never taken, as a failed overlay load ends in SYSERR and @ABORT (1ADFH) and SYS2's request 84H returns Z with Register A = 00H (1E02H).
24FBXPARM
LD DE,0000H 11 00 00
XPARM: load Register Pair DE with the word at 24FCH, X's value: 0000H in the file, FFFFH when X was given (source: ck on X parm).
24FE
LD A,D 7A
Load Register A with Register D, the high byte of X's value.
24FF
OR E B3
OR Register A with Register E: Z when X was not given.
2500
RET Z C8
Return Z without X: Register Pair HL = the line pointer (source: back on no (X)).
2501
PUSH HL E5
Save Register Pair HL, the line pointer, on the stack for 2508H (source: save pointer).
2502
LD HL,2559H 21 59 25LD HL,PMTSRC$
Load Register Pair HL with 2559H, PMTSRC$, Insert SOURCE disk ENTER (source: init prompt).
2505
Call FLASH at 2463H to blink the prompt until ENTER or BREAK (source: prompt for source disk).
2508
POP DE D1
Restore the line pointer saved at 2501H into Register Pair DE (source: pointer to DE).
2509
RET NZ C0
Return NZ after BREAK, with Register A = 3FH and Register Pair HL = STOP$, which IOERR shows; no system prompt follows, though SYS2 now holds the overlay area and SYS1 must be read from drive 0 (B104) (source: back on error in HL).
250A
EX DE,HL EB
Exchange Register Pair DE and Register Pair HL: Register Pair HL = the line pointer (source: if no error, pointer).
250B
RET C9
Return Z to the entry with Register Pair HL = the line pointer (source: back to HL).
250CGOSYS2
LD A,84H 3E 84
GOSYS2: load Register A with 84H, the request that loads SYS2/SYS and does nothing else (source: load sys2).
250E
RST 28H EF
Call the request with RST 28H; RST28 drops the RST's return address for any overlay request (1A5FH), so SYS2 returns to RST28's tail, whose RET (1A7EH) goes to 24F9H, and the bytes that follow run only as LOADIT.
250FLOADIT
LD DE,2594H 11 94 25LD DE,FCB
LOADIT: load Register Pair DE with 2594H, the FCB of the program.
2512
SET 2,(IY+12H) FD CB 12 D6
Set bit 2 of SFLAG$ (IY+12H, 007CH), the bit @RUN sets: @OPEN lets a file of EXEC protection be opened with access READ, for LOAD (X) too, which then leaves the program in memory without running it (B103). Index Register IY holds 006AH from @FLAGS (source: turn on RUN flag).
2516
LD A,4CH 3E 4C
Load Register A with 4CH, SVC 76, @LOAD (source: load the file).
2518
RST 28H EF
Call @LOAD with RST 28H (SYS0/SYS): Z with Register Pair HL = the transfer address, NZ with Register A = the error number OR C0H.
2519
RET Z C8
Return Z when the program is loaded, with Register Pair HL = its transfer address.
251A
PUSH AF F5
Save Register Pair AF, the error, on the stack for 251EH (source: save error ret code).
251B
Call PMTSYS at 2420H to ask for the system diskette before the error message is read from SYS4/SYS (source: get system disk back).
251E
POP AF F1
Restore Register Pair AF, the error, saved at 251AH (source: rcvr error ret code).
251F
RET C9
Return NZ with Register A = the error number OR C0H.
2520DSP
LD A,02H 3E 02
DSP: load Register A with 02H, SVC 2, @DSP, which sends Register C to the video (source: display byte).
2522
RST 28H EF
Call @DSP with RST 28H (BOOT/SYS) to send Register C to the video.
2523
RET Z C8
Return Z when the byte was sent (source: return if OK).
2524
Jump to IOERR at 2447H with the error; IOERR's RET then returns to DSP's caller in FLASH.

2527H - Member 14 (RUN and LOAD): the Messages, PRMTBL and the FCB

The message, the two prompts (each begins with 0FH, cursor off, 1DH, start of the line, and 1EH, erase to its end, and ends with 1DH and 03H), STOP$ (0EH, cursor on, 1DH, and Command aborted), the parameter table, the default extension and the first byte of the FCB, the member's last; the FCB's other 31 bytes, 2595H-25B3H, lie after the member and have no row.

2527-2539SPCREQ$
DEFM "File spec required" / DEFB 0DH 46 69 6C 65 20 73 70 65 63 20 72 65 71 75 69 72 65 64 0D
SPCREQ$, 2527H-2539H: the message of COMM3 (24E8H), shown by EXTERR.
253A-2558PMTSYS$
DEFB 0FH, 1DH, 1EH / DEFM "Insert SYSTEM disk <ENTER>" / DEFB 1DH, 03H 0F 1D 1E 49 6E 73 65 72 74 20 53 59 53 54 45 4D 20 64 69 73 6B 20 3C 45 4E 54 45 52 3E 1D 03
PMTSYS$, 253AH-2558H: the prompt PMTSYS shows (2421H): cursor off, start of the line, erase to its end, the text, start of the line again, end of text.
2559-2577PMTSRC$
DEFB 0FH, 1DH, 1EH / DEFM "Insert SOURCE disk <ENTER>" / DEFB 1DH, 03H 0F 1D 1E 49 6E 73 65 72 74 20 53 4F 55 52 43 45 20 64 69 73 6B 20 3C 45 4E 54 45 52 3E 1D 03
PMTSRC$, 2559H-2577H: the prompt of X (2502H), in the same form.
2578-2589STOP$
DEFB 0EH, 1DH / DEFM "Command aborted" / DEFB 0DH 0E 1D 43 6F 6D 6D 61 6E 64 20 61 62 6F 72 74 65 64 0D
STOP$, 2578H-2589H: the message after BREAK at the source prompt (24C3H); after BREAK at the system prompt it is dropped (B101): cursor on, start of the line, the text and a carriage return.
258APRMTBL
DEFB 80H 80
PRMTBL, 258AH: 80H, the mark of the 6.x table form that @PARAM reads (24CCH).
258B
DEFB 41H 41
258BH: type 41H, a flag, a name of 1 character.
258C
DEFM "X" 58
258CH: the name X, a program on a diskette other than the system diskette.
258D
DEFB 00H 00
258DH: the response byte of X, cleared and set by @PARAM and not read.
258E-258F
DEFW 24FCH FC 24
258EH-258FH: 24FCH, XPARM+1, the operand of the LD DE at 24FBH, read also at 2408H and 242EH.
2590
DEFB 00H 00
2590H: 00H, the end of the table after its one parameter.
2591-2593CMDEXT
DEFM "CMD" 43 4D 44
CMDEXT, 2591H-2593H: CMD, the default extension @FEXT gives the spec (24F0H).
2594FCB
DEFB 00H 00
FCB, 2594H: the first byte of the FCB of the program, 00H in the file, the last byte of member 14. @FSPEC writes the spec here (24E0H) and @LOAD or @RUN reads the file through it.