General:
SYS11/SYS handles the TAPE, PURGE, and LIST library commands.
Disassembly:
NOTE: 42B4H is the storage location for the PROGRAM PROTECT Flag.
NOTE: 4414H is the storage location for the NUMBER OF THE OVERLAY CURRENTLY IN MEMORY.
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.
NOTE: 427AH is the storage location for the EXECUTE FILE FLAG.
[5218H]
5218H – Exit with a ILLEGAL PARAMETER error.
521DH – Exit with a PARAMETER NOT FOUND error.
5221H – Exit with an error of DISK DRIVE NOT ON.
5226H – Decode the COMMAND LINE.
[522FH]
522FH – Scan the COMMAND TABLE for a match.
[5237H]
5233
5234
INC HL
INC HL
5237H – Determine the JUMP POINT from a MATCHING ENTRY of the COMMAND TABLE.
523EH – COMMAND TABLE.
5246H – Compare the first “BC” number of bytes of the string at (DE) againg the String at (HL).
[5254H]
5258H – Position HL to the next non-space character.
525FH – Pause if “@” is Pressed.
[002BH]
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.
If we are here, then we got a @ so now we are going to sit and wait for an ENTER.
[0049H]
[5267H]
526FH - Output a Byte held in Register A to the Screen and, if 5277H is set to 0000H, to the Printer.
[5A91H]
527A
DEC C
[003BH]
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.
[0033H]
NOTE: 0033H is the Model III ROM character print routine; displays the character held in Register A at the current cursor position.
5286H - Output a text string pointed to by Register Pair HL to the Screen and, if 5277H is set to 0000H, to the Printer as well.
[526FH]
5293H - Output the low nybble of Register A in Hexadecimal to the Screen and, if 5277H is set to 0000H, to the Printer.
The DAA opcode is mysterious, but the first step is to move the value to process into a certain range.
The next step in processing a DAA opcode is to adjust the values again.
[526FH]
529DH - Encode a Two Digit Decimal Number in Text at (HL).
[529FH]
52A9H - "TAPE" Routine.
The next 5 instructions are a standard way of clearing a memory region. HL is the base, DE = HL + 1, BC = the bytes to move. Then (HL) is set to 00H, which means 00H is then successively copied from one location to the next location, BC number of times.
Now 97 bytes of a buffer starting at 5BA2H has been zero'ed.
[5258H]
[521DH]
[5219H]
[525CH]
[521DH]
[52D9H]
52D9H - Continuation of "TAPE" Routine. Jumped here to process the command line looking for the Destination spec.
[52E5H]
52E5H - Continuation of "TAPE" Routine. Jumped here if we didn't get a destination spec.
- 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.
[52EEH]
[5219H]
[521DH]
[521DH]
[5219H]
[3042H]
[021BH]
NOTE: 021BH is the Model III ROM routine to display the character at (HL) until a 03H is found.
[53BCH]
[54D3H]
531FH - Continuation of "TAPE" Routine. Evaluate the Parameter in a Given String.
[525CH]
[5219H]
[525CH]
[5338H]
[5338H]
[5219H]
[525CH]
[525CH]
5348H - Continuation of "TAPE" Routine. Prompt the user to insert a cassette and wait for a key.
[021BH]
NOTE: 021BH is the Model III ROM routine to display the character at (HL) until a 03H is found.
[0049H]
[0033H]
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.
5356H - "TAPE" Routine - Message and Byte Storage.
53CBH - Contination of "TAPE" Routine. Read file from disk into RAM to TAPE save.
[021BH]
NOTE: 021BH is the Model III ROM routine to display the character at (HL) until a 03H is found.
[0040H]
NOTE: 0040H is the Model III ROM routine to get a full line from the keyboard. In this routine, a line is terminated by a carriage return or BREAK, and characters typed are echoed to the display. On entry, B must be the maximum length of line to be accepted and (HL) must be the storage buffer which should be set to B+1. On Exit, CARRY will be set if the BREAK key was hit, Register B will contain the number of characters entered, and (HL) will contain the line from the keyboard followed by the terminating character. Register paid DE is altered in this routine.
53CF
LD B,00H
[4424H]
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 2 in OVERLAY 3.
[4409H]
NOTE: 4409H is the SYS00/SYS routine to process DOS errors.
[0013H]
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.
[4409H]
NOTE: 4409H is the SYS00/SYS routine to process DOS errors.
- If Register A equals 06H.
- If A < 06H, the CARRY FLAG will be set.
- if A >= 06H, the NO CARRY FLAG will be set.
5404H - Contination of "TAPE" Routine. Routine to handle a COMMENT BLOCK.
[54B3H]
[54B3H]
[5408H]
540FH - Contination of "TAPE" Routine. Routine to handle a CODE BLOCK.
[54B3H]
[54B3H]
[54B3H]
[54B3H]
[5423H]
542CH - Contination of "TAPE" Routine. Routine to handle a EXECUTION ADDRESS BLOCK.
[54B3H]
[54B3H]
[54B3H]
543AH - Contination of "TAPE" Routine. Passed through from the above routine, this code writes the file from RAM to TAPE.
[0264H]
[545FH]
[545FH]
- If Register A equals 0, the Z FLAG is set.
- If A < 30H 0, the CARRY FLAG will be set.
- if A >= 30H 0, the NO CARRY FLAG will be set.
[545FH]
[0264H]
[544AH]
545FH - Contination of "TAPE" Routine. Jumped to when less than 6 characters of the filename has been written.
First we need to output the remaining characters in the filename as spaces. Register B holds the number of filename characters left to output.
[0264H]
[545FH]
[54A1H]
[53FFH]
547EH - Subroutine in the "TAPE" Routine - Write an entire code block to tape, with checksum. Register B holds the data block length and Register C will calculate the checksum.
[0264H]
[0264H]
[0264H]
[0264H]
[0264H]
[5493H]
[0264H]
54A1H - Contination of "TAPE" Routine. Jumped to when we have an EXECUTION ADDRESS BLOCK. This routine will write the block and then exit the routine.
[0264H]
[0264H]
[0264H]
[01F8H]
54B3H - Subroutine in the "TAPE" Routine. Read a Byte from the Disk File.
[0013H]
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.
[4409H]
NOTE: 4409H is the SYS00/SYS routine to process DOS errors.
54BDH - Subroutine in the "TAPE" Routine. Write a Byte to the Disk File.
[001BH]
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.
[4409H]
NOTE: 4409H is the SYS00/SYS routine to process DOS errors.
54D3H - Part of "TAPE" Routine. Transfer a File from Tape to RAM for Disk Save.
[021BH]
NOTE: 021BH is the Model III ROM routine to display the character at (HL) until a 03H is found.
[0243H]
[0235H]
[5219H]
NOTE: 4020H is the storage location for the CURSOR POSITION ON SCREEN.
[0235H]
[54FEH]
[54F0H]
NOTE: 4020H is the storage location for the CURSOR POSITION ON SCREEN.
POP DE
Top of a loop (ending at 5544H) to read the entire file from tape.
[0235H]
[5546H]
[5511H]
If we are here, then the byte read from the cassette was a CODE BLOCK identifier.
Next, process the BLOCK LENGTH.
[0235H]
Next, process the LSB of the CODE ADDRESS.
[0235H]
Next, process the MSB of the CODE ADDRESS.
[0235H]
Next, loop to read the block
[0235H]
[5534H]
The block is now read into the buffer at HL, and Register C now holds the checksum. So next, verify the checksum.
[0235H]
[5219H]
5546H - Contination of "TAPE" Routine. Jumped to when we have an EXECUTION ADDRESS to write that block and finish.
[0314H]
5552
OR E
[5559H]
555FH - Contination of "TAPE" Routine. Write a File from RAM to Diskette.
[4420H]
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.
[4409H]
NOTE: 4409H is the SYS00/SYS routine to process DOS errors.
[5599H]
[5219H]
[54BDH]
[54BDH]
[54BDH]
558E
DEC B
[558FH]
5599H - Contination of Write a File from RAM to Diskette portion of the "TAPE" Routine. Jumped here if an EXECUTE ADDRESS BLOCK was found.
[54BDH]
[54BDH]
[54BDH]
[54BDH]
[4428H]
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.
55ADH - Continuation of the "TAPE" Routine. Load a SYSTEM Tape into RAM and RUN IT.
[021BH]
NOTE: 021BH is the Model III ROM routine to display the character at (HL) until a 03H is found.
[0235H]
[5219H]
NOTE: 4020H is the storage location for the CURSOR POSITION ON SCREEN.
[0235H]
[55C6H]
[0235H]
[5601H]
[55CDH]
[0235H]
[0235H]
[0235H]
[0235H]
[55F3H]
55F3H - Continuation of the SYSTEM Tape into RAM and RUN IT portion of the "TAPE" Routine. Jumped here if there was no memory fault.
[55E7H]
[0235H]
[5219H]
5601H - Continuation of the SYSTEM Tape into RAM and RUN IT portion of the "TAPE" Routine. Jumped here if the we just got a EXECUTION ADDRESS BLOCK.
5609
OR L
560DH - "PURGE" Library Command.
[5258H]
[5647H]
If we are here, then we got a * and need to delete DOS.
[563AH]
If we are here, then we got a : and need to check for a drive letter after the :
[5221H]
NOTE: 4413H is the storage location for the NUMBER OF DISK DRIVES in the system.
[525CH]
[5647H]
[4454H]
NOTE: 4454H is the DOS PARAMETER STRING PARSE routine. It decodes DOS LIBRARY parameters.
[521DH]
[021BH]
NOTE: 021BH is the Model III ROM routine to display the character at (HL) until a 03H is found.
[0040H]
NOTE: 0040H is the Model III ROM routine to get a full line from the keyboard. In this routine, a line is terminated by a carriage return or BREAK, and characters typed are echoed to the display. On entry, B must be the maximum length of line to be accepted and (HL) must be the storage buffer which should be set to B+1. On Exit, CARRY will be set if the BREAK key was hit, Register B will contain the number of characters entered, and (HL) will contain the line from the keyboard followed by the terminating character. Register paid DE is altered in this routine.
- 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.
[5662H]
[5658H]
[5667H]
5662H - Continuation of "PURGE". Jumped here if the MASTER PASSWORD provided by the user was less than 8 characters. Register B will hold the number of characters received and Register Pair HL will be pointing to the first non-valid character in the Master Password Buffer.
[5662H]
[57A4H]
[4A93H]
NOTE: 4A93H is the SYS00/SYS routine to READ THE GAT sector into RAM (Buffer at 4D00H).
[4409H]
NOTE: 4409H is the SYS00/SYS routine to process DOS errors.
[4ABAH]
NOTE: 4ABAH is the SYS00/SYS routine to read the HIT sector into RAM.
[4409H]
NOTE: 4409H is the SYS00/SYS routine to process DOS errors.
NOTE: 4300H is a memory buffer (referred to as Memory Buffer 1) where HIT TABLE was stored in RAM.
[569AH]
569AH - Continuation of "PURGE". Jumped here if the MASTER PASSWORD provided by the user was correct.
[57D4H]
[5791H]
[56B4H]
56B4H - Continuation of "PURGE". Jumped here if HL points to a HIT entry that needs to be deleted.
[4A67H]
NOTE: 4A67H is the SYS00/SYS routine to read the directory entry into RAM (Buffer at 4300H)
[4409H]
NOTE: 4409H is the SYS00/SYS routine to process DOS errors.
[56E3H]
[4ABAH]
NOTE: 4ABAH is the SYS00/SYS routine to read the HIT sector into RAM.
[4409H]
NOTE: 4409H is the SYS00/SYS routine to process DOS errors.
[4AC2H]
NOTE: 4AC2H is the SYS00/SYS routine to write the HIT sector from RAM to diskette.
[4409H]
NOTE: 4409H is the SYS00/SYS routine to process DOS errors.
56E3H - Continuation of "PURGE". Jumped here if the file is active.
[5701H]
[56F6H]
[5750H]
56F6H - Continuation of "PURGE".
[5701H]
[5750H]
[021BH]
NOTE: 021BH is the Model III ROM routine to display the character at (HL) until a 03H is found.
[021BH]
NOTE: 021BH is the Model III ROM routine to display the character at (HL) until a 03H is found.
[0040H]
NOTE: 0040H is the Model III ROM routine to get a full line from the keyboard. In this routine, a line is terminated by a carriage return or BREAK, and characters typed are echoed to the display. On entry, B must be the maximum length of line to be accepted and (HL) must be the storage buffer which should be set to B+1. On Exit, CARRY will be set if the BREAK key was hit, Register B will contain the number of characters entered, and (HL) will contain the line from the keyboard followed by the terminating character. Register paid DE is altered in this routine.
[5791H]
[572BH]
[5704H]
572BH - Continuation of "PURGE". Jumped here if we found a file to delete, and the user confirmed to delete it.
LD IYH,42H
[4424H]
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 2 in OVERLAY 3.
[4409H]
NOTE: 4409H is the SYS00/SYS routine to process DOS errors.
[442CH]
NOTE: 442CH is the SYS00/SYS routine to KILL A DISK FILE. On Entry DE mus tpoint to th ememory location identifying if the file is open or not.
575AH - SUBroutine in the "PURGE" command which will get the FILESPEC from a DIRECTORY ENTRY.
- If Register A equals !, the Z FLAG is set.
- If A < !, the CARRY FLAG will be set.
- if A >= !, the NO CARRY FLAG will be set.
[576EH]
[5764H]
[5788H]
- If Register A equals !, the Z FLAG is set.
- If A < !, the CARRY FLAG will be set.
- if A >= !, the NO CARRY FLAG will be set.
[5788H]
[577EH]
5791H - Continuation of the "PURGE" Routine - Finish the routine and request system disk if needed.
[021BH]
NOTE: 021BH is the Model III ROM routine to display the character at (HL) until a 03H is found.
[0049H]
57A4H - Subroutine in the "PURGE" Routine - 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.
57B8
57B9
RRCA
57CF
OR L
57D4H - Subroutine in the "PURGE" Routine - Delete all System Files.
[021BH]
NOTE: 021BH is the Model III ROM routine to display the character at (HL) until a 03H is found.
[021BH]
NOTE: 021BH is the Model III ROM routine to display the character at (HL) until a 03H is found.
[021BH]
NOTE: 021BH is the Model III ROM routine to display the character at (HL) until a 03H is found.
[0040H]
NOTE: 0040H is the Model III ROM routine to get a full line from the keyboard. In this routine, a line is terminated by a carriage return or BREAK, and characters typed are echoed to the display. On entry, B must be the maximum length of line to be accepted and (HL) must be the storage buffer which should be set to B+1. On Exit, CARRY will be set if the BREAK key was hit, Register B will contain the number of characters entered, and (HL) will contain the line from the keyboard followed by the terminating character. Register paid DE is altered in this routine.
[580AH]
[57FAH]
57F8
INC SP
57FAH - Continuation of the "PURGE" subroutine to Delete all System Files.
[57D4H]
5806
OR E
[580FH]
580FH - Continuation of the "PURGE" subroutine to Delete all System Files.
[4AC2H]
NOTE: 4AC2H is the SYS00/SYS routine to write the HIT sector from RAM to diskette.
[4409H]
NOTE: 4409H is the SYS00/SYS routine to process DOS errors.
NOTE: 4D00H is a memory buffer (referred to as Memory Buffer 2) where the GAT TABLE is stored in RAM.
[4A9BH]
NOTE: 4A9BH is the SYS00/SYS routine to to write the GAT sector from RAM to diskette.
[4409H]
NOTE: 4409H is the SYS00/SYS routine to process DOS errors.
We now need to write out the DUMMY system (to display the need for a SYSTEM disk).
[4409H]
NOTE: 4409H is the SYS00/SYS routine to process DOS errors.
5866H - "PURGE" Command Message and Byte Storage.
5866H - "PURGE" Command Parameter Table.
58BFH - "PURGE" Command Message and Byte Storage.
58CCH - "LIST" Command.
[441CH]
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.
[521DH]
- 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.
[58EEH]
[58E4H]
We are here either because of a pass through completion of 25 characters or because we hit a character which was not valid.
[4454H]
NOTE: 4454H is the DOS PARAMETER STRING PARSE routine. It decodes DOS LIBRARY parameters.
[5219H]
[4424H]
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 2 in OVERLAY 3.
[4409H]
NOTE: 4409H is the SYS00/SYS routine to process DOS errors.
[591EH]
591EH - Continuation "LIST" Command; jumped here if the LRL is not 256.
- If Register A equals a LRL of 200, the Z FLAG is set.
- If A < a LRL of 200, the CARRY FLAG will be set.
- if A >= a LRL of 200, the NO CARRY FLAG will be set.
592CH - Continuation "LIST" Command; jumped here if the LRL is less than 200.
- If the LRL (held in Register A) equals 100, the Z FLAG is set.
- If the LRL (held in Register A) < 100, the CARRY FLAG will be set.
- if If the LRL (held in Register A) >= 100 the NO CARRY FLAG will be set.
5935H - Continuation "LIST" Command; jumped here if first digit of the LRL was "1" or "2".
5938H - Continuation "LIST" Command; jumped here to deal with the tens and ones position number of the LRL.
5938
593C
OR C
[594BH]
[01C9H]
NOTE: 01C9H is the Model III ROM routine to to CLEAR THE SCREEN and RETurn.
595A
OR C
[59B5H]
If we are here then we are outputting in ASCII Format.
[5286H]
[0013H]
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.
[5998H]
[597FH]
- 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.
[597FH]
[598FH]
[526FH]
598A
OR C
[0060H]
[028DH]
NOTE: 028DH is the Model III ROM routine to CHECK FOR BREAK. On exit, the NZ FLAG will be set if BREAK was detected.
5998H - Continuation "LIST" Command; jumped here if we got an error retrieving the file from disk. Register A will contain the error code.
[59A3H]
[59A3H]
59A3H - Continuation "LIST" Command; jumped here if the error we got error retrieving the file from disk was 1CH or 1DH.
.NOTE: 4020H is the storage location for the CURSOR POSITION ON SCREEN.
[59AFH]
[526FH]
[5286H]
59B5H - Continuation "LIST" Command; jumped here if the file is to be listed in hex.
[5286H]
[526FH]
[4436H]
NOTE: 4436H is the SYS00/SYS vector for 'READ', which reads the record that the disk drive is positioned over.
[59F0H]
[5A18H]
[59C5H]
59F0H - Continuation "LIST" Command; jumped here if the file is to be listed in hex BUT we are not in FULL SECTOR I/O mode because the LRL was not 256.
- If Register A equals 61, the Z FLAG is set.
- If A < 61, the CARRY FLAG will be set.
- if A >= 61, the NO CARRY FLAG will be set.