4E12H - Main Overlay Function - "OPEN". On entry, Register B should be holding the RECORD LENGTH of the file to OPEN.
NOTE: 4414H is the storage location for the NUMBER OF THE OVERLAY CURRENTLY IN MEMORY, so this will force the reload of the overlay.
4E22
POP HL
NOTE: 4463H is the storage location for the old system disk side number.
Beginning of a loop of 80 iterations, where the HIT Table in RAM (pointed to by HL) is checked, one at a time, for a matching HIT Entry.
End of HIT Table Lookup Loop. If we are here, then all 80 entries were checked, and we had no match.
NOTE: 4413H is the storage location for the NUMBER OF DISK DRIVES in the system.
- If Register A equals 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.
If we are here, we have tested all the available drives, and found no HIT entry match.
NOTE: 44D4H is the routine which handles DRIVE SELECT (Register C holds the drive number to be used).
4E92H - Set up for a DRIVE NOT ON SYSTEM error.
4E96H - Restore Register Pair BC and HL, and continue checking HIT entries.
4E9CH - Continuation of Routine, jumped to if we have found the HIT entry match in the HIT Entry Stored in the RAM Buffer at 4D00H.
4EA7H - Continuation of Routine. Jumped to if we have matched the HIT Entry AND Read the Directory Entry into Buffer 1.
Top of a loop of 11 characters to compare for a filename match.
Bottom of a loop of 11 characters to compare for a filename match. If we're here then we must have had a filename match, because mismatches JUMP back to the HIT scanning routine above.
Just as above, the next 4 instructions copy the ACCESS FILE PASSWORD (initially pointed at by Register Pair HL) into Register Pair HL.
- If Register A equals 06H, the Z FLAG is set.
- If A < 06H, the CARRY FLAG will be set.
- if A >= 06H, the NO CARRY FLAG will be set.
4F14H - This routine is jumped to if it is determined that NO ACCESS is PERMITTED.
4F1AH - This routine is jumped to if we are OK with the access level permitted.
4F23H - Main Overlay Function - "INIT".
The next 3 instructionsset the EOF to ZERO.
4F3FH - Continuation of INIT routine, where the OPEN attempt returned an ERROR.
- If Register A equals 18H, the Z FLAG is set.
- If A < 18H, the CARRY FLAG will be set.
- if A >= 18H, the NO CARRY FLAG will be set.
NOTE: 4FCFH is the middle of a LD (HL),nn OPCODE.
4F6CH - Continuation of INIT Routine. Jumped to if we have parsed the GAT and found a track which is not full.
The next set of instructions save the registers used in a LDIR, sets up for a LDIR to move 256 bytes (i.e., a sector) from Memory Buffer 1 (i.e., 4300H) to Memory Buffer 2 (i.e., 4D00H), and restore the registers.
NOTE: 5138H is the storage location for the SELECTED DRIVE NUMBER.
NOTE: 4413H is the storage location for the NUMBER OF DISK DRIVES in the system.
- If Register A equals 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.
4F98H - Continuation of INIT Routine. Jumped to if an empty HIT entry was found.
The next set of instructions save the registers used in a LDIR, sets up for a LDIR to move 256 bytes (i.e., a sector) from Memory Buffer 2 (i.e., 4D00H) to Memory Buffer 1 (i.e., 4300H), and restore the registers.
NOTE: 4A67H is the SYS00/SYS routine to read the directory entry into a memory buffer.
NOTE: 514CH is the storage location for the UPDATE PASSWORD.
NOTE: 4FCFH is the middle of a LD (HL),nn OPCODE.
NOTE: 4FCFH is the middle of a LD (HL),nn OPCODE.
NOTE: 421CH is the storage location for the Clock Data: Month.
NOTE: 421AH is the storage location for the Clock Data: Year.
5006H - SUBroutine to Construct an Open File DCB.
5009
POP HL
NOTE: 4463H is the storage location for the disk side number.
5064H - SUBroutine to extract the filespec from the DCB.
NOTE: 5137H is the storage location for the SIDE number.
The next set of instructions initialize the FILENAME + EXTENSION (11 bytes) into SPACEs.
The next set of instructions initialize the PASSWORD (8 bytes) into SPACEs.
The next set of instructions initialize the DRIVE NUMBER to -1.
NOTE: 5138H is the storage location for the SELECTED DRIVE NUMBER.
The next set of instructions move the filename to the workspace.
5094H - This is a continuation of the 5064H subroutine to extract the filespec from the DCB. We are here if the filename is NOT null.
- If the storage location for the NUMBER OF DISK DRIVES in the system (stored in Register A) equals the REQUESTED DRIVE NUMBER (stored in Register C), the Z FLAG is set.
- If the storage location for the NUMBER OF DISK DRIVES in the system (stored in Register A) < the REQUESTED DRIVE NUMBER (stored in Register C), the CARRY FLAG will be set.
- if the storage location for the NUMBER OF DISK DRIVES in the system (stored in Register A) >= the REQUESTED DRIVE NUMBER (stored in Register C), the NO CARRY FLAG will be set.
50C3H - This is a continuation of the 5064H (and then 5094H) subroutine to extract the filespec from the DCB. We are here if the filename, extension, and password have been copied to the work area, and the drive number supplied is valid.
50CDH - SUBroutine to get the filename, extension, and password (including validation). This routine checks the number of characters set in Register B starting at (HL) and if valid, puts that character into (DE).
50D1H - Validate the number of characters set in Register B contained in the memory locations pointed to by Register Pair HL and put the valid characters into the memory locations pointed to by Register Pair DE.
- 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.
- If Register A equals one character above (ASCII: 1 character above 9, the Z FLAG is set.
- If A < ASCII: 1 character above 9, the CARRY FLAG will be set.
- if A >= ASCII: 1 character above 9, the NO CARRY FLAG will be set.
- 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.
- If Register A equals 1 character above Z, the Z FLAG is set.
- If A < 1 character above Z, the CARRY FLAG will be set.
- if , the NO CARRY FLAG will be set.
50E7H - SUBroutine to Generate a HASH Code for 11 Characters pointed to by (HL) - Hash code returned in Register A.
The next 2 instructions are how a hash is calculated. The prior hash is XORed against the current character, and then the bits are rotated left.
50F7H - SUBroutine to find an empty directory (i.e., HIT) entry.
- If Register A equals 80, the Z FLAG is set.
- If A < 80, the CARRY FLAG will be set.
- if A >= 80, the NO CARRY FLAG will be set.
5107H - MAIN ROUTINE - Password Encode. Encode the password stored in the memory location pointed to by Register Pair DE; results in Register Pair HL.
The next few instructions skip to the end of the password (pointed to by Register Pair DE) by adding 7 to the LSB (i.e., Register E).
At this point, Register Pair DE is now pointing to the END of the password.
511B
511C
RRCA
5133
OR L