TRS-80 DOS - TRSDOS v1.3 - CONVERT/CMD Disassembled
Page Customization
Page Index
CONVERT/CMD
Other Navigation
Description:
CONVERT copies the files of a Model I diskette (single density: 10 sectors of 256 bytes per track, 2 granules of 5 sectors, the directory on track 17) to a TRSDOS 1.3 diskette. The source calls it the MODEL 1 TO MODEL 3 CONVERSION PROGRAM. It reads the Model I diskette with its own disk routines (the source's M1M3READ part, 55A2H-5A05H), which drive the FDC directly in single density, and writes each file with the TRSDOS 1.3 calls INIT, PUT (through the ROM's 001BH) and CLOSE.
Use: CONVERT :s :d converts from drive s to drive d; without them (or with either one missing) it asks 'Source Drive? ' and 'Destination Drive? '. The two drives must differ ('Single Drive Convert is NOT allowed'). A drive number is checked against MAXDRV (4413H); a bad one on the command line ends with the error, a bad reply is asked again. BREAK at any prompt returns to TRSDOS READY.
What it does: it reads the HIT (sector 1) and the GAT (sector 0) of the directory track of the source diskette, then looks at every one of the 64 HIT entries in turn (a column of 8 records at a time). A record that is free, extended, invisible or a system file is skipped. Every other file is converted without asking:
- A file with an access password of its own (not blank and not the same as the update password) is not converted: its name is shown with 'NOT Converted (Protected File)'.
- A file with an update password: 'Enter Password for NAME/EXT ?' is asked. The right password is added to the file spec of both files (NAME/EXT.PASSWORD), so the new file gets it; a wrong one is asked again; ENTER alone copies the file without it, and afterwards the update password code of the source record (the code of a blank password changed to the TRSDOS 1.3 one) and its attribute byte are written into the new file's directory record.
- A file without passwords: its name is shown.
- The new file is opened with INIT and the record length of the source file. When it is already on the destination diskette, 'Existing File. Use it (Y/N/Q) ? ' is asked: N skips the file, Q returns to TRSDOS READY, anything else writes over it.
- The file is copied byte by byte until the end of the file (error 28 or 29 from READBT), then the new file is closed.
When every HIT entry has been looked at, 'Conversion Complete' is shown and CONVERT returns to TRSDOS READY (402DH); CFLAG (42B4H) is set to 55H at the start, so TRSDOS READY clears user memory.
CONVERT/CMD loads at 5200H-5AFEH (2271 bytes in three areas: 5200H-55A1H, 55ABH-59EEH and 5A06H-5AFEH; the DEFS areas 55A2H-55AAH and 59EFH-5A05H are not in the file), transfer address 5200H. Its variables and buffers from 5AFFH to 5FFFH are not in the file.
Memory Map
| Address Range | Label | Contents |
|---|---|---|
| 5200H-52AFH | CONV, ASKSRC, ASKDES, DOCONV, DOCON0-DOCON2 | The drives, the HIT and GAT of the source, the main loop. |
| 52B0H-536DH | COMPRS, MOVDCB, SETPAS, SETDRV, DRVSET | The file specs of the two files. |
| 536EH-5477H | CKPROT, DSPNAM, INPUT, EXST, SETFLG, CKPASS, CKDRIV | Passwords, prompts and replies. |
| 5478H-55A1H | RWLOOP, GETFIL, BMPFIL, PROCES, PROCE0-PROCE7 | The copy, the HIT walk, one file. |
| 55A2H-55B1H | DUMMY, DRIVE, TRK, SEC, DIRTK | Variables of the source diskette routines. |
| 55B2H-56B1H | CSEL, CSELCT, SPEEK, CKBSY, delays, READT, OUTRED, MREAD | Seek and read a sector of the source diskette. |
| 56B2H-576AH | READ0, RDREC, RDSEC, READBT, RBYTE, GETPA, MB5 | Read a file of the source diskette. |
| 576BH-59EDH | DIRED, REDGAT, LFDIR, TRKGT, ROPEN, SETDCB, DOLINK, CRACK, GETFLD, HASH, TRAP, CKHDRV, RDHITT | The directory, open, file specs, hash codes. |
| 59EEH-5A05H | DRV, PWORD, NAME, EXT, UPDTDC, ACCTDC | The parts of a file spec (59EFH up not in the file). |
| 5A06H-5AFEH | TITLE ... SPCOFF | Messages. |
| 5AFFH-5FFFH | SDRIVE ... BUFER2 | Variables, DCBs and buffers (not in the file). |
Variables:
| Address | Label | Description |
|---|---|---|
| 5AFFH 1 byte | SDRIVE | Not in the file. The source drive. |
| 5B00H 1 byte | DDRIVE | Not in the file. The destination drive. |
| 5B01H 1 byte | MOVFLG | Not in the file. FFH when only ENTER was pressed for the password (PROCE4 then writes the password code into the new record). |
| 5B02H-5B03H 2 bytes | FILPNT | Not in the file. The next HIT entry (5E00H-5EFFH). |
| 5B04H 1 byte | FILCNT | Not in the file. HIT entries left, from 64. |
| 5B05H 1 byte | LFNCNT | Not in the file. The directory record of the entry in FILPNT (bits 0-2 the sector less 2, bits 3-5 the record). |
| 5B06H 1 byte | SVCNT | Not in the file. The length of the password typed. |
| 5B07H-5B08H 2 bytes | PWSAVE | Not in the file. The update password code of the file (record offset 10H). |
| 5B09H-5B26H 30 bytes | FILNAM | Not in the file. NAME/EXT and 03H. |
| 5B27H-5B30H 10 bytes | KEYBUF | Not in the file. The reply typed. |
| 5B31H-5B62H 50 bytes | DCBR | Not in the file. The DCB of the source file (filled by SETDCB). |
| 5B63H-5B94H 50 bytes | DCBW | Not in the file. The DCB of the new file (opened by INIT). |
| 5B95H-5C94H 256 bytes | DBUFR1 | Not in the file. The buffer of DCBR. |
| 5C95H-5D94H 256 bytes | DBUFR2 | Not in the file. The buffer of DCBW. |
| 5E00H-5EFFH 256 bytes | HITBUF | Not in the file. The HIT of the source diskette. |
| 5F00H-5FFFH 256 bytes | BUFER2 | Not in the file. The GAT, then the directory sectors of the source diskette. |
| 55A2H-55AAH 9 bytes | DUMMY | Not in the file. The ID field SPEEK reads. |
| 55ABH 1 byte | DRIVE | The select byte of the drive in use. |
| 55ACH, 55ADH 1 byte each | TRK, SEC | Not used. |
| 55AEH-55B1H 4 bytes | DIRTK | The directory track of drives 0-3 (17 each). |
| 59EEH 1 byte | DRV | The drive of the file spec (FFH = any). |
| 59EFH-59F6H 8 bytes | PWORD | Not in the file. The password of the file spec. |
| 59F7H-5A01H 11 bytes | NAME, EXT | Not in the file. The name and extension, padded with spaces. |
| 5A02H-5A05H 4 bytes | UPDTDC, ACCTDC | Not in the file. The code of PWORD (not used). |
| 53E9H-53EAH 2 bytes | SAVTXT | Operand of LD HL at 53E8H: the prompt INPUT shows again. |
| 552CH 1 byte | CHGLRL | Operand of LD B at 552BH: the record length of the new file. |
| 5556H-5557H 2 bytes | SAVDIR | Operand of LD HL at 5555H: the directory record of the source file. |
| 5587H-5588H 2 bytes | SAVLFN | Operand of LD BC at 5586H: the logical file number and drive of the new file. |
| 55FDH 1 byte | SVTRK | Operand of LD D at 55FCH: the track SPEEK seeks. |
| 562FH-5630H 2 bytes | RHLL | Operand of LD HL at 562EH: the buffer READT reads into. |
| 57EAH 1 byte | HCODE | Operand of CP at 57E9H: the hash code of the file ROPEN looks for. |
| 5846H 1 byte | RLRL | Operand of LD A at 5845H: the record length given to ROPEN. |
| 5849H 1 byte | PRIV | Operand of LD A at 5848H: access bits for DCB+01H (00H). |
| 5857H-5858H 2 bytes | BLKBUF | Operand of LD DE at 5856H: the buffer given to ROPEN. |
| 5886H 1 byte | VERSON | Operand of LD A at 5885H: the GAT's version byte less 24H. |
| 588FH 1 byte | INCFLG | Operand of LD A at 588EH: the EOF byte of the file. |
| 58C0H 1 byte | SAVDRV | Operand of LD C at 58BFH: the drive of the file. |
| 58CCH 1 byte | SAVEA | Operand of LD A at 58CBH: the link byte of an extended record. |
| 58E1H-58E2H 2 bytes | SAVEDE | Operand of LD DE at 58E0H: where in the DCB the next extents go. |
| 42B4H 1 byte | CFLAG | In SYS0: set to 55H, TRSDOS READY clears user memory. |
| 4413H 1 byte | MAXDRV | In SYS0: the highest drive number. |
| 4300H-43FFH 256 bytes | BUFF1 | In SYS0: the directory sector LFNDIR and WRDIR use in PROCE4. |
The Read DCB (filled by SETDCB)
| Offset | Label | Contents |
|---|---|---|
| 00H | TYPE | 80H: open. |
| 01H | PROT | Bit 7: byte access (READBT); bit 5: the next record must be read into the buffer. |
| 03H-04H | BUFL, BUFH | The buffer (DBUFR1). |
| 05H | OFFSET | The offset of the next byte in the buffer. |
| 06H | DRVNUM | The drive. |
| 07H | LFN | The HIT offset of the file. |
| 08H | EOF | The EOF byte (record offset 03H). |
| 09H | LRL | The logical record length (record offset 04H). |
| 0AH-0BH | NRN | The next record (sector), from 0. |
| 0CH-0DH | ERN | The ending record number (record offset 14H; corrected unless the version byte is 24H). |
| 0EH up | The extents (record offset 16H up): the track, then the granule byte (bits 7-5 the first granule, bits 4-0 the granules less 1); FFH ends them. |
Analysis Notes
Source and file. The release file and the file assembled in the source tree (M1M3CONV) are the same 2271 bytes. The source is M1M3CONV.SRC, which includes M1M3READ.SRC at 55A2H; its pseudo instructions SAV3, EXI3, LD BC,(HL), LD HL,(HL), LD (HL),BC and CD rr assemble to several instructions each.
The HIT walk. FILPNT moves 32 bytes at a time down a column of the HIT and on to the next column when it passes FFH; LFNCNT keeps the record number to match (bits 0-2 the column, which is the directory sector less 2, bits 3-5 the row, which is the record in the sector). LFDIR takes the sector from the record number it is given and the record in the sector from FILPNT, so ROPEN's search, which reads the record of every HIT entry with the right hash code, compares the name of the record in FILPNT's row of that entry's sector.
Not reached. READ0 (56B2H) and OPERR1 (5806H) are not called or jumped to by any instruction of CONVERT. TRK and SEC (55ACH, 55ADH) and UPDTDC and ACCTDC (5A02H-5A05H) are not read.
PROCE4. The attribute byte comes from the source record at SAVDIR in BUFER2; when ROPEN has read an extended record (DOLINK) into BUFER2 since, that place holds another record.
Disassembly:
5200H - CONV - Entry Point: Sign On and the Drive Numbers from the Command Line
Original Source Code Comment: SAVE THE COMMAND LINE POINTER
Original Source Code Comment: SET THE 'CLEAR RAM' FLAG
Original Source Code Comment: CLEAR THE SCREEN
Original Source Code Comment: HL => 'CONVERSION PGM' MSG
Original Source Code Comment: DISPLAY IT
Original Source Code Comment: GET COMMAND LINE POINTER BACK
The command line may give both drives as :s :d.
Original Source Code Comment: GET THE CHAR FROM THE LINE
Original Source Code Comment: END OF LINE?
Original Source Code Comment: YES, ASK FOR BOTH DRIVE NUMBERS
Original Source Code Comment: DRIVE SPECIFIER?
Original Source Code Comment: NO, ASK FOR SOURCE
Original Source Code Comment: BUMP TO THE DRIVE NUMBER
Original Source Code Comment: GET THE DRIVE NUMBER
Original Source Code Comment: VALID DRIVE NUMBER?
Original Source Code Comment: NO, EXIT
Original Source Code Comment: SAVE IT AS THE SOURCE DRIVE
Original Source Code Comment: BUMP PAST SPACE
Original Source Code Comment: BUMP TO NEXT SLOT
Original Source Code Comment: GET THE NEXT BYTE
Original Source Code Comment: END OF LINE?
Original Source Code Comment: YES, ASK FOR DESTINATION
Original Source Code Comment: DRIVE SPECIFIER?
Original Source Code Comment: NO, ASK FOR DESTINATION
Original Source Code Comment: BUMP TO THE DRIVE NUMBER
Original Source Code Comment: GET IT
Original Source Code Comment: VALID DRIVE NUMBER?
Original Source Code Comment: NO, EXIT
Original Source Code Comment: SAVE IT AS THE DESTINATION DRIVE NUMBER
Original Source Code Comment: AND DO THE CONVERSION
523CH - ASKSRC - Prompt for the Source Drive
Original Source Code Comment: HL => 'SOURCE DRIVE NO.' MSG
Original Source Code Comment: DISPLAY AND GET THE ANSWER
Original Source Code Comment: ABORT IT BREAK KEY
Original Source Code Comment: GET THE DRIVE NUMBER
Original Source Code Comment: SEE IF VALID DRIVE NUMBER
Original Source Code Comment: NOT VALID. DO IT AGAIN
Original Source Code Comment: SET AS SOURCE DRIVE
524EH - ASKDES - Prompt for the Destination Drive
Original Source Code Comment: HL => 'DESTINATION DRIVE NO.' MSG
Original Source Code Comment: DISPLAY AND GET THE ANSWER
Original Source Code Comment: ABORT IF BREAK KEY
Original Source Code Comment: GET THE DRIVE NUMBER
Original Source Code Comment: SEE IF VALID DRIVE NUMBER
Original Source Code Comment: NO, DO IT AGAIN
Original Source Code Comment: SET AS DESTINATION DRIVE NUMBER
5260H - DOCONV - Check the Drives, Read the HIT and the GAT of the Source Diskette
Original Source Code Comment: GET THE SOURCE DRIVE
Original Source Code Comment: INTO B
Original Source Code Comment: GET THE DESTINATION DRIVE
Original Source Code Comment: SAME DRIVES?
Original Source Code Comment: NO, CONTINUE
Original Source Code Comment: HL => 'CANT USE SAME DRIVE' MSG
Original Source Code Comment: DISPLAY IT
Original Source Code Comment: DO IT ALL OVER AGAIN
Original Source Code Comment: GET THE SOURCE DRIVE NUMBER
Original Source Code Comment: INTO C
Original Source Code Comment: READ IN THE MODEL 1 HIT TABLE
Original Source Code Comment: EXIT IF ERROR
Original Source Code Comment: SAVE THE HIT FOR THE FILE POINTER
Original Source Code Comment: START AN LFN COUNTER
Original Source Code Comment: INIT THE 'MOVE' FLAG
Original Source Code Comment: MAX NUMBER OF FILES TO LOOK AT
Original Source Code Comment: SET THE COUNTER
Original Source Code Comment: GO READ IN THE GAT
Original Source Code Comment: EXIT IF ERROR
Original Source Code Comment: SEE IF THIS IS MODEL 1, VERSION 2.4
Original Source Code Comment: IF IT IS, 'A' WILL BE ZERO
Original Source Code Comment: SAVE THE 'Z' OR 'NZ' IN VERSION FLAG
5299H - DOCON1 / DOCON2 - Main Loop: Convert Each File, then Conversion Complete
Every HIT entry is looked at in turn; each file found is converted.
Original Source Code Comment: GET THE NEXT FILE TO PROCESS
Original Source Code Comment: END OF FILES. DISPLAY FINALE
Original Source Code Comment: PROCESS THE FILE
Original Source Code Comment: CLEAR THE 'MOVE' FLAG
Original Source Code Comment: DO THE NEXT FILE
Original Source Code Comment: HL => 'CONVERSION COMPLETE' MSG
Original Source Code Comment: DISPLAY IT
Original Source Code Comment: RETURN TO DOS
52B0H - COMPRS - Make NAME/EXT from a Directory Record
Original Source Code Comment: SET FOR 8 CHARS
Original Source Code Comment: SAVE THE POINTER TO THE NAME
Original Source Code Comment: OFFSET TO THE BEGIN OF FILENAME IN DIR
Original Source Code Comment: HL => FRONT OF FILE NAME
Original Source Code Comment: PLACE TO STORE IT
Original Source Code Comment: GET A CHAR
Original Source Code Comment: SPACE
Original Source Code Comment: YES, GO FOR EXTENSION
Original Source Code Comment: SAVE IT IN BUFFER
Original Source Code Comment: BUMP POINTERS
Original Source Code Comment: LOOP FOR COUNT
Original Source Code Comment: GET THE NAME POINTER BACK
Original Source Code Comment: SAVE THE 'FILNAM' POINTER
Original Source Code Comment: OFFSET TO THE EXTENSION
Original Source Code Comment: HL => EXTENSTION
Original Source Code Comment: GET 'FILNAM' POINTER BACK
Original Source Code Comment: SEE IF ANY EXTENSION
Original Source Code Comment: SPACE?
Original Source Code Comment: YES. NO EXT. EXIT
Original Source Code Comment: SET THE EXTENSTION SPECIFIER
Original Source Code Comment: INTO THE BUFFER
Original Source Code Comment: BUMP TO NEXT SLOT
Original Source Code Comment: SET FOR 3 CHARS
Original Source Code Comment: GET A CHARACTER
Original Source Code Comment: END OF EXTENSTION?
Original Source Code Comment: YES, EXIT
Original Source Code Comment: SET INTO THE BUFFER
Original Source Code Comment: BUMP POINTERS
Original Source Code Comment: LOOP FOR COUNT
Original Source Code Comment: TERMINATE THE NAME
52EAH - MOVDCB - Copy the File Spec into the Read and Write DCBs
Original Source Code Comment: DE => WRITE DCB
Original Source Code Comment: BC => READ DCB
Original Source Code Comment: WHERE THE NAME IS
Original Source Code Comment: GET A BYTE
Original Source Code Comment: INTO THE WRITE DCB
Original Source Code Comment: INTO THE READ DCB
Original Source Code Comment: END OF FILESPEC?
Original Source Code Comment: YES, EXIT
Original Source Code Comment: NO, BUMP POINTERS
Original Source Code Comment: AND LOOP TILL DONE
5306H - SETPAS - Add the Password to Both File Specs
Original Source Code Comment: HL => READ DCB
Original Source Code Comment: SET A COUNTER
Original Source Code Comment: GET A CHARACTER
Original Source Code Comment: END OF FILESPEC?
Original Source Code Comment: YES, SET THE PASSWORD
Original Source Code Comment: BUMP TO NEXT CHAR
Original Source Code Comment: INC THE COUNT
Original Source Code Comment: LOOP TILL FOUND
Original Source Code Comment: SAVE THE POINTER IN DE
Original Source Code Comment: HL => WRITE DCB
Original Source Code Comment: CLEAR B
Original Source Code Comment: HL => WHERE PW GOES IN WRITE DCB
Original Source Code Comment: BC => WHERE USER SUPPLIED PW IS
Original Source Code Comment: SET PW SPECIFIER
Original Source Code Comment: INTO WRITE DCB
Original Source Code Comment: INTO READ DCB
Original Source Code Comment: AND PICK UP THE PASSWORD
Original Source Code Comment: GET A CHAR
Original Source Code Comment: LESS THEN LEGAL?
Original Source Code Comment: NO, CONTINUE
Original Source Code Comment: SET AS END OF LINE
Original Source Code Comment: INTO THE READ DCB
Original Source Code Comment: INTO THE WRITE DCB
Original Source Code Comment: END OF LINE?
Original Source Code Comment: YES, EXIT
Original Source Code Comment: NO, BUMP POINTERS
533DH - SETDRV - Add the Drive Numbers to Both File Specs
Original Source Code Comment: PICK UP THE READ DCB
Original Source Code Comment: SET A COUNTER
Original Source Code Comment: GET A CHARACTER
Original Source Code Comment: END OF FILE?
Original Source Code Comment: YES, SET THE DRIVE NUMBER
Original Source Code Comment: NO, BUMP TO NEXT CHAR
Original Source Code Comment: BUMP THE COUNT
Original Source Code Comment: LOOP TILL FOUND
Original Source Code Comment: PICK UP THE SOURCE DRIVE NUMBER
Original Source Code Comment: SET IT
Original Source Code Comment: HL => WRITE DCB
Original Source Code Comment: CLEAR THE MSB OF THE COUNT
Original Source Code Comment: HL => END OF THE FILESPEC
Original Source Code Comment: GET THE DESTINATION DRIVE NUMBER
Original Source Code Comment: SET IT
5364H - DRVSET - Put a Drive Specifier and 0DH at HL
Original Source Code Comment: SET A DRIVE SPECIFIER
Original Source Code Comment: BUMP TO NEXT SLOT
Original Source Code Comment: MAKE THE DRIVE NUMBER ASCII
Original Source Code Comment: BUMP TO NEXT SLOT
Original Source Code Comment: SET TERMINATOR
Original Source Code Comment: EXIT. DONE
536EH - CKPROT - Check the Passwords of a Directory Record
Original Source Code Comment: DE => DIR RECORD
Original Source Code Comment: OFFSET TO THE UPDATE HASH CODE
Original Source Code Comment: HL => UPD
Original Source Code Comment: PICK UP THE UPD
Original Source Code Comment: BUMP TO THE ACC
Original Source Code Comment: PICK UP THE ACC
Original Source Code Comment: ADD THE TWO TOGETHER
Original Source Code Comment: HAS EITHER ACC OR UPD ON IT
Both codes are the code of a blank password when their sum is 852CH.
Original Source Code Comment: ARE BOTH PW'S BLANKS?
Original Source Code Comment: IF SO, HL = 0
Original Source Code Comment: YES, BOTH BLANKS. EXIT 'Z'
Original Source Code Comment: OFFSET TO THE UPDATE HASH CODE
Original Source Code Comment: HL => UPD TRAP
Original Source Code Comment: GET IT
Original Source Code Comment: SAVE IT FOR LATER
Original Source Code Comment: OFFSET TO THE ACCESS HASH CODE
Original Source Code Comment: HL => ACC TRAP DOOR
Original Source Code Comment: PICK IT UP
Original Source Code Comment: TRAP FOR 'BLANKS'
Original Source Code Comment: ACC = BLANKS?
Original Source Code Comment: YES, EXIT AND SET 'NZ'
Original Source Code Comment: GET THE UPDATE TRAP
Original Source Code Comment: ACC = UPD?
Original Source Code Comment: YES, EXIT
Original Source Code Comment: SET 'Z'
Original Source Code Comment: SET THE CARRY FLAG
Original Source Code Comment: CLEAR CARRY AND SET 'NZ'
53BDH - DSPNAM - Display the File Name
Original Source Code Comment: HL => COMPRESSED FILE NAME
Original Source Code Comment: DISPLAY IT
Original Source Code Comment: OUTPUT A SPACE AND CURSOR OFF CHAR
53D0H - INPUT - Display a Prompt and Get a One Character Reply
Original Source Code Comment: SAVE POINTER IN CASE WE NEED IT AGAIN
Original Source Code Comment: DISPLAY THE TEXT
Original Source Code Comment: SCRATCH PAD AREA
Original Source Code Comment: SET FOR 1 CHAR
Original Source Code Comment: KEYBOARD HANDLER
Original Source Code Comment: RET IF BREAK KEY HIT
Original Source Code Comment: GET THE COUNT
Original Source Code Comment: ANY ANSWER?
Original Source Code Comment: YES, EXIT
Original Source Code Comment: HL => 'INVALID REPLY' MSG
Original Source Code Comment: DISPLAY IT
Original Source Code Comment: PICK UP THE ORIGINAL MESSAGE
Original Source Code Comment: AND DO IT AGAIN
53EDH - EXST - Existing File: Use It (Y/N/Q)?
Original Source Code Comment: HL => EXISTING FILE MSG
Original Source Code Comment: DISPLAY IT
Original Source Code Comment: PLACE TO STORE THE ANSWER
Original Source Code Comment: SET FOR 3 CHARS
Original Source Code Comment: GET THE ANSWER
Original Source Code Comment: EXIT TO DOS IF BREAK KEY
Original Source Code Comment: PICK UP THE 1ST LETTER
Original Source Code Comment: QUIT?
Original Source Code Comment: EXIT TO DOS
Original Source Code Comment: NO?
540DH - SETFLG - Ask for the Password of a File
Original Source Code Comment: SAVE REGISTERS
Original Source Code Comment: CLEAR THE 'MOVE' FLAG
Original Source Code Comment: HL => 'PASSWORD FOR' MSG
Original Source Code Comment: HL => FILENAME TO DISPLAY
Original Source Code Comment: HL => '? ' MSG
Original Source Code Comment: SCRATCH PAD BUFFER
Original Source Code Comment: SET FOR 8 CHARS
Original Source Code Comment: GET THE ANSWER
Original Source Code Comment: EXIT IF BREAK KEY
Original Source Code Comment: ANY ANSWER GIVEN?
Original Source Code Comment: NO, EXIT
Original Source Code Comment: GET THE COUNT
Original Source Code Comment: SAVE THE CHAR COUNT
Original Source Code Comment: AND EXIT
Original Source Code Comment: MAKE 'NZ' AND SET CARRY
Original Source Code Comment: GET DE BACK
5442H - CKPASS - Compare the Password Typed with the Update Password
Original Source Code Comment: WHERE THE ANSWER IS STORED
Original Source Code Comment: GET THE COUNT
Original Source Code Comment: INTO B
Original Source Code Comment: DO A TRAP DOOR ON IT
Original Source Code Comment: GET THE SAVED ONE
Original Source Code Comment: SEE IF MATCH
Original Source Code Comment: YES, WAS MATCH
Original Source Code Comment: SET THE CARRY FLAG
Original Source Code Comment: CLEAR THE CARRY FLAG
5462H - CKDRIV - Check an ASCII Drive Number
Original Source Code Comment: MASK OFF ASCII
Original Source Code Comment: ERROR, EXIT
Original Source Code Comment: SAVE THE DRIVE NUMBER
Original Source Code Comment: GET THE MAX DRIVE IN SYSTEM
Original Source Code Comment: GREATER THAN WHAT YOU OWN?
Original Source Code Comment: YES, EXIT
Original Source Code Comment: SET 'Z'
Original Source Code Comment: GET THE BINARY DRIVE BACK
Original Source Code Comment: EXIT
Original Source Code Comment: BAD DRIVE NUMBER
Original Source Code Comment: SET 'NZ'
Original Source Code Comment: EXIT
Original Source Code Comment: DRIVE NOT IN SYSTEM
Original Source Code Comment: SET 'NZ'
5478H - RWLOOP - Copy the File Byte by Byte
Original Source Code Comment: GET THE READ DCB
Original Source Code Comment: READ A BYTE
Original Source Code Comment: GOOD READ
Original Source Code Comment: SAVE THE ERROR CODE
Original Source Code Comment: MASK A 29 TO A 28
Original Source Code Comment: END OF FILE?
Original Source Code Comment: YES, EXIT
Original Source Code Comment: GET THE ERROR CODE BACK
Original Source Code Comment: AND EXIT
Original Source Code Comment: GET THE WRITE DCB
Original Source Code Comment: WRITE IT OUT
Original Source Code Comment: LOOP IF GOOD WRITE
Original Source Code Comment: ELSE EXIT
5495H - GETFIL - Find the Next File in the HIT of the Source Diskette
Original Source Code Comment: SAVE REGISTERS
Original Source Code Comment: GET THE FILE POINTER
Original Source Code Comment: ANY HASH CODE HERE?
Original Source Code Comment: YES, PICK UP THE VALUES
Original Source Code Comment: BUMP THE FILE POINTERS
Original Source Code Comment: GET THE FILE COUNT
Original Source Code Comment: WE DONE?
Original Source Code Comment: YES, EXIT
Original Source Code Comment: GET THE NEXT FILE
Original Source Code Comment: SET THE CARRY. END OF FILES
Original Source Code Comment: GET THE LFN COUNTER
Original Source Code Comment: INTO B
Original Source Code Comment: GET THE SOURCE DRIVE
Original Source Code Comment: INTO C
Original Source Code Comment: READ IN THE DIR RECORD FOR THIS GUY
Original Source Code Comment: EXIT IF ERROR
Original Source Code Comment: GET THE ATTRIB BYTE
Original Source Code Comment: IF NO FILE, WILL SET THIS BIT
Original Source Code Comment: FREE/EXTENDED/INVISIBLE/SYSTEM FILE?
Original Source Code Comment: YES, SKIP IT
Original Source Code Comment: RESTORE THE REGISTERS
54C5H - BMPFIL - Move to the Next HIT Entry
Original Source Code Comment: GET THE FILE POINTER
Original Source Code Comment: NUMBER OF BYTES TO BUMP
Original Source Code Comment: BUMP THE POINTER
Original Source Code Comment: BACK INTO L
Original Source Code Comment: NO WRAP AROUND. COUNTINE
Original Source Code Comment: BUMP TO NEXT RWO
Original Source Code Comment: SAVE IT
Original Source Code Comment: GET THE LFN COUNTER
Original Source Code Comment: BUMP TO NEXT LFN SLOT
Original Source Code Comment: MASK FOR MAX VALUE
Original Source Code Comment: DID WE WRAP AROUND?
Original Source Code Comment: NO, CONTINUE
Original Source Code Comment: YES, BUMP THE COUNTER
Original Source Code Comment: SAVE THE LFN COUNTER
Original Source Code Comment: GET THE FILE COUNTER
Original Source Code Comment: SUBTRACT THE ONE WE JUST DID
Original Source Code Comment: SAVE IT FOR NEXT TIME
Original Source Code Comment: DONE
54E9H - PROCES - Convert One File
Original Source Code Comment: SEE IF 'ACC' PROTECTED
Original Source Code Comment: YES, EXIT AND DO NEXT FILE
Original Source Code Comment: SAVE THE POINTER TO THE DIRECTORY ENTRY
Original Source Code Comment: SAVE THE 'Z' 'NZ' FLAGS
Original Source Code Comment: COMPRESS THE FILESPEC
Original Source Code Comment: COPY THE NAMES TO THE READ/WRITE DCB'S
Original Source Code Comment: GET THE FLAGS BACK
Original Source Code Comment: NO PASSWORD. CONTINUE
A file with an update password: the password is asked for, or ENTER copies the file without it.
Original Source Code Comment: PROMPT FOR THE PASSWORD
Original Source Code Comment: USER HIT ENTER KEY. CONTINUE
Original Source Code Comment: SEE IF VALID PASSWORD
Original Source Code Comment: NO, DO IT AGAIN
Original Source Code Comment: SET THE PASSWORD
Original Source Code Comment: DISPLAY THE FILE NAME
Original Source Code Comment: SET THE DRIVE NUMBERS INTO DCB'S
Original Source Code Comment: HL => READ DISK BUFFER
Original Source Code Comment: DE => READ DCB
Original Source Code Comment: SET FOR LRL OF 0
Original Source Code Comment: DO THE READ OPEN
Original Source Code Comment: EXIT IF ERROR
Original Source Code Comment: GET THE SOURCE LRL
Original Source Code Comment: SET THE DESTINATION FOR SAME
Original Source Code Comment: HL => WRITE DISK BUFFER
Original Source Code Comment: WRITE DCB
Original Source Code Comment: SET FOR LRL OF 256
Original Source Code Comment: OPEN THE FILE ON MODEL 3
Original Source Code Comment: EXIT IF ERROR
Original Source Code Comment: IS A NEW FILE. CONTINUE
Original Source Code Comment: IS EXISTING. PROMPT FOR IT
Original Source Code Comment: NO, BUMP TO NEXT FILE
Original Source Code Comment: DO THE READ/WRITE
Original Source Code Comment: NEW LINE
Original Source Code Comment: OUT TO THE VIDEO
Original Source Code Comment: BUMP THE POINTERS TO THE NEXT FILE
Original Source Code Comment: DO WE HAVE TO TRANSFER THE PASSWORD?
Original Source Code Comment: YES, DO IT
Original Source Code Comment: NO, CLOSE THE FILE
Original Source Code Comment: EXIT IF ERROR
Original Source Code Comment: ELSE RETURN
5555H - PROCE4 - Put the Update Password and the Attributes into the New Directory Record
Only ENTER was pressed for the password: the update password code and the attribute byte of the source record go into the new directory record.
Original Source Code Comment: POINTER TO DIR SAVED HERE
Original Source Code Comment: GET THE ATTRIB BYTE
Original Source Code Comment: SAVE IT ON THE STACK
Original Source Code Comment: GET THE SAVED UPDATE PW
Original Source Code Comment: BLANKS?
Original Source Code Comment: NO, CONTINUE
Original Source Code Comment: YES, CHANGE TO 'NEW' BLANKS
Original Source Code Comment: SAVE IT ON THE STACK
Original Source Code Comment: GET THE MODEL 3 LFN
Original Source Code Comment: INTO B
Original Source Code Comment: GET THE MODEL 3 DRIVE NUMBER
Original Source Code Comment: INTO C
Original Source Code Comment: SAVE IT FOR A DIRECTORY WRITE
Original Source Code Comment: GET HL POINTING TO THE DIR ENTRY
Original Source Code Comment: DE => FILE
Original Source Code Comment: OFFSET TO THE PASSWORD
Original Source Code Comment: HL => PASSWORD
Original Source Code Comment: GET THE TRAP DOOR CODE BACK
Original Source Code Comment: SET IT
Original Source Code Comment: GET THE ATTRIB BYTE BACK
Original Source Code Comment: SET IT IN THE ATTRIB SLOT
Original Source Code Comment: LFN AND DRIVE NUMBER SAVED HERE
Original Source Code Comment: WRITE OUT THE MODIFIED DIRECTORY
Original Source Code Comment: EXIT IF ERROR
Original Source Code Comment: CLOSE THE WRITE FILE
5592H - PROCE6 / PROCE7 - NOT Converted (Protected File); the Next File
Original Source Code Comment: COMPRESS THE NAME
Original Source Code Comment: DISPLAY THE NAME
Original Source Code Comment: HL => 'SKIPPED' MSG
Original Source Code Comment: BUMP TO NEXT FILE
Original Source Code Comment: AND EXIT
55A2H - DUMMY / DRIVE / TRK / SEC / DIRTK - Variables of the Source Diskette Routines (M1M3READ)
Original Source Code Comment: DUMMY BUFFER FOR READ TRACK ADDRESS
Original Source Code Comment: CURRENT DRIVE IN USE
Original Source Code Comment: CURRENT TRACK IN USE
Original Source Code Comment: CURRENT SECTOR IN USE
Original Source Code Comment: DIRECTORY TRACK FOR DRIVE 1
Original Source Code Comment: " " " " 2
Original Source Code Comment: " " " " 3
Original Source Code Comment: " " " " 4
55B2H - CSEL / CSELCT - Select the Drive in Single Density
Original Source Code Comment: GET THE DRIVE NUMBER
Original Source Code Comment: MAKE IT A BIT PATTERN
Original Source Code Comment: GET THE DRIVE BIT PATTERN
Original Source Code Comment: INSURE SINGLE DENSITY
Original Source Code Comment: OUT TO THE SELECT LATCH
Original Source Code Comment: EXIT
55C1H - SPEEK - Seek a Track of the Source Diskette
The FDC is told which track the head is on by reading an ID field first, then it seeks.
Original Source Code Comment: GET THE DRIVE NUMBER
Original Source Code Comment: MAKE IT A BIT PATTERN
Original Source Code Comment: INSURE SINGLE DENSITY
Original Source Code Comment: SAVE IT
Original Source Code Comment: GET THE TRACK NUMBER
Original Source Code Comment: SAVE IT FOR LATER
Original Source Code Comment: GET THE FDC STATUS
Original Source Code Comment: MOTOR ON?
Original Source Code Comment: YES, DO THE SEEK
Original Source Code Comment: SELECT THE DRIVE
Original Source Code Comment: INTERRUPT THE DISK
Original Source Code Comment: AND DELAY FOR MOTOR SPEED
Original Source Code Comment: WILL FOR FDC
Original Source Code Comment: B=0, C=FDC DATA PORT
Original Source Code Comment: RESELECT THE DRIVE
Original Source Code Comment: KEEP A COPY OF IT
Original Source Code Comment: INSURE INTERRUPTS OFF
Original Source Code Comment: DATA REQUEST MASK
Original Source Code Comment: HL => DUMMY BUFFER AREA
Original Source Code Comment: READ TRACK ADDRESS COMMAND
Original Source Code Comment: DO THE READ
Original Source Code Comment: GET THE TRACK ADDRESS
Original Source Code Comment: DESIRED TRACK SAVED HERE
Original Source Code Comment: TELL FDC WHERE WE ARE
Original Source Code Comment: GET THE DESIRED TRACK
Original Source Code Comment: OUTPUT TO THE FDC
Original Source Code Comment: THE SEEK COMMAND
Original Source Code Comment: ISSUE THE COMMAND
5607H - CKBSY - Wait until the FDC Is Not Busy
Original Source Code Comment: 'SDELY'
Original Source Code Comment: GET FDC STATUS
Original Source Code Comment: BUSY?
Original Source Code Comment: NO, RETURN
Original Source Code Comment: KEEP THE DRIVE GOING
Original Source Code Comment: AND CONTINUE LOOKING
5614H - DELLU / DELLZ / SDELY / SDELAZ - Delays
5621H - READT / OUTRED - Read a Sector (or an ID Field) by Polling the FDC
Original Source Code Comment: B=0, C=FDC DATA PORT
Original Source Code Comment: SELECT THE DRIVE
Original Source Code Comment: SAVE COPY OF IT
Original Source Code Comment: INSURE INTERRUPTS OFF
Original Source Code Comment: DATA REQUEST MASK
Original Source Code Comment: SAVE BUFFER POINTER
Original Source Code Comment: READ COMMAND
Original Source Code Comment: TO THE FDC
Original Source Code Comment: 'SDELY'
Original Source Code Comment: GET THE DRIVE NUMBER
Original Source Code Comment: KEEP SELECTING IT
Original Source Code Comment: GET THE FDC STATUS
Original Source Code Comment: FDC DRQ?
Original Source Code Comment: READ THE BYTE
Original Source Code Comment: READ ALL BYTES
The sector buffer is full.
Original Source Code Comment: IS FDC BUSY
Original Source Code Comment: RETRY AS LONG AS FDC BUSY
5653H - MREAD - Read a Sector of the Source Diskette, 9 Tries
Original Source Code Comment: SAVE BUFFER POINTER
Original Source Code Comment: SELECT THE DRIVE
Original Source Code Comment: INTERRUPT THE FDC
Original Source Code Comment: SELECT THE DRIVE
Original Source Code Comment: SET FOR 9 RETRIES
Original Source Code Comment: SAVE RETRY COUNT
Original Source Code Comment: SAVE TRACK SECTOR
Original Source Code Comment: SAVE BUFFER POINTER
Original Source Code Comment: GET BUFFER POINTER BACK
Original Source Code Comment: SEEK OR CRC ERROR?
Original Source Code Comment: YES, DO A RETRY
Original Source Code Comment: GET THE SECTOR NUMBER
Original Source Code Comment: OUTPUT TO THE SECTOR REGISTER
Original Source Code Comment: READ IT IN
Original Source Code Comment: ANY ERROR?
Original Source Code Comment: SAVE THE FLAGS
Original Source Code Comment: TERMINATE THE OPERATION
Original Source Code Comment: GET THE FLAGS BACK
Original Source Code Comment: YES, DO A RETRY
Original Source Code Comment: CRC ERROR CODE
Original Source Code Comment: CRC ERROR?
Original Source Code Comment: YES, EXIT
Original Source Code Comment: ASSUME SEEK ERROR
Original Source Code Comment: GET THE ERROR CODE
Original Source Code Comment: SET 'NZ'
56B2H - READ0 - Read a Record
READ0 is not called by any instruction of CONVERT.
Original Source Code Comment: SAVE THE USERS REGISTERS
Original Source Code Comment: LRL OF 256?
Original Source Code Comment: YES, GO READ
Original Source Code Comment: GET THE LRL
Original Source Code Comment: SAVE BUFFER POINTER
Original Source Code Comment: SAVE LRL
Original Source Code Comment: READ A BYTE FROM DISK
Original Source Code Comment: RET IF ERROR
Original Source Code Comment: PUT IT INTO THE BUFFER
Original Source Code Comment: BUMP POINTER TO NEXT LOC
Original Source Code Comment: CONTINUE FOR COUNT
56CBH - RDREC / RDSEC - Read the Next Sector of a File into its Buffer
Original Source Code Comment: GET THE RECORD NUMBER
Original Source Code Comment: EXIT IF NOT IN RANGE
Original Source Code Comment: GET PHYSICAL DISK ADDRESS
Original Source Code Comment: EXIT IF ERROR
Original Source Code Comment: SHOW RECORD HAS BEEN READ
Original Source Code Comment: GET THE BUFFER ADDRESS IN HL
Original Source Code Comment: GO READ SECTOR INTO BUFFER
56E0H - READBT / RBYTE - Read the Next Byte of a File
Original Source Code Comment: ASSUME LRL OF 256
Original Source Code Comment: DO WE NEED TO READ NEXT RECORD?
Original Source Code Comment: NOPE, IT'S OKAY
Original Source Code Comment: YES, READ NEXT RECORD TO BUFFER
Original Source Code Comment: EXIT IF ERROR
Original Source Code Comment: SEE IF RECORD IN IN RANGE
Original Source Code Comment: EXIT IF SO
Original Source Code Comment: CALCULATE BUFFER ADDRESS
Original Source Code Comment: SET Z FOR GOOD RETURN
Original Source Code Comment: GET A CHARACTER
Original Source Code Comment: SAVE CHAR AND FLAGS
Original Source Code Comment: INCREMENT BYTE POINTER
Original Source Code Comment: EXIT IF NO WRAP AROUND
Original Source Code Comment: SHOW NEXT REC NEEDS TO BE READ
Original Source Code Comment: BUMP TO NEXT RECORD NUMBER
Original Source Code Comment: GET THE CHAR AND FLAGS
5709H - GETPA - Track and Sector of the Next Record from the Extents
Original Source Code Comment: SAVE CALLERS REGISTERS
Original Source Code Comment: GET THE NEXT RECORD NUMBER
Original Source Code Comment: MOVE DCB POINTER TO HL
Original Source Code Comment: HL => BEGIN OF EXTENTS
Original Source Code Comment: GET THE TRACK NUMBER
Original Source Code Comment: END OF EXTENTS?
Original Source Code Comment: YES, OUT OF RANGE
Original Source Code Comment: BUMP TO GRAN POINTER
Original Source Code Comment: GET EXTENT POINTER
Original Source Code Comment: MASK OFF STARTING GRAN
Original Source Code Comment: CORRECT FOR 1'S OFFSET
Original Source Code Comment: SAVE FOR NOW
Original Source Code Comment: MULT A * 5
Original Source Code Comment: E=#SECTORS IN EXTENT
Original Source Code Comment: DE = # SECTORS IN EXTENT
Original Source Code Comment: HL = DESIRED SECTOR OFFSET
Original Source Code Comment: SUBTRACT DESIRED - # IN THIS EXTENT
Original Source Code Comment: THIS IS THE EXTENT
Original Source Code Comment: THROW AWAY PREV DESIRED SECTOR OFFSET
Original Source Code Comment: PUT IN NEW ONE
Original Source Code Comment: GET IT BACK INTO BC
Original Source Code Comment: HL =>THIS EXTENTS 2ND BYTE
Original Source Code Comment: HL =>NEXT EXTENTS 1ST BYTE
Original Source Code Comment: RESTORE CALLERS REGISTERS
Original Source Code Comment: RECORD OUT OF RANGE
Original Source Code Comment: SET 'NZ'
Original Source Code Comment: DE = TOTAL SECTOR OFFSET
Original Source Code Comment: HL => 2ND BYTE OF THIS EXTENT
Original Source Code Comment: GET STARING GRAN NUMBER
Original Source Code Comment: MASK OFF NUMBER OF GRANS
Original Source Code Comment: GET IT TO BITS 0-2
Original Source Code Comment: SAVE DCB EXTENT POINTER
Original Source Code Comment: MULT START GRAN# * 5 = STARTING SECTOR NUM
Original Source Code Comment: HL = STARTING SECTOR NUMBER
Original Source Code Comment: ADD TO GET TOTL SECR OFFSET
Original Source Code Comment: NUMBER OF SECTORS IN A TRACK
Original Source Code Comment: SAVE IT
Original Source Code Comment: DE => 1ST BYTE OF TRACK FOR THIS EXTENT
Original Source Code Comment: GET THE TRACK NUMBER
Original Source Code Comment: ADD IN THE OFFSET
Original Source Code Comment: PUT IT INTO D
Original Source Code Comment: GET THE SECTOR NUMBER
Original Source Code Comment: THIS IS THE DE VALUE
Original Source Code Comment: GET THE DRIVE NUMBER
Original Source Code Comment: INTO C
Original Source Code Comment: GOOD RETURN
5764H - MB5 - Multiply A by 5
Original Source Code Comment: SAVE BC
Original Source Code Comment: SAVE A COPY OF NUMBER IN B
Original Source Code Comment: TIMES 2
Original Source Code Comment: TIMES 4
Original Source Code Comment: TIMES 5
Original Source Code Comment: GET BC BACK
576BH - DIRED - Read the Directory Record of a File
5780H - REDGAT - Read the GAT of the Source Diskette
5792H - LFDIR - Track, Sector and Buffer Place of a Directory Record
Original Source Code Comment: SET FOR DIRECTORY TRACK
Original Source Code Comment: GET THE LFN
Original Source Code Comment: MASK FOR SECTOR NUMBER
Original Source Code Comment: DIR STARTS ON SECTOR 2
Original Source Code Comment: INTO E
Original Source Code Comment: MSB OF BUFFER
Original Source Code Comment: GET THE LSB OF THE FILE POINTER
Original Source Code Comment: MASK OFF SECTOR OFFSET
Original Source Code Comment: INTO HL
Original Source Code Comment: SET GOOD RETURN
57A4H - TRKGT - The Directory Track of a Drive
Original Source Code Comment: SAVE B
Original Source Code Comment: HL => DIRECTORY TRACK TABLE
Original Source Code Comment: HL => THIS DRIVE'S DIR TRK
Original Source Code Comment: GET B BACK
Original Source Code Comment: GET THE DIRECTORY TRACK
57AEH - ROPEN - Open a File of the Source Diskette
Original Source Code Comment: SAVE THE LRL
Original Source Code Comment: SAVE THE BUFF ADDRESS
Original Source Code Comment: HL=> FILE NAME
Original Source Code Comment: CRACK OPEN FILE SPEC
Original Source Code Comment: ILLEGAL SPEC
Original Source Code Comment: GENERATE A HASH CODE
Original Source Code Comment: AND SAVE IT
Original Source Code Comment: DE=> PASSWORD STRING
Original Source Code Comment: CALCULATE TRAP DOOR CODE
Original Source Code Comment: SET THE UPDATE TDC
Original Source Code Comment: SET THE ACCESS TDC
Original Source Code Comment: C = REQUESTED DRIVE NUM
Original Source Code Comment: JUMP IF A DRIVE SUPPLIED
Original Source Code Comment: GLOBAL, START WITH 0
Original Source Code Comment: SEE IF THE DRIVE EXISTS
Original Source Code Comment: READ IN THE HASH TABLE
Original Source Code Comment: RETURN IF ERROR
Original Source Code Comment: PICK UP NEXT HIT CODE
Original Source Code Comment: JUMP IF NO HIT CODE
Original Source Code Comment: VALID HASH,CHECK NAME
57F0H - OPNODR / OPNONE / OPERR0 - Not Found on this Drive; the Errors
Original Source Code Comment: CHECK NEXT DIRVE
Original Source Code Comment: FILE NOT IN DIR
Original Source Code Comment: SET FOR DRIVE 0
Original Source Code Comment: PUT US BACK ON 0
OPERR1 is not reached by any instruction of CONVERT.
Original Source Code Comment: DRIVE NOT IN SYSTEM
580AH - OPEN6 - Not this Record: the Next HIT Entry
Original Source Code Comment: B = LEN
Original Source Code Comment: HL=> DIR
Original Source Code Comment: C = DRIVE, B = HASH
Original Source Code Comment: HL => DIT
5810H - OPEN4 / OPEN4A - The Hash Code Matches: Compare the Name
Original Source Code Comment: HL => HIT
Original Source Code Comment: C = DRIVE
Original Source Code Comment: B = LFN
Original Source Code Comment: READ IN DIR RECORD
Original Source Code Comment: HL => DIR
Original Source Code Comment: SAVE THE LFN
Original Source Code Comment: JUMP IF LINKED ENTRY
Original Source Code Comment: HL => DIR+5
Original Source Code Comment: DE => NAME AND EXT
Original Source Code Comment: VERIFY FILE NAME & EXT
Original Source Code Comment: JP IF NOT SAME
Original Source Code Comment: VERIFY ENTIRE NAM/EXT
Original Source Code Comment: SAVE DRIVE NUMBER
Original Source Code Comment: HL => DIR
Original Source Code Comment: IGNORE THE SAVED DRV #
Original Source Code Comment: IGNORE HIT POINTER
Original Source Code Comment: SAVE PRIVILEDGE LEVEL
583EH - SETDCB - Fill the DCB from the Directory Record
Original Source Code Comment: DE = DIR
Original Source Code Comment: HL = DCB
Original Source Code Comment: 'FILE'
Original Source Code Comment: JP IF NOT BLOCKED ACCESS
Original Source Code Comment: SET BLOCKED
Original Source Code Comment: SET POSN
Original Source Code Comment: SAVE THE ACCESS MODE
Original Source Code Comment: RESERVED
Original Source Code Comment: BLOCK BUFF (LSB)
Original Source Code Comment: BLOCK BUFF (MSB)
Original Source Code Comment: BYTE ADDRESS
Original Source Code Comment: DRIVE
Original Source Code Comment: GET THE DRIVE NUMBER
Original Source Code Comment: SAVE IT
Original Source Code Comment: LFN
Original Source Code Comment: DE = DIR +3
Original Source Code Comment: EOF BYTE
Original Source Code Comment: GET THE DIRECTORY LRL
Original Source Code Comment: LRL
Original Source Code Comment: NRN (LSB)
Original Source Code Comment: NRN (MSB)
Original Source Code Comment: DE = DIR + 20
Original Source Code Comment: HL = DIR POINTER
Original Source Code Comment: GET THE ERN
The ending record number is corrected unless the diskette has the version byte 24H.
Original Source Code Comment: WILL BE 'Z' IF VERSION 2.4
Original Source Code Comment: IS IT 2.4?
Original Source Code Comment: YES. DON'T BUMP THE ERN
Original Source Code Comment: NULL FILE?
Original Source Code Comment: YES. EXIT
Original Source Code Comment: GET THE EOF BYTE
Original Source Code Comment: EOF OF ZERO?
Original Source Code Comment: YES. DON'T DEC THE ERN
Original Source Code Comment: BUMP THE ERN TO CORRECT FOR 2.3 AND EARLIER
Original Source Code Comment: HL = DCB POINTER
Original Source Code Comment: STORE THE ERN IN THE DCB
Original Source Code Comment: DE = DIR + 22
Original Source Code Comment: NUMBER OF BYTES IN EXTENTS
Original Source Code Comment: MOVE THEM TO THE DCB
Original Source Code Comment: BACK UP TO LAST EXTENT
Original Source Code Comment: GET THE TRACK NUMBER
Original Source Code Comment: EXTENDED DIRECTORY?
Original Source Code Comment: YES, MOVE IN THE LINKED EXTENTS
Original Source Code Comment: NO, SET 'GOOD' RETURN
Original Source Code Comment: CLEAR PRIVLEDGE
Original Source Code Comment: AND LRL
58AFH - DOLINK - The Extents of the Extended Directory Record
Original Source Code Comment: BACK UP OVER LAST POINTER
Original Source Code Comment: SAVE THE POINTER
Original Source Code Comment: BUMP TO EXTEND EXT POINTER
Original Source Code Comment: GET IT
Original Source Code Comment: SAVE THE OFFSET VALUES
Original Source Code Comment: MASK FOR JUST SECTOR NUMBER
Original Source Code Comment: CORRECT WITH SECTOR OFFSET
Original Source Code Comment: INTO E FOR SECTOR
Original Source Code Comment: DRIVE SAVED HERE
Original Source Code Comment: GET THE DIR TRACK NUMBER
Original Source Code Comment: HL => BUFFER
Original Source Code Comment: READ IN THE EXTED DIR REC
Original Source Code Comment: EXIT IF ERROR
Original Source Code Comment: OFFSET SAVED HERE
Original Source Code Comment: SHIFT IT TO LSB
Original Source Code Comment: GET JUST THE OFFSET
Original Source Code Comment: WE DONE?
Original Source Code Comment: YES, FOUND IT
Original Source Code Comment: SIZE OF A DIRECTORY RECORD
Original Source Code Comment: DEC THE COUNTER
Original Source Code Comment: LOOP TILL FOUND
Original Source Code Comment: OFFSET TO BEG OF EXT POINTERS
Original Source Code Comment: HL => EXTENTS
Original Source Code Comment: DCB POINTER SAVED HERE
Original Source Code Comment: DO MORE EXTENTS
58E6H - CRACK - Split a File Spec into Name, Extension, Password and Drive
Original Source Code Comment: INITIALIZE NAME & EXT
Original Source Code Comment: INITIALIZE PASSWORD
Original Source Code Comment: ASSUME GLOBAL DRV SEARCH
Original Source Code Comment: GET THE NAME FIELD
Original Source Code Comment: SAVE TERMINATING CHAR
Original Source Code Comment: JP IF NAME FIELD SUPPLIED
Original Source Code Comment: ILLEGAL FILE NAME
Original Source Code Comment: A = NAME FIELD TERMINATOR
Original Source Code Comment: JP IF NOT EXTENSION
Original Source Code Comment: GET FILE'S EXTENSION
Original Source Code Comment: JP IF NOT PASSWORD
Original Source Code Comment: GET FILE'S PASSWORD
Original Source Code Comment: JP IF NOT DRIVE SPEC
Original Source Code Comment: GET THE DRIVE IN ASCII
Original Source Code Comment: CONVERT TO HEX
Original Source Code Comment: ILLEGAL
Original Source Code Comment: GREATER THAN MAX
Original Source Code Comment: RESTORE A
Original Source Code Comment: DRIVE NOT IN SYSTEM
Original Source Code Comment: REPORT IT!
5944H - GETFLD - Copy One Field of a File Spec
Original Source Code Comment: GET 1ST CHAR IN STRING
Original Source Code Comment: 1ST CHAR MUST BE ALPHA
Original Source Code Comment: GET NEXT CHAR
Original Source Code Comment: RET IF CONTROL CHAR
Original Source Code Comment: JP IF NUMERIC
Original Source Code Comment: RET IF SPECIAL CHAR
Original Source Code Comment: RETURN IF NOT ALPHA
Original Source Code Comment: MOVE FIELD
595EH - HASH - The Hash Code of NAME and EXT
Original Source Code Comment: GET NEXT CHAR
Original Source Code Comment: ACCUMULATE HASH CODE
Original Source Code Comment: CONTINUE THROUGH NAME
Original Source Code Comment: REFETCH HASH CODE
Original Source Code Comment: FORCE NON-ZERO
596EH - TRAP / SETTDC - The Hash Code of a Password
Original Source Code Comment: DE => FILENAME
59AAH - CKHDRV - Is the Drive There? (Index Pulses)
Original Source Code Comment: FORCE CLEAR FDC
Original Source Code Comment: SELECT DRIVE
Original Source Code Comment: START WITH NO INDEX
Original Source Code Comment: WAIT FOR INDEX
Original Source Code Comment: WAIT FOR INDEX TO PASS
Original Source Code Comment: SET C FLAG IF WRITE PROT
59CAH - CHKINX - Read the Index Bit, with a Time Out
Original Source Code Comment: DRIVE DOESN'T EXIST
Original Source Code Comment: CHECK INDEX STATUS BIT
Original Source Code Comment: IGNORE CHKINX CALLER
Original Source Code Comment: RESTORE BC
Original Source Code Comment: CLEAR Z FLAG
59D9H - RDHITT - Read the HIT of the Source Diskette
Original Source Code Comment: HIT TABLE BUFFER
Original Source Code Comment: SAVE THE POINTER
Original Source Code Comment: READ IN THE HIT
Original Source Code Comment: GET THE BUFFER POINTER BACK
Original Source Code Comment: ERROR CODE
59EEH - DRV / PWORD / NAME / EXT / UPDTDC / ACCTDC - Variables of the File Spec
Original Source Code Comment: REQUESTED DRIVE NUM
Original Source Code Comment: PASSWORD FIELD
Original Source Code Comment: FILE NAME
Original Source Code Comment: FILE EXTENSION
Original Source Code Comment: UPDATE PASS TDC
Original Source Code Comment: ACCESS PASS TDC
5A06H - Messages
5AFFH - Variables and Buffers (not in the file)
Original Source Code Comment: SOURCE DRIVE (BINARY)
Original Source Code Comment: DESTINATION DRIVE (BINARY)
Original Source Code Comment: FLAG TO SHOW 'ENTER' FOR PASSWORD
Original Source Code Comment: POINTER TO HIT TABLE
Original Source Code Comment: NUMBER OF FILES LEFT TO LOOK AT
Original Source Code Comment: LFN COUNTER
Original Source Code Comment: CHAR COUNT OF PW ENTERED
Original Source Code Comment: USER SUPPLIED PW (TRAP DOOR CODE) HERE
Original Source Code Comment: SCRATCH PAD FOR FILE NAME
Original Source Code Comment: SCRATCH PAD KEYBOARD BUFFER
Original Source Code Comment: READ DCB
Original Source Code Comment: WRITE DCB
Original Source Code Comment: READ DISK BUFFER
Original Source Code Comment: WRITE DISK BUFFER
Original Source Code Comment: HASH CODE TABLE BUFFER
Original Source Code Comment: MODEL 1 INTERNAL DISK BUFFER