SYS09/SYS handles the COPY, DUAL, FORMS, KILL, MASTER, PATCH, RELO, ROUTE, SETCOM, and WP LIBrary Command.
TRS-80 DOS - TRSDOS v1.3 - SYS09/SYS Disassembled
General:
Overlay Overview:
SYS09/SYS is the "1/3 DOS Commands" overlay — one of three command-handler overlays in TRSDOS 1.3 that together implement the library of resident-DOS commands. SYS09 is loaded into the SYSHI overlay area at 5200H by the DOS command interpreter when the user invokes one of its ten commands. Each command receives control with HL pointing at the rest of the command line (the text after the command name and a separating space).
The overlay's BEGIN entry sets a few system flags (CFLAG=55H, FLAG1=0, SCAFLG=0, BASICG=-1) and then dispatches via the GETTAB table-lookup routine. GETTAB walks the TABLE entries (each a DCF tuple of command-code byte + 2-byte handler address); a match returns the handler address in HL, which the caller uses as the new return address. If no match is found, control falls through to ERR2/ERRX and the SYS0 ERROR routine reports an illegal-parameter error.
Memory Map:
| Address Range | Region | Notes |
|---|---|---|
| 5200H–5217H | BEGIN dispatch | Entry-point initialization and command-table dispatcher. |
| 5218H–5225H | Error entries | NOCMD, ERR2, ERR3, ERR9, ERRX paths (each loads an error code and falls through to JP ERROR). |
| 5226H–523DH | GETTAB routine | Table-lookup helper used by BEGIN to resolve a command code to its handler address. |
| 523EH–525CH | TABLE | Command lookup table (10 DCF entries, terminated by DEFB 0). |
| 525DH–5567H | COPY command | COPY logic: parse syntax, single-drive vs dual-drive copy, record-by-record loop, message handling. |
| 5568H–5664H | SLANT helpers | Drive-spec parsing, GETDIR helper, totals tracking (used by COPY and KILL). |
| 5669H–570DH | S9KILL command | KILL logic: walk directory, kill matching files, count totals. |
| 570EH–597AH | PATCH command | PATCH logic: parse (ADD=, FIND=, CHG=) directives, hex conversion, write-back. |
| 597BH–5A0FH | HEXGET / patch helpers | Hex string parser, error/success messages for PATCH. |
| 5A14H–5B1AH | RELO command | RELO logic: relocate a /CMD file to a new load address. |
| 5B1FH–5B99H | FORMS command | FORMS logic: forms-control device parameter setting. |
| 5B9AH–5C74H | ROUTE command | ROUTE logic: route a device to/from RS-232. |
| 5C75H–5F33H | SETCOM command | SETCOM logic: set RS-232 communication parameters (baud, parity, stop bits, etc.). |
| 5F34H–5FD8H | DUAL command | DUAL logic: toggle dual-display flag. |
| 5FD9H–603DH | WPROT command | WP (Write Protect) command logic. |
| 603EH–60BDH | MASTER command | MASTER command: set the system master password. |
| 60BEH–6493H | DCB / buffer storage | S9DCB3, BUFER3, S9DCB, S9DCB1, S9DCB2, BUFER4, BUFER1, BUFER2 (uninitialized DEFS storage; not in load file). |
Command Jump Table (TABLE @ 523EH):
Each entry in TABLE is a DCF macro expansion (DEFB cmdcode + DEFW handler, 3 bytes). The 1-byte command codes (CPY, DUALT, FORM, KILLL, MAST, PAT, RELOO, RUTE, SCOM, WPT) are SYS1 globals defined in SYS1.GBL; the entries are scanned by GETTAB until a match against the command-byte in C is found, with terminator DEFB 0 marking end-of-list.
| TABLE addr | Source equate | Command | Handler | Handler addr |
|---|---|---|---|---|
| 523EH | CPY | COPY | COPY | 525DH |
| 5241H | DUALT | DUAL | DUAL | 5F34H |
| 5244H | FORM | FORMS | FORMS | 5B1FH |
| 5247H | KILLL | KILL | S9KILL | 5669H |
| 524AH | MAST | MASTER | MASTER | 603EH |
| 524DH | PAT | PATCH | PATCH | 571BH |
| 5250H | RELOO | RELO | RELO | 5A14H |
| 5253H | RUTE | ROUTE | ROUTE | 5B9AH |
| 5256H | SCOM | SETCOM | SETCOM | 5C75H |
| 5259H | WPT | WP (Write Protect) | WPROT | 5FD9H |
| 525CH | DEFB 0 — end-of-list terminator | — | ||
Major Routines:
| Address | Label | Description |
|---|---|---|
| 5200H | BEGIN | Overlay entry. Sets CFLAG=55H, clears FLAG1/SCAFLG, sets BASICG=-1, then dispatches via GETTAB. |
| 5218H | NOCMD | No matching command. Pop saved HL and fall through to ERR2. |
| 5219H | ERR2 | Bad parameter (LD A,ERICP=0BH); JR ERRX. |
| 521DH | ERR3 | Missing parameter (LD A,ERCPM=0AH); JR ERRX. |
| 5221H | ERR9 | Drive not in system (LD A,EDNS=02H); fall through to ERRX. |
| 5223H | ERRX | JP ERROR — transfer to SYS0 error handler with code in A. |
| 5226H | GETTAB | Table lookup. Walks TABLE comparing C against each command code; returns with HL=handler addr and CF=0, or CF=1 if not found. |
| 523EH | TABLE | Command lookup table (10 DCF entries; see Jump Table above). |
| 525DH | COPY | COPY command. Syntax: COPY filespec1 filespec2 / COPY filespec :D / COPY /EXT:D :D. |
| 5273H | GETTWO | Helper: parse two filespecs from the COPY command line. |
| 52A3H | DSPREC | Subroutine: bump the record-number counter and display it as the file copies. |
| 52F3H | DISPLY | Subroutine: display the "Copying filespec1 to filespec2" message. |
| 5310H | PRNTIT | Subroutine: walk a filespec and print printable chars (ASCII > '!') until terminator. |
| 532AH | S9WAIT | Subroutine: flash a prompt and wait for ENTER. |
| 5357H | SINGCP | Single-drive copy main loop — load buffer, prompt swap, write buffer. |
| 54D0H | COPY0 | Two-file copy main entry — cleared LRL, handle dual-drive case. |
| 5669H | S9KILL | KILL command. Removes a file from the directory. |
| 571BH | PATCH | PATCH command. Patches data in disk file records using ADD=/FIND=/CHG= directives. |
| 5A14H | RELO | RELO command. Relocates the load address of a /CMD file. |
| 5B1FH | FORMS | FORMS command. Sets forms-device parameters (WIDTH, LINES). |
| 5B9AH | ROUTE | ROUTE command. Routes a device to/from RS-232. |
| 5C75H | SETCOM | SETCOM command. Sets RS-232 parameters (BAUD, WORD, STOP, PARITY, WAIT, etc.). |
| 5F34H | DUAL | DUAL command. Toggles dual-display mode flag. |
| 5FD9H | WPROT | WP (Write Protect) command. Sets the write-protect flag for a drive. |
| 603EH | MASTER | MASTER command. Sets the system master password. |
Complete Variable List:
The following table lists every workspace and self-modifying-code variable used by SYS09. Self-modifying targets (marked †) are addresses inside the overlay's own code where a LD (nnnn),A or similar instruction stores a transient operand byte; these are not persistent across overlay loads (a different overlay loaded into 5200H+ will overwrite them) and therefore do not appear in the site's RAM-addresses JSON, which catalogues only stable, persistent locations.
| Address | Label | Purpose |
|---|---|---|
| 52BAH | RECCS | Record-count counter (DEFW -1; bumped by DSPREC each record copied). |
| 52EDH | RECNUM | Five-digit ASCII display buffer for the record number ("00000"). |
| 53A4H | LRLCHG † | Self-mod target: holds the LRL byte for the current copy operation. |
| 54A6H | FLFLAG | Number-of-256-byte-blocks counter for single-drive COPY. |
| 54A7H | FSFLAG | Flash-on/flash-off flag for the prompt display. |
| 54E0H | LRLCH1 † | Self-mod target: second LRL byte storage during COPY. |
| 5565H | SAVE3 | Saved-buffer-pointer storage (DEFW BUFFER). |
| 5567H | S9TRK | Directory track number storage (DEFB 0). |
| 5648H | TOTCHG † | Self-mod target inside the totals-update routine. |
| 56C5H | ADDD | DEFT 'ADD=' — encoded compare string for PATCH directive. |
| 56CAH | FINDD | DEFT 'FIND=' — encoded compare string for PATCH directive. |
| 56D0H | CHGG | DEFT 'CHG=' — encoded compare string for PATCH directive. |
| 56D5H | ADD1 | User-supplied patch address (DEFW 0). |
| 56D7H | FIND | 32-byte buffer for the PATCH FIND= string. |
| 56F7H | CHAG99 | 32-byte buffer for the PATCH CHG= string. |
| 5717H | CHGFLG | Flag: did the user supply CHG=? (0=no, non-0=yes). |
| 5718H | FNDFLG | Flag: did the user supply FIND=? (0=no, non-0=yes). |
| 5719H | ERNSAV | Saved end-record-number for the PATCH operation (DEFW 0). |
| 5897H | PATEND † | Self-mod target inside PATCH end-of-operation logic. |
| 599AH | SYSFLG | System-files flag for PATCH * (patch system files). |
| 5A27H | RLADD † | Self-mod target: relocation address operand for RELO. |
| 5B12H | RLTABL | RELO parameter table (DEFM 'ADD' + DEFW RLADD + terminator). |
| 5B1BH | SAVE | 2-byte general-purpose storage (DEFS 2). |
| 5B1DH | SAVE1 | 2-byte general-purpose storage (DEFS 2). |
| 5B44H | CHAR † | Self-mod target: holds FORMS WIDTH parameter. |
| 5B51H | FLINE † | Self-mod target: holds FORMS LINES parameter. |
| 5B5FH | FORCOM | FORMS parameter table (DEFM 'WIDTH' + DEFW CHAR + ...). |
| 5B8DH | PCHANG † | Self-mod target inside ROUTE / PCHAR processing. |
| 5E03H | SOFF | SETCOM: RS-232 ON/OFF flag (DEFW 0). |
| 5E05H | SBAUD | SETCOM: BAUD rate (DEFW 0). |
| 5E07H | SWORD | SETCOM: WORD length (DEFW 0). |
| 5E09H | SSTOP | SETCOM: STOP bits (DEFW 0). |
| 5E0BH | SPAR | SETCOM: PARITY (DEFW 0). |
| 5E0DH | SWAIT | SETCOM: WAIT flag (DEFW 0). |
| 5E0FH | SSWAIT | SETCOM: NO-WAIT flag (DEFW 0). |
| 5FEEH | WPDRV † | Self-mod target: WP (Write Protect) drive number storage. |
| 60BEH | S9DCB3 | DCB#3 storage (DEFS DCBSIZ=50). |
| 60F0H | BUFER3 | 40H-byte general-purpose buffer. |
| 6130H | S9DCB | DCB#0 storage (DEFS DCBSIZ=50). |
| 6162H | S9DCB1 | DCB#1 storage (DEFS DCBSIZ=50). |
| 6194H | S9DCB2 | DCB#2 storage (EQU $ — aliased into BUFER4 area). |
| 6200H | BUFER4 | 256-byte buffer (boundary-aligned via ORG $,256). |
| 6300H | BUFER1 | 256-byte read buffer for COPY. |
| 6400H | BUFER2 | 256-byte write buffer for COPY. |
Disassembly:
5200H - Start.
Original Source Code Comment: SET THE 'CLEAR RAM' FLAG
NOTE: 42B4H is the storage location for the CLEAR RAM Flag.
Original Source Code Comment: CLEAR A
NOTE: 4414H is the storage location for the NUMBER OF THE OVERLAY CURRENTLY IN MEMORY.
Original Source Code Comment: CLEAR THE SYSTEM FLAG
NOTE: 42FFH is the storage location for whether a password check is skipped or undertaken in an OPEN command. If Bit 0 is set, the check is skipped.
Original Source Code Comment: CLEAR THE PROTECTION OVER RIDE SWITCH
Original Source Code Comment: MAKE A -1
Original Source Code Comment: SHOW BASIC NO LONGER IN RAM
Original Source Code Comment: SAVE COMMAND LINE POINTER
Original Source Code Comment: GET ADDRESS OF COMMAND
Original Source Code Comment: NOT ANY OF THESE COMMANDS. EXIT
Original Source Code Comment: HL=> COMMAND LINE, SP=COMMAND ADDRESS
Original Source Code Comment: EXIT TO THE COMMAND
5218H - NOCMD - Jumped to if the command requested is not one of the commands available in this overlay.
Original Source Code Comment: GET COMMAND LINE POINTER OFF STACK
Original Source Code Comment: BAD PARAMETER
521DH - ERR3 - Jumped here if we are missing the parameter.
Original Source Code Comment: MISSING PARAMETER
5221H - ERR9 - Jumped here if we we were requested to do something to a drive which is not on the system.
Original Source Code Comment: DRIVE NOT IN SYSTEM
5226H - GETTAB - Routine to do a Table Lookup.
Original Source Code Comment: HL => COMMAND TABLE
Original Source Code Comment: GET THE TABLE COMPARE BYTE
Original Source Code Comment: END OF TABLE?
Original Source Code Comment: NO, LOOK IT UP
Original Source Code Comment: SET CARRY. COMMAND NOT FOUND
522FH - GETTA2 - Continuation of the Table Lookup - Jumped here if the table compare byte matched.
Original Source Code Comment: MATCH THE COMMAND?
Original Source Code Comment: YES, GET THE ADDRESS
Original Source Code Comment: HL => LSB OF ADDRESS
Original Source Code Comment: HL => MSB OF ADDRESS
Original Source Code Comment: HL => NEXT COMMAND BYTE
Original Source Code Comment: LOOP TILL FOUND
5237H - GETTA3 - Continuation of the Table Lookup - Jumped here to load HL with the address of the matched routine.
Original Source Code Comment: HL => LSB OF ADDRESS
Original Source Code Comment: GET IT
Original Source Code Comment: HL => MSB OF ADDRESS
Original Source Code Comment: GET IT
Original Source Code Comment: HL = COMMAND ADDRESS
Original Source Code Comment: INSURE CARRY OFF
523EH - TABLE - Command Lookup Table.
Original Source Code Comment: END OF LIST
525DH - MAIN ROUTINE --- COPY COMMAND
Original Source Code Comment: SAVE THE LINE POINTER
Original Source Code Comment: PUT DIRECTORY FIND
Original Source Code Comment: TO COPY FUNCTION
Original Source Code Comment: GET POINTER BACK
Original Source Code Comment: MIRROR COMMAND LINE POINTER
Original Source Code Comment: TO DE
Original Source Code Comment: GET A CHARACTER FROM COMMAND LINE
Original Source Code Comment: COPY ALL EXTENSIONS?
Original Source Code Comment: GO COPY IF SO
Original Source Code Comment: GET FILE SYNTAX
Original Source Code Comment: EXIT IF SYNTAX ERROR
Original Source Code Comment: SAVE THE LINE POINTER
Original Source Code Comment: POINT TO DCB #2
NOTE: 441CH is the SYS00/SYS routine to CHECK THE SYNTAX OF A FILESPEC before for use. This RST 28H's with a value of C1H so as to call ROUTINE 4 in OVERLAY 1.
Original Source Code Comment: CHECK SYNTAX OF 2ND FILESPEC
Original Source Code Comment: IF OKAY, BOTH FILES GIVEN
Original Source Code Comment: DRIVE SPECIFICATION ?
Original Source Code Comment: IF SO, GO MOVE PGM NAME
Original Source Code Comment: PW SPECIFICATION ?
Original Source Code Comment: IF SO, GO MOVE PGM NAME
Original Source Code Comment: EXTENSION?
Original Source Code Comment: ERROR IF NOT ONE OF THEM
Original Source Code Comment: SAVE THE CHARACTER
Original Source Code Comment: CLEAR COUNTER
Original Source Code Comment: BACK NAME POINTER UP
Original Source Code Comment: GET A CHARACTER
Original Source Code Comment: SAME AS SAVED CHAR?
Original Source Code Comment: IF SO, MOVE NAME
Original Source Code Comment: EOF?
Original Source Code Comment: IF SO, MOVE NAME
Original Source Code Comment: POINT TO NEXT CHARACTER
Original Source Code Comment: INCREMENT COUNTER
Original Source Code Comment: CONTINUE CHECK
529BH - CHECK2 - Part of the COPY routine; jumped here if the filename characters match.
Original Source Code Comment: BACKUP DCB2
Original Source Code Comment: BACK UP DCB1
Original Source Code Comment: GET A DCB1 CHAR
Original Source Code Comment: PUT IT IN DCB2
Original Source Code Comment: DO FOR COUNT
Original Source Code Comment: DO SYNTAX CHECK AGAIN
52A3H - DSPREC - SUBROUTINE to bump the record number being processed and display that record number as being copied.
Original Source Code Comment: SAVE CALLER'S REGISTERS
Original Source Code Comment: GET THE INTERNAL COUNTER
Original Source Code Comment: BUMP IT
Original Source Code Comment: SAVE IT FOR LATER
Original Source Code Comment: MAKE IT ASCII
Original Source Code Comment: POINT TO COPY REC MSG
NOTE: 021BH is the Model III ROM routine to display the character at (HL) until a 03H is found.
Original Source Code Comment: PRINT IT
Original Source Code Comment: RESTORE CALLER'S REGISTERS
52BAH - RECCS - MESSAGE and STORAGE AREA.
52BCH - Subroutine to convert the new record number to ASCII and put it into the message "COPYING RECORD nnnn".
NOTE: 0A9AH is the Model III ROM routine to STORE AN INTEGER. The value in HL is put into the single precision number storage area of 4121H and is flagged as an INTEGER.
Original Source Code Comment: HEX TO ASCII ROUTINE IN ROM
NOTE: 1034H is the Model III ROM routine to initialize the buffer for an ASCII conversion. It checks the edit flag (at 40D8H), sets HL to point to a buffer at 4130H, and puts a space there.
NOTE: 0FD9H is a routine which will convert the integer value in REG 1 (i.e., 4124H) to an ASCII string. Returns with register pair HL pointing to the result.
Original Source Code Comment: POINT TO WHERE ASCII IS
Original Source Code Comment: POINT TO SCREEN MSG
Original Source Code Comment: 5 ASCII CHARS
Original Source Code Comment: GET A ASCII CHAR
Original Source Code Comment: SPACE?
Original Source Code Comment: NO, IT'S OKAY
Original Source Code Comment: CONVERT TO '0'
Original Source Code Comment: STORE IN MSG
Original Source Code Comment: BUMP THE POINTERS
Original Source Code Comment: DO FOR COUNT
52DCH - RECORD - MESSAGE and STORAGE AREA.
52F3H - DISPLY - Subroutine to display the message COPYING filespec 1 TO filespec 2.
Original Source Code Comment: POINT TO 'COPYING' MSG
NOTE: 021BH is the Model III ROM routine to display the character at (HL) until a 03H is found.
Original Source Code Comment: OUTPUT IT TO SCREEN
Original Source Code Comment: POINT TO 1ST FILE NAME
Original Source Code Comment: SCREEN PRINT THE NAME
Original Source Code Comment: POINT TO 'TO' MSG
NOTE: 021BH is the Model III ROM routine to display the character at (HL) until a 03H is found.
Original Source Code Comment: SCREEN PRINT IT
Original Source Code Comment: POINT TO 2ND FILE NAME
Original Source Code Comment: SCREEN PRINT THE NAME
Original Source Code Comment: LOAD A CR
NOTE: 0033H is the Model III ROM character print routine; displays the character held in Register A at the current cursor position. Since this was JUMPED to instead of CALLed, the RET at the end of this ROM routine will then RETurn to the caller of this subroutine instead of returning to this place.
Original Source Code Comment: OUTPUT IT AND RETURN
5310H - PRNTIT - Subroutine of the Subroutine to display the message COPYING filespec 1 TO filespec 2. Parse the characters in the filespecs and display them.
Original Source Code Comment: GET A CHAR
Original Source Code Comment: SPACE OR LESS?
Original Source Code Comment: RETURN IF SO
NOTE: 0033H is the Model III ROM character print routine; displays the character held in Register A at the current cursor position.
Original Source Code Comment: ELSE OUTPUT THE CHAR
Original Source Code Comment: BUMP THE POINTER
Original Source Code Comment: AND CONTINUE
531AH - COPMSG - MESSAGE and STORAGE AREA.
532AH - S9WAIT - Subroutine to display a flashing prompt of the message pointed to by Register Pair HL.
Original Source Code Comment: SAVE POINTER TO MESSAGE
NOTE: 021BH is the Model III ROM routine to display the character at (HL) until a 03H is found.
Original Source Code Comment: DISPLAY IT
Original Source Code Comment: GET POINTER BACK
Original Source Code Comment: SET A TIMER
NOTE: 002BH is the Model III ROM Keyboard scanning routine; Register A exits with the ASCII value for the key that was pressed or ZERO if no key was pressed.
Original Source Code Comment: SCAN THE KEYBOARD
Original Source Code Comment: USER HIT ENTER?
Original Source Code Comment: YES, EXIT
Original Source Code Comment: DEC THE TIMER
Original Source Code Comment: WE TIMED OUT?
Original Source Code Comment: NO, KEEP TIMING
Original Source Code Comment: GET THE FLASH FLAG
Original Source Code Comment: FLIP IT
Original Source Code Comment: PUT IT BACK
Original Source Code Comment: IF Z, PUT THE MESSAGE ON THE SCREEN
Original Source Code Comment: ELSE ERASE THE MSG FROM SCREEN
534DH - Jump point in the subroutine to display a flashing prompt of the message pointed to by Register Pair HL. Jumped here if we got a ENTER from the user.
Original Source Code Comment: LOAD A 'MOVE TO BEG OF LINE' CHAR
NOTE: 0033H is the Model III ROM character print routine; displays the character held in Register A at the current cursor position.
Original Source Code Comment: OUTPUT IT
Original Source Code Comment: LOAD 'ERASE TO END OF LINE CHAR'
NOTE: 0033H is the Model III ROM character print routine; displays the character held in Register A at the current cursor position. Since this was JUMPED to instead of CALLed, the RET at the end of this ROM routine will then RETurn to the caller of this subroutine instead of returning to this place.
Original Source Code Comment: OUTPUT IT AND RETURN
5357H - SINGCP - Single Drive, Single File Copy Routine.
This routine finds out how much user ram is available, and reads the first file until EOF or memory full. Ask to swap disks and write until the file is written; swapping back if memory ran out before EOF.
Original Source Code Comment: GET END OF MEMORY
Original Source Code Comment: POINT TO BEGIN OF BUFFER AREA
Original Source Code Comment: CLEAR CARRY
Original Source Code Comment: HL NOW CONTAINS NO. OF BYTES LEFT IN MEM
Original Source Code Comment: SET FOR DIVIDE BY 256
Original Source Code Comment: CLEAR COUNTER
Original Source Code Comment: INC THE # BLOCKS COUNTER
Original Source Code Comment: CLEAR COUNTERS
Original Source Code Comment: SUBTRACE 256 FROM REMAINING BYTES
Original Source Code Comment: CONTINUE SUBTRACT IF NO CARRY
Original Source Code Comment: A NOW HAS # OF 256 BLOCKS
Original Source Code Comment: DUMB ONE OFF
Original Source Code Comment: SAVE THE NUM OF BLOCKS
'Insert SOURCE Disk (ENTER) ' + 03H"
Original Source Code Comment: GET SOURCE DISK MESSAGE
Original Source Code Comment: FLASH AND WAIT
Original Source Code Comment: OPEN THE READ FILE
Original Source Code Comment: GET THE PARAMETERS
Original Source Code Comment: SHOW LRL OF 256
Note: IX+09H = the position in the DCB for the LOGICAL RECORD LENGTH).
Original Source Code Comment: GET THE LRL
Original Source Code Comment: SAVE IT
Note: IX+08H = the position in the DCB for the BYTE OFFSET IN THE SECTOR FOR LAST BYTE OF THE FILE).
Original Source Code Comment: GET THE EOF
Original Source Code Comment: SAVE IT
Original Source Code Comment: SET FOR LRL 256
Note: IX+0CH = the position in the DCB for the NMSB OF THE LAST SECTOR TO READ/EOF)
Original Source Code Comment: GET THE ERN
Original Source Code Comment: SAVE IT
Note: IX+0DH = the position in the DCB for the MSB OF THE LAST SECTOR TO READ/EOF)
Original Source Code Comment: 'INSERT DESTINATION' MSG
Original Source Code Comment: FLASH AND WAIT
Original Source Code Comment: SET FOR LRL OF 256
Original Source Code Comment: POINT TO THE WRITE FILE DCB
Original Source Code Comment: POINT TO THE READ BUFFER
NOTE: 4420H is the SYS00/SYS routine to INITIALIZE A FILE (i.e., CREATE or OPEN). This RST 28H's with a value of A2H so as to call ROUTINE 2 in OVERLAY 2. Register HL needs to point to a RAM BUFFER for the DCB's.
Original Source Code Comment: GO OPEN OR INIT THE FILE
Original Source Code Comment: EXIT IF ERROR
'Insert SOURCE Disk (ENTER) ' + 03H"
Original Source Code Comment: 'INSERT SOURCE' MSG
Original Source Code Comment: FLASH AND WAIT
Original Source Code Comment: POINT TO READ BUFFER
Original Source Code Comment: PUT IT INTO THE DCB BUFF ADDR LOC
Original Source Code Comment: NUMBER OF BLOCKS OF MEMORY
Original Source Code Comment: USE IT AS A COUNTER
Original Source Code Comment: SAVE THE COUNTER
Original Source Code Comment: POINT TO THE READ DCB
NOTE: 4436H is the SYS00/SYS vector for 'READ', which reads the record that the disk drive is positioned over.
Original Source Code Comment: GO READ 1 BLOCK
Original Source Code Comment: RESTORE THE COUNTER
Original Source Code Comment: IF NO ERROR, FINE
Original Source Code Comment: EOF ERROR?
Original Source Code Comment: THAT'S OKAY, WE'RE DONE WITH READ
Original Source Code Comment: REC OUT OF RANGE?
Original Source Code Comment: THEN DONE
Original Source Code Comment: REPORT ERROR AND ABORT
53D6H - LOOPZ2 - Continuation of SINGLE FILE, SINGLE DRIVE Copy - Jumped here when a block as successfully been read into the READ FILE BUFFER.
Original Source Code Comment: GET THE BUFF ADDR FROM DCB
Original Source Code Comment: LOAD 256 INTO DE
Original Source Code Comment: BUMP BUFF ADDR BY 256 (1 BLOCK)
Original Source Code Comment: MAKE THIS THE NEW READ BUFFER
Original Source Code Comment: AND READ SOME MORE
At this point, the READ RAM buffer has been filled, so now we need to write it to disk.
Original Source Code Comment: 'INSERT DESTINATION' MSG
Original Source Code Comment: FLASH AND WAIT
Original Source Code Comment: POINT TO BEG OF READ BUFFER
Original Source Code Comment: RESET THE READ DCB BUFF POINTER
Original Source Code Comment: RESET THE WRITE DCB BUFF POINTER
Original Source Code Comment: GET THE BLOCK COUNT
Original Source Code Comment: MAKE IT A COUNTER
Original Source Code Comment: SAVE COUNTER
Original Source Code Comment: POINT TO WRITE DCB
NOTE: 443CH is the SYS00/SYS vector for 'WRITE with VERIFY', which will write verify a write with a retry count of 3. DE must point to the buffer to write.
Original Source Code Comment: WRITE WITH VERIFY
Original Source Code Comment: RESTORE COUNTER
Original Source Code Comment: REPORT AND EXIT IF ERROR
Original Source Code Comment: GET THE BUFFER POINTER
Original Source Code Comment: LOAD DE WITH 256
Original Source Code Comment: BUMP POINTER TO NEXT BLOCK
Original Source Code Comment: PUT INTO DCB AS POINTER
Original Source Code Comment: CONTINUE FOR COUNT
Original Source Code Comment: GO READ SOME MORE
540EH - GOGO - Continuation of SINGLE FILE, SINGLE DRIVE Copy - Jumped here to write out what we have if we had a (harmless) EOF error or Records Out of Range error.
Original Source Code Comment: GET THE BLOCK COUNT
Original Source Code Comment: SUB THE NUMBER WE ACTUALLY READ
Original Source Code Comment: USE IT FOR A COUNTER
Original Source Code Comment: SAVE THE COUNTER
Original Source Code Comment: 'INSERT DESTINATION' MSG
Original Source Code Comment: FLASH AND WAIT
Original Source Code Comment: POINT TO READ BUFFER BEGINNING
Original Source Code Comment: RESET THE WRITE BUFF POINTER
Original Source Code Comment: GET THE COUNTER BACK
Original Source Code Comment: SAVE THE COUNTER
Original Source Code Comment: POINT TO WRITE DCB
NOTE: 443CH is the SYS00/SYS vector for 'WRITE with VERIFY', which will write verify a write with a retry count of 3. DE must point to the buffer to write.
Original Source Code Comment: WRITE WITH VERIFY
Original Source Code Comment: RESTORE THE COUNTER
Original Source Code Comment: REPORT AND EXIT IF ERROR
Original Source Code Comment: GET THE BUFFER POINTER
Original Source Code Comment: LOAD 256 INTO DE
Original Source Code Comment: BUMP THE POINTER BY 1 BLOCK
Original Source Code Comment: PUT IT BACK AS NEW POINTER
Original Source Code Comment: CONTINUE FOR COUNT
At this point, the buffers have been written, but the EOF cannot simply be transferred because of the EOF / RECORD OUT OF RANGE error on the read, so we need to recalculate and set the appropriate EOF.
Original Source Code Comment: SET UP THE PARAMETERS FROM OPEN
Original Source Code Comment: GET THE LRL
Note: IX+09H = the position in the DCB for the LOGICAL RECORD LENGTH).
Original Source Code Comment: GET THE EOF
Note: IX+08H = the position in the DCB for the BYTE OFFSET IN THE SECTOR FOR LAST BYTE OF THE FILE).
Original Source Code Comment: GET THE ERN
Note: IX+0CH = the position in the DCB for the NMSB OF THE LAST SECTOR TO READ/EOF)
Note: IX+0DH = the position in the DCB for the MSB OF THE LAST SECTOR TO READ/EOF)
Original Source Code Comment: POINT TO WRITE DCB
NOTE: 4428H is the SYS00/SYS routine to CLOSE A DISK FILE. This RST 28H's with a value of 93H so as to call ROUTINE 1 in OVERLAY 3.
Original Source Code Comment: CLOSE THE FILE
'Insert SOURCE Disk (ENTER) ' + 03H"
Original Source Code Comment: 'INSERT SOURCE' MSG
Original Source Code Comment: FLASH AND WAIT
Original Source Code Comment: CLOSE AND EXIT
5463H - S9DES - MESSAGE and STORAGE AREA.
Original Source Code Comment: NUM OF BLOCKS COUNT
Original Source Code Comment: FLASH FLAG
54B9H - COP91 - SINGLE DRIVE COPY ROUTINE - See if the user has selected the drives to make this a single drive copy. This portion parses both for a drive number, and defaults to "0" if none.
Original Source Code Comment: POINT TO 1ST FILE DCB
Original Source Code Comment: SET FOR COUNT OF 24
Original Source Code Comment: GET A CHARACTER
Original Source Code Comment: DRIVE SPECIFIER?
Original Source Code Comment: BUMP POINTER
Original Source Code Comment: IF SO, CHECK DRIVE
Original Source Code Comment: LOOP FOR COUNT
Original Source Code Comment: ASSUME DRIVE 0 THEN
Original Source Code Comment: AND CONTINUE
54B9H - COP91 - Continuation of the routine to see if the user has selected the drives to make this a single drive copy; jumped here if a we got a ":" in the SOURCE FILE DCB.
Original Source Code Comment: GET THE DRIVE NUMBER
Original Source Code Comment: POINT TO 2ND FILE NAME
Original Source Code Comment: SET FOR COUNT OF 24 CHARS
Original Source Code Comment: GET A CHAR
Original Source Code Comment: DRIVE SPECIFIER?
Original Source Code Comment: BUMP POINTER
Original Source Code Comment: YES, GO CHECK DRIVE NUM
Original Source Code Comment: LOOP FOR COUNT
Original Source Code Comment: ASSUME DRIVE 0 THEN
Original Source Code Comment: AND CONTINUE
54CBH - COP93 - Continuation of the routine to see if the user has selected the drives to make this a single drive copy; check the two drive numbers (held in A and C) to see if they match.
Original Source Code Comment: GET THE DRIVE NUMBER
Original Source Code Comment: THE TWO DRIVES THE SAME?
Original Source Code Comment: YES, SINGLE DRIVE COPY
54D0H - COPY0 - Dual Drive copy roputine.
Original Source Code Comment: DISPLAY THE FILE NAMES
Original Source Code Comment: SET THE INTERNAL COUNTER
Original Source Code Comment: GO OPEN THE READ FILE
Original Source Code Comment: EXIT IF ERROR
Original Source Code Comment: SET FOR LRL OF 256
Original Source Code Comment: POINT TO DCB #2
Original Source Code Comment: POINT TO SAME BUFFER
NOTE: 4420H is the SYS00/SYS routine to INITIALIZE A FILE (i.e., CREATE or OPEN). This RST 28H's with a value of A2H so as to call ROUTINE 2 in OVERLAY 2. Register HL needs to point to a RAM BUFFER for the DCB's.
Original Source Code Comment: OPEN OR INIT THE FILE
Original Source Code Comment: EXIT IF ERROR
Original Source Code Comment: DISPLAY RECORD NUMBER
Original Source Code Comment: POINT TO DCB #1
Original Source Code Comment: HL => DATA BUFFER
NOTE: 4436H is the SYS00/SYS vector for 'READ', which reads the record that the disk drive is positioned over.
Original Source Code Comment: READ IN A RECORD
Original Source Code Comment: IF NO ERROR, GO WRITE
Original Source Code Comment: EOF ERROR ?
Original Source Code Comment: YES, ALL DONE
Original Source Code Comment: NRN ERROR ?
Original Source Code Comment: IF SO, DONE BUT ADJUST
Original Source Code Comment: REPORT TRUE ERROR AND EXIT
5506H - NEXT - Copy the READ FILE BUFFER to the DESTINATION FILE BUFFER, and WRITE.
Original Source Code Comment: GET THE LRL
Original Source Code Comment: LRL OF 256?
Original Source Code Comment: NO, CONTINUE
Original Source Code Comment: HL => READ BUFFER
Original Source Code Comment: DE => WRITE BUFFER
Original Source Code Comment: NUMBER OF BYTES TO MORE
Original Source Code Comment: MOVE IT TO THE WRITE BUFFER
Original Source Code Comment: POINT TO DCB #2
Original Source Code Comment: HL => DATA BUFFER (NON-256)
Original Source Code Comment: WRITE OUT THE RECORD
Original Source Code Comment: IF NO ERR, CONTINUE
Original Source Code Comment: REPORT ERROR AND EXIT
5525H - DONE0 - The copy routine has completed but with a (harmless) EOF or RECORD OUT OF RANGE ERROR.
Original Source Code Comment: GET THE LRL
Original Source Code Comment: LRL 256?
Original Source Code Comment: NO, CONTINUE
Original Source Code Comment: GET THE EOF BYTE
Original Source Code Comment: ON SECTOR BOUNDARY?
Original Source Code Comment: YES, CONTINUE
If we are here then we need to specially calculate the EOF.
Note: IX+0CH = the position in the DCB for the LSB OF THE LAST SECTOR TO READ/EOF)
Original Source Code Comment: GET THE ERN
Note: IX+0DH = the position in the DCB for the MSB OF THE LAST SECTOR TO READ/EOF)
Original Source Code Comment: BACK UP TO LAST RECORD
Note: IX+0CH = the position in the DCB for the NMSB OF THE LAST SECTOR TO READ/EOF)
Original Source Code Comment: STORE IT
Note: IX+0DH = the position in the DCB for the MSB OF THE LAST SECTOR TO READ/EOF)
Original Source Code Comment: GET THE EOF BYTE
Original Source Code Comment: PUT IT INTO THE DESTINATION DCB
Original Source Code Comment: POINT TO WRITE DCB
NOTE: 4428H is the SYS00/SYS routine to CLOSE A DISK FILE. This RST 28H's with a value of 93H so as to call ROUTINE 1 in OVERLAY 3.
Original Source Code Comment: GO CLOSE IT
Original Source Code Comment: EXIT IF ERROR
Original Source Code Comment: POINT TO READ DCB
NOTE: 4428H is the SYS00/SYS routine to CLOSE A DISK FILE. This RST 28H's with a value of 93H so as to call ROUTINE 1 in OVERLAY 3.
Original Source Code Comment: GO CLOSE THE FILE
Original Source Code Comment: EXIT IF ERROR
Original Source Code Comment: RETURN TO DOS
555BH - DRIVE1 - MESSAGE and STORAGE AREA.
Original Source Code Comment: MOVE TO BEG OF LINE CHAR
5568H - GETDIR - Read the Directory Track into a Buffer at 4300H.
Original Source Code Comment: GET THE DRIVE NUMBER
Original Source Code Comment: MASK OFF ASCII
Original Source Code Comment: SAVE IT IN C
NOTE: 4B3EH is the SYS00/SYS routine to identify the track number of the directory. Routine exits with the director track number in Register D.
Original Source Code Comment: GET THE DIRECTORY TRACK THIS DRIVE
Original Source Code Comment: GET DIR SECTOR WE'RE GONNA READ
Original Source Code Comment: PUT IT INTO E
Original Source Code Comment: DOS BUFFER
Original Source Code Comment: GO READ SECTOR OF DIRECTORY
Original Source Code Comment: EXIT
557CH - MOVE1 - Routine to transfer B number of characters from (DE) to (IX), aborting if a SPACE is found.
Original Source Code Comment: GET A CHAR
Original Source Code Comment: IS IT A SPACE?
Original Source Code Comment: DESTROY MOVE1 CALL IN CASE
Original Source Code Comment: YES, ILLEGAL
Original Source Code Comment: PUT CALL BACK, IT'S OKAY
Note: IX+00H = the position in the DCB for the TYPE of FCB byte. Bit 0: 1=Read Only, Bit 1: 1=Write Only, Bit 4: 1=The next 2 bytes are simply the address of another FCB, Bit 7=1: Then the next 50 bytes are the description of an open file.
Original Source Code Comment: SAVE THE CHAR
Original Source Code Comment: BUMP THE POINTERS
Original Source Code Comment: CONTINUE FOR COUNT
558FH - MOVE2 - Routine to copy a filename from the directory entry (pointed to by DE) into the DCB (pointed to HL); returns with Register C containing the number of characters in the filename.
Original Source Code Comment: SET FOR 8 CHARS
Original Source Code Comment: GET A CHAR
Original Source Code Comment: SPACE?
Original Source Code Comment: YES, DONE
Original Source Code Comment: SAVE THE CHAR
Original Source Code Comment: INC A COUNT
Original Source Code Comment: BUMP THE POINTERS
Original Source Code Comment: CONTINUE FOR COUNT
559CH - MOVE3 - Routine to copy an extension from the directory entry (pointed to by DE) into the DCB (pointed to HL); returns with Register C containing the number of characters in the extension.
Original Source Code Comment: SET FOR 4 CHARS
Original Source Code Comment: GET A CHAR
Original Source Code Comment: SAVE IT
Original Source Code Comment: INC A COUNTER
Original Source Code Comment: BUMP THE POINTERS
Original Source Code Comment: CONTINUE FOR COUNT
55A6H - MOVE4 - Routine to the drivespec from the directory entry (pointed to by DE) into the DCB (pointed to HL).
Original Source Code Comment: SET FOR COUNT OF 3 CHARS
Original Source Code Comment: GET A CHAR
Original Source Code Comment: SAVE IT
Original Source Code Comment: BUMP THE POINTERS
Original Source Code Comment: CONTINUE FOR COUNT
55AFH - SKSP - Routine to Skip Spaces in DE and Point to the next Non-Blank Character.
Original Source Code Comment: GET A CHAR
Original Source Code Comment: SPACE?
Original Source Code Comment: NO, RET
Original Source Code Comment: BUMP THE POINTER
Original Source Code Comment: AND KEEP LOOKING
55B6H - SLANT - This routine gets called if the user entered a wildcard copy command such as "COPY /EXT:x :x".
Original Source Code Comment: BUMP THE COMMAND LINE POINTER
Original Source Code Comment: PLACE TO STORE EXTENSION
Original Source Code Comment: SET FOR 3 CHARS
Original Source Code Comment: GO GET'EM
Original Source Code Comment: GET NEXT COMMAND LINE CHAR
Original Source Code Comment: DRIVE SPECIFIER?
Original Source Code Comment: NO, ERROR THEN. MUST HAVE DRIVE NUM
Original Source Code Comment: POINT TO READ DRIVE SAVE
Original Source Code Comment: SET FOR 2 CHARS (:D)
Original Source Code Comment: GO GET THE READ DRIVE NUM
Original Source Code Comment: SKIP ANY SPACES
Original Source Code Comment: DRIVE SPECIFIER?
Original Source Code Comment: NO, ERROR THEN
Original Source Code Comment: PLACE TO SAVE WRITE DRIVE NUM
Original Source Code Comment: SET FOR 2 CHARS (:D)
Original Source Code Comment: GO GET WRITE DRIVE NUM
Original Source Code Comment: GET WRITE DRIVE NUM
- If Register A equals 4, the Z FLAG is set.
- If A < 4, the CARRY FLAG will be set.
- if A >= 4, the NO CARRY FLAG will be set.
Original Source Code Comment: GREATER THAN 3?
Original Source Code Comment: YES, NO SUCH DRIVE
55E8H - SLANT0 - Common Routine for COPY and KILL - Wild Card Search Routine.
Original Source Code Comment: LOAD BEGIN OF DIRECTORY
Original Source Code Comment: RESET SECTOR LOCATION TO 3
Original Source Code Comment: GET READ DRIVE NUM
- If Register A equals 4, the Z FLAG is set.
- If A < 4, the CARRY FLAG will be set.
- if A >= 4, the NO CARRY FLAG will be set.
Original Source Code Comment: GREATER THAN 3?
Original Source Code Comment: YES, NO SUCH DRIVE
Original Source Code Comment: LENGTH OF DIRECTORY RECORDS
Original Source Code Comment: SAVE THE COUNTER
Original Source Code Comment: GET A SECTOR FROM DIRECTORY
Original Source Code Comment: POINT TO BUFFER
Original Source Code Comment: SAVE POINTER
Original Source Code Comment: GET 1ST CHAR OF DIR
Original Source Code Comment: IS THIS FILE PROTECTED IN 'ANY' WAY?
Original Source Code Comment: YES, IGNORE IT THEN
If we are here, then the file CAN be copied or killed, next we need to see if the user supplied extension matches the filename's extension.
Original Source Code Comment: GET THE LSB OF DIR POINTER
Original Source Code Comment: POINT TO TO THE 'EXT'
Original Source Code Comment: PUT IT BACK
Original Source Code Comment: POINT TO 'USR' ASKED EXT
Original Source Code Comment: SET FOR THREE CHARS
Original Source Code Comment: GET A CHAR FROM DIR
Original Source Code Comment: MATCH USER?
Original Source Code Comment: NO, SKIP THIS FILE
Original Source Code Comment: BUMP THE POINTERS
Original Source Code Comment: CONTINUE FOR COUNT
Original Source Code Comment: GET THE BUFFER POINTER BACK
Original Source Code Comment: GET THE LSB OF DIR POINTER
Original Source Code Comment: MAKE IT POINT AT THIS FILE'S NAME
Original Source Code Comment: PUT IT BACK
Original Source Code Comment: CLEAR CHAR COUNTER
Original Source Code Comment: POINT TO READ DCB
Original Source Code Comment: MOVE FILE NAME TO READ DCB
Original Source Code Comment: PLACE WHERE EXT IS STORED
Original Source Code Comment: GO GET THE EXTENSION INTO DCB
Original Source Code Comment: SAVE THE COUNTER
Original Source Code Comment: POINT TO READ DRIVE NUMBER
Original Source Code Comment: MOVE IT INTO DCB
Original Source Code Comment: POINT TO READ DCB
Original Source Code Comment: POINT TO WRITE DCB
Original Source Code Comment: GET THE COUNT BACK
Original Source Code Comment: CLEAR THE MSB OF COUNT
Original Source Code Comment: DUPLICATE THE FILE NAME INTO WRITE DCB
Original Source Code Comment: GET THE WRITE POINTER INTO HL
Original Source Code Comment: POINT TO WRITE DRIVE NUMBER
Original Source Code Comment: MOVE DRIVE INTO WRITE DCB
Original Source Code Comment: GO COPY THE FILE
Original Source Code Comment: GET NEXT FILE IN DIRECTORY
Original Source Code Comment: GET THE DIR POINTER
Original Source Code Comment: GET THE LSB OF POINTER
Original Source Code Comment: POINT TO NEXT FILE
Original Source Code Comment: SAVE AS NEW POINTER
- If Register A equals 0F0H, the Z FLAG is set.
- If A < 0F0H, the CARRY FLAG will be set.
- if A >= 0F0H, the NO CARRY FLAG will be set.
Original Source Code Comment: AT END OF THIS DIRECTORY SECTOR?
Original Source Code Comment: NO, CONTINUE
Original Source Code Comment: GET THE SECTOR COUNT BACK
Original Source Code Comment: LOAD THE SECTOR POINTER
Original Source Code Comment: BUMP TO NEXT SECTOR
Original Source Code Comment: RE-SAVE IT
Original Source Code Comment: AND CONTINUE FOR ALL SECTORS
Original Source Code Comment: DONE, ALL FILES COPIED
5669H - S9KILL - "KILL" Routine.
566A
LD E,LLD D,H
Original Source Code Comment: MIRROR THE COMMAND LINE TO DE
Original Source Code Comment: GET A COMMAND LINE CHAR
Original Source Code Comment: KILL ALL MATCH EXT?
Original Source Code Comment: NO, REGULAR KILL
If we are here, then the user requested to KILL based on a WILDCARD.
Original Source Code Comment: BUMP THE POINTER
Original Source Code Comment: PLACE TO SAVE 'EXT'
Original Source Code Comment: SET FOR 3 CHARS
Original Source Code Comment: MOVE 'EM
Original Source Code Comment: GET NEXT CHAR
Original Source Code Comment: DRIVE SPECIFIER?
Original Source Code Comment: NO, ERROR. MUST HAVE DRIVE NUM
Original Source Code Comment: PLACE TO SAVE DRIVE NUM
Original Source Code Comment: SET FOR 2 CHARS (:D)
Original Source Code Comment: GET DRIVE
Original Source Code Comment: SET LOOPER ROUTINE FOR KILL
Original Source Code Comment: INSTEAD OF COPY
Original Source Code Comment: AND GO KILL
5692H - KILLIT - Continuation of the KILL ROUTINE.
Original Source Code Comment: GO OPEN THE FILE
5697H - KILL1 - Continuation of the KILL ROUTINE; display the KILLING message and kill the file.
Original Source Code Comment: GET SYNTAX OF FILE NAME
Original Source Code Comment: EXIT IF SYNTAX ERROR
Original Source Code Comment: SAVE REGS
Original Source Code Comment: POINT TO 'KILLING' MSG
NOTE: 021BH is the Model III ROM routine to display the character at (HL) until a 03H is found.
Original Source Code Comment: PRINT IT
Original Source Code Comment: POINT TO THE FILE NAME
Original Source Code Comment: PRINT IT ALSO
Original Source Code Comment: RESTORE THE REGIS
NOTE: 4424H is the SYS00/SYS routine to OPEN A DISK FILE for use. This RST 28H's with a value of 92H so as to call ROUTINE 1 in OVERLAY 3.
Original Source Code Comment: GO OPEN THE FILE
Original Source Code Comment: EXIT IF ERROR
Original Source Code Comment: EXIT IF ERROR
56BAH - KILMSG - MESSAGE and STORAGE AREA for KILL.
Original Source Code Comment: MOVE TO BEG OF LINE CHAR
56BAH - KILMSG - MESSAGE and STORAGE AREA for PATCH.
Original Source Code Comment: USER ADDRESS TO PATCH
Original Source Code Comment: BUFFER FOR FIND STRING
Original Source Code Comment: BUFFER FOR CHANGE STRING
Original Source Code Comment: FLAG TO SHOW FIND ADDRESS OR NOT
Original Source Code Comment: END REC NUM SAVE
571BH - PATCH Main Routine.
Original Source Code Comment: GET THE CHARACTER FROM THE COMMAND LINE
Original Source Code Comment: ASKING FOR SYSTEM FILES?
Original Source Code Comment: YES, DO IT
Original Source Code Comment: CHECK SYNTAX OF FILESPEC
Original Source Code Comment: EXIT IF ERROR
Original Source Code Comment: SKIP SPACES
Original Source Code Comment: END OF LINE?
Original Source Code Comment: YES, ERROR
Original Source Code Comment: START OF LIST?
Original Source Code Comment: NO, ERROR
Original Source Code Comment: BUMP TO 1ST CHAR
Original Source Code Comment: DE => 'ADD=' COMPARE
Original Source Code Comment: GET THE LENGTH
Original Source Code Comment: INTO BC
Original Source Code Comment: POINT TO TEXT
Original Source Code Comment: DO THE COMPARE
Original Source Code Comment: NO MATCH, PARAM ERROR
Original Source Code Comment: BUMP PAST ADD=
Original Source Code Comment: PUT THE POINTER INTO IX
Original Source Code Comment: CLEAR AN ACCUMULATOR
Note: IX+00H = the position in the DCB for the TYPE of FCB byte. Bit 0: 1=Read Only, Bit 1: 1=Write Only, Bit 4: 1=The next 2 bytes are simply the address of another FCB, Bit 7=1: Then the next 50 bytes are the description of an open file.
Original Source Code Comment: GET A DIGIT
The next few instructions compare the character to 0, : (i.e., 1 above 9), A, and G (i.e., 1 above F) to make sure that it is in the range of a valid hex character.
- If Register A equals 0, the Z FLAG is set.
- If A < 0, the CARRY FLAG will be set.
- if A >= 0, the NO CARRY FLAG will be set.
Original Source Code Comment: NUMERIC?
Original Source Code Comment: YES, EXIT
- If Register A equals 1 more than 9, the Z FLAG is set.
- If A < 1 more than 9, the CARRY FLAG will be set.
- if A >= 1 more than 9, the NO CARRY FLAG will be set.
Original Source Code Comment: YES
- If Register A equals A, the Z FLAG is set.
- If A < A, the CARRY FLAG will be set.
- if A >= A, the NO CARRY FLAG will be set.
Original Source Code Comment: ALPHA?
Original Source Code Comment: NO, EXIT
- If Register A equals G, the Z FLAG is set.
- If A < G, the CARRY FLAG will be set.
- if A >= G, the NO CARRY FLAG will be set.
The next few instructions turn the validated hex character into decimal.
Original Source Code Comment: HL:=HL*16
Original Source Code Comment: MASK OFF ASCII
- If Register A equals 10, the Z FLAG is set.
- If A < 10, the CARRY FLAG will be set.
- if A >= 10, the NO CARRY FLAG will be set.
Original Source Code Comment: ALPHA?
Original Source Code Comment: NO
Original Source Code Comment: YES, CORRECT
The parameter character is now a decimal number held in Register A.
Original Source Code Comment: NEW DIGIT INTO DE
Original Source Code Comment: BUMP TO NEXT DIGIT
Original Source Code Comment: AND CONTINUE
5771H - PLOOP3 - Continuation of the PATCH command. Jumped here if we were given an invalid hex character on the ADD= portion of the command line. A is holding the character from the COMMAND LINE which we know is NOT a valid hex character.
Original Source Code Comment: SAVE THE ADDRESS
Original Source Code Comment: COMMA?
Original Source Code Comment: NO, BAD PARAM
POP HLPUSH IX
Original Source Code Comment: MOVE THE POINTER BACK TO HL
Original Source Code Comment: BUMP PAST ','
Original Source Code Comment: DE => 'FIND=' COMPARE
Original Source Code Comment: GET THE LENGTH
Original Source Code Comment: POINT TO TEXT
Original Source Code Comment: INTO BC
Original Source Code Comment: DO THE COMPARE
Original Source Code Comment: EXIT IF NO MATCH
Original Source Code Comment: HL => FIND STRING
Original Source Code Comment: PLACE TO STORE IT
Original Source Code Comment: MOVE IT AND GET LENGTH
Original Source Code Comment: SAVE THE LENGTH
Original Source Code Comment: GET THE NEXT CHAR
Original Source Code Comment: COMMA?
Original Source Code Comment: EXIT IF NOT
Original Source Code Comment: BUMP TO NEXT CHAR
Original Source Code Comment: DE => 'CHG=' COMPARE
Original Source Code Comment: GET THE LENGTH
Original Source Code Comment: BUMP TO TEXT
Original Source Code Comment: PUT THE LENGTH INTO BC
Original Source Code Comment: DO THE COMPARE
Original Source Code Comment: EXIT IF PARAM ERROR
Original Source Code Comment: HL => CHANGE STRING
Original Source Code Comment: PLACE TO STORE IT
Original Source Code Comment: MOVE IT AND GET LENGTH
Original Source Code Comment: SAVE THE LENGTH
Original Source Code Comment: SAVE THE LENGTH
Original Source Code Comment: SEE IF THEY ARE THE SAME
Original Source Code Comment: NO, BAD PARAM
If we are here, then we have the FIND field and the CHANGE fields stored and they are of matching length.
Original Source Code Comment: CLEAR OUT A
Original Source Code Comment: SET FOR NO CHANGE MADE
Original Source Code Comment: SET FOR DIDN'T FIND
Original Source Code Comment: SEE IF DOING SYSTEM FILES
Original Source Code Comment: YES, BYPASS OPEN
Original Source Code Comment: SET THE PROTECTION OVER-RIDE FLAG
Original Source Code Comment: OPEN THE FILE
Original Source Code Comment: EXIT IF ERROR
Original Source Code Comment: GET THE STATUS/PROTECTION LEVEL
Original Source Code Comment: INSURE FULL ACCESS
Original Source Code Comment: PUT IT BACK
Original Source Code Comment: GET THE 1ST EXTENT
Original Source Code Comment: IS THIS SYS 0?
Original Source Code Comment: IS THIS SYS 0?
Original Source Code Comment: NO, CONTINUE
Original Source Code Comment: FINAL CHECK
Original Source Code Comment: MASK OFF NUMBER OF GRANS
Original Source Code Comment: NOT SYS 0
Original Source Code Comment: GET THE NEXT RECORD NUMBER
Original Source Code Comment: FOOL GETPDA TO BYPASS BOOT SECTOR
Original Source Code Comment: SET NEW RECORD NUMBER
Original Source Code Comment: DO FIRST READ ON FILE
Original Source Code Comment: GET ERN
Original Source Code Comment: SAVE ERN
Next, we need to get a block of data from the file.
Original Source Code Comment: GET CHARACTER FROM BUFF
Original Source Code Comment: LOAD FILE CHARACTER?
Original Source Code Comment: GO IF SO
Original Source Code Comment: END OF FILE CHARACTER?
Original Source Code Comment: DONE IF SO
Original Source Code Comment: END OF FILE CHARACTER?
Original Source Code Comment: DONE IF SO
- If Register A equals 21H, the Z FLAG is set.
- If A < 21H, the CARRY FLAG will be set.
- if A >= 21H, the NO CARRY FLAG will be set.
Original Source Code Comment: COMMENT OR SUCH?
Original Source Code Comment: BYPASS IF SO
Original Source Code Comment: LOAD FILE FORMAT ERROR
Original Source Code Comment: EXIT TO ERROR
5816H - PATCHK - Continuation of the PATCH command. Read a CODE BLOCK from the file
Original Source Code Comment: GET NEXT CHARACTER IN BUFF
Original Source Code Comment: PUT CHARACTER COUNT IN B
Original Source Code Comment: POINT TO LOAD ADDRESS
Original Source Code Comment: GET LSB OF LOAD ADDRESS
Original Source Code Comment: BUMP COUNT FOR IT
Original Source Code Comment: GET MSB OF LOAD ADDRESS
Original Source Code Comment: BUMP COUNT FOR IT
Original Source Code Comment: SAVE BUFFER LOCATION
Original Source Code Comment: SAVE LOAD ADDRESS
Original Source Code Comment: IF B<>0 THEN COUNT NOT 256
Original Source Code Comment: B=0 OR B=256 - SET ADD ACCOURDINGLY
Original Source Code Comment: GO OFFSET ADDRESS
5825H - PATCH0 - Continuation of the PATCH command read a CODE BLOCK routine; jumped here if there is more data to read in the code block than just the 3 bytes comprising the field size and data address.
The next few instructions are to set DE to be DE + the length of the field. This requires some math. First, work the LSB of Register Pair DE.
5826
5827
ADD A,B
LD E,ALD A,E
Original Source Code Comment: PUT LSB INTO A
Original Source Code Comment: PUT MSB INTO A
Original Source Code Comment: ANY CARRY, ADD IT
Original Source Code Comment: DE => LOAD ADDRESS + COUNT
Original Source Code Comment: GET THE ASKED FOR ADDRESS
Original Source Code Comment: CLEAR FLAGS
Original Source Code Comment: SUBTRACT END ADD FROM ASKED
Original Source Code Comment: RESTORE STACK PROPERLY
Original Source Code Comment: IF NO CARRY, LOAD ADDRESS TOO LOW
Original Source Code Comment: SAVE BUFFER ADD
Original Source Code Comment: GET ASKED ADDRESS
Original Source Code Comment: CLEAR FLAGS
Original Source Code Comment: ASKED ADD - LOAD ADD
Original Source Code Comment: SAVE DIFFERENCE IN B
Original Source Code Comment: RESTORE BUFFER ADD
Original Source Code Comment: IF CARRY, TOO LOW
Original Source Code Comment: BUMP PAST THE MSB OF LOAD ADDRESS
Original Source Code Comment: FORCE NON-ZERO
Original Source Code Comment: SHOW WE'VE FOUND ADDRESS
Original Source Code Comment: GET THE BYTE COUNT OFFSET
Original Source Code Comment: ANY OFFSET?
Original Source Code Comment: NO, BYPASS DJNZ
Original Source Code Comment: NOW GET TO SPECIFIC ADD
Original Source Code Comment: IF OUT OF BUFFER, READ NEXT SECTOR
Original Source Code Comment: DE => FIND STRING
Original Source Code Comment: GET THE LENGTH
Original Source Code Comment: BUMP TO TEXT
Original Source Code Comment: PUT THE LENGTH INTO BC
Original Source Code Comment: DO THE COMPARISON
Original Source Code Comment: IF NOT, TELL USER SO
Original Source Code Comment: DE => CHANGE STRING
Original Source Code Comment: ARE FIND AND CHANGE THE SAME?
Original Source Code Comment: YES. DON'T NEED TO CHANGE ANYTHING
Original Source Code Comment: SWAP POINTERS
Original Source Code Comment: MOVE IN THE NEW STRING
Original Source Code Comment: FORCE NON-ZERO
Original Source Code Comment: SHOW WE MADE CHANGE
Original Source Code Comment: IS THIS A SYSTEM FILE?
Original Source Code Comment: SAVE THE FLAG
Original Source Code Comment: YES, CLOSE THE SYSTEM FILE
Original Source Code Comment: GET THE FLAG BACK
Original Source Code Comment: EXIT IF SYSTEM FILE
If we are here, then we just patched a non-SYSTEM file.
Original Source Code Comment: SET REGISTERS UP FOR WRITE AND CLOSE
Original Source Code Comment: BACK UP ON LRL
NOTE: 443CH is the SYS00/SYS vector for 'WRITE with VERIFY', which will write verify a write with a retry count of 3. DE must point to the buffer to write.
Original Source Code Comment: WRITE & VERIFY
Original Source Code Comment: WE'RE DONE
5888H - DLYLOP - Continuation of the PATCH command to deal with a COMMENT BLOCK.
Original Source Code Comment: BYPASS NO-USE DATA
Original Source Code Comment: GET CHARACTER COUNT
Original Source Code Comment: IF END OF BUFF, DO READ
5897H - PATEND - Continuation of the PATCH command to display the results of the Patch and exit.
Original Source Code Comment: DID WE FIND ADDRESS?
Original Source Code Comment: IF SO, CHECK IF CHANGE
Original Source Code Comment: SHOW DIDN'T FIND ADD
NOTE: 021BH is the Model III ROM routine to display the character at (HL) until a 03H is found. Since this was JUMPED to instead of CALLed, the RET at the end of this ROM routine will then RETurn to the caller of this subroutine instead of returning to this place.
Original Source Code Comment: PRINT AND EXIT TO DOS
58A3H - PATEN1 - Continuation of the PATCH command to display the results of the Patch if we have a match.
Original Source Code Comment: DID WE CHANGE IT?
Original Source Code Comment: IF SO, TELL USER
Original Source Code Comment: SHOW DIDN'T CHANGE
Original Source Code Comment: EXIT
58AEH - PATEN2 - Continuation of the PATCH command to display the results of a successful Patch.
Original Source Code Comment: SHOW CHANGE MADE
Original Source Code Comment: EXIT
58B3H - REDIT - Continuation of the PATCH command. Subroutine to read a sector.
Original Source Code Comment: SAVE BC
Original Source Code Comment: SET UP THE DCB
NOTE: 4436H is the SYS00/SYS vector for 'READ', which reads the record that the disk drive is positioned over.
Original Source Code Comment: READ A RECORD
Original Source Code Comment: RESTORE BC
Original Source Code Comment: EXIT IF GOOD
Original Source Code Comment: DESTROY CALL TO READIT
Original Source Code Comment: AND REPORT ERROR
58C0H - MOVLTH - Part of the PATCH routine. This routine decodes an abitrary length hexadecimal field. It is called related to the FIND and CHG fields given by the user. HL points to the source, and DE points to the destination.
Original Source Code Comment: CLEAR A COUNTER
Original Source Code Comment: GET A CHARACTER
- If Register A equals 30H, the Z FLAG is set.
- If A < 30H, the CARRY FLAG will be set.
- if A >= 30H, the NO CARRY FLAG will be set.
Original Source Code Comment: END OF LINE?
Original Source Code Comment: YES, EXIT
Original Source Code Comment: CONVERT IT TO HEX
Original Source Code Comment: SAVE IT IN C
Original Source Code Comment: BUMP TO NEXT VALUE
Original Source Code Comment: GET IT
Original Source Code Comment: CONVERT IT TO HEX
Original Source Code Comment: ADD IN THE MSB
Original Source Code Comment: STORE IT
Original Source Code Comment: BUMP TO NEXT SLOT
Original Source Code Comment: BUMP TO NEXT CHARACTER
Original Source Code Comment: BUMP THE COUNTER
Original Source Code Comment: LOOP TILL DONE
58D7H - MOVLT2 - Part of the PATCH routine's subroutine which decodes an abitrary length hexadecimal field. Jumped here when we hit the END OF STRING (by virtue of a character below "0" being found).
Original Source Code Comment: GET THE COUNTER
Original Source Code Comment: ANYTHING ENTERED?
Original Source Code Comment: NO, MISSING PARAM
58DDH - TCONV - Convert a Byte Contaning a Hex Character to the High Nybble.
Original Source Code Comment: CONVERT IT
58E2
58E4
58E6
SLA A
SLA A
SLA ASLA A
Original Source Code Comment: MOVE IT TO THE MSB
58E9H - TCONV1 - Convert a Byte Contaning a Hex Character to the Low Nybble a/k/a get the value of an ASCII character.
Original Source Code Comment: MASK OFF ASCII
Original Source Code Comment: EXIT IF PARAM ERROR
- If Register A equals 10, the Z FLAG is set.
- If A < 10, the CARRY FLAG will be set.
- if A >= 10, the NO CARRY FLAG will be set.
Original Source Code Comment: NUMBER?
Original Source Code Comment: YES, EXIT
Original Source Code Comment: TRY ALPHA
- If Register A equals 10, the Z FLAG is set.
- If A < 10, the CARRY FLAG will be set.
- if A >= 10, the NO CARRY FLAG will be set.
Original Source Code Comment: NO, PARAM ERROR
- If Register A equals 16, the Z FLAG is set.
- If A < 16, the CARRY FLAG will be set.
- if A >= 16, the NO CARRY FLAG will be set.
58FEH - HSYS - PATCH routine for a SYSTEM/OVERLAY File.
Original Source Code Comment: BUMP TO NEXT VALUE
Original Source Code Comment: GET THE SYSTEM NUMBER
Original Source Code Comment: COMES BACK IN DE
Original Source Code Comment: SKIP SPACES
Original Source Code Comment: ASSUME DRIVE 0
Original Source Code Comment: DRIVE SPECIFIER
Original Source Code Comment: NO, CONTINUE
Original Source Code Comment: BUMP TO DRIVE NUMBER
Original Source Code Comment: GET IT
Original Source Code Comment: BUMP PAST DRIVE NUMB
Original Source Code Comment: MASK OFF ASCII
Original Source Code Comment: EXIT IF SILLY DRIVE NUMBER
Original Source Code Comment: PUT THE DRIVE INTO C
Original Source Code Comment: COMMAND LINE TO STACK, SYSTEM NUMBER TO HL
Original Source Code Comment: PUT THE SYSTEM NUMBER ON STACK
Original Source Code Comment: PUT THE DRIVE NUMBER ON STACK
Original Source Code Comment: CLEAR OUT THE DCB
Original Source Code Comment: SIZE OF THE DCB
Original Source Code Comment: CLEAR BYTE
Original Source Code Comment: CLEAR IT OUT
Original Source Code Comment: IX => DCB
Note: IX+00H = the position in the DCB for the TYPE of FCB byte. Bit 0: 1=Read Only, Bit 1: 1=Write Only, Bit 4: 1=The next 2 bytes are simply the address of another FCB, Bit 7=1: Then the next 50 bytes are the description of an open file.
Original Source Code Comment: SET THE DISK DCB TYPE
Note: IX+0CH = the position in the DCB for the NMSB OF THE LAST SECTOR TO READ/EOF)
Original Source Code Comment: SET THE END RECORD NUMBER
Note: IX+0DH = the position in the DCB for the MSB OF THE LAST SECTOR TO READ/EOF)
Note: IX+03H = the position in the DCB for the LSB of the FILE BUFFER RAM ADDRESS).
Original Source Code Comment: SET THE BUFFER
Note: IX+04H = the position in the DCB for the MSB of the FILE BUFFER RAM ADDRESS).
Original Source Code Comment: GET THE DRIVE NUMBER BACK
Note: IX+06H = the position in the DCB for the DRIVE NUMBER).
Original Source Code Comment: SAVE THE DRIVE NUMBER
Original Source Code Comment: GET THE SYSTEM MODULE
Note: IX+07H = the position in the DCB for the LOGICAL FILE NUMBER [the directory entry number]).
Original Source Code Comment: SET IT IN THE DCB
NOTE: 4ABAH is the SYS00/SYS routine to read the HIT sector into RAM.
Original Source Code Comment: READ IN THE HIT TABLE
NOTE: 4409H is the SYS00/SYS routine to process DOS errors.
Original Source Code Comment: EXIT IF ERROR
Original Source Code Comment: SYSTEM NUMBER TIMES 2
Original Source Code Comment: OFFSET TO THE SYSTEM NUMBERS
Original Source Code Comment: ADD IN THIS SYSTEM
5951
LD H,43HLD L,A
Original Source Code Comment: INTO HL
Original Source Code Comment: GET THE STARTING GRAN
Original Source Code Comment: BUMP TO TRACK NUMBER
Original Source Code Comment: SET IT IN THE DCB
Original Source Code Comment: SET THE SYSTEM FLAG
Original Source Code Comment: GET THE COMMAND LINE POINTER BACK
5963H - CLOSYS - Patch File routine to update a system overlay file. The flags were preserved to the stack before this routine was called and are retrieved right after.
Original Source Code Comment: GET THE RECORD NUMBER
Original Source Code Comment: BACK UP ONE RECORD
Original Source Code Comment: PUT IT BACK
Original Source Code Comment: IX => DCB
Original Source Code Comment: GET THE DISK TRACK/SECTOR
Original Source Code Comment: HL => WHERE THE DATA IS
Original Source Code Comment: DO THE WRITE OUT
NOTE: 4409H is the SYS00/SYS routine to process DOS errors.
Original Source Code Comment: EXIT IF ERROR
Original Source Code Comment: ELSE DONE
597BH - HEXGET - Evaluate the overlay number a/k/a Convert a Decimal String into a Binary Value.
597C
LD C,LLD BC,HL
Original Source Code Comment: MOVE THE POINTER TO BC
Original Source Code Comment: CLEAR AN ACCUM
Original Source Code Comment: GET A DIGIT
Original Source Code Comment: MASK OFF ASCII
Original Source Code Comment: EXIT IF END OF NUMBER
- If Register A equals 10, the Z FLAG is set.
- If A < 10, the CARRY FLAG will be set.
- if A >= 10, the NO CARRY FLAG will be set.
Original Source Code Comment: GREATER THAN NUMBER?
Original Source Code Comment: YES, EXIT
Original Source Code Comment: BUMP TO NEXT VALUE
598B
LD E,LLD DE,HL
Original Source Code Comment: MIRROR THE VALUE TO DE
598D
598E
598F
ADD HL,HL
ADD HL,HL
ADD HL,HLADD HL,HL
Original Source Code Comment: TIMES 2
5991
LD D,00HLD DE,A
Original Source Code Comment: NEW DIGIT INTO DE
Original Source Code Comment: ADD IN THE NEW DIGIT
Original Source Code Comment: GET THE NEXT DIGIT
5996H - HEXGE2 - Continuation of the above evaluation routine when the number found is less than 0 or more than 9.
Original Source Code Comment: VALUE TO DE
5998
LD L,CLD HL,BC
Original Source Code Comment: MOVE THE COMMAND LINE BACK TO HL
Original Source Code Comment: DONE
599AH - SYSFLG - MESSAGE and STORAGE AREA.
599BH - OPENIT - General Disk Routine. Open the disk file and preserve the LRL.
Original Source Code Comment: SET UP THE DCB
NOTE: 4424H is the SYS00/SYS routine to OPEN A DISK FILE for use. This RST 28H's with a value of 92H so as to call ROUTINE 1 in OVERLAY 3.
Original Source Code Comment: SAVE POSSIBLE ERROR
Original Source Code Comment: GET THE SOURCE LRL
Original Source Code Comment: SAVE IT FOR COPY
Original Source Code Comment: GET POSSIBLE ERROR BACK
59ADH - GETDCB - General Disk Routine. Set up for full sector FILE I/O.
Original Source Code Comment: SET FOR LRL OF 256
Original Source Code Comment: POINT TO DCB
Original Source Code Comment: POINT TO BUFFER
Original Source Code Comment: EXIT
59B6H - INITIT - General Disk Routine. Set up for full sector FILE I/O and Create A FiLE.
Original Source Code Comment: SET UP THE DCB
NOTE: 4420H is the SYS00/SYS routine to INITIALIZE A FILE (i.e., CREATE or OPEN). This RST 28H's with a value of A2H so as to call ROUTINE 2 in OVERLAY 2. Register HL needs to point to a RAM BUFFER for the DCB's.
Original Source Code Comment: OPEN OR INIT AND RET
59BCH - GETSYN - General Disk Routine. Set Register Pair DE to point to the SOURCE FILE DCB, check the syntax of the associated Filespec, and RETurn.
Original Source Code Comment: POINT TO READ DCB
NOTE: 441CH is the SYS00/SYS routine to CHECK THE SYNTAX OF A FILESPEC before for use. This RST 28H's with a value of C1H so as to call ROUTINE 4 in OVERLAY 1.
Original Source Code Comment: AND CHECK IT OUT
59C2H - PATERR - Patch Error Routine. Display a STRING NOT FOUND message and ABORT.
NOTE: 021BH is the Model III ROM routine to display the character at (HL) until a 03H is found. Since this was JUMPED to instead of CALLed, the RET at the end of this ROM routine will then RETurn to the caller of this subroutine instead of returning to this place.
59C8H - CHGMAD - MESSAGE and STORAGE AREA for the PATCH command.
5A14H - "RELO" Routine. This routine ONLY updates t he LOAD FILE FORMAT ADDRESS, it does not "renum" the file.
Original Source Code Comment: DE => DCB
NOTE: 441CH is the SYS00/SYS routine to CHECK THE SYNTAX OF A FILESPEC before for use. This RST 28H's with a value of C1H so as to call ROUTINE 4 in OVERLAY 1.
Original Source Code Comment: CHECK SYNTAX OF FILESPEC
Original Source Code Comment: EXIT IF ERROR
Original Source Code Comment: DE => SYNTAX TABLE
NOTE: 4454H is the DOS PARAMETER STRING PARSE routine. It decodes DOS LIBRARY parameters.
Original Source Code Comment: GET THE OPTIONS
Original Source Code Comment: EXIT IF ERROR
Original Source Code Comment: RELO ADDRESS STORED HERE
Original Source Code Comment: SAVE THE NUMBER
Original Source Code Comment: POINT TO BUFFER 1
Original Source Code Comment: POINT TO DCB
Original Source Code Comment: LRL OF 256
NOTE: 4424H is the SYS00/SYS routine to OPEN A DISK FILE for use. This RST 28H's with a value of 92H so as to call ROUTINE 1 in OVERLAY 3.
Original Source Code Comment: OPEN THE FILE
Original Source Code Comment: EXIT IF ERROR
Original Source Code Comment: READ A BYTE
Original Source Code Comment: SAVE IT
Original Source Code Comment: READ SECOND BYTE
Original Source Code Comment: PUT IT INTO B
Original Source Code Comment: GET CHAR BACK
Original Source Code Comment: COMMENT?
Original Source Code Comment: YES, STALL
Original Source Code Comment: LOAD FILE FORMAT?
Original Source Code Comment: YES, GO
Original Source Code Comment: ERROR
5A4FH - LOOP0 - Part of the RELO command. Jumped here if the character indicated a CODE BLOCK.
Original Source Code Comment: READ THE LSB OF ADDRESS
Original Source Code Comment: SAVE IT
Original Source Code Comment: GOT ADDRESS
Original Source Code Comment: PUT IT IN DE
Original Source Code Comment: GET THE RELO ADDRESS
Original Source Code Comment: SAVE IT AGAIN
Original Source Code Comment: CLEAR CARRY
Original Source Code Comment: GET THE DIFFERENCE
Original Source Code Comment: SAVE THE OFFSET
Original Source Code Comment: POINT TO MAIN BUFFER
Original Source Code Comment: GET THE RELO ADDRESS
Original Source Code Comment: SET A LOAD FILE HEADER
Original Source Code Comment: STORE THE CHAR COUNT
Original Source Code Comment: STORE THE ADDRESS
Original Source Code Comment: DEC FOR THE ADDRESS
Original Source Code Comment: POINT TO DCB
Original Source Code Comment: STORE IN BUFFER
Original Source Code Comment: CONTINUE FOR COUNT
Original Source Code Comment: READ THE LOAD FILE HEADER
Original Source Code Comment: END OF RECORD?
Original Source Code Comment: END IF SO
Original Source Code Comment: LOAD FILE FORMAT?
Original Source Code Comment: NO, ERROR
Original Source Code Comment: READ THE CHAR COUNT
Original Source Code Comment: SAVE IN B
Original Source Code Comment: GET THE ADDRESS
Original Source Code Comment: SAVE IN L
Original Source Code Comment: GET THE MSB
Original Source Code Comment: SAVE IN H
Original Source Code Comment: GET THE OFFSET
Original Source Code Comment: ADD TO ADDRESS
5AA9H - LOOP7 - Part of the RELO command. Jumped here if loop to read the characters in the prior routine hit an 02H to indicate END OF RECORD.
Original Source Code Comment: SAVE THE 2
Original Source Code Comment: GET THE NEXT 2
Original Source Code Comment: GET THE ENTRY ADDR
Original Source Code Comment: STORE THE LENGTH
Original Source Code Comment: STORE THE LSB OF ADDR
Original Source Code Comment: GET THE MSB
Original Source Code Comment: STORE THE MSB OF ADDR
Original Source Code Comment: SAVE THE END POINTER
Original Source Code Comment: POINT TO DCB
NOTE: 443FH is the SYS00/SYS vector for 'REWIND', which will rewind the open file.
Original Source Code Comment: BACK TO BEGINNING OF FILE
Original Source Code Comment: EXIT IF ERROR
Original Source Code Comment: GET THE END ADDRESS
Original Source Code Comment: GET THE START ADDR
Original Source Code Comment: GET THE NUM OF BYTES
5ADE
LD C,LLD B,H
Original Source Code Comment: MOVE TO BC
Original Source Code Comment: GET THE BUFFER IN HL
Original Source Code Comment: POINT TO DCB
Original Source Code Comment: GET A CHARACTER
Original Source Code Comment: WRITE IT OUT
Original Source Code Comment: BUMP POINTER
Original Source Code Comment: DEC THE COUNTER
5AE9
OR CLD A,B
Original Source Code Comment: WE DONE?
Original Source Code Comment: NO, CONTINUE
NOTE: 4428H is the SYS00/SYS routine to CLOSE A DISK FILE. This RST 28H's with a value of 93H so as to call ROUTINE 1 in OVERLAY 3.
Original Source Code Comment: CLOSE THE FILE
Original Source Code Comment: AND DONE
5AF3H - STALL - Continuation of RELO Command. Jumped here if we need to skip over all the bytes in a COMMENT block. Requires Register B to contain the number of bytes in the COMMENT BLOCK to be skipped.
Original Source Code Comment: READ THE COMMENT
5AFBH - ZREAD - Continuation of RELO Command. Thgis routine reads a byte and puts it into Register A.
Original Source Code Comment: SAVE DE
Original Source Code Comment: POINT TO DCB
NOTE: 0013H is the Model III ROM routine to read a byte from an input device. Requires DE = starting address of DCB of device and on Exit Register A = byte received from device, Z set if device ready. Uses AF.
Original Source Code Comment: READ A BYTE
Original Source Code Comment: RESTORE DE
Original Source Code Comment: RET OF OKAY
5B04H - EROR - Continuation of the RELO Command. Exit to the error handler.
NOTE: 4409H is the SYS00/SYS routine to process DOS errors.
Original Source Code Comment: EXIT TO ERROR HANDLER
5B07H - ZWRITE - Continuation of the RELO Command. Write a byte out.
Original Source Code Comment: SAVE DE
Original Source Code Comment: POINT TO DCB
NOTE: 001BH is the Model III ROM routine to write a byte to an output device. Requires Register A to contain the byte to output and Register Pair DE to be the starting address of DCB of device. On exit, Z set if device ready. Uses AF.
Original Source Code Comment: ZWRITE A BYTE
Original Source Code Comment: RET IF OKAY
Original Source Code Comment: ELSE REPORT ERROR
5B12H - RLTABL - MESSAGE and STORAGE AREA for the RELO COMMAND.
5B1FH - Main Routine - "FORMS".
Original Source Code Comment: CLEAR OUT ANY OLD COUNTS
Original Source Code Comment: GET NEXT NON-BLANK CHAR
Original Source Code Comment: FORMS BY ITSELF?
Original Source Code Comment: NO, CONTINUE
Original Source Code Comment: YES, DO A TOP OF FORM
NOTE: 003BH is the Model III ROM routine to write the byte held in Register A to the printer, including waiting for the printer to be available OR getting a BREAK. Uses Register Pair DE. Since this was JUMPED to instead of CALLed, the RET at the end of this ROM routine will then RETurn to the caller of this subroutine instead of returning to this place.
Original Source Code Comment: AND RETURN
5B36H - FORMS1 - Continuation of the "FORMS" Routine. Jumped here if we determined that we actually got parameters on the COMMAND LINE.
Original Source Code Comment: DE => FORMS COMMANDS
NOTE: 4454H is the DOS PARAMETER STRING PARSE routine. It decodes DOS LIBRARY parameters.
Original Source Code Comment: DO THE CHECK ON IT
Original Source Code Comment: PARAMETER ERROR
Original Source Code Comment: IX => PRINTER DCB
Original Source Code Comment: USER CHARACTER COUNT
Original Source Code Comment: CONVERT TO HEX
5B49
OR LLD A,H
Original Source Code Comment: USER SELECT ANYTHING?
Original Source Code Comment: NO, TRY LINE PER PAGE
Note: IX+06H = the position in the PRINTER DCB for LINE WIDTH.
Original Source Code Comment: STORE THE USER COUNT
Original Source Code Comment: NUMBER OF LINES STORED HERE
Original Source Code Comment: CONVERT TO HEX
5B56
OR LLD A,H
Original Source Code Comment: ANY NEW LINE?
Original Source Code Comment: NO, EXIT
Original Source Code Comment: CORRECT FOR 1'S OFFSET
Original Source Code Comment: EXIT IF WAS 255
Note: IX+03H = the position in the PRINTER DCB for LINES PER PAGE.
Original Source Code Comment: YES, SAVE NEW LINES PER PAGE
5B5FH - FORCOM - Continuation of the "FORMS" Routine. MESSAGE and BYTE STORAGE.
Original Source Code Comment: END OF LIST
5B70H - COMPAR - General Subroutine. Compare DE and HL Strings.
5B80H - PDATA - Display "MESSAGE" + " = ". HL must point to the message
NOTE: 021BH is the Model III ROM routine to display the character at (HL) until a 03H is found.
Original Source Code Comment: DISPLAY MESSAGE
Original Source Code Comment: HL => ' = ' MSG
NOTE: 021BH is the Model III ROM routine to display the character at (HL) until a 03H is found. Since this was JUMPED to instead of CALLed, the RET at the end of this ROM routine will then RETurn to the caller of this subroutine instead of returning to this place.
Original Source Code Comment: PRINT AND EXIT
5B89H - PDATA1 - Display "MESSAGE" + ", ". HL must point to the message
NOTE: 021BH is the Model III ROM routine to display the character at (HL) until a 03H is found.
Original Source Code Comment: DISPLAY MESSAGE
Original Source Code Comment: A COMMA
NOTE: 0033H is the Model III ROM character print routine; displays the character held in Register A at the current cursor position.
Original Source Code Comment: AND A SPACE
NOTE: 0033H is the Model III ROM character print routine; displays the character held in Register A at the current cursor position. Since this was JUMPED to instead of CALLed, the RET at the end of this ROM routine will then RETurn to the caller of this subroutine instead of returning to this place.
Original Source Code Comment: DISPLAY AND RETURN
5B96H - S9EQU - MESSAGE AND STORAGE AREA.
5B9AH - NEW "ROUTE" COMMAND. This was deprecated, and the below 2 instructions just throw an error.
Original Source Code Comment: TEMP... PROGRAM NOT FOUND ERROR
5B9AH - OLD "ROUTE" COMMAND. Before the ROUTE command was deprecated, the code was ...
Original Source Code Comment: TEMP... PROGRAM NOT FOUND ERROR
Original Source Code Comment: YES, IT'S OKAY
Original Source Code Comment: DUAL ON?
Original Source Code Comment: YES, CAN'T ROUTE
If we are here then neither the ROUTE nor DUAL was set, so we need to actually process the command.
Original Source Code Comment: SKIP ANY SPACES
- If Register A equals SPACE, the Z FLAG is set.
- If A < SPACE, the CARRY FLAG will be set.
- if A >= SPACE, the NO CARRY FLAG will be set.
Original Source Code Comment: ROUTE BY ITSELF?
Original Source Code Comment: YES, JUST RESET DCB
Original Source Code Comment: START OF PARAMETERS?
Original Source Code Comment: NO, MISSING PARAMETERS
Original Source Code Comment: BUMP PAST (
Original Source Code Comment: DE => 'SOURCE'
Original Source Code Comment: GET THE COUNT
5BB8
LD B,00HLD C,A
Original Source Code Comment: INTO BC
Original Source Code Comment: BUMP TO 1ST CHAR
Original Source Code Comment: DO THE COMPARE
Original Source Code Comment: WASN'T SOURCE, TRY DEST
Original Source Code Comment: ADD THE 'SOURCE' COUNT TO COMMAND LINE
Original Source Code Comment: HL => '='. GET NEXT TOKEN
Original Source Code Comment: PARAMETER ERROR
Original Source Code Comment: SAVE COMMAND LINE POINTER
Original Source Code Comment: HL POINT TO TOKEN
Original Source Code Comment: DE => DESTIN IN ROUTE DCB
Original Source Code Comment: NUMBER OF BYTES
Original Source Code Comment: MOVE TO THE DCB
Original Source Code Comment: GET COMMAND LINE POINTER BACK
5BD3
INC HLINC HL
Original Source Code Comment: BUMP PAST DESCRIPTOR
Original Source Code Comment: GET NEXT CHAR ON COMMAND LINE
Original Source Code Comment: SPACE?
Original Source Code Comment: YES, CONTINUE
Original Source Code Comment: COMMA?
Original Source Code Comment: YES
Original Source Code Comment: END OF LIST?
Original Source Code Comment: YES, DO IT
Original Source Code Comment: END OF LINE?
Original Source Code Comment: MUST BE MORE ON THE LINE
Original Source Code Comment: SET THE DUAL/ROUTE FLAG
Original Source Code Comment: PARAM ERROR
5BF1H - ROUTE4 - ROUTINE inside the ROUTE COMMAND. Move the pointer to the current character on the COMMAND LINE by 1 and then JUMP to 5BD4H.
Original Source Code Comment: BUMP TO NEXT CHAR
5BF4H - ROUTE5 - ROUTINE inside the ROUTE COMMAND. Process the DESTINATION.
Original Source Code Comment: HL => 'DESTIN'
Original Source Code Comment: GET THE COUNT
5BF9
LD B,00HLD C,A
Original Source Code Comment: INTO BC
Original Source Code Comment: BUMP TO 1ST CHAR
Original Source Code Comment: DO THE COMPARISON
Original Source Code Comment: WASN'T ANYTHING SUPPORTED
Original Source Code Comment: ADD THE COUNT TO COMMAND LINE
Original Source Code Comment: HL => '='. GET THE TOKEN
Original Source Code Comment: EXIT IF ERROR
Original Source Code Comment: SAVE COMMAND LINE POINTER
Original Source Code Comment: HL => TOKEN
Original Source Code Comment: DE => SOURCE IN DCB
Original Source Code Comment: SET IT
5C10H - GETTOK - Continuation of the ROUTE routine; process the actual source/destination device code.
Original Source Code Comment: GET NEXT CHAR ON COMMAND LINE
Original Source Code Comment: EQUAL?
Original Source Code Comment: NO, ERROR. EXIT
Original Source Code Comment: BUMP TO NEXT CHAR
Original Source Code Comment: SEE IF DISPLAY
Original Source Code Comment: YES, EXIT
Original Source Code Comment: NO, TRY FOR KEYBOARD
Original Source Code Comment: YES, EXIT
Original Source Code Comment: NO, TRY FOR PRINTER
Original Source Code Comment: YES, EXIT
Original Source Code Comment: NO, TRY FOR RS-232 OUTPUT
Original Source Code Comment: YES, EXIT
Original Source Code Comment: THEN IT HAS TO BE RS-232 INPUT
5C3AH - NOROTE - Abort out of the ROUTE command via a "CAN'T ROUTE" Error.
Original Source Code Comment: HL => 'CANT ROUTE' MSG
NOTE: 021BH is the Model III ROM routine to display the character at (HL) until a 03H is found. Since this was JUMPED to instead of CALLed, the RET at the end of this ROM routine will then RETurn to the caller of this subroutine instead of returning to this place.
Original Source Code Comment: DISPLAY AND RETURN
5C40H - RTMSG - MESSAGE and BYTE STORAGE AREA for the ROUTE COMMEND.
5C75H - "SETCOM" Command - Configure the RS-232.
Original Source Code Comment: SKIP ANY SPACES ON COMMAND LINE
- If Register A equals SPACE, the Z FLAG is set.
- If A < SPACE, the CARRY FLAG will be set.
- if A >= SPACE, the NO CARRY FLAG will be set.
Original Source Code Comment: END OF LINE?
Original Source Code Comment: NO, GET PARAMETERS
Original Source Code Comment: GET THE TRANSMIT FLAG
Original Source Code Comment: RS-232 OFF?
Original Source Code Comment: YES, JUST DISPLAY OFF MESSAGE
Original Source Code Comment: HL => 'BAUD = ' MSG
Original Source Code Comment: DISPLAY IT
Original Source Code Comment: GET THE BAUD RATE
Original Source Code Comment: MASK OFF XMIT BITS
Original Source Code Comment: MULTIPLY BY 2
5C91
LD B,00HLD C,A
Original Source Code Comment: INTO BC
Original Source Code Comment: HL => CONVERSION TABLE
Original Source Code Comment: GET THE ADDRESS THERE
Original Source Code Comment: HL => TEXT
Original Source Code Comment: DISPLAY BAUD RATE
Original Source Code Comment: HL => 'UART = ' MSG
Original Source Code Comment: DISPLAY IT
Original Source Code Comment: GET THE BIT PATTERN
Original Source Code Comment: MASK ALL BUF NUMBER OF BITS
5CAA
5CAB
RLCA
RLCARLCA
Original Source Code Comment: MOVE THE BITS OVER TO LEAST SIG
Original Source Code Comment: TIMES 2
5CAE
LD B,00HLD C,A
Original Source Code Comment: INTO BC
Original Source Code Comment: HL => NUMBER OF BITS TABLE
Original Source Code Comment: HL => ADDRESS OF MESSAGE
Original Source Code Comment: GET THE ADDRESS
Original Source Code Comment: INTO HL
Original Source Code Comment: DISPLAY IT
Original Source Code Comment: HL => 'STOP = ' MSG
Original Source Code Comment: GET THE BIT PATTERN
Original Source Code Comment: 2 STOP BITS?
Original Source Code Comment: ASSUME 1
Original Source Code Comment: YES, WAS 1 STOP BIT
Original Source Code Comment: MAKE IT '2'
NOTE: 0033H is the Model III ROM character print routine; displays the character held in Register A at the current cursor position.
Original Source Code Comment: DISPLAY IT ON THE SCREEN
Original Source Code Comment: OUTPUT COMMA AND SPACE
Original Source Code Comment: HL => 'PARITY = '
Original Source Code Comment: DISPLAY IT
Original Source Code Comment: GET THE UART FLAG AGAIN
Original Source Code Comment: HL => 'NONE' IN CASE
Original Source Code Comment: PARITY OFF?
Original Source Code Comment: YES, IT'S OFF. PRINT AND RETURN
Original Source Code Comment: ASSUME ODD
Original Source Code Comment: IS IT
Original Source Code Comment: YES, IT'S ODD
Original Source Code Comment: DIAPLAY PARITY AND RETURN
Original Source Code Comment: CHANGE ',' TO A ' '
Original Source Code Comment: IN THE PRINT ROUTINE
Original Source Code Comment: GET THE WAIT/NO WAIT FLAG
Original Source Code Comment: HL => 'WAIT'
Original Source Code Comment: IS WAIT MODE. DISPLAY
Original Source Code Comment: NO WAIT MODE
Original Source Code Comment: DISPLAY AND EXIT
Original Source Code Comment: HL => MODE
Original Source Code Comment: DISPLAY AND EXIT
5D09H - SETOFF - SETCOM Routine - Turn the RS-232 Off.
Original Source Code Comment: TURN RS-232 OFF
Original Source Code Comment: NO BAUD RATE
Original Source Code Comment: NO UART CONFIG
Original Source Code Comment: SET 'WAIT' MODE
Original Source Code Comment: HL => 'RS-232 OFF' MSG
Original Source Code Comment: SAVE TEXT POINTER
Original Source Code Comment: DO THE INIT
Original Source Code Comment: GET TEXT POINTER BACK
NOTE: 021BH is the Model III ROM routine to display the character at (HL) until a 03H is found. Since this was JUMPED to instead of CALLed, the RET at the end of this ROM routine will then RETurn to the caller of this subroutine instead of returning to this place.
Original Source Code Comment: PRINT IT AND EXIT
5D1FH - SETCO1 - SETCOM Routine - Set up the RS-232 Channel.
Original Source Code Comment: START OF PARAMETER LIST?
Original Source Code Comment: NO, PARAMETER ERROR
Original Source Code Comment: BUMP TO NEXT CHAR
Original Source Code Comment: GET THE CHARACTER
Original Source Code Comment: SET DEFAULT FALUES?
Original Source Code Comment: NO, SET THE VALUES
Original Source Code Comment: SET THE UART CONFIG
Original Source Code Comment: SET FOR 300 BAUD
Original Source Code Comment: SET FOR WAIT MODE
Original Source Code Comment: DO THE INIT
Original Source Code Comment: DISPLAY THE VALUES
5D3DH - SETVAL - SETCOM Routine - Set up the RS-232 Channel - Jumped to if we didn't get an OPEN PARENTHESIS when we expected it.
Original Source Code Comment: BACK UP TO THE '('
Original Source Code Comment: DE => SYNTAX TABLE
NOTE: 4454H is the DOS PARAMETER STRING PARSE routine. It decodes DOS LIBRARY parameters.
Original Source Code Comment: CHECK THE VALUES
Original Source Code Comment: EXIT IF ERROR
Original Source Code Comment: SEE IF RS-232 OFF
5D4A
OR LLD A,H
Original Source Code Comment: YES, DO IT
Original Source Code Comment: SEE IF WAIT MODE
5D51
OR LLD A,H
Original Source Code Comment: NO, TRY FOR NO WAIT
Original Source Code Comment: SET WAIT/NO WAIT MODE
Original Source Code Comment: AND CONTINUE
5D5AH - SETVA1 - SETCOM Routine - Reset WAIT Mode.
Original Source Code Comment: SEE IF NO WAIT MODE
5D5D
OR LLD A,H
Original Source Code Comment: NO, CONTINUE
Original Source Code Comment: CLEAR THE WAIT FLAG
5D64H - SETVA2 - SETCOM Routine - Set the Baud Rate and Stop Bits.
Original Source Code Comment: GET THE BAUD RATE
5D68
OR CLD A,B
Original Source Code Comment: ANY BAUD RATE GIVEN
Original Source Code Comment: NO, CONTINUE
Original Source Code Comment: HL => BAUD RATE TABLE
Original Source Code Comment: GET THE BYTE
Original Source Code Comment: END OF TABLE
Original Source Code Comment: YES, PARAMETER ERROR
Original Source Code Comment: GET THE VALUE
Original Source Code Comment: BUMP TO BYTE VALUE
Original Source Code Comment: BUMP TO NEXT BAUD RATE
Original Source Code Comment: CLEAR CARRY
Original Source Code Comment: HL = VALUE FROM TABLE
Original Source Code Comment: BC = DESIRED VALUE
Original Source Code Comment: NO MATCH
Original Source Code Comment: BACK UP TO THE BAUD RATE
Original Source Code Comment: GET IT
Original Source Code Comment: SET IT INTO THE RS-232 DCB
Original Source Code Comment: GET THE STOP BITS
5D89
OR LLD A,H
Original Source Code Comment: ANY STOP GIVEN
Original Source Code Comment: NO, CONTINUE
Original Source Code Comment: SEE IF 1 STOP BIT
Original Source Code Comment: SET BIT 4
Original Source Code Comment: UNSET BIT 4 IF SET
Original Source Code Comment: ELSE SET IT
Original Source Code Comment: SEE IF ANY PARITY
5D99
OR LLD A,H
Original Source Code Comment: SET FOR BIT 3
Original Source Code Comment: NO, CONTINUE
Original Source Code Comment: GET THE VALUE
Original Source Code Comment: PARITY 'NONE'?
Original Source Code Comment: NO, SET IT
Original Source Code Comment: TURN THE PARITY OFF
5DA9H - SETV50 - SETCOM Routine - Set the Parity and Word Length.
Original Source Code Comment: SEE IF PARITY ODD
Original Source Code Comment: SET FOR BIT 7
Original Source Code Comment: UNSET IF ODD
Original Source Code Comment: ELSE EVEN
Original Source Code Comment: SEE IF ANY WORD GIVEN
5DB8
OR LLD A,H
Original Source Code Comment: NO
Original Source Code Comment: GO UNSET PRESENT WORD
Original Source Code Comment: GET THE WORD LENGTH
Original Source Code Comment: LOWEST IS 5 BITS
Original Source Code Comment: PARAMETER ERROR IF LESS
Original Source Code Comment: WAS 5. ALREADY SET
Original Source Code Comment: PUT THE VALUE BACK INTO L
Original Source Code Comment: NOT 6
Original Source Code Comment: SET BIT 6
5DD1H - SETVA7 - SETCOM Routine - Set the Word Length if 7 Bits.
Original Source Code Comment: HOW ABOUT 7
Original Source Code Comment: SET BIT 5
5DD8H - SETVA8 - SETCOM Routine - Set the Word Length if 8 Bits.
Original Source Code Comment: HOW ABOUT 8
Original Source Code Comment: NO, PARAMETER ERROR
Original Source Code Comment: SET BIT 5 AND 6
Original Source Code Comment: GET THE BUILT UART BYTE
Original Source Code Comment: INUSRE LSB'S OFF
Original Source Code Comment: INSURE XMIT ENABLE ON
Original Source Code Comment: DO THE INIT
Original Source Code Comment: AND DISPLAY VALUE
5DF1H - SETBYT - SETCOM Routine - Set the configuration bits of the RS-232 based on the mask held in Register B.
Original Source Code Comment: GET THE UART BYTE WE'RE BUILDING
Original Source Code Comment: ADD IN THE NEW VALUE
Original Source Code Comment: SAVE FOR NEXT TIME
Original Source Code Comment: SET 'Z'
5DFAH - UNSET - SETCOM Routine - Reset the configuration bits of the RS-232 based on the mask held in Register B.
Original Source Code Comment: GET THE VALUE
Original Source Code Comment: FLIP IT THE OTHER WAY
Original Source Code Comment: SAVE IT
Original Source Code Comment: GET THE BYTE WE'RE BUILDING
Original Source Code Comment: TURN OFF DESIRED BITS
5E03H - SOFF - MESSAGE and BYTE STORAGE for SETCOM.
5E11H - SETSWT - PARSER TABLE for SETCOM.
5E4AH - BADTAB - BAUD RATE TABLE for SETCOM.
Original Source Code Comment: END OF LIST
5E79H - TABLE1 - Word Length Text Pointer Table.
5E81H - TABLE2 - Baud Rate Text Pointer Table.
5E9FH - BAUDMG - MESSAGE DISPLAY for SETCOM CONFIGURATION.
SEBA
Original Source Code Comment: BACKSPACE
SEDA
SEEE
SEFA
SEFF
SFOE
5F34H - "DUAL" Routine - Output to BOTH the Printer and the Display
First, check to see if ROUTE is on.
Original Source Code Comment: GET THE DUAL FLAG
Original Source Code Comment: IS ROUTE IN EFFECT?
Original Source Code Comment: YES, CAN'T WHILE ROUTE IS ON
Original Source Code Comment: SYS 1 ON/OFF CHECK
Next, check to see if DUAL is already on.
Original Source Code Comment: GET THE FLAG ONCE AGAIN
Original Source Code Comment: IS DUAL ALREADY ON?
Original Source Code Comment: YES, JUST DISPLAY MESSAGE AGAIN
If we're here, then we actually need to process the DUAL command.
Original Source Code Comment: MAKE IT 'NZ'
Original Source Code Comment: GET THE DRIVER ADDR
Original Source Code Comment: SAVE IT IN 'RES' DUAL ROUTINE
Original Source Code Comment: GET THE DRIVER ADDR
Original Source Code Comment: SAVE IT IN DUAL ROUTINE
Original Source Code Comment: ADDRESS OF THE DUAL ROUTINE
Original Source Code Comment: INTO VIDEO
Original Source Code Comment: INTO PRINTER
Original Source Code Comment: HL => 'ON' MSG
5F64H - DUALOF - "DUAL" Routine - Restore
Original Source Code Comment: GET THE DUAL ON/OFF FLAG
Original Source Code Comment: DUAL ALREADY OFF?
Original Source Code Comment: YES, JUST DISPLAY MESSAGE
If we are here, then we need to process a DUAL OFF command.
Original Source Code Comment: GET THE SAVED VIDEO DRIVER ADDR
Original Source Code Comment: RESTORE
Original Source Code Comment: GET THE SAVED PRINTER DRIVER ADDR
Original Source Code Comment: RESTORE
Original Source Code Comment: CLEAR THE DUAL FLAG
Original Source Code Comment: HL => 'OFF' MSG
Original Source Code Comment: SAVE ON/OFF MSG
Original Source Code Comment: HL => 'DUAL IS NOW' MSG
NOTE: 021BH is the Model III ROM routine to display the character at (HL) until a 03H is found.
Original Source Code Comment: DISPLAY IT
Original Source Code Comment: RESTORE FINAL MSG
NOTE: 021BH is the Model III ROM routine to display the character at (HL) until a 03H is found. Since this was JUMPED to instead of CALLed, the RET at the end of this ROM routine will then RETurn to the caller of this subroutine instead of returning to this place.
Original Source Code Comment: DISPLAY AND RETURN
5F88H - NODUAL - "DUAL" Routine - Abort if DUAL is engaged while ROUTE is engaged.
Original Source Code Comment: HL => 'CANT DUAL WHILE ROUTE' MSG
NOTE: 021BH is the Model III ROM routine to display the character at (HL) until a 03H is found. Since this was JUMPED to instead of CALLed, the RET at the end of this ROM routine will then RETurn to the caller of this subroutine instead of returning to this place.
Original Source Code Comment: DISPLAY AND RETURN
5F8EH - SKIPSP - Get the next COMMAND LINE character.
Original Source Code Comment: GET A CHRACTER
Original Source Code Comment: SPACE?
Original Source Code Comment: NO, EXIT
Original Source Code Comment: BUMP TO NEXT CHAR
Original Source Code Comment: LOOP TILL NON-SPACE FOUND
5F95H - NODMSG - MESSAGE and BYTE STORAGE for DUAL.
5FD9H - WPROT - "WP" Routine - Set a drive as write protected.
Original Source Code Comment: SKIP ANY SPACES
Original Source Code Comment: END OF LINE?
Original Source Code Comment: NO, HAVE A DRIVE
Original Source Code Comment: AN IMPOSSIBLE DRIVE NUMBER
Original Source Code Comment: SET IT
5FE4H - WPROT1 - "WP" Routine - Jumped here if there were parameters given.
Original Source Code Comment: DE => DRIVE SYNTAX
NOTE: 4454H is the DOS PARAMETER STRING PARSE routine. It decodes DOS LIBRARY parameters.
Original Source Code Comment: GET THE SYNTAX AND VALUE
Original Source Code Comment: EXIT IF ERROR
Original Source Code Comment: DRIVE NUMBER STORED HERE
Original Source Code Comment: SEE IF ALLOWABLE DRIVE
- If Register A equals the value held in Register C, the Z FLAG is set.
- If A < C, the CARRY FLAG will be set.
- if A >= C, the NO CARRY FLAG will be set.
Original Source Code Comment: NO, REPORT ERROR
Original Source Code Comment: GET THE DRIVE
Original Source Code Comment: MAKE IT ASCII
Original Source Code Comment: SET IT INTO MESSAGE
Original Source Code Comment: SAVE THE DRIVE NUMBER
Original Source Code Comment: HL => 'DRIVE X PROTECTED' MSG
NOTE: 021BH is the Model III ROM routine to display the character at (HL) until a 03H is found.
Original Source Code Comment: DISPLAY IT
Original Source Code Comment: FINAL PORTION OF MSG
NOTE: 021BH is the Model III ROM routine to display the character at (HL) until a 03H is found.
Original Source Code Comment: GET DRIVE BACK
Original Source Code Comment: GET THE DRIVE
Original Source Code Comment: SET IT IN DOS
6010H - WPSW - PARSER TABLE for WP COMMAND.
603EH - "MASTER" Routine. This routine re-assigns the master drive number.
Original Source Code Comment: SKIP ANY SPACES
Original Source Code Comment: END OF LINE?
Original Source Code Comment: NO, GET MASTER DRIVE NUMBER
Original Source Code Comment: SET MASTER DRIVE AS DRIVE 0
Original Source Code Comment: SET IT
6048H - MAST1 - "MASTER" Routine - Jumped here if there were parameters given.
Original Source Code Comment: DE => SYNTAX TABLE
NOTE: 4454H is the DOS PARAMETER STRING PARSE routine. It decodes DOS LIBRARY parameters.
Original Source Code Comment: GET THE DRIVE NUMBER
Original Source Code Comment: NOTHING SUPPORTED
Original Source Code Comment: GET THE DRIVE NUMBER
Original Source Code Comment: SEE IF LEGAL DRIVE
- If Register A equals the value held in Register C, the Z FLAG is set.
- If A < C, the CARRY FLAG will be set.
- if A >= C, the NO CARRY FLAG will be set.
Original Source Code Comment: NO, DRIVE NOT IN SYSTEM
Original Source Code Comment: GET THE DRIVE
Original Source Code Comment: MAKE IT ASCII
Original Source Code Comment: SET IT IN MESSAGE
Original Source Code Comment: SAVE DRIVE NUMBER
Original Source Code Comment: HL => 'DISK DRIVE X' MSG
NOTE: 021BH is the Model III ROM routine to display the character at (HL) until a 03H is found.
Original Source Code Comment: DISPLAY IT
Original Source Code Comment: HL => 'IS MASTER DRIVE' MSG
NOTE: 021BH is the Model III ROM routine to display the character at (HL) until a 03H is found.
Original Source Code Comment: DISPLAY IT
Original Source Code Comment: GET THE DRIVE NUMBER BACK
Original Source Code Comment: GET IT
Original Source Code Comment: SET THE MASTER INTO DOS
6075H - MSTMSG - MESSAGE and BYTE STORAGE for MASTER.
6086H - CONVHX - Convert Binary Coded Decimal into a Binary Value. On Entry HL = a hex value and On Exit HL = the decimal value.
Original Source Code Comment: PUT THE VALUE INTO DE
Original Source Code Comment: GET THE MSB
Original Source Code Comment: DO THE SHIFTS
608C
LD H,00HLD L,A
Original Source Code Comment: INTO HL
608F
POP BCPUSH HL
Original Source Code Comment: HL = HL * 10
Original Source Code Comment: MULTIPLY IT BY 10
Now the high nybble of the MSB has been shifted over to the 10's spot, so that the low nybble of the MSB can occupy the 1's spot.
Original Source Code Comment: GET THE 2ND DIGIT
Original Source Code Comment: INTO BC
Original Source Code Comment: HL = HL * 10
Original Source Code Comment: MULTIPLY IT BY 10
Now the converted MSB has been shifted over to the 10's spot, so that the LSB can occupy the 1's spot.
Original Source Code Comment: DO THE LSB
60A2
LD B,00HLD C,A
Original Source Code Comment: INTO BC
60A6
POP BC
Now the high nybble of the LSB has been added to the converted MSB.
Original Source Code Comment: MULTIPLY IT BY 10
Now everything has been pushed over one level, leaving just the 1's spot empty.
Original Source Code Comment: MASK FOR LSD
Original Source Code Comment: INTO BC
60B0H - ADDHL - Routine to Multiply HL by 10. Requires HL = BC.
Original Source Code Comment: TIMES 2
Original Source Code Comment: TIMES 4
Original Source Code Comment: TIMES 5
Original Source Code Comment: TIMES 10
60B5H - SHIFT - Get the high nybble.
60B7
60B9
60BB
SRL A
SRL A
SRL ASRL A
Original Source Code Comment: GET THE HIGHEST NIBBLE
MISC - STORAGE BYTES.
6130S9DCB
6162S9DCB1
6194S9DCB2
6300BUFER1
6400BUFER2