;************************************************************** ;* ;* C P / M version 2 . 2 ;* ;* Reverse Assembly of system image for MAI "portable" ;* ;* by rzh (comments and structure lifted from CP/M source) ;* ;************************************************************** ; ; Set memory limit here. This is the amount of contiguous ; ram starting from 0000. CP/M will reside at the end of this space. ; IOBYTE EQU 3 ;i/o definition byte. TDRIVE EQU 4 ;current drive name and user number. ENTRY EQU 5 ;entry point for the cp/m bdos. TFCB EQU 5CH ;default file control block. TBUFF EQU 80H ;i/o buffer and command line storage. TBASE EQU 100H ;transiant program storage area. ; ; Set control character equates. ; CNTRLC EQU 3 ;control-c CNTRLE EQU 05H ;control-e BS EQU 08H ;backspace TAB EQU 09H ;tab LF EQU 0AH ;line feed FF EQU 0CH ;form feed CR EQU 0DH ;carriage return CNTRLP EQU 10H ;control-p CNTRLR EQU 12H ;control-r CNTRLS EQU 13H ;control-s CNTRLU EQU 15H ;control-u CNTRLX EQU 18H ;control-x CNTRLZ EQU 1AH ;control-z (end-of-file mark) DEL EQU 7FH ;rubout ; ; Set origin for CP/M ; ORG 0CD00H ; CBASE: JP COMMAND ;execute command processor (ccp). JP CLEARBUF ;entry to empty input buffer before starting ccp. ; ; Standard cp/m ccp input buffer. Format is (max length), ; (actual length), (char #1), (char #2), (char #3), etc. ; INBUFF: DB 127 ;length of input buffer. DB 0 ;current length of contents. DB ' ' DB 'COPYRIGHT (C) 1979,' DB ' DIGITAL RESEARCH ' DB 0,0,0,0,0,0,0,0 DB 0,0,0,0,0,0,0,0 DB 0,0,0,0,0,0,0,0 DB 0,0,0,0,0,0,0,0 DB 0,0,0,0,0,0,0,0 DB 0,0,0,0,0,0,0,0 DB 0,0,0,0,0,0,0,0 DB 0,0,0,0,0,0,0,0 DB 0,0,0,0,0,0,0,0 DB 0,0 INPOINT: DEFW INBUFF+2 ;input line pointer NAMEPNT: DEFW 0 ;input line pointer used for error message. Points to ; ;start of name in error. ; ; Routine to print (A) on the console. All registers used. ; PRINT: LD E,A ;setup bdos call. LD C,2 JP ENTRY ; ; Routine to print (A) on the console and to save (BC). ; PRINTB: PUSH BC CALL PRINT POP BC RET ; ; Routine to send a carriage return, line feed combination ; to the console. ; CRLF: LD A,CR CALL PRINTB LD A,LF JP PRINTB ; ; Routine to send one space to the console and save (BC). ; SPACE: LD A,' ' JP PRINTB ; ; Routine to print character string pointed to be (BC) on the ; console. It must terminate with a null byte. ; PLINE: PUSH BC CALL CRLF POP HL PLINE2: LD A,(HL) OR A RET Z INC HL PUSH HL CALL PRINT POP HL JP PLINE2 ; ; Routine to reset the disk system. ; RESDSK: LD C,13 JP ENTRY ; ; Routine to select disk (A). ; DSKSEL: LD E,A LD C,14 JP ENTRY ; ; Routine to call bdos and save the return code. The zero ; flag is set on a return of 0ffh. ; ENTRY1: CALL ENTRY LD (RTNCODE),A ;save return code. INC A ;set zero if 0ffh returned. RET ; ; Routine to open a file. (DE) must point to the FCB. ; OPEN: LD C,15 JP ENTRY1 ; ; Routine to open file at (FCB). ; OPENFCB: XOR A ;clear the record number byte at fcb+32 LD (FCB+32),A LD DE,FCB JP OPEN ; ; Routine to close a file. (DE) points to FCB. ; CLOSE: LD C,16 JP ENTRY1 ; ; Routine to search for the first file with ambigueous name ; (DE). ; SRCHFST: LD C,17 JP ENTRY1 ; ; Search for the next ambiguous file name. ; SRCHNXT: LD C,18 JP ENTRY1 ; ; Search for file at (FCB). ; SRCHFCB: LD DE,FCB JP SRCHFST ; ; Routine to delete a file pointed to by (DE). ; DELETE: LD C,19 JP ENTRY ; ; Routine to call the bdos and set the zero flag if a zero ; status is returned. ; ENTRY2: CALL ENTRY OR A ;set zero flag if appropriate. RET ; ; Routine to read the next record from a sequential file. ; (DE) points to the FCB. ; RDREC: LD C,20 JP ENTRY2 ; ; Routine to read file at (FCB). ; READFCB: LD DE,FCB JP RDREC ; ; Routine to write the next record of a sequential file. ; (DE) points to the FCB. ; WRTREC: LD C,21 JP ENTRY2 ; ; Routine to create the file pointed to by (DE). ; CREATE: LD C,22 JP ENTRY1 ; ; Routine to rename the file pointed to by (DE). Note that ; the new name starts at (DE+16). ; RENAM: LD C,23 JP ENTRY ; ; Get the current user code. ; GETUSR: LD E,0FFH ; ; Routne to get or set the current user code. ; If (E) is FF then this is a GET, else it is a SET. ; GETSETUC: LD C,32 JP ENTRY ; ; Routine to set the current drive byte at (TDRIVE). ; SETCDRV: CALL GETUSR ;get user number ADD A,A ;and shift into the upper 4 bits. ADD A,A ADD A,A ADD A,A LD HL,CDRIVE ;now add in the current drive number. OR (HL) LD (TDRIVE),A ;and save. RET ; ; Move currently active drive down to (TDRIVE). ; MOVECD: LD A,(CDRIVE) LD (TDRIVE),A RET ; ; Routine to convert (A) into upper case ascii. Only letters ; are affected. ; UPPER: CP 'a' ;check for letters in the range of 'a' to 'z'. RET C CP '{' RET NC AND 5FH ;convert it if found. RET ; ; Routine to get a line of input. We must check to see if the ; user is in (BATCH) mode. If so, then read the input from file ; ($$$.SUB). At the end, reset to console input. ; GETINP: LD A,(BATCH) ;if =0, then use console input. OR A JP Z,GETINP1 ; ; Use the submit file ($$$.sub) which is prepared by a ; SUBMIT run. It must be on drive (A) and it will be deleted ; if and error occures (like eof). ; LD A,(CDRIVE) ;select drive 0 if need be. OR A LD A,0 ;always use drive A for submit. CALL NZ,DSKSEL ;select it if required. LD DE,BATCHFCB CALL OPEN ;look for it. JP Z,GETINP1 ;if not there, use normal input. LD A,(BATCHFCB+15) ;get last record number+1. DEC A LD (BATCHFCB+32),A LD DE,BATCHFCB CALL RDREC ;read last record. JP NZ,GETINP1 ;quit on end of file. ; ; Move this record into input buffer. ; LD DE,INBUFF+1 LD HL,TBUFF ;data was read into buffer here. LD B,128 ;all 128 characters may be used. CALL HL2DE ;(HL) to (DE), (B) bytes. LD HL,BATCHFCB+14 LD (HL),0 ;zero out the 's2' byte. INC HL ;and decrement the record count. DEC (HL) LD DE,BATCHFCB ;close the batch file now. CALL CLOSE JP Z,GETINP1 ;quit on an error. LD A,(CDRIVE) ;re-select previous drive if need be. OR A CALL NZ,DSKSEL ;don't do needless selects. ; ; Print line just read on console. ; LD HL,INBUFF+2 CALL PLINE2 CALL CHKCON ;check console, quit on a key. JP Z,GETINP2 ;jump if no key is pressed. ; ; Terminate the submit job on any keyboard input. Delete this ; file such that it is not re-started and jump to normal keyboard ; input section. ; CALL DELBATCH ;delete the batch file. JP CMMND1 ;and restart command input. ; ; Get here for normal keyboard input. Delete the submit file ; incase there was one. ; GETINP1: CALL DELBATCH ;delete file ($$$.sub). CALL SETCDRV ;reset active disk. LD C,10 ;get line from console device. LD DE,INBUFF CALL ENTRY CALL MOVECD ;reset current drive (again). ; ; Convert input line to upper case. ; GETINP2: LD HL,INBUFF+1 LD B,(HL) ;(B)=character counter. GETINP3: INC HL LD A,B ;end of the line? OR A JP Z,GETINP4 LD A,(HL) ;convert to upper case. CALL UPPER LD (HL),A DEC B ;adjust character count. JP GETINP3 GETINP4: LD (HL),A ;add trailing null. LD HL,INBUFF+2 LD (INPOINT),HL ;reset input line pointer. RET ; ; Routine to check the console for a key pressed. The zero ; flag is set is none, else the character is returned in (A). ; CHKCON: LD C,11 ;check console. CALL ENTRY OR A RET Z ;return if nothing. LD C,1 ;else get character. CALL ENTRY OR A ;clear zero flag and return. RET ; ; Routine to get the currently active drive number. ; GETDSK: LD C,25 JP ENTRY ; ; Set the stabdard dma address. ; STDDMA: LD DE,TBUFF ; ; Routine to set the dma address to (DE). ; DMASET: LD C,26 JP ENTRY ; ; Delete the batch file created by SUBMIT. ; DELBATCH: LD HL,BATCH ;is batch active? LD A,(HL) OR A RET Z LD (HL),0 ;yes, de-activate it. XOR A CALL DSKSEL ;select drive 0 for sure. LD DE,BATCHFCB ;and delete this file. CALL DELETE LD A,(CDRIVE) ;reset current drive. JP DSKSEL ; ; Check to two strings at (PATTRN1) and (PATTRN2). They must be ; the same or we halt.... ; VERIFY: LD DE,PATTRN1 ;these are the serial number bytes. LD HL,PATTRN2 ;ditto, but how could they be different? LD B,6 ;6 bytes each. VERIFY1: LD A,(DE) CP (HL) JP NZ,HALT ;jump to halt routine. INC DE INC HL DEC B JP NZ,VERIFY1 RET ; ; Print back file name with a '?' to indicate a syntax error. ; SYNERR: CALL CRLF ;end current line. LD HL,(NAMEPNT) ;this points to name in error. SYNERR1: LD A,(HL) ;print it until a space or null is found. CP ' ' JP Z,SYNERR2 OR A JP Z,SYNERR2 PUSH HL CALL PRINT POP HL INC HL JP SYNERR1 SYNERR2: LD A,'?' ;add trailing '?'. CALL PRINT CALL CRLF CALL DELBATCH ;delete any batch file. JP CMMND1 ;and restart from console input. ; ; Check character at (DE) for legal command input. Note that the ; zero flag is set if the character is a delimiter. ; CHECK: LD A,(DE) OR A RET Z CP ' ' ;control characters are not legal here. JP C,SYNERR RET Z ;check for valid delimiter. CP '=' RET Z CP '_' RET Z CP '.' RET Z CP ':' RET Z CP ';' RET Z CP '<' RET Z CP '>' RET Z RET ; ; Get the next non-blank character from (DE). ; NONBLANK: LD A,(DE) OR A ;string ends with a null. RET Z CP ' ' RET NZ INC DE JP NONBLANK ; ; Add (HL)=(HL)+(A) ; ADDHL: ADD A,L LD L,A RET NC ;take care of any carry. INC H RET ; ; Convert the first name in (FCB). ; CONVFST: LD A,0 ; ; Format a file name (convert * to '?', etc.). On return, ; (A)=0 is an unambigeous name was specified. Enter with (A) equal to ; the position within the fcb for the name (either 0 or 16). ; CONVERT: LD HL,FCB CALL ADDHL PUSH HL PUSH HL XOR A LD (CHGDRV),A ;initialize drive change flag. LD HL,(INPOINT) ;set (HL) as pointer into input line. EX DE,HL CALL NONBLANK ;get next non-blank character. EX DE,HL LD (NAMEPNT),HL ;save pointer here for any error message. EX DE,HL POP HL LD A,(DE) ;get first character. OR A JP Z,CONVRT1 SBC A,'A'-1 ;might be a drive name, convert to binary. LD B,A ;and save. INC DE ;check next character for a ':'. LD A,(DE) CP ':' JP Z,CONVRT2 DEC DE ;nope, move pointer back to the start of the line. CONVRT1: LD A,(CDRIVE) LD (HL),A JP CONVRT3 CONVRT2: LD A,B LD (CHGDRV),A ;set change in drives flag. LD (HL),B INC DE ; ; Convert the basic file name. ; CONVRT3: LD B,08H CONVRT4: CALL CHECK JP Z,CONVRT8 INC HL CP '*' ;note that an '*' will fill the remaining JP NZ,CONVRT5 ;field with '?'. LD (HL),'?' JP CONVRT6 CONVRT5: LD (HL),A INC DE CONVRT6: DEC B JP NZ,CONVRT4 CONVRT7: CALL CHECK ;get next delimiter. JP Z,GETEXT INC DE JP CONVRT7 CONVRT8: INC HL ;blank fill the file name. LD (HL),' ' DEC B JP NZ,CONVRT8 ; ; Get the extension and convert it. ; GETEXT: LD B,03H CP '.' JP NZ,GETEXT5 INC DE GETEXT1: CALL CHECK JP Z,GETEXT5 INC HL CP '*' JP NZ,GETEXT2 LD (HL),'?' JP GETEXT3 GETEXT2: LD (HL),A INC DE GETEXT3: DEC B JP NZ,GETEXT1 GETEXT4: CALL CHECK JP Z,GETEXT6 INC DE JP GETEXT4 GETEXT5: INC HL LD (HL),' ' DEC B JP NZ,GETEXT5 GETEXT6: LD B,3 GETEXT7: INC HL LD (HL),0 DEC B JP NZ,GETEXT7 EX DE,HL LD (INPOINT),HL ;save input line pointer. POP HL ; ; Check to see if this is an ambigeous file name specification. ; Set the (A) register to non zero if it is. ; LD BC,11 ;set name length. GETEXT8: INC HL LD A,(HL) CP '?' ;any question marks? JP NZ,GETEXT9 INC B ;count them. GETEXT9: DEC C JP NZ,GETEXT8 LD A,B OR A RET ; ; CP/M command table. Note commands can be either 3 or 4 characters long. ; NUMCMDS EQU 6 ;number of commands CMDTBL: DB 'DIR ' DB 'ERA ' DB 'TYPE' DB 'SAVE' DB 'REN ' DB 'USER' ; ; The following six bytes must agree with those at (PATTRN2) ; or cp/m will HALT. Why? ; PATTRN1: DB 0F3H,22,0,0,5,3BH ;(* serial number bytes *). ; ; Search the command table for a match with what has just ; been entered. If a match is found, then we jump to the ; proper section. Else jump to (UNKNOWN). ; On return, the (C) register is set to the command number ; that matched (or NUMCMDS+1 if no match). ; SEARCH: LD HL,CMDTBL LD C,0 SEARCH1: LD A,C CP NUMCMDS ;this commands exists. RET NC LD DE,FCB+1 ;check this one. LD B,4 ;max command length. SEARCH2: LD A,(DE) CP (HL) JP NZ,SEARCH3 ;not a match. INC DE INC HL DEC B JP NZ,SEARCH2 LD A,(DE) ;allow a 3 character command to match. CP ' ' JP NZ,SEARCH4 LD A,C ;set return register for this command. RET SEARCH3: INC HL DEC B JP NZ,SEARCH3 SEARCH4: INC C JP SEARCH1 ; ; Set the input buffer to empty and then start the command ; processor (ccp). ; CLEARBUF: XOR A LD (INBUFF+1),A ;second byte is actual length. ; ;************************************************************** ;* ;* ;* C C P - C o n s o l e C o m m a n d P r o c e s s o r ;* ;************************************************************** ;* COMMAND: LD SP,CCPSTACK ;setup stack area. PUSH BC ;note that (C) should be equal to: LD A,C ;(uuuudddd) where 'uuuu' is the user number RRA ;and 'dddd' is the drive number. RRA RRA RRA AND 0FH ;isolate the user number. LD E,A CALL GETSETUC ;and set it. CALL RESDSK ;reset the disk system. LD (BATCH),A ;clear batch mode flag. POP BC LD A,C AND 0FH ;isolate the drive number. LD (CDRIVE),A ;and save. CALL DSKSEL ;...and select. LD A,(INBUFF+1) OR A ;anything in input buffer already? JP NZ,CMMND2 ;yes, we just process it. ; ; Entry point to get a command line from the console. ; CMMND1: LD SP,CCPSTACK ;set stack straight. CALL CRLF ;start a new line on the screen. CALL GETDSK ;get current drive. ADD A,'A' CALL PRINT ;print current drive. LD A,'>' CALL PRINT ;and add prompt. CALL GETINP ;get line from user. ; ; Process command line here. ; CMMND2: LD DE,TBUFF CALL DMASET ;set standard dma address. CALL GETDSK LD (CDRIVE),A ;set current drive. CALL CONVFST ;convert name typed in. CALL NZ,SYNERR ;wild cards are not allowed. LD A,(CHGDRV) ;if a change in drives was indicated, OR A ;then treat this as an unknown command JP NZ,UNKNOWN ;which gets executed. CALL SEARCH ;else search command table for a match. ; ; Note that an unknown command returns ; with (A) pointing to the last address ; in our table which is (UNKNOWN). ; LD HL,CMDADR ;now, look thru our address table for command (A). LD E,A ;set (DE) to command number. LD D,0 ADD HL,DE ADD HL,DE ;(HL)=(CMDADR)+2*(command number). LD A,(HL) ;now pick out this address. INC HL LD H,(HL) LD L,A JP (HL) ;now execute it. ; ; CP/M command address table. ; CMDADR: DW DIRECT,ERASE,TYPE,SAVE DW RENAME,USER,UNKNOWN ; ; Halt the system. Reason for this is unknown at present. ; HALT: LD HL,76F3H ;'DI HLT' instructions. LD (CBASE),HL LD HL,CBASE JP (HL) ; ; Read error while TYPEing a file. ; RDERROR: LD BC,RDERR JP PLINE RDERR: DB 'READ ERROR',0 ; ; Required file was not located. ; NONE: LD BC,NOFILE JP PLINE NOFILE: DB 'NO FILE',0 ; ; Decode a command of the form 'A>filename number{ filename}. ; Note that a drive specifier is not allowed on the first file ; name. On return, the number is in register (A). Any error ; causes 'filename?' to be printed and the command is aborted. ; DECODE: CALL CONVFST ;convert filename. LD A,(CHGDRV) ;do not allow a drive to be specified. OR A JP NZ,SYNERR LD HL,FCB+1 ;convert number now. LD BC,11 ;(B)=sum register, (C)=max digit count. DECODE1: LD A,(HL) CP ' ' ;a space terminates the numeral. JP Z,DECODE3 INC HL SUB '0' ;make binary from ascii. CP 10 ;legal digit? JP NC,SYNERR LD D,A ;yes, save it in (D). LD A,B ;compute (B)=(B)*10 and check for overflow. AND 0E0H JP NZ,SYNERR LD A,B RLCA RLCA RLCA ;(A)=(B)*8 ADD A,B ;.......*9 JP C,SYNERR ADD A,B ;.......*10 JP C,SYNERR ADD A,D ;add in new digit now. DECODE2: JP C,SYNERR LD B,A ;and save result. DEC C ;only look at 11 digits. JP NZ,DECODE1 RET DECODE3: LD A,(HL) ;spaces must follow (why?). CP ' ' JP NZ,SYNERR INC HL DECODE4: DEC C JP NZ,DECODE3 LD A,B ;set (A)=the numeric value entered. RET ; ; Move 3 bytes from (HL) to (DE). Note that there is only ; one reference to this at (A2D5h). ; MOVE3: LD B,3 ; ; Move (B) bytes from (HL) to (DE). ; HL2DE: LD A,(HL) LD (DE),A INC HL INC DE DEC B JP NZ,HL2DE RET ; ; Compute (HL)=(TBUFF)+(A)+(C) and get the byte that's here. ; EXTRACT: LD HL,TBUFF ADD A,C CALL ADDHL LD A,(HL) RET ; ; Check drive specified. If it means a change, then the new ; drive will be selected. In any case, the drive byte of the ; fcb will be set to null (means use current drive). ; DSELECT: XOR A ;null out first byte of fcb. LD (FCB),A LD A,(CHGDRV) ;a drive change indicated? OR A RET Z DEC A ;yes, is it the same as the current drive? LD HL,CDRIVE CP (HL) RET Z JP DSKSEL ;no. Select it then. ; ; Check the drive selection and reset it to the previous ; drive if it was changed for the preceeding command. ; RESETDR: LD A,(CHGDRV) ;drive change indicated? OR A RET Z DEC A ;yes, was it a different drive? LD HL,CDRIVE CP (HL) RET Z LD A,(CDRIVE) ;yes, re-select our old drive. JP DSKSEL ; ;************************************************************** ;* ;* D I R E C T O R Y C O M M A N D ;* ;************************************************************** ; DIRECT: CALL CONVFST ;convert file name. CALL DSELECT ;select indicated drive. LD HL,FCB+1 ;was any file indicated? LD A,(HL) CP ' ' JP NZ,DIRECT2 LD B,11 ;no. Fill field with '?' - same as *.*. DIRECT1: LD (HL),'?' INC HL DEC B JP NZ,DIRECT1 DIRECT2: LD E,0 ;set initial cursor position. PUSH DE CALL SRCHFCB ;get first file name. CALL Z,NONE ;none found at all? DIRECT3: JP Z,DIRECT9 ;terminate if no more names. LD A,(RTNCODE) ;get file's position in segment (0-3). RRCA RRCA RRCA AND 60H ;(A)=position*32 LD C,A LD A,10 CALL EXTRACT ;extract the tenth entry in fcb. RLA ;check system file status bit. JP C,DIRECT8 ;we don't list them. POP DE LD A,E ;bump name count. INC E PUSH DE AND 03H ;at end of line? PUSH AF JP NZ,DIRECT4 CALL CRLF ;yes, end this line and start another. PUSH BC CALL GETDSK ;start line with ('A:'). POP BC ADD A,'A' CALL PRINTB LD A,':' CALL PRINTB JP DIRECT5 DIRECT4: CALL SPACE ;add seperator between file names. LD A,':' CALL PRINTB DIRECT5: CALL SPACE LD B,1 ;'extract' each file name character at a time. DIRECT6: LD A,B CALL EXTRACT AND 7FH ;strip bit 7 (status bit). CP ' ' ;are we at the end of the name? JP NZ,DRECT65 POP AF ;yes, don't print spaces at the end of a line. PUSH AF CP 3 JP NZ,DRECT63 LD A,9 ;first check for no extension. CALL EXTRACT AND 7FH CP ' ' JP Z,DIRECT7 ;don't print spaces. DRECT63: LD A,' ' ;else print them. DRECT65: CALL PRINTB INC B ;bump to next character psoition. LD A,B CP 12 ;end of the name? JP NC,DIRECT7 CP 9 ;nope, starting extension? JP NZ,DIRECT6 CALL SPACE ;yes, add separating space. JP DIRECT6 DIRECT7: POP AF ;get the next file name. DIRECT8: CALL CHKCON ;first check console, quit on anything. JP NZ,DIRECT9 CALL SRCHNXT ;get next name. JP DIRECT3 ;and continue with our list. DIRECT9: POP DE ;restore the stack and return to command level. JP GETBACK ; ;************************************************************** ;* ;* E R A S E C O M M A N D ;* ;************************************************************** ; ERASE: CALL CONVFST ;convert file name. CP 11 ;was '*.*' entered? JP NZ,ERASE1 LD BC,YESNO ;yes, ask for confirmation. CALL PLINE CALL GETINP LD HL,INBUFF+1 DEC (HL) ;must be exactly 'y'. JP NZ,CMMND1 INC HL LD A,(HL) CP 'Y' JP NZ,CMMND1 INC HL LD (INPOINT),HL ;save input line pointer. ERASE1: CALL DSELECT ;select desired disk. LD DE,FCB CALL DELETE ;delete the file. INC A CALL Z,NONE ;not there? JP GETBACK ;return to command level now. YESNO: DB 'ALL (Y/N)?',0 ; ;************************************************************** ;* ;* T Y P E C O M M A N D ;* ;************************************************************** ; TYPE: CALL CONVFST ;convert file name. JP NZ,SYNERR ;wild cards not allowed. CALL DSELECT ;select indicated drive. CALL OPENFCB ;open the file. JP Z,TYPE5 ;not there? CALL CRLF ;ok, start a new line on the screen. LD HL,NBYTES ;initialize byte counter. LD (HL),0FFH ;set to read first sector. TYPE1: LD HL,NBYTES TYPE2: LD A,(HL) ;have we written the entire sector? CP 128 JP C,TYPE3 PUSH HL ;yes, read in the next one. CALL READFCB POP HL JP NZ,TYPE4 ;end or error? XOR A ;ok, clear byte counter. LD (HL),A TYPE3: INC (HL) ;count this byte. LD HL,TBUFF ;and get the (A)th one from the buffer (TBUFF). CALL ADDHL LD A,(HL) CP CNTRLZ ;end of file mark? JP Z,GETBACK CALL PRINT ;no, print it. CALL CHKCON ;check console, quit if anything ready. JP NZ,GETBACK JP TYPE1 ; ; Get here on an end of file or read error. ; TYPE4: DEC A ;read error? JP Z,GETBACK CALL RDERROR ;yes, print message. TYPE5: CALL RESETDR ;and reset proper drive JP SYNERR ;now print file name with problem. ; ;************************************************************** ;* ;* S A V E C O M M A N D ;* ;************************************************************** ; SAVE: CALL DECODE ;get numeric token that folows SAVE. PUSH AF ;save number of pages to write. CALL CONVFST ;convert file name. JP NZ,SYNERR ;wild cards not allowed. CALL DSELECT ;select specified drive. LD DE,FCB ;now delete this file. PUSH DE CALL DELETE POP DE CALL CREATE ;and create it again. JP Z,SAVE3 ;can't create? XOR A ;clear record number byte LD (FCB+32),A POP AF ;convert pages to sectors. LD L,A LD H,0 ADD HL,HL ;(HL)=number of sectors to write. LD DE,TBASE ;and we start from here. SAVE1: LD A,H ;done yet? OR L JP Z,SAVE2 DEC HL ;nope, count this and compute the start PUSH HL ;of the next 128 byte sector. LD HL,128 ADD HL,DE PUSH HL ;save it and set the transfer address. CALL DMASET LD DE,FCB ;write out this sector now. CALL WRTREC POP DE ;reset (DE) to the start of the last sector. POP HL ;restore sector count. JP NZ,SAVE3 ;write error? JP SAVE1 ; ; Get here after writing all of the file. ; SAVE2: LD DE,FCB ;now close the file. CALL CLOSE INC A ;did it close ok? JP NZ,SAVE4 ; ; Print out error message (no space). ; SAVE3: LD BC,NOSPACE CALL PLINE SAVE4: CALL STDDMA ;reset the standard dma address. JP GETBACK NOSPACE: db 'No space',0 ; ;************************************************************** ;* ;* R E N A M E C O M M A N D ;* ;************************************************************** ; RENAME: CALL CONVFST ;convert first file name. JP NZ,SYNERR ;wild cards not allowed. LD A,(CHGDRV) ;remember any change in drives specified. PUSH AF CALL DSELECT ;and select this drive. CALL SRCHFCB ;is this file present? JP NZ,RENAME6 ;yes, print error message. LD HL,FCB ;yes, move this name into second slot. LD DE,FCB+16 LD B,16 CALL HL2DE LD HL,(INPOINT) ;get input pointer. EX DE,HL CALL NONBLANK ;get next non blank character. CP '=' ;only allow an '=' or '_' separator. JP Z,RENAME1 CP '_' JP NZ,RENAME5 RENAME1: EX DE,HL INC HL ;ok, skip separator. LD (INPOINT),HL ;save input line pointer. CALL CONVFST ;convert second file name now. JP NZ,RENAME5 ;again, no wild cards. POP AF ;if a drive was specified, then it LD B,A ;must be the same as before. LD HL,CHGDRV LD A,(HL) OR A JP Z,RENAME2 CP B LD (HL),B JP NZ,RENAME5 ;they were different, error. RENAME2: LD (HL),B ; reset as per the first file specification. XOR A LD (FCB),A ;clear the drive byte of the fcb RENAME3: CALL SRCHFCB ;and go look for second file. JP Z,RENAME4 ;doesn't exist? LD DE,FCB CALL RENAM ;ok, rename the file. JP GETBACK ; ; Process rename errors here. ; RENAME4: CALL NONE ;file not there. JP GETBACK RENAME5: CALL RESETDR ;bad command format. JP SYNERR RENAME6: LD BC,EXISTS ;destination file already exists. CALL PLINE JP GETBACK EXISTS: db 'File exists',0 ; ;************************************************************** ;* ;* U S E R C O M M A N D ;* ;************************************************************** ; USER: CALL DECODE ;get numeric value following command. CP 16 ;legal user number? JP NC,SYNERR LD E,A ;yes but is there anything else? LD A,(FCB+1) CP ' ' JP Z,SYNERR ;yes, that is not allowed. CALL GETSETUC ;ok, set user code. JP GETBACK1 ; ;************************************************************** ;* ;* T R A N S I E N T P R O G R A M C O M M A N D ;* ;************************************************************** ; UNKNOWN: CALL VERIFY ;check for valid system (why?). LD A,(FCB+1) ;anything to execute? CP ' ' JP NZ,UNKWN1 LD A,(CHGDRV) ;nope, only a drive change? OR A JP Z,GETBACK1 ;neither??? DEC A LD (CDRIVE),A ;ok, store new drive CALL MOVECD ;set (TDRIVE) also. CALL DSKSEL ;and select this drive. JP GETBACK1 ;then return. ; ; Here a file name was typed. Prepare to execute it. ; UNKWN1: LD DE,FCB+9 ;an extension specified? LD A,(DE) CP ' ' JP NZ,SYNERR ;yes, not allowed UNKWN2: PUSH DE CALL DSELECT ;select specified drive. POP DE LD HL,COMFILE ;set the extension to 'COM'. CALL MOVE3 CALL OPENFCB ;and open this file. JP Z,UNKWN9 ;not present? ; ; Load in the program. ; LD HL,TBASE ;store the program starting here. UNKWN3: PUSH HL EX DE,HL CALL DMASET ;set transfer address. LD DE,FCB ;and read the next record. CALL RDREC JP NZ,UNKWN4 ;end of file or read error? POP HL ;nope, bump pointer for next sctor. LD DE,128 ADD HL,DE LD DE,CBASE ;enough room for the whole file? LD A,L SUB E LD A,H SBC A,D JP NC,UNKWN0 ;no, it can't fit. JP UNKWN3 ; ; Get here after finished reading. ; UNKWN4: POP HL DEC A ;normal end of file? JP NZ,UNKWN0 CALL RESETDR ;yes, reset previous drive. CALL CONVFST ;convert the first file name that follows LD HL,CHGDRV ;command name. PUSH HL LD A,(HL) ;set drive code in default fcb. LD (FCB),A LD A,16 ;put second name 16 bytes later. CALL CONVERT ;convert second file name. POP HL LD A,(HL) ;and set the drive for this second file. LD (FCB+16),A XOR A ;clear record byte in fcb. LD (FCB+32),A LD DE,TFCB ;move it into place at (005Ch). LD HL,FCB LD B,33 CALL HL2DE LD HL,INBUFF+2 ;now move the remainder of the input UNKWN5: LD A,(HL) ;line down to (0080h). Look for a non blank. OR A ;or a null. JP Z,UNKWN6 CP ' ' JP Z,UNKWN6 INC HL JP UNKWN5 ; ; Do the line move now. It ends in a null byte. ; UNKWN6: LD B,0 ;keep a character count. LD DE,TBUFF+1 ;data gets put here. UNKWN7: LD A,(HL) ;move it now. LD (DE),A OR A JP Z,UNKWN8 INC B INC HL INC DE JP UNKWN7 UNKWN8: LD A,B ;now store the character count. LD (TBUFF),A CALL CRLF ;clean up the screen. CALL STDDMA ;set standard transfer address. CALL SETCDRV ;reset current drive. CALL TBASE ;and execute the program. ; ; Transient programs return here (or reboot). ; LD SP,BATCH ;set stack first off. CALL MOVECD ;move current drive into place (TDRIVE). CALL DSKSEL ;and reselect it. JP CMMND1 ;back to command mode. ; ; Get here if some error occured. ; UNKWN9: CALL RESETDR ;improper format. JP SYNERR UNKWN0: LD BC,BADLOAD ;read error or won't fit. CALL PLINE JP GETBACK BADLOAD: db 'BAD LOAD',0 COMFILE: db 'COM' ;command file extension. ; ; Get here to return to command level. We will reset the ; previous active drive and then either return to command ; level directly or print error message and then return. ; GETBACK: CALL RESETDR ;reset previous drive. GETBACK1: CALL CONVFST ;convert first name in (FCB). LD A,(FCB+1) ;if this was just a drive change SUB ' ' ;request, make sure it was valid. LD HL,CHGDRV OR (HL) JP NZ,SYNERR JP CMMND1 ;ok, return to command level. ; ; ccp stack area. ; db 0,0,0,0,0,0,0,0 db 0,0,0,0,0,0,0,0 CCPSTACK EQU $ ;end of ccp stack area. ; ; Batch (or SUBMIT) processing information storage. ; BATCH: db 0 ;batch mode flag (0=not active) BATCHFCB: db 0,'$$$ SUB' ; db 0,0,0,0,0,0,0,0 db 0,0,0,0,0,0,0,0 db 0,0,0,0,0 ; ; File control block setup by the CCP. ; FCB: db 0,' ' db 0,0,0,0,0 db ' ' db 0,0,0,0,0 RTNCODE: db 0 ;status returned from bdos call. CDRIVE: db 0 ;currently active drive. CHGDRV: db 0 ;change in drives flag (0=no change). NBYTES: dw 0 ;byte counter used by TYPE. ; ; Room for expansion? ; db 0,0,0,0,0,0,0,0 db 0,0,0,0,0 ; ; Note that the following six bytes must match those at ; (PATTRN1) or cp/m will HALT. Why? ; PATTRN2: db 0f3h,22,0,0,5,3bh ;(* serial number bytes *). ; ;************************************************************** ;* ;* B D O S E N T R Y ;* ;************************************************************** ; FBASE: JP FBASE1 ; ; Bdos error table. ; BADSCTR: dw ERROR1 ;bad sector on read or write. BADSLCT: dw ERROR2 ;bad disk select. RODISK: dw ERROR3 ;disk is read only. ROFILE: dw ERROR4 ;file is read only. ; ; Entry into bdos. (DE) or (E) are the parameters passed. The ; function number desired is in register (C). ; FBASE1: EX DE,HL ;save the (DE) parameters. LD (PARAMS),HL EX DE,HL LD A,E ;and save register (E) in particular. LD (EPARAM),A LD HL,0 LD (STATUS),HL ;clear return status. ADD HL,SP LD (USRSTACK),HL ;save user's stack pointer. LD SP,STKAREA ;and set our own. XOR A ;clear auto select storage space. LD (AUTOFLAG),A LD (AUTO),A LD HL,GOBACK ;set return address. PUSH HL LD A,C ;get function number. CP NFUNCTS ;valid function number? RET NC LD C,E ;keep single register function here. LD HL,FUNCTNS ;now look thru the function table. LD E,A LD D,0 ;(DE)=function number. ADD HL,DE ADD HL,DE ;(HL)=(start of table)+2*(function number). LD E,(HL) INC HL LD D,(HL) ;now (DE)=address for this function. LD HL,(PARAMS) ;retrieve parameters. EX DE,HL ;now (DE) has the original parameters. JP (HL) ;execute desired function. ; ; BDOS function jump table. ; NFUNCTS EQU 41 ;number of functions in following table. ; FUNCTNS: dw WBOOT dw GETCON dw OUTCON dw GETRDR dw PUNCH dw LIST dw DIRCIO dw GETIOB dw SETIOB dw PRTSTR dw RDBUFF dw GETCSTS dw GETVER dw RSTDSK dw SETDSK dw OPENFIL dw CLOSEFIL dw GETFST dw GETNXT dw DELFILE dw READSEQ dw WRTSEQ dw FCREATE dw RENFILE dw GETLOG dw GETCRNT dw PUTDMA dw GETALOC dw WRTPRTD dw GETROV dw SETATTR dw GETPARM dw GETUSER dw RDRANDOM dw WTRANDOM dw FILESIZE dw SETRAN dw LOGOFF dw RTN dw 0db04h ;?????? dw WTSPECL ; ; Bdos error message section. ; ERROR1: LD HL,BADSEC ;bad sector message. CALL PRTERR ;print it and get a 1 char response. CP CNTRLC ;re-boot request (control-c)? JP Z,0 ;yes. RET ;no, return to retry i/o function. ; ERROR2: LD HL,BADSEL ;bad drive selected. JP ERROR5 ; ERROR3: LD HL,DISKRO ;disk is read only. JP ERROR5 ; ERROR4: LD HL,FILERO ;file is read only. ; ERROR5: CALL PRTERR JP 0 ;always reboot on these errors. ; BDOSERR: db 'Bdos Err On ' BDOSDRV: db ' : $' BADSEC: db 'Bad Sector$' BADSEL: db 'Select$' FILERO: db 'File ' DISKRO: db 'R/O$' ; ; Print bdos error message. ; PRTERR: PUSH HL ;save second message pointer. CALL OUTCRLF ;send (cr)(lf). LD A,(ACTIVE) ;get active drive. ADD A,'A' ;make ascii. LD (BDOSDRV),A ;and put in message. LD BC,BDOSERR ;and print it. CALL PRTMESG POP BC ;print second message line now. CALL PRTMESG ; ; Get an input character. We will check our 1 character ; buffer first. This may be set by the console status routine. ; GETCHAR: LD HL,CHARBUF ;check character buffer. LD A,(HL) ;anything present already? LD (HL),0 ;...either case clear it. OR A RET NZ ;yes, use it. JP CONIN ;nope, go get a character response. ; ; Input and echo a character. ; GETECHO: CALL GETCHAR ;input a character CALL CHKCHAR ;carriage control? RET C ;no, a regular control char so don't echo. PUSH AF ;ok, save character now. LD C,A CALL OUTCON ;and echo it. POP AF ;get character and return. RET ; ; Check character in (A). Set the zero flag on a carriage ; control character and the carry flag on any other control ; character. ; CHKCHAR: CP CR ;check for carriage return, line feed, RET Z ; backspace, or a tab. CP LF RET Z CP TAB RET Z CP BS RET Z CP ' ' ;other control char? Set carry flag. RET ; ; Check the console during output. Halt on a control-s, then ; reboot on a control-c. If anything else is ready, clear the ; zero flag and return (the calling routine may want to do ; something). ; CKCONSOL: LD A,(CHARBUF) ;check buffer OR A ;if anything, just return without checking. JP NZ,CKCON2 CALL CONST ;nothing in buffer. Check console. AND 01H ;look at bit 0. RET Z ;return if nothing. CALL CONIN ;ok, get it. CP CNTRLS ;if not control-s, return with zero cleared. JP NZ,CKCON1 CALL CONIN ;halt processing until another char CP CNTRLC ;is typed. Control-c? JP Z,0 ;yes, reboot now. XOR A ;no, just pretend nothing was ever ready. RET CKCON1: LD (CHARBUF),A ;save character in buffer for later processing. CKCON2: LD A,1 ;set (A) to non zero to mean something is ready. RET ; ; Output (C) to the screen. If the printer flip-flop flag ; is set, we will send character to printer also. The console ; will be checked in the process. ; OUTCHAR: LD A,(OUTFLAG) ;check output flag OR A ;anything and we won't generate output. JP NZ,OUTCHR1 PUSH BC CALL CKCONSOL ;check console (we don't care what's there). POP BC PUSH BC CALL CONOUT ;output (C) to the screen. POP BC PUSH BC LD A,(PRTFLAG) ;check printer flip-flop flag. OR A CALL NZ,LIST ;print it also if non-zero. POP BC OUTCHR1: LD A,C ;update cursors position. LD HL,CURPOS CP DEL ;rubouts don't do anything here. RET Z INC (HL) ;bump line pointer. CP ' ' ;and return if a normal character. RET NC DEC (HL) ;restore and check for the start of the line. LD A,(HL) OR A RET Z ;ignore control characters at the start of the line. LD A,C CP BS ;is it a backspace? JP NZ,OUTCHR2 DEC (HL) ;yes, backup pointer. RET OUTCHR2: CP LF ;is it a line feed? RET NZ ;ignore anything else. LD (HL),0 ;reset pointer to start of line. RET ; ; Output (A) to the screen. If it is a control character ; (other than carriage control), use ^x format. ; SHOWIT: LD A,C CALL CHKCHAR ;check character. JP NC,OUTCON ;not a control, use normal output. PUSH AF LD C,'^' ;for a control character, preceed it with '^'. CALL OUTCHAR POP AF OR '@' ;and then use the letter equivalent. LD C,A ; ; Function to output (C) to the console device and expand tabs ; if necessary. ; OUTCON: LD A,C CP TAB ;is it a tab? JP NZ,OUTCHAR ;use regular output. OUTCON1: LD C,' ' ;yes it is, use spaces instead. CALL OUTCHAR LD A,(CURPOS) ;go until the cursor is at a multiple of 8 AND 07H ;position. JP NZ,OUTCON1 RET ; ; Echo a backspace character. Erase the prevoius character ; on the screen. ; BACKUP: CALL BACKUP1 ;backup the screen 1 place. LD C,' ' ;then blank that character. CALL CONOUT BACKUP1: LD C,BS ;then back space once more. JP CONOUT ; ; Signal a deleted line. Print a '#' at the end and start ; over. ; NEWLINE: LD C,'#' CALL OUTCHAR ;print this. CALL OUTCRLF ;start new line. NEWLN1: LD A,(CURPOS) ;move the cursor to the starting position. LD HL,STARTING CP (HL) RET NC ;there yet? LD C,' ' CALL OUTCHAR ;nope, keep going. JP NEWLN1 ; ; Output a (cr) (lf) to the console device (screen). ; OUTCRLF: LD C,CR CALL OUTCHAR LD C,LF JP OUTCHAR ; ; Print message pointed to by (BC). It will end with a '$'. ; PRTMESG: LD A,(BC) ;check for terminating character. CP '$' RET Z INC BC PUSH BC ;otherwise, bump pointer and print it. LD C,A CALL OUTCON POP BC JP PRTMESG ; ; Function to execute a buffered read. ; RDBUFF: LD A,(CURPOS) ;use present location as starting one. LD (STARTING),A LD HL,(PARAMS) ;get the maximum buffer space. LD C,(HL) INC HL ;point to first available space. PUSH HL ;and save. LD B,0 ;keep a character count. RDBUF1: PUSH BC PUSH HL RDBUF2: CALL GETCHAR ;get the next input character. AND 7FH ;strip bit 7. POP HL ;reset registers. POP BC CP CR ;end of the line? JP Z,RDBUF17 CP LF JP Z,RDBUF17 CP BS ;how about backspace? JP NZ,RDBUF3 LD A,B ;yes, but ignore at the beginning of the line. OR A JP Z,RDBUF1 DEC B ;ok, update counter. LD A,(CURPOS) ;if we backspace to the start of the line, LD (OUTFLAG),A ;treat as a cancel (control-x). JP RDBUF10 RDBUF3: CP DEL ;user typed a rubout? JP NZ,RDBUF4 LD A,B ;ignore at the start of the line OR A JP Z,RDBUF1 LD A,(HL) ;ok, echo the previous character. DEC B ;and reset pointers (counters). DEC HL JP RDBUF15 RDBUF4: CP CNTRLE ;physical end of line? JP NZ,RDBUF5 PUSH BC ;yes, do it. PUSH HL CALL OUTCRLF XOR A ;and update starting position. LD (STARTING),A JP RDBUF2 RDBUF5: CP CNTRLP ;control-p? JP NZ,RDBUF6 PUSH HL ;yes, flip the print flag flip-flop byte. LD HL,PRTFLAG LD A,1 ;PRTFLAG=1-PRTFLAG SUB (HL) LD (HL),A POP HL JP RDBUF1 RDBUF6: CP CNTRLX ;control-x (cancel)? JP NZ,RDBUF8 POP HL RDBUF7: LD A,(STARTING) ;yes, backup the cursor to here. LD HL,CURPOS CP (HL) JP NC,RDBUFF ;done yet? DEC (HL) ;no, decrement pointer and output back up one space. CALL BACKUP JP RDBUF7 RDBUF8: CP CNTRLU ;control-u (cancel line)? JP NZ,RDBUF9 CALL NEWLINE ;start a new line. POP HL JP RDBUFF RDBUF9: CP CNTRLR ;control-r? JP NZ,RDBUF14 RDBUF10: PUSH BC ;yes, start a new line and retype the old one. CALL NEWLINE POP BC POP HL PUSH HL PUSH BC RDBUF11: LD A,B ;done whole line yet? OR A JP Z,RDBUF12 INC HL ;nope, get next character. LD C,(HL) DEC B ;count it. PUSH BC PUSH HL CALL SHOWIT ;and display it. POP HL POP BC JP RDBUF11 RDBUF12: PUSH HL ;done with line. If we were displaying LD A,(OUTFLAG) ;then update cursor position. OR A JP Z,RDBUF2 LD HL,CURPOS ;because this line is shorter, we must SUB (HL) ;back up the cursor (not the screen however) LD (OUTFLAG),A ;some number of positions. RDBUF13: CALL BACKUP ;note that as long as (OUTFLAG) is non LD HL,OUTFLAG ;zero, the screen will not be changed. DEC (HL) JP NZ,RDBUF13 JP RDBUF2 ;now just get the next character. ; ; Just a normal character, put this in our buffer and echo. ; RDBUF14: INC HL LD (HL),A ;store character. INC B ;and count it. RDBUF15: PUSH BC PUSH HL LD C,A ;echo it now. CALL SHOWIT POP HL POP BC LD A,(HL) ;was it an abort request? CP CNTRLC ;control-c abort? LD A,B JP NZ,RDBUF16 CP 1 ;only if at start of line. JP Z,0 RDBUF16: CP C ;nope, have we filled the buffer? JP C,RDBUF1 RDBUF17: POP HL ;yes, end the line with return. LD (HL),B LD C,CR JP OUTCHAR ;output (cr) and return. ; ; Function to get a character from the console device. ; GETCON: CALL GETECHO ;get and echo. JP SETSTAT ;save status and return. ; ; Function to get a character from the tape reader device. ; GETRDR: CALL READER ;get a character from reader, set status and return. JP SETSTAT ; ; Function to perform direct console i/o. If (C) contains (FF) ; then this is an input request. If (C) contains (FE) then ;; this is a status request. Otherwise we are to output (C). ; DIRCIO: LD A,C ;test for (FF). INC A JP Z,DIRC1 INC A ;test for (FE). JP Z,CONST JP CONOUT ;just output (C). DIRC1: CALL CONST ;this is an input request. OR A JP Z,GOBACK1 ;not ready? Just return (directly). CALL CONIN ;yes, get character. JP SETSTAT ;set status and return. ; ; Function to return the i/o byte. ; GETIOB: LD A,(IOBYTE) JP SETSTAT ; ; Function to set the i/o byte. ; SETIOB: LD HL,IOBYTE LD (HL),C RET ; ; Function to print the character string pointed to by (DE) ; on the console device. The string ends with a '$'. ; PRTSTR: EX DE,HL LD C,L LD B,H ;now (BC) points to it. JP PRTMESG ; ; Function to interigate the console device. ; GETCSTS: CALL CKCONSOL ; ; Get here to set the status and return to the cleanup ; section. Then back to the user. ; SETSTAT: LD (STATUS),A RTN: RET ; ; Set the status to 1 (read or write error code). ; IOERR1: LD A,1 JP SETSTAT ; OUTFLAG: DB 0 ;output flag (non zero means no output). STARTING: DB 2 ;starting position for cursor. CURPOS: DB 0 ;cursor position (0=start of line) PRTFLAG: DB 0 ;printer flag (control-p toggle). List if non-zero. CHARBUF: DB 0 ;single input character buffer. ; ; Stack area for BDOS calls. ; USRSTACK: DW 0 ;save users stack pointer here. ; DB 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 DB 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 STKAREA EQU $ ;end of stack area. ; USERNO: DB 0 ;current user number. ACTIVE: DB 0 ;currently active drive. PARAMS: DW 0 ;save (DE) parameters here on entry. STATUS: DW 0 ;status returned from bdos function. ; ; Select error occured, jump to error routine. ; SLCTERR: LD HL,BADSLCT ; ; Jump to (HL) indirectly. ; JUMPHL: LD E,(HL) INC HL LD D,(HL) ;now (DE) contain the desired address. EX DE,HL JP (HL) ; ; Block move. (DE) to (HL), (C) bytes total. ; DE2HL: INC C ;is count down to zero? DE2HL1: DEC C RET Z ;yes, we are done. LD A,(DE) ;no, move one more byte. LD (HL),A INC DE INC HL JP DE2HL1 ;and repeat. ; ; Select the desired drive. ; SELECT: LD A,(ACTIVE) ;get active disk. LD C,A CALL SELDSK ;select it. LD A,H ;valid drive? OR L ;valid drive? RET Z ;return if not. ; ; Here, the BIOS returned the address of the parameter block ; in (HL). We will extract the necessary pointers and save them. ; LD E,(HL) ;yes, get address of translation table into (DE) INC HL LD D,(HL) INC HL LD (SCRATCH1),HL ;save pointers to scratch areas. INC HL INC HL LD (SCRATCH2),HL ;ditto. INC HL INC HL LD (SCRATCH3),HL ;ditto. INC HL INC HL EX DE,HL ;now save the translation table address. LD (XLATE),HL LD HL,DIRBUF ;put the next 8 bytes here. LD C,8 ;they consist of the directory buffer CALL DE2HL ;pointer, parameter block pointer, LD HL,(DISKPB) ;check and allocation vectors. EX DE,HL LD HL,SECTORS ;move parameter block into our ram. LD C,15 ;it is 15 bytes long. CALL DE2HL LD HL,(DSKSIZE) ;check disk size. LD A,H ;more than 256 blocks on this? LD HL,BIGDISK LD (HL),0FFH ;set to small. OR A JP Z,SELECT1 LD (HL),0 ;wrong, set to large. SELECT1: LD A,0FFH ;clear the zero flag. OR A RET ; ; Routine to home the disk track head and clear pointers. ; HOMEDRV: CALL HOME ;home the head. XOR A LD HL,(SCRATCH2) ;set our track pointer also. LD (HL),A INC HL LD (HL),A LD HL,(SCRATCH3) ;and our sector pointer. LD (HL),A INC HL LD (HL),A RET ; ; Do the actual disk read and check the error return status. ; DOREAD: CALL READ JP IORET ; ; Do the actual disk write and handle any bios error. ; DOWRITE: CALL WRITE IORET: OR A RET Z ;return unless an error occurred. LD HL,BADSCTR ;bad read/write on this sector. JP JUMPHL ; ; Routine to select the track and sector that the desired ; block number falls in. ; TRKSEC: LD HL,(FILEPOS) ;get position of last accessed file LD C,2 ;in directory and compute sector #. CALL SHIFTR ;sector #=file-position/4. LD (BLKNMBR),HL ;save this as the block number of interest. LD (CKSUMTBL),HL ;what's it doing here too? ; ; if the sector number has already been set (BLKNMBR), enter ; at this point. ; TRKSEC1: LD HL,BLKNMBR LD C,(HL) ;move sector number into (BC). INC HL LD B,(HL) LD HL,(SCRATCH3) ;get current sector number and LD E,(HL) ;move this into (DE). INC HL LD D,(HL) LD HL,(SCRATCH2) ;get current track number. LD A,(HL) ;and move this into (HL). INC HL LD H,(HL) LD L,A TRKSEC2: LD A,C ;is desired sector before current one? SUB E LD A,B SBC A,D JP NC,TRKSEC3 PUSH HL ;yes, decrement sectors by one track. LD HL,(SECTORS) ;get sectors per track LD A,E SUB L LD E,A LD A,D SBC A,H LD D,A ;now we have backed up one full track. POP HL DEC HL ;adjust track counter. JP TRKSEC2 TRKSEC3: PUSH HL ;desired sector is after current one. LD HL,(SECTORS) ;get sectors per track. ADD HL,DE ;bump sector pointer to next track. JP C,TRKSEC4 LD A,C ;is desired sector now before current one? SUB L LD A,B SBC A,H JP C,TRKSEC4 EX DE,HL ;not yes, increment track counter POP HL ;and continue until it is. INC HL JP TRKSEC3 ; ; here we have determined the track number that contains the ; desired sector. ; TRKSEC4: POP HL ;get track number (HL). PUSH BC PUSH DE PUSH HL EX DE,HL LD HL,(OFFSET) ;adjust for first track offset. ADD HL,DE LD B,H LD C,L CALL SETTRK ;select this track. POP DE ;reset current track pointer. LD HL,(SCRATCH2) LD (HL),E INC HL LD (HL),D POP DE LD HL,(SCRATCH3) ;reset the first sector on this track. LD (HL),E INC HL LD (HL),D POP BC LD A,C ;now subtract the desired one. SUB E ;to make it relative (1-# sectors/track). LD C,A LD A,B SBC A,D LD B,A LD HL,(XLATE) ;translate this sector according to this table. EX DE,HL CALL SECTRN ;let the bios translate it. LD C,L LD B,H JP SETSEC ;and select it. ; ; Compute block number from record number (SAVNREC) and ; extent number (SAVEXT). ; GETBLOCK: LD HL,BLKSHFT ;get logical to physical conversion. LD C,(HL) ;note that this is base 2 log of ratio. LD A,(SAVNREC) ;get record number. GETBLK1: OR A ;compute (A)=(A)/2^BLKSHFT. RRA DEC C JP NZ,GETBLK1 LD B,A ;save result in (B). LD A,8 SUB (HL) LD C,A ;compute (C)=8-BLKSHFT. LD A,(SAVEXT) GETBLK2: DEC C ;compute (A)=SAVEXT*2^(8-BLKSHFT). JP Z,GETBLK3 OR A RLA JP GETBLK2 GETBLK3: ADD A,B RET ; ; Routine to extract the (BC) block byte from the fcb pointed ; to by (PARAMS). If this is a big-disk, then these are 16 bit ; block numbers, else they are 8 bit numbers. ; Number is returned in (HL). ; EXTBLK: LD HL,(PARAMS) ;get fcb address. LD DE,16 ;block numbers start 16 bytes into fcb. ADD HL,DE ADD HL,BC LD A,(BIGDISK) ;are we using a big-disk? OR A JP Z,EXTBLK1 LD L,(HL) ;no, extract an 8 bit number from the fcb. LD H,0 RET EXTBLK1: ADD HL,BC ;yes, extract a 16 bit number. LD E,(HL) INC HL LD D,(HL) EX DE,HL ;return in (HL). RET ; ; Compute block number. ; COMBLK: CALL GETBLOCK LD C,A LD B,0 CALL EXTBLK LD (BLKNMBR),HL RET ; ; Check for a zero block number (unused). ; CHKBLK: LD HL,(BLKNMBR) LD A,L ;is it zero? OR H RET ; ; Adjust physical block (BLKNMBR) and convert to logical ; sector (LOGSECT). This is the starting sector of this block. ; The actual sector of interest is then added to this and the ; resulting sector number is stored back in (BLKNMBR). This ; will still have to be adjusted for the track number. ; LOGICAL: LD A,(BLKSHFT) ;get log2(physical/logical sectors). LD HL,(BLKNMBR) ;get physical sector desired. LOGICL1: ADD HL,HL ;compute logical sector number. DEC A ;note logical sectors are 128 bytes long. JP NZ,LOGICL1 LD (LOGSECT),HL ;save logical sector. LD A,(BLKMASK) ;get block mask. LD C,A LD A,(SAVNREC) ;get next sector to access. AND C ;extract the relative position within OR L ;and add it too logical sector. LD L,A LD (BLKNMBR),HL ;and store. RET ; ; Set (HL) to point to extent byte in fcb. ; SETEXT: LD HL,(PARAMS) LD DE,12 ;it is the twelth byte. ADD HL,DE RET ; ; Set (HL) to point to record count byte in fcb and (DE) to ; next record number byte. ; SETHLDE: LD HL,(PARAMS) LD DE,15 ;record count byte (#15). ADD HL,DE EX DE,HL LD HL,17 ;next record number (#32). ADD HL,DE RET ; ; Save current file data from fcb. ; STRDATA: CALL SETHLDE LD A,(HL) ;get and store record count byte. LD (SAVNREC),A EX DE,HL LD A,(HL) ;get and store next record number byte. LD (SAVNXT),A CALL SETEXT ;point to extent byte. LD A,(EXTMASK) ;get extent mask. AND (HL) LD (SAVEXT),A ;and save extent here. RET ; ; Set the next record to access. If (MODE) is set to 2, then ; the last record byte (SAVNREC) has the correct number to access. ; For sequential access, (MODE) will be equal to 1. ; SETNREC: CALL SETHLDE LD A,(MODE) ;get sequential flag (=1). CP 2 ;a 2 indicates that no adder is needed. JP NZ,STNREC1 XOR A ;clear adder (random access?). STNREC1: LD C,A LD A,(SAVNREC) ;get last record number. ADD A,C ;increment record count. LD (HL),A ;and set fcb's next record byte. EX DE,HL LD A,(SAVNXT) ;get next record byte from storage. LD (HL),A ;and put this into fcb as number of records used. RET ; ; Shift (HL) right (C) bits. ; SHIFTR: INC C SHIFTR1: DEC C RET Z LD A,H OR A RRA LD H,A LD A,L RRA LD L,A JP SHIFTR1 ; ; Compute the check-sum for the directory buffer. Return ; integer sum in (A). ; CHECKSUM: LD C,128 ;length of buffer. LD HL,(DIRBUF) ;get its location. XOR A ;clear summation byte. CHKSUM1: ADD A,(HL) ;and compute sum ignoring carries. INC HL DEC C JP NZ,CHKSUM1 RET ; ; Shift (HL) left (C) bits. ; SHIFTL: INC C SHIFTL1: DEC C RET Z ADD HL,HL ;shift left 1 bit. JP SHIFTL1 ; ; Routine to set a bit in a 16 bit value contained in (BC). ; The bit set depends on the current drive selection. ; SETBIT: PUSH BC ;save 16 bit word. LD A,(ACTIVE) ;get active drive. LD C,A LD HL,1 CALL SHIFTL ;shift bit 0 into place. POP BC ;now 'or' this with the original word. LD A,C OR L LD L,A ;low byte done, do high byte. LD A,B OR H LD H,A RET ; ; Extract the write protect status bit for the current drive. ; The result is returned in (A), bit 0. ; GETWPRT: LD HL,(WRTPRT) ;get status bytes. LD A,(ACTIVE) ;which drive is current? LD C,A CALL SHIFTR ;shift status such that bit 0 is the LD A,L ;one of interest for this drive. AND 01H ;and isolate it. RET ; ; Function to write protect the current disk. ; WRTPRTD: LD HL,WRTPRT ;point to status word. LD C,(HL) ;set (BC) equal to the status. INC HL LD B,(HL) CALL SETBIT ;and set this bit according to current drive. LD (WRTPRT),HL ;then save. LD HL,(DIRSIZE) ;now save directory size limit. INC HL ;remember the last one. EX DE,HL LD HL,(SCRATCH1) ;and store it here. LD (HL),E ;put low byte. INC HL LD (HL),D ;then high byte. RET ; ; Check for a read only file. ; CHKROFL: CALL FCB2HL ;set (HL) to file entry in directory buffer. CKROF1: LD DE,9 ;look at bit 7 of the ninth byte. ADD HL,DE LD A,(HL) RLA RET NC ;return if ok. LD HL,ROFILE ;else, print error message and terminate. JP JUMPHL ; ; Check the write protect status of the active disk. ; CHKWPRT: CALL GETWPRT RET Z ;return if ok. LD HL,RODISK ;else print message and terminate. JP JUMPHL ; ; Routine to set (HL) pointing to the proper entry in the ; directory buffer. ; FCB2HL: LD HL,(DIRBUF) ;get address of buffer. LD A,(FCBPOS) ;relative position of file. ; ; Routine to add (A) to (HL). ; ADDA2HL: ADD A,L LD L,A RET NC INC H ;take care of any carry. RET ; ; Routine to get the 's2' byte from the fcb supplied in ; the initial parameter specification. ; GETS2: LD HL,(PARAMS) ;get address of fcb. LD DE,14 ;relative position of 's2'. ADD HL,DE LD A,(HL) ;extract this byte. RET ; ; Clear the 's2' byte in the fcb. ; CLEARS2: CALL GETS2 ;this sets (HL) pointing to it. LD (HL),0 ;now clear it. RET ; ; Set bit 7 in the 's2' byte of the fcb. ; SETS2B7: CALL GETS2 ;get the byte. OR 80H ;and set bit 7. LD (HL),A ;then store. RET ; ; Compare (FILEPOS) with (SCRATCH1) and set flags based on ; the difference. This checks to see if there are more file ; names in the directory. We are at (FILEPOS) and there are ; (SCRATCH1) of them to check. ; MOREFLS: LD HL,(FILEPOS) ;we are here. EX DE,HL LD HL,(SCRATCH1) ;and don't go past here. LD A,E ;compute difference but don't keep. SUB (HL) INC HL LD A,D SBC A,(HL) ;set carry if no more names. RET ; ; Call this routine to prevent (SCRATCH1) from being greater ; than (FILEPOS). ; CHKNMBR: CALL MOREFLS ;SCRATCH1 too big? RET C INC DE ;yes, reset it to (FILEPOS). LD (HL),D DEC HL LD (HL),E RET ; ; Compute (HL)=(DE)-(HL) ; SUBHL: LD A,E ;compute difference. SUB L LD L,A ;store low byte. LD A,D SBC A,H LD H,A ;and then high byte. RET ; ; Set the directory checksum byte. ; SETDIR: LD C,0FFH ; ; Routine to set or compare the directory checksum byte. If ; (C)=0ffh, then this will set the checksum byte. Else the byte ; will be checked. If the check fails (the disk has been changed), ; then this disk will be write protected. ; CHECKDIR: LD HL,(CKSUMTBL) EX DE,HL LD HL,(ALLOC1) CALL SUBHL RET NC ;ok if (CKSUMTBL) > (ALLOC1), so return. PUSH BC CALL CHECKSUM ;else compute checksum. LD HL,(CHKVECT) ;get address of checksum table. EX DE,HL LD HL,(CKSUMTBL) ADD HL,DE ;set (HL) to point to byte for this drive. POP BC INC C ;set or check ? JP Z,CHKDIR1 CP (HL) ;check them. RET Z ;return if they are the same. CALL MOREFLS ;not the same, do we care? RET NC CALL WRTPRTD ;yes, mark this as write protected. RET CHKDIR1: LD (HL),A ;just set the byte. RET ; ; Do a write to the directory of the current disk. ; DIRWRITE: CALL SETDIR ;set checksum byte. CALL DIRDMA ;set directory dma address. LD C,1 ;tell the bios to actually write. CALL DOWRITE ;then do the write. JP DEFDMA ; ; Read from the directory. ; DIRREAD: CALL DIRDMA ;set the directory dma address. CALL DOREAD ;and read it. ; ; Routine to set the dma address to the users choice. ; DEFDMA: LD HL,USERDMA ;reset the default dma address and return. JP DIRDMA1 ; ; Routine to set the dma address for directory work. ; DIRDMA: LD HL,DIRBUF ; ; Set the dma address. On entry, (HL) points to ; word containing the desired dma address. ; DIRDMA1: LD C,(HL) INC HL LD B,(HL) ;setup (BC) and go to the bios to set it. JP SETDMA ; ; Move the directory buffer into user's dma space. ; MOVEDIR: LD HL,(DIRBUF) ;buffer is located here, and EX DE,HL LD HL,(USERDMA) ; put it here. LD C,128 ;this is its length. JP DE2HL ;move it now and return. ; ; Check (FILEPOS) and set the zero flag if it equals 0ffffh. ; CKFILPOS: LD HL,FILEPOS LD A,(HL) INC HL CP (HL) ;are both bytes the same? RET NZ INC A ;yes, but are they each 0ffh? RET ; ; Set location (FILEPOS) to 0ffffh. ; STFILPOS: LD HL,0FFFFH LD (FILEPOS),HL RET ; ; Move on to the next file position within the current ; directory buffer. If no more exist, set pointer to 0ffffh ; and the calling routine will check for this. Enter with (C) ; equal to 0ffh to cause the checksum byte to be set, else we ; will check this disk and set write protect if checksums are ; not the same (applies only if another directory sector must ; be read). ; NXENTRY: LD HL,(DIRSIZE) ;get directory entry size limit. EX DE,HL LD HL,(FILEPOS) ;get current count. INC HL ;go on to the next one. LD (FILEPOS),HL CALL SUBHL ;(HL)=(DIRSIZE)-(FILEPOS) JP NC,NXENT1 ;is there more room left? JP STFILPOS ;no. Set this flag and return. NXENT1: LD A,(FILEPOS) ;get file position within directory. AND 03H ;only look within this sector (only 4 entries fit). LD B,5 ;convert to relative position (32 bytes each). NXENT2: ADD A,A ;note that this is not efficient DEC B ;5 'ADD A's would be better. JP NZ,NXENT2 LD (FCBPOS),A ;save it as position of fcb. OR A RET NZ ;return if we are within buffer. PUSH BC CALL TRKSEC ;we need the next directory sector. CALL DIRREAD POP BC JP CHECKDIR ; ; Routine to to get a bit from the disk space allocation ; map. It is returned in (A), bit position 0. On entry to here, ; set (BC) to the block number on the disk to check. ; On return, (D) will contain the original bit position for ; this block number and (HL) will point to the address for it. ; CKBITMAP: LD A,C ;determine bit number of interest. AND 07H ;compute (D)=(E)=(C and 7)+1. INC A LD E,A ;save particular bit number. LD D,A ; ; compute (BC)=(BC)/8. ; LD A,C RRCA ;now shift right 3 bits. RRCA RRCA AND 1FH ;and clear bits 7,6,5. LD C,A LD A,B ADD A,A ;now shift (B) into bits 7,6,5. ADD A,A ADD A,A ADD A,A ADD A,A OR C ;and add in (C). LD C,A ;ok, (C) has been completed. LD A,B ;is there a better way of doing this? RRCA RRCA RRCA AND 1FH LD B,A ;and now (B) is completed. ; ; use this as an offset into the disk space allocation ; table. ; LD HL,(ALOCVECT) ADD HL,BC LD A,(HL) ;now get correct byte. CKBMAP1: RLCA ;get correct bit into position 0. DEC E JP NZ,CKBMAP1 RET ; ; Set or clear the bit map such that block number (BC) will be marked ; as used. On entry, if (E)=0 then this bit will be cleared, if it equals ; 1 then it will be set (don't use anyother values). ; STBITMAP: PUSH DE CALL CKBITMAP ;get the byte of interest. AND 0FEH ;clear the affected bit. POP BC OR C ;and now set it acording to (C). ; ; entry to restore the original bit position and then store ; in table. (A) contains the value, (D) contains the bit ; position (1-8), and (HL) points to the address within the ; space allocation table for this byte. ; STBMAP1: RRCA ;restore original bit position. DEC D JP NZ,STBMAP1 LD (HL),A ;and store byte in table. RET ; ; Set/clear space used bits in allocation map for this file. ; On entry, (C)=1 to set the map and (C)=0 to clear it. ; SETFILE: CALL FCB2HL ;get address of fcb LD DE,16 ADD HL,DE ;get to block number bytes. PUSH BC LD C,17 ;check all 17 bytes (max) of table. SETFL1: POP DE DEC C ;done all bytes yet? RET Z PUSH DE LD A,(BIGDISK) ;check disk size for 16 bit block numbers. OR A JP Z,SETFL2 PUSH BC ;only 8 bit numbers. set (BC) to this one. PUSH HL LD C,(HL) ;get low byte from table, always LD B,0 ;set high byte to zero. JP SETFL3 SETFL2: DEC C ;for 16 bit block numbers, adjust counter. PUSH BC LD C,(HL) ;now get both the low and high bytes. INC HL LD B,(HL) PUSH HL SETFL3: LD A,C ;block used? OR B JP Z,SETFL4 LD HL,(DSKSIZE) ;is this block number within the LD A,L ;space on the disk? SUB C LD A,H SBC A,B CALL NC,STBITMAP ;yes, set the proper bit. SETFL4: POP HL ;point to next block number in fcb. INC HL POP BC JP SETFL1 ; ; Construct the space used allocation bit map for the active ; drive. If a file name starts with '$' and it is under the ; current user number, then (STATUS) is set to minus 1. Otherwise ; it is not set at all. ; BITMAP: LD HL,(DSKSIZE) ;compute size of allocation table. LD C,3 CALL SHIFTR ;(HL)=(HL)/8. INC HL ;at lease 1 byte. LD B,H LD C,L ;set (BC) to the allocation table length. ; ; Initialize the bitmap for this drive. Right now, the first ; two bytes are specified by the disk parameter block. However ; a patch could be entered here if it were necessary to setup ; this table in a special manner. For example, the bios could ; determine locations of 'bad blocks' and set them as already ; 'used' in the map. ; LD HL,(ALOCVECT) ;now zero out the table now. BITMAP1: LD (HL),0 INC HL DEC BC LD A,B OR C JP NZ,BITMAP1 LD HL,(ALLOC0) ;get initial space used by directory. EX DE,HL LD HL,(ALOCVECT) ;and put this into map. LD (HL),E INC HL LD (HL),D ; ; End of initialization portion. ; CALL HOMEDRV ;now home the drive. LD HL,(SCRATCH1) LD (HL),3 ;force next directory request to read INC HL ;in a sector. LD (HL),0 CALL STFILPOS ;clear initial file position also. BITMAP2: LD C,0FFH ;read next file name in directory CALL NXENTRY ;and set checksum byte. CALL CKFILPOS ;is there another file? RET Z CALL FCB2HL ;yes, get its address. LD A,0E5H CP (HL) ;empty file entry? JP Z,BITMAP2 LD A,(USERNO) ;no, correct user number? CP (HL) JP NZ,BITMAP3 INC HL LD A,(HL) ;yes, does name start with a '$'? SUB '$' JP NZ,BITMAP3 DEC A ;yes, set status to minus one. LD (STATUS),A BITMAP3: LD C,1 ;now set this file's space as used in bit map. CALL SETFILE CALL CHKNMBR ;keep (SCRATCH1) in bounds. JP BITMAP2 ; ; Set the status (STATUS) and return. ; STSTATUS: LD A,(FNDSTAT) JP SETSTAT ; ; Check extents in (A) and (C). Set the zero flag if they ; are the same. The number of 16k chunks of disk space that ; the directory extent covers is expressad is (EXTMASK+1). ; No registers are modified. ; SAMEXT: PUSH BC PUSH AF LD A,(EXTMASK) ;get extent mask and use it to CPL ;compare both extent numbers. LD B,A ;save resulting mask here. LD A,C ;mask first extent and save in (C). AND B LD C,A POP AF ;now mask second extent and compare AND B ;with the first one. SUB C AND 1FH ;(* only check buts 0-4 *) POP BC ;the zero flag is set if they are the same. RET ;restore (BC) and return. ; ; Search for the first occurence of a file name. On entry, ; register (C) should contain the number of bytes of the fcb ; that must match. ; FINDFST: LD A,0FFH LD (FNDSTAT),A LD HL,COUNTER ;save character count. LD (HL),C LD HL,(PARAMS) ;get filename to match. LD (SAVEFCB),HL ;and save. CALL STFILPOS ;clear initial file position (set to 0ffffh). CALL HOMEDRV ;home the drive. ; ; Entry to locate the next occurence of a filename within the ; directory. The disk is not expected to have been changed. If ; it was, then it will be write protected. ; FINDNXT: LD C,0 ;write protect the disk if changed. CALL NXENTRY ;get next filename entry in directory. CALL CKFILPOS ;is file position = 0ffffh? JP Z,FNDNXT6 ;yes, exit now then. LD HL,(SAVEFCB) ;set (DE) pointing to filename to match. EX DE,HL LD A,(DE) CP 0E5H ;empty directory entry? JP Z,FNDNXT1 ;(* are we trying to reserect erased entries? *) PUSH DE CALL MOREFLS ;more files in directory? POP DE JP NC,FNDNXT6 ;no more. Exit now. FNDNXT1: CALL FCB2HL ;get address of this fcb in directory. LD A,(COUNTER) ;get number of bytes (characters) to check. LD C,A LD B,0 ;initialize byte position counter. FNDNXT2: LD A,C ;are we done with the compare? OR A JP Z,FNDNXT5 LD A,(DE) ;no, check next byte. CP '?' ;don't care about this character? JP Z,FNDNXT4 LD A,B ;get bytes position in fcb. CP 13 ;don't care about the thirteenth byte either. JP Z,FNDNXT4 CP 12 ;extent byte? LD A,(DE) JP Z,FNDNXT3 SUB (HL) ;otherwise compare characters. AND 7FH JP NZ,FINDNXT ;not the same, check next entry. JP FNDNXT4 ;so far so good, keep checking. FNDNXT3: PUSH BC ;check the extent byte here. LD C,(HL) CALL SAMEXT POP BC JP NZ,FINDNXT ;not the same, look some more. ; ; So far the names compare. Bump pointers to the next byte ; and continue until all (C) characters have been checked. ; FNDNXT4: INC DE ;bump pointers. INC HL INC B DEC C ;adjust character counter. JP FNDNXT2 FNDNXT5: LD A,(FILEPOS) ;return the position of this entry. AND 03H LD (STATUS),A LD HL,FNDSTAT LD A,(HL) RLA RET NC XOR A LD (HL),A RET ; ; Filename was not found. Set appropriate status. ; FNDNXT6: CALL STFILPOS ;set (FILEPOS) to 0ffffh. LD A,0FFH ;say not located. JP SETSTAT ; ; Erase files from the directory. Only the first byte of the ; fcb will be affected. It is set to (E5). ; ERAFILE: CALL CHKWPRT ;is disk write protected? LD C,12 ;only compare file names. CALL FINDFST ;get first file name. ERAFIL1: CALL CKFILPOS ;any found? RET Z ;nope, we must be done. CALL CHKROFL ;is file read only? CALL FCB2HL ;nope, get address of fcb and LD (HL),0E5H ;set first byte to 'empty'. LD C,0 ;clear the space from the bit map. CALL SETFILE CALL DIRWRITE ;now write the directory sector back out. CALL FINDNXT ;find the next file name. JP ERAFIL1 ;and repeat process. ; ; Look through the space allocation map (bit map) for the ; next available block. Start searching at block number (BC-1). ; The search procedure is to look for an empty block that is ; before the starting block. If not empty, look at a later ; block number. In this way, we return the closest empty block ; on either side of the 'target' block number. This will speed ; access on random devices. For serial devices, this should be ; changed to look in the forward direction first and then start ; at the front and search some more. ; ; On return, (DE)= block number that is empty and (HL) =0 ; if no empry block was found. ; FNDSPACE: LD D,B ;set (DE) as the block that is checked. LD E,C ; ; Look before target block. Registers (BC) are used as the lower ; pointer and (DE) as the upper pointer. ; FNDSPA1: LD A,C ;is block 0 specified? OR B JP Z,FNDSPA2 DEC BC ;nope, check previous block. PUSH DE PUSH BC CALL CKBITMAP RRA ;is this block empty? JP NC,FNDSPA3 ;yes. use this. ; ; Note that the above logic gets the first block that it finds ; that is empty. Thus a file could be written 'backward' making ; it very slow to access. This could be changed to look for the ; first empty block and then continue until the start of this ; empty space is located and then used that starting block. ; This should help speed up access to some files especially on ; a well used disk with lots of fairly small 'holes'. ; POP BC ;nope, check some more. POP DE ; ; Now look after target block. ; FNDSPA2: LD HL,(DSKSIZE) ;is block (DE) within disk limits? LD A,E SUB L LD A,D SBC A,H JP NC,FNDSPA4 INC DE ;yes, move on to next one. PUSH BC PUSH DE LD B,D LD C,E CALL CKBITMAP ;check it. RRA ;empty? JP NC,FNDSPA3 POP DE ;nope, continue searching. POP BC JP FNDSPA1 ; ; Empty block found. Set it as used and return with (HL) ; pointing to it (true?). ; FNDSPA3: RLA ;reset byte. INC A ;and set bit 0. CALL STBMAP1 ;update bit map. POP HL ;set return registers. POP DE RET ; ; Free block was not found. If (BC) is not zero, then we have ; not checked all of the disk space. ; FNDSPA4: LD A,C OR B JP NZ,FNDSPA1 LD HL,0 ;set 'not found' status. RET ; ; Move a complete fcb entry into the directory and write it. ; FCBSET: LD C,0 LD E,32 ;length of each entry. ; ; Move (E) bytes from the fcb pointed to by (PARAMS) into ; fcb in directory starting at relative byte (C). This updated ; directory buffer is then written to the disk. ; UPDATE: PUSH DE LD B,0 ;set (BC) to relative byte position. LD HL,(PARAMS) ;get address of fcb. ADD HL,BC ;compute starting byte. EX DE,HL CALL FCB2HL ;get address of fcb to update in directory. POP BC ;set (C) to number of bytes to change. CALL DE2HL UPDATE1: CALL TRKSEC ;determine the track and sector affected. JP DIRWRITE ;then write this sector out. ; ; Routine to change the name of all files on the disk with a ; specified name. The fcb contains the current name as the ; first 12 characters and the new name 16 bytes into the fcb. ; CHGNAMES: CALL CHKWPRT ;check for a write protected disk. LD C,12 ;match first 12 bytes of fcb only. CALL FINDFST ;get first name. LD HL,(PARAMS) ;get address of fcb. LD A,(HL) ;get user number. LD DE,16 ;move over to desired name. ADD HL,DE LD (HL),A ;keep same user number. CHGNAM1: CALL CKFILPOS ;any matching file found? RET Z ;no, we must be done. CALL CHKROFL ;check for read only file. LD C,16 ;start 16 bytes into fcb. LD E,12 ;and update the first 12 bytes of directory. CALL UPDATE CALL FINDNXT ;get the next file name. JP CHGNAM1 ;and continue. ; ; Update a files attributes. The procedure is to search for ; every file with the same name as shown in fcb (ignoring bit 7) ; and then to update it (which includes bit 7). No other changes ; are made. ; SAVEATTR: LD C,12 ;match first 12 bytes. CALL FINDFST ;look for first filename. SAVATR1: CALL CKFILPOS ;was one found? RET Z ;nope, we must be done. LD C,0 ;yes, update the first 12 bytes now. LD E,12 CALL UPDATE ;update filename and write directory. CALL FINDNXT ;and get the next file. JP SAVATR1 ;then continue until done. ; ; Open a file (name specified in fcb). ; OPENIT: LD C,15 ;compare the first 15 bytes. CALL FINDFST ;get the first one in directory. CALL CKFILPOS ;any at all? RET Z OPENIT1: CALL SETEXT ;point to extent byte within users fcb. LD A,(HL) ;and get it. PUSH AF ;save it and address. PUSH HL CALL FCB2HL ;point to fcb in directory. EX DE,HL LD HL,(PARAMS) ;this is the users copy. LD C,32 ;move it into users space. PUSH DE CALL DE2HL CALL SETS2B7 ;set bit 7 in 's2' byte (unmodified). POP DE ;now get the extent byte from this fcb. LD HL,12 ADD HL,DE LD C,(HL) ;into (C). LD HL,15 ;now get the record count byte into (B). ADD HL,DE LD B,(HL) POP HL ;keep the same extent as the user had originally. POP AF LD (HL),A LD A,C ;is it the same as in the directory fcb? CP (HL) LD A,B ;if yes, then use the same record count. JP Z,OPENIT2 LD A,0 ;if the user specified an extent greater than JP C,OPENIT2 ;the one in the directory, then set record count to 0. LD A,128 ;otherwise set to maximum. OPENIT2: LD HL,(PARAMS) ;set record count in users fcb to (A). LD DE,15 ADD HL,DE ;compute relative position. LD (HL),A ;and set the record count. RET ; ; Move two bytes from (DE) to (HL) if (and only if) (HL) ; point to a zero value (16 bit). ; Return with zero flag set it (DE) was moved. Registers (DE) ; and (HL) are not changed. However (A) is. ; MOVEWORD: LD A,(HL) ;check for a zero word. INC HL OR (HL) ;both bytes zero? DEC HL RET NZ ;nope, just return. LD A,(DE) ;yes, move two bytes from (DE) into LD (HL),A ;this zero space. INC DE INC HL LD A,(DE) LD (HL),A DEC DE ;don't disturb these registers. DEC HL RET ; ; Get here to close a file specified by (fcb). ; CLOSEIT: XOR A ;clear status and file position bytes. LD (STATUS),A LD (FILEPOS),A LD (FILEPOS+1),A CALL GETWPRT ;get write protect bit for this drive. RET NZ ;just return if it is set. CALL GETS2 ;else get the 's2' byte. AND 80H ;and look at bit 7 (file unmodified?). RET NZ ;just return if set. LD C,15 ;else look up this file in directory. CALL FINDFST CALL CKFILPOS ;was it found? RET Z ;just return if not. LD BC,16 ;set (HL) pointing to records used section. CALL FCB2HL ADD HL,BC EX DE,HL LD HL,(PARAMS) ;do the same for users specified fcb. ADD HL,BC LD C,16 ;this many bytes are present in this extent. CLOSEIT1: LD A,(BIGDISK) ;8 or 16 bit record numbers? OR A JP Z,CLOSEIT4 LD A,(HL) ;just 8 bit. Get one from users fcb. OR A LD A,(DE) ;now get one from directory fcb. JP NZ,CLOSEIT2 LD (HL),A ;users byte was zero. Update from directory. CLOSEIT2: OR A JP NZ,CLOSEIT3 LD A,(HL) ;directories byte was zero, update from users fcb. LD (DE),A CLOSEIT3: CP (HL) ;if neither one of these bytes were zero, JP NZ,CLOSEIT7 ;then close error if they are not the same. JP CLOSEIT5 ;ok so far, get to next byte in fcbs. CLOSEIT4: CALL MOVEWORD ;update users fcb if it is zero. EX DE,HL CALL MOVEWORD ;update directories fcb if it is zero. EX DE,HL LD A,(DE) ;if these two values are no different, CP (HL) ;then a close error occured. JP NZ,CLOSEIT7 INC DE ;check second byte. INC HL LD A,(DE) CP (HL) JP NZ,CLOSEIT7 DEC C ;remember 16 bit values. CLOSEIT5: INC DE ;bump to next item in table. INC HL DEC C ;there are 16 entries only. JP NZ,CLOSEIT1 ;continue if more to do. LD BC,0FFECH ;backup 20 places (extent byte). ADD HL,BC EX DE,HL ADD HL,BC LD A,(DE) CP (HL) ;directory's extent already greater than the JP C,CLOSEIT6 ;users extent? LD (HL),A ;no, update directory extent. LD BC,3 ;and update the record count byte in ADD HL,BC ;directories fcb. EX DE,HL ADD HL,BC LD A,(HL) ;get from user. LD (DE),A ;and put in directory. CLOSEIT6: LD A,0FFH ;set 'was open and is now closed' byte. LD (CLOSEFLG),A JP UPDATE1 ;update the directory now. CLOSEIT7: LD HL,STATUS ;set return status and then return. DEC (HL) RET ; ; Routine to get the next empty space in the directory. It ; will then be cleared for use. ; GETEMPTY: CALL CHKWPRT ;make sure disk is not write protected. LD HL,(PARAMS) ;save current parameters (fcb). PUSH HL LD HL,EMPTYFCB ;use special one for empty space. LD (PARAMS),HL LD C,1 ;search for first empty spot in directory. CALL FINDFST ;(* only check first byte *) CALL CKFILPOS ;none? POP HL LD (PARAMS),HL ;restore original fcb address. RET Z ;return if no more space. EX DE,HL LD HL,15 ;point to number of records for this file. ADD HL,DE LD C,17 ;and clear all of this space. XOR A GETMT1: LD (HL),A INC HL DEC C JP NZ,GETMT1 LD HL,13 ;clear the 's1' byte also. ADD HL,DE LD (HL),A CALL CHKNMBR ;keep (SCRATCH1) within bounds. CALL FCBSET ;write out this fcb entry to directory. JP SETS2B7 ;set 's2' byte bit 7 (unmodified at present). ; ; Routine to close the current extent and open the next one ; for reading. ; GETNEXT: XOR A LD (CLOSEFLG),A ;clear close flag. CALL CLOSEIT ;close this extent. CALL CKFILPOS RET Z ;not there??? LD HL,(PARAMS) ;get extent byte. LD BC,12 ADD HL,BC LD A,(HL) ;and increment it. INC A AND 1FH ;keep within range 0-31. LD (HL),A JP Z,GTNEXT1 ;overflow? LD B,A ;mask extent byte. LD A,(EXTMASK) AND B LD HL,CLOSEFLG ;check close flag (0ffh is ok). AND (HL) JP Z,GTNEXT2 ;if zero, we must read in next extent. JP GTNEXT3 ;else, it is already in memory. GTNEXT1: LD BC,2 ;Point to the 's2' byte. ADD HL,BC INC (HL) ;and bump it. LD A,(HL) ;too many extents? AND 0FH JP Z,GTNEXT5 ;yes, set error code. ; ; Get here to open the next extent. ; GTNEXT2: LD C,15 ;set to check first 15 bytes of fcb. CALL FINDFST ;find the first one. CALL CKFILPOS ;none available? JP NZ,GTNEXT3 LD A,(RDWRTFLG) ;no extent present. Can we open an empty one? INC A ;0ffh means reading (so not possible). JP Z,GTNEXT5 ;or an error. CALL GETEMPTY ;we are writing, get an empty entry. CALL CKFILPOS ;none? JP Z,GTNEXT5 ;error if true. JP GTNEXT4 ;else we are almost done. GTNEXT3: CALL OPENIT1 ;open this extent. GTNEXT4: CALL STRDATA ;move in updated data (rec #, extent #, etc.) XOR A ;clear status and return. JP SETSTAT ; ; Error in extending the file. Too many extents were needed ; or not enough space on the disk. ; GTNEXT5: CALL IOERR1 ;set error code, clear bit 7 of 's2' JP SETS2B7 ;so this is not written on a close. ; ; Read a sequential file. ; RDSEQ: LD A,1 ;set sequential access mode. LD (MODE),A RDSEQ1: LD A,0FFH ;don't allow reading unwritten space. LD (RDWRTFLG),A CALL STRDATA ;put rec# and ext# into fcb. LD A,(SAVNREC) ;get next record to read. LD HL,SAVNXT ;get number of records in extent. CP (HL) ;within this extent? JP C,RDSEQ2 CP 128 ;no. Is this extent fully used? JP NZ,RDSEQ3 ;no. End-of-file. CALL GETNEXT ;yes, open the next one. XOR A ;reset next record to read. LD (SAVNREC),A LD A,(STATUS) ;check on open, successful? OR A JP NZ,RDSEQ3 ;no, error. RDSEQ2: CALL COMBLK ;ok. compute block number to read. CALL CHKBLK ;check it. Within bounds? JP Z,RDSEQ3 ;no, error. CALL LOGICAL ;convert (BLKNMBR) to logical sector (128 byte). CALL TRKSEC1 ;set the track and sector for this block #. CALL DOREAD ;and read it. JP SETNREC ;and set the next record to be accessed. ; ; Read error occured. Set status and return. ; RDSEQ3: JP IOERR1 ; ; Write the next sequential record. ; WTSEQ: LD A,1 ;set sequential access mode. LD (MODE),A WTSEQ1: LD A,0 ;allow an addition empty extent to be opened. LD (RDWRTFLG),A CALL CHKWPRT ;check write protect status. LD HL,(PARAMS) CALL CKROF1 ;check for read only file, (HL) already set to fcb. CALL STRDATA ;put updated data into fcb. LD A,(SAVNREC) ;get record number to write. CP 128 ;within range? JP NC,IOERR1 ;no, error(?). CALL COMBLK ;compute block number. CALL CHKBLK ;check number. LD C,0 ;is there one to write to? JP NZ,WTSEQ6 ;yes, go do it. CALL GETBLOCK ;get next block number within fcb LD (RELBLOCK),A ;and save. LD BC,0 ;start looking for space from the start OR A ;if none allocated as yet. JP Z,WTSEQ2 LD C,A ;extract previous block number from fcb DEC BC ;so we can be closest to it. CALL EXTBLK LD B,H LD C,L WTSEQ2: CALL FNDSPACE ;find the next empty block nearest number (BC). LD A,L ;check for a zero number. OR H JP NZ,WTSEQ3 LD A,2 ;no more space? JP SETSTAT WTSEQ3: LD (BLKNMBR),HL ;save block number to access. EX DE,HL ;put block number into (DE). LD HL,(PARAMS) ;now we must update the fcb for this LD BC,16 ;newly allocated block. ADD HL,BC LD A,(BIGDISK) ;8 or 16 bit block numbers? OR A LD A,(RELBLOCK) ;(* update this entry *) JP Z,WTSEQ4 ;zero means 16 bit ones. CALL ADDA2HL ;(HL)=(HL)+(A) LD (HL),E ;store new block number. JP WTSEQ5 WTSEQ4: LD C,A ;compute spot in this 16 bit table. LD B,0 ADD HL,BC ADD HL,BC LD (HL),E ;stuff block number (DE) there. INC HL LD (HL),D WTSEQ5: LD C,2 ;set (C) to indicate writing to un-used disk space. WTSEQ6: LD A,(STATUS) ;are we ok so far? OR A RET NZ PUSH BC ;yes, save write flag for bios (register C). CALL LOGICAL ;convert (BLKNMBR) over to logical sectors. LD A,(MODE) ;get access mode flag (1=sequential, DEC A ;0=random, 2=special?). DEC A JP NZ,WTSEQ9 ; ; Special random i/o from function #40. Maybe for M/PM, but the ; current block, if it has not been written to, will be zeroed ; out and then written (reason?). ; POP BC PUSH BC LD A,C ;get write status flag (2=writing unused space). DEC A DEC A JP NZ,WTSEQ9 PUSH HL LD HL,(DIRBUF) ;zero out the directory buffer. LD D,A ;note that (A) is zero here. WTSEQ7: LD (HL),A INC HL INC D ;do 128 bytes. JP P,WTSEQ7 CALL DIRDMA ;tell the bios the dma address for directory access. LD HL,(LOGSECT) ;get sector that starts current block. LD C,2 ;set 'writing to unused space' flag. WTSEQ8: LD (BLKNMBR),HL ;save sector to write. PUSH BC CALL TRKSEC1 ;determine its track and sector numbers. POP BC CALL DOWRITE ;now write out 128 bytes of zeros. LD HL,(BLKNMBR) ;get sector number. LD C,0 ;set normal write flag. LD A,(BLKMASK) ;determine if we have written the entire LD B,A ;physical block. AND L CP B INC HL ;prepare for the next one. JP NZ,WTSEQ8 ;continue until (BLKMASK+1) sectors written. POP HL ;reset next sector number. LD (BLKNMBR),HL CALL DEFDMA ;and reset dma address. ; ; Normal disk write. Set the desired track and sector then ; do the actual write. ; WTSEQ9: CALL TRKSEC1 ;determine track and sector for this write. POP BC ;get write status flag. PUSH BC CALL DOWRITE ;and write this out. POP BC LD A,(SAVNREC) ;get number of records in file. LD HL,SAVNXT ;get last record written. CP (HL) JP C,WTSEQ10 LD (HL),A ;we have to update record count. INC (HL) LD C,2 ; ;* This area has been patched to correct disk update problem ;* when using blocking and de-blocking in the BIOS. ; WTSEQ10: NOP ;was 'dcr c' NOP ;was 'dcr c' LD HL,0 ;was 'jnz wtseq99' ; ; * End of patch. ; PUSH AF CALL GETS2 ;set 'extent written to' flag. AND 7FH ;(* clear bit 7 *) LD (HL),A POP AF ;get record count for this extent. WTSEQ99: CP 127 ;is it full? JP NZ,WTSEQ12 LD A,(MODE) ;yes, are we in sequential mode? CP 1 JP NZ,WTSEQ12 CALL SETNREC ;yes, set next record number. CALL GETNEXT ;and get next empty space in directory. LD HL,STATUS ;ok? LD A,(HL) OR A JP NZ,WTSEQ11 DEC A ;yes, set record count to -1. LD (SAVNREC),A WTSEQ11: LD (HL),0 ;clear status. WTSEQ12: JP SETNREC ;set next record to access. ; ; For random i/o, set the fcb for the desired record number ; based on the 'r0,r1,r2' bytes. These bytes in the fcb are ; used as follows: ; ; fcb+35 fcb+34 fcb+33 ; | 'r-2' | 'r-1' | 'r-0' | ; |7 0 | 7 0 | 7 0| ; |0 0 0 0 0 0 0 0 | 0 0 0 0 0 0 0 0 | 0 0 0 0 0 0 0 0| ; | overflow | | extra | extent | record # | ; | ______________| |_extent|__number___|_____________| ; also 's2' ; ; On entry, register (C) contains 0ffh if this is a read ; and thus we can not access unwritten disk space. Otherwise, ; another extent will be opened (for writing) if required. ; POSITION: XOR A ;set random i/o flag. LD (MODE),A ; ; Special entry (function #40). M/PM ? ; POSITN1: PUSH BC ;save read/write flag. LD HL,(PARAMS) ;get address of fcb. EX DE,HL LD HL,33 ;now get byte 'r0'. ADD HL,DE LD A,(HL) AND 7FH ;keep bits 0-6 for the record number to access. PUSH AF LD A,(HL) ;now get bit 7 of 'r0' and bits 0-3 of 'r1'. RLA INC HL LD A,(HL) RLA AND 1FH ;and save this in bits 0-4 of (C). LD C,A ;this is the extent byte. LD A,(HL) ;now get the extra extent byte. RRA RRA RRA RRA AND 0FH LD B,A ;and save it in (B). POP AF ;get record number back to (A). INC HL ;check overflow byte 'r2'. LD L,(HL) INC L DEC L LD L,6 ;prepare for error. JP NZ,POSITN5 ;out of disk space error. LD HL,32 ;store record number into fcb. ADD HL,DE LD (HL),A LD HL,12 ;and now check the extent byte. ADD HL,DE LD A,C SUB (HL) ;same extent as before? JP NZ,POSITN2 LD HL,14 ;yes, check extra extent byte 's2' also. ADD HL,DE LD A,B SUB (HL) AND 7FH JP Z,POSITN3 ;same, we are almost done then. ; ; Get here when another extent is required. ; POSITN2: PUSH BC PUSH DE CALL CLOSEIT ;close current extent. POP DE POP BC LD L,3 ;prepare for error. LD A,(STATUS) INC A JP Z,POSITN4 ;close error. LD HL,12 ;put desired extent into fcb now. ADD HL,DE LD (HL),C LD HL,14 ;and store extra extent byte 's2'. ADD HL,DE LD (HL),B CALL OPENIT ;try and get this extent. LD A,(STATUS) ;was it there? INC A JP NZ,POSITN3 POP BC ;no. can we create a new one (writing?). PUSH BC LD L,4 ;prepare for error. INC C JP Z,POSITN4 ;nope, reading unwritten space error. CALL GETEMPTY ;yes we can, try to find space. LD L,5 ;prepare for error. LD A,(STATUS) INC A JP Z,POSITN4 ;out of space? ; ; Normal return location. Clear error code and return. ; POSITN3: POP BC ;restore stack. XOR A ;and clear error code byte. JP SETSTAT ; ; Error. Set the 's2' byte to indicate this (why?). ; POSITN4: PUSH HL CALL GETS2 LD (HL),0C0H POP HL ; ; Return with error code (presently in L). ; POSITN5: POP BC LD A,L ;get error code. LD (STATUS),A JP SETS2B7 ; ; Read a random record. ; READRAN: LD C,0FFH ;set 'read' status. CALL POSITION ;position the file to proper record. CALL Z,RDSEQ1 ;and read it as usual (if no errors). RET ; ; Write to a random record. ; WRITERAN: LD C,0 ;set 'writing' flag. CALL POSITION ;position the file to proper record. CALL Z,WTSEQ1 ;and write as usual (if no errors). RET ; ; Compute the random record number. Enter with (HL) pointing ; to a fcb an (DE) contains a relative location of a record ; number. On exit, (C) contains the 'r0' byte, (B) the 'r1' ; byte, and (A) the 'r2' byte. ; ; On return, the zero flag is set if the record is within ; bounds. Otherwise, an overflow occured. ; COMPRAND: EX DE,HL ;save fcb pointer in (DE). ADD HL,DE ;compute relative position of record #. LD C,(HL) ;get record number into (BC). LD B,0 LD HL,12 ;now get extent. ADD HL,DE LD A,(HL) ;compute (BC)=(record #)+(extent)*128. RRCA ;move lower bit into bit 7. AND 80H ;and ignore all other bits. ADD A,C ;add to our record number. LD C,A LD A,0 ;take care of any carry. ADC A,B LD B,A LD A,(HL) ;now get the upper bits of extent into RRCA ;bit positions 0-3. AND 0FH ;and ignore all others. ADD A,B ;add this in to 'r1' byte. LD B,A LD HL,14 ;get the 's2' byte (extra extent). ADD HL,DE LD A,(HL) ADD A,A ;and shift it left 4 bits (bits 4-7). ADD A,A ADD A,A ADD A,A PUSH AF ;save carry flag (bit 0 of flag byte). ADD A,B ;now add extra extent into 'r1'. LD B,A PUSH AF ;and save carry (overflow byte 'r2'). POP HL ;bit 0 of (L) is the overflow indicator. LD A,L POP HL ;and same for first carry flag. OR L ;either one of these set? AND 01H ;only check the carry flags. RET ; ; Routine to setup the fcb (bytes 'r0', 'r1', 'r2') to ; reflect the last record used for a random (or other) file. ; This reads the directory and looks at all extents computing ; the largerst record number for each and keeping the maximum ; value only. Then 'r0', 'r1', and 'r2' will reflect this ; maximum record number. This is used to compute the space used ; by a random file. ; RANSIZE: LD C,12 ;look thru directory for first entry with CALL FINDFST ;this name. LD HL,(PARAMS) ;zero out the 'r0, r1, r2' bytes. LD DE,33 ADD HL,DE PUSH HL LD (HL),D ;note that (D)=0. INC HL LD (HL),D INC HL LD (HL),D RANSIZ1: CALL CKFILPOS ;is there an extent to process? JP Z,RANSIZ3 ;no, we are done. CALL FCB2HL ;set (HL) pointing to proper fcb in dir. LD DE,15 ;point to last record in extent. CALL COMPRAND ;and compute random parameters. POP HL PUSH HL ;now check these values against those LD E,A ;already in fcb. LD A,C ;the carry flag will be set if those SUB (HL) ;in the fcb represent a larger size than INC HL ;this extent does. LD A,B SBC A,(HL) INC HL LD A,E SBC A,(HL) JP C,RANSIZ2 LD (HL),E ;we found a larger (in size) extent. DEC HL ;stuff these values into fcb. LD (HL),B DEC HL LD (HL),C RANSIZ2: CALL FINDNXT ;now get the next extent. JP RANSIZ1 ;continue til all done. RANSIZ3: POP HL ;we are done, restore the stack and RET ;return. ; ; Function to return the random record position of a given ; file which has been read in sequential mode up to now. ; SETRAN: LD HL,(PARAMS) ;point to fcb. LD DE,32 ;and to last used record. CALL COMPRAND ;compute random position. LD HL,33 ;now stuff these values into fcb. ADD HL,DE LD (HL),C ;move 'r0'. INC HL LD (HL),B ;and 'r1'. INC HL LD (HL),A ;and lastly 'r2'. RET ; ; This routine select the drive specified in (ACTIVE) and ; update the login vector and bitmap table if this drive was ; not already active. ; LOGINDRV: LD HL,(LOGIN) ;get the login vector. LD A,(ACTIVE) ;get the default drive. LD C,A CALL SHIFTR ;position active bit for this drive PUSH HL ;into bit 0. EX DE,HL CALL SELECT ;select this drive. POP HL CALL Z,SLCTERR ;valid drive? LD A,L ;is this a newly activated drive? RRA RET C LD HL,(LOGIN) ;yes, update the login vector. LD C,L LD B,H CALL SETBIT LD (LOGIN),HL ;and save. JP BITMAP ;now update the bitmap. ; ; Function to set the active disk number. ; SETDSK: LD A,(EPARAM) ;get parameter passed and see if this LD HL,ACTIVE ;represents a change in drives. CP (HL) RET Z LD (HL),A ;yes it does, log it in. JP LOGINDRV ; ; This is the 'auto disk select' routine. The firsst byte ; of the fcb is examined for a drive specification. If non ; zero then the drive will be selected and loged in. ; AUTOSEL: LD A,0FFH ;say 'auto-select activated'. LD (AUTO),A LD HL,(PARAMS) ;get drive specified. LD A,(HL) AND 1FH ;look at lower 5 bits. DEC A ;adjust for (1=A, 2=B) etc. LD (EPARAM),A ;and save for the select routine. CP 1EH ;check for 'no change' condition. JP NC,AUTOSL1 ;yes, don't change. LD A,(ACTIVE) ;we must change, save currently active LD (OLDDRV),A ;drive. LD A,(HL) ;and save first byte of fcb also. LD (AUTOFLAG),A ;this must be non-zero. AND 0E0H ;whats this for (bits 6,7 are used for LD (HL),A ;something)? CALL SETDSK ;select and log in this drive. AUTOSL1: LD A,(USERNO) ;move user number into fcb. LD HL,(PARAMS) ;(* upper half of first byte *) OR (HL) LD (HL),A RET ;and return (all done). ; ; Function to return the current cp/m version number. ; GETVER: LD A,022H ;version 2.2 JP SETSTAT ; ; Function to reset the disk system. ; RSTDSK: LD HL,0 ;clear write protect status and log LD (WRTPRT),HL ;in vector. LD (LOGIN),HL XOR A ;select drive 'A'. LD (ACTIVE),A LD HL,TBUFF ;setup default dma address. LD (USERDMA),HL CALL DEFDMA JP LOGINDRV ;now log in drive 'A'. ; ; Function to open a specified file. ; OPENFIL: CALL CLEARS2 ;clear 's2' byte. CALL AUTOSEL ;select proper disk. JP OPENIT ;and open the file. ; ; Function to close a specified file. ; CLOSEFIL: CALL AUTOSEL ;select proper disk. JP CLOSEIT ;and close the file. ; ; Function to return the first occurence of a specified file ; name. If the first byte of the fcb is '?' then the name will ; not be checked (get the first entry no matter what). ; GETFST: LD C,0 ;prepare for special search. EX DE,HL LD A,(HL) ;is first byte a '?'? CP '?' JP Z,GETFST1 ;yes, just get very first entry (zero length match). CALL SETEXT ;get the extension byte from fcb. LD A,(HL) ;is it '?'? if yes, then we want CP '?' ;an entry with a specific 's2' byte. CALL NZ,CLEARS2 ;otherwise, look for a zero 's2' byte. CALL AUTOSEL ;select proper drive. LD C,15 ;compare bytes 0-14 in fcb (12&13 excluded). GETFST1: CALL FINDFST ;find an entry and then move it into JP MOVEDIR ;the users dma space. ; ; Function to return the next occurence of a file name. ; GETNXT: LD HL,(SAVEFCB) ;restore pointers. note that no LD (PARAMS),HL ;other dbos calls are allowed. CALL AUTOSEL ;no error will be returned, but the CALL FINDNXT ;results will be wrong. JP MOVEDIR ; ; Function to delete a file by name. ; DELFILE: CALL AUTOSEL ;select proper drive. CALL ERAFILE ;erase the file. JP STSTATUS ;set status and return. ; ; Function to execute a sequential read of the specified ; record number. ; READSEQ: CALL AUTOSEL ;select proper drive then read. JP RDSEQ ; ; Function to write the net sequential record. ; WRTSEQ: CALL AUTOSEL ;select proper drive then write. JP WTSEQ ; ; Create a file function. ; FCREATE: CALL CLEARS2 ;clear the 's2' byte on all creates. CALL AUTOSEL ;select proper drive and get the next JP GETEMPTY ;empty directory space. ; ; Function to rename a file. ; RENFILE: CALL AUTOSEL ;select proper drive and then switch CALL CHGNAMES ;file names. JP STSTATUS ; ; Function to return the login vector. ; GETLOG: LD HL,(LOGIN) JP GETPRM1 ; ; Function to return the current disk assignment. ; GETCRNT: LD A,(ACTIVE) JP SETSTAT ; ; Function to set the dma address. ; PUTDMA: EX DE,HL LD (USERDMA),HL ;save in our space and then get to JP DEFDMA ;the bios with this also. ; ; Function to return the allocation vector. ; GETALOC: LD HL,(ALOCVECT) JP GETPRM1 ; ; Function to return the read-only status vector. ; GETROV: LD HL,(WRTPRT) JP GETPRM1 ; ; Function to set the file attributes (read-only, system). ; SETATTR: CALL AUTOSEL ;select proper drive then save attributes. CALL SAVEATTR JP STSTATUS ; ; Function to return the address of the disk parameter block ; for the current drive. ; GETPARM: LD HL,(DISKPB) GETPRM1: LD (STATUS),HL RET ; ; Function to get or set the user number. If (E) was (FF) ; then this is a request to return the current user number. ; Else set the user number from (E). ; GETUSER: LD A,(EPARAM) ;get parameter. CP 0FFH ;get user number? JP NZ,SETUSER LD A,(USERNO) ;yes, just do it. JP SETSTAT SETUSER: AND 1FH ;no, we should set it instead. keep low LD (USERNO),A ;bits (0-4) only. RET ; ; Function to read a random record from a file. ; RDRANDOM: CALL AUTOSEL ;select proper drive and read. JP READRAN ; ; Function to compute the file size for random files. ; WTRANDOM: CALL AUTOSEL ;select proper drive and write. JP WRITERAN ; ; Function to compute the size of a random file. ; FILESIZE: CALL AUTOSEL ;select proper drive and check file length JP RANSIZE ; ; Function #37. This allows a program to log off any drives. ; On entry, set (DE) to contain a word with bits set for those ; drives that are to be logged off. The log-in vector and the ; write protect vector will be updated. This must be a M/PM ; special function. ; LOGOFF: LD HL,(PARAMS) ;get drives to log off. LD A,L ;for each bit that is set, we want CPL ;to clear that bit in (LOGIN) LD E,A ;and (WRTPRT). LD A,H CPL LD HL,(LOGIN) ;reset the login vector. AND H LD D,A LD A,L AND E LD E,A LD HL,(WRTPRT) EX DE,HL LD (LOGIN),HL ;and save. LD A,L ;now do the write protect vector. AND E LD L,A LD A,H AND D LD H,A LD (WRTPRT),HL ;and save. all done. RET ; ; Get here to return to the user. ; GOBACK: LD A,(AUTO) ;was auto select activated? OR A JP Z,GOBACK1 LD HL,(PARAMS) ;yes, but was a change made? LD (HL),0 ;(* reset first byte of fcb *) LD A,(AUTOFLAG) OR A JP Z,GOBACK1 LD (HL),A ;yes, reset first byte properly. LD A,(OLDDRV) ;and get the old drive and select it. LD (EPARAM),A CALL SETDSK GOBACK1: LD HL,(USRSTACK) ;reset the users stack pointer. LD SP,HL LD HL,(STATUS) ;get return status. LD A,L ;force version 1.4 compatability. LD B,H RET ;and go back to user. ; ; Function #40. This is a special entry to do random i/o. ; For the case where we are writing to unused disk space, this ; space will be zeroed out first. This must be a M/PM special ; purpose function, because why would any normal program even ; care about the previous contents of a sector about to be ; written over. ; WTSPECL: CALL AUTOSEL ;select proper drive. LD A,2 ;use special write mode. LD (MODE),A LD C,0 ;set write indicator. CALL POSITN1 ;position the file. CALL Z,WTSEQ1 ;and write (if no errors). RET ; ;************************************************************** ;* ;* BDOS data storage pool. ;* ;************************************************************** ; EMPTYFCB: db 0e5h ;empty directory segment indicator. WRTPRT: dw 0 ;write protect status for all 16 drives. LOGIN: dw 0 ;drive active word (1 bit per drive). USERDMA: dw 80h ;user's dma address (defaults to 80h). ; ; Scratch areas from parameter block. ; SCRATCH1: dw 0 ;relative position within dir segment for file (0-3). SCRATCH2: dw 0 ;last selected track number. SCRATCH3: dw 0 ;last selected sector number. ; ; Disk storage areas from parameter block. ; DIRBUF: dw 80h ;address of directory buffer to use. DISKPB: dw 0 ;contains address of disk parameter block. CHKVECT: dw 0 ;address of check vector. ALOCVECT: dw 0 ;address of allocation vector (bit map). ; ; Parameter block returned from the bios. ; SECTORS: dw 0 ;sectors per track from bios. BLKSHFT: db 0 ;block shift. BLKMASK: db 0 ;block mask. EXTMASK: db 0 ;extent mask. DSKSIZE: dw 0 ;disk size from bios (number of blocks-1). DIRSIZE: dw 0 ;directory size. ALLOC0: dw 0 ;storage for first bytes of bit map (dir space used). ALLOC1: dw 0 OFFSET: dw 0 ;first usable track number. XLATE: dw 0 ;sector translation table address. ; ; CLOSEFLG: db 0 ;close flag (=0ffh is extent written ok). RDWRTFLG: db 0 ;read/write flag (0ffh=read, 0=write). FNDSTAT: db 0 ;filename found status (0=found first entry). MODE: db 0 ;I/o mode select (0=random, 1=sequential, 2=special random). EPARAM: db 0 ;storage for register (E) on entry to bdos. RELBLOCK: db 0 ;relative position within fcb of block number written. COUNTER: db 0 ;byte counter for directory name searches. SAVEFCB: dw 0,0 ;save space for address of fcb (for directory searches). BIGDISK: db 0 ;if =0 then disk is > 256 blocks long. AUTO: db 0 ;if non-zero, then auto select activated. OLDDRV: db 0 ;on auto select, storage for previous drive. AUTOFLAG: db 0 ;if non-zero, then auto select changed drives. SAVNXT: db 0 ;storage for next record number to access. SAVEXT: db 0 ;storage for extent number of file. SAVNREC: dw 0 ;storage for number of records in file. BLKNMBR: dw 0 ;block number (physical sector) used within a file or logical sect LOGSECT: dw 0 ;starting logical (128 byte) sector of block (physical sector). FCBPOS: db 0 ;relative position within buffer for fcb of file of interest. FILEPOS: dw 0 ;files position within directory (0 to max entries -1). ; ; Disk directory buffer checksum bytes. One for each of the ; 16 possible drives. ; CKSUMTBL: db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 ; ; Extra space ? ; db 0,0,0,0 ; ;************************************************************** ;* ;* B I O S J U M P T A B L E ;* ;************************************************************** ; BOOT: JR 0E333H ;boot NOP WBOOT: JP 0EDD5H ;wboot CONST: JP 0E3D0H ;const CONIN: JP 0E3DDH ;conin CONOUT: JP 0E3DFH ;conout LIST: JP 0E3DFH ;list PUNCH: JP 0E3DFH ;punch READER: JP 0E3DDH ;rdr HOME: JP 0E395H ;home SELDSK: JP 0E3A9H ;seldsk SETTRK: JP 0E397H ;settrk SETSEC: JP 0E39CH ;setsec SETDMA: JP 0E3A1H ;setdma READ: JP 0E3E0H ;read WRITE JP 0E3E4H ;write PRSTAT: JP 0E3D2H ; SECTRN: JP 0E3A6H ;sectrn HUH?: JP 0ED2DH ; E336 00000000 dw 0,0 E33A 00000000 dw 0,0 E33E 73F35AE3 dw 0f373h,0e35ah E342 F3F333F4 dw 0f3f3h,0f433h E346 87E3 dw 0e387h E348 00000000 dw 0,0 E34C 00000000 dw 0,0 E350 73F35AE3 dw 0f373h,0e35ah E354 13F45BF4 dw 0f413h,0f45bh E358 8EE3 dw 0e38eh E35A 2000 dw 32 E35C 04 db 4 E35D 0F db 15 E35E 00 db 0 E35F 3801 dw 312 E361 7F00 dw 127 E363 C0 db 192 E364 00 db 0 E365 2000 dw 32 E367 0300 dw 3 E369 2000 dw 32 E36B 04 db 4 E36C 0F db 15 E36D 00 db 0 E36E 9800 dw 152 E370 7F00 dw 127 E372 C0 db 192 E373 00 db 0 E374 2000 dw 32 E376 0300 dw 3 E378 2000 dw 32 E37A 04 db 4 E37B 0F db 15 E37C 00 db 0 E37D 4800 dw 72 E37F 7F00 dw 127 E381 C0 db 192 E382 00 db 0 E383 2000 dw 32 E385 0300 dw 3 E387 00A0 dw 0a000h E389 01 db 1 E38A 01 db 1 E38B 00 db 0 E38C 0001 dw 100h E38E 00A0 dw 0a000h E390 01 db 1 E391 02 db 2 E392 00 db 0 E393 0001 dw 100h E395 0E00 dw 0eh E397 79 LD A,C ;settrk? E398 3268F3 LD (0F368H),A E39B C9 RET E39C 79 LD A,C ;setsec? E39D 3269F3 LD (0F369H),A E3A0 C9 RET E3A1 ED436AF3 LD (0F36AH),BC ;setdma? E3A5 C9 RET E3A6 60 LD H,B ;sectran E3A7 69 LD L,C E3A8 C9 RET E3A9 79 LD A,C ;seldsk? E3AA 210000 LD HL,0 E3AD FE02 CP 2 E3AF D0 RET NC E3B0 3267F3 LD (0F367H),A E3B3 FD2187E3 LD IY,0E387H ; select A: E3B7 2136E3 LD HL,0E336H E3BA B7 OR A E3BB 2807 JR Z,0E3C4H E3BD 2148E3 LD HL,0E348H ; select B: E3C0 FD218EE3 LD IY,0E38EH E3C4 FB EI E3C5 ED4D RETI E3C7 00 NOP E3C8 46EA dw 0ea46h E3CA C4E3 dw 0e3c4h E3CC 46EF dw 0ef46h E3CE 44EE dw 0ee44h E3D0 AF XOR A E3D1 C9 RET E3D2 210FF5 LD HL,0F50FH E3D5 CB46 BIT 0,(HL) E3D7 3EFF LD A,0FFH E3D9 C8 RET Z E3DA C39BF2 JP 0F29BH E3DD 3E03 LD A,3 ;conin? E3DF C9 RET E3E0 AF XOR A ;read? E3E1 4F LD C,A E3E2 1802 JR 0E3E6H E3E4 3EFF LD A,0FFH ;write? E3E6 326FF3 LD (0F36FH),A E3E9 79 LD A,C E3EA 3270F3 LD (0F370H),A E3ED ED7383F4 LD (0F483H),SP E3F1 31C1F4 LD SP,0F4C1H E3F4 CDFDE3 CALL 0E3FDH E3F7 ED7B83F4 LD SP,(0F483H) E3FB AF XOR A E3FC C9 RET ; ; common code for disk read/write ; E3FD 3A66F3 LD A,(0F366H) E400 B7 OR A E401 2865 JR Z,0E468H E403 3A67F3 LD A,(0F367H) E406 216CF3 LD HL,0F36CH E409 BE CP (HL) E40A 2059 JR NZ,0E465H E40C 3A68F3 LD A,(0F368H) E40F 216DF3 LD HL,0F36DH E412 BE CP (HL) E413 2050 JR NZ,0E465H E415 3A69F3 LD A,(0F369H) E418 E610 AND 10H E41A 216EF3 LD HL,0F36EH E41D BE CP (HL) E41E 2045 JR NZ,0E465H E420 DB08 IN A,(8) E422 CB7F BIT 7,A E424 2807 JR Z,0E42DH E426 3A6DF3 LD A,(0F36DH) E429 FE03 CP 3 E42B 2838 JR Z,0E465H E42D CD1FEA CALL 0EA1FH E430 3A69F3 LD A,(0F369H) E433 E60F AND 0FH E435 215FF6 LD HL,0F65FH E438 57 LD D,A E439 1E00 LD E,0 E43B CB3A SRL D E43D CB1B RR E E43F 19 ADD HL,DE E440 ED5B6AF3 LD DE,(0F36AH) E444 3A6FF3 LD A,(0F36FH) E447 B7 OR A E448 018000 LD BC,80H E44B 2801 JR Z,0E44EH E44D EB EX DE,HL E44E EDB0 LDIR E450 B7 OR A E451 C8 RET Z E452 3265F3 LD (0F365H),A E455 3A6DF3 LD A,(0F36DH) E458 FE03 CP 3 E45A 2805 JR Z,0E461H E45C 3A70F3 LD A,(0F370H) E45F 3D DEC A E460 C0 RET NZ E461 CDA7E4 CALL 0E4A7H E464 C9 RET E465 CDA7E4 CALL 0E4A7H E468 3EFF LD A,0FFH E46A 3266F3 LD (0F366H),A E46D 3A67F3 LD A,(0F367H) E470 2187E3 LD HL,0E387H E473 B7 OR A E474 2803 JR Z,0E479H E476 218EE3 LD HL,0E38EH E479 2271F3 LD (0F371H),HL E47C 216CF3 LD HL,0F36CH E47F BE CP (HL) E480 77 LD (HL),A E481 C480E9 CALL NZ,0E980H E484 3A68F3 LD A,(0F368H) E487 326DF3 LD (0F36DH),A E48A 3A69F3 LD A,(0F369H) E48D E610 AND 10H E48F 326EF3 LD (0F36EH),A E492 3A70F3 LD A,(0F370H) E495 FE02 CP 2 E497 C4A1E4 CALL NZ,0E4A1H E49A AF XOR A E49B 3265F3 LD (0F365H),A E49E C3FDE3 JP 0E3FDH E4A1 CDA7E4 CALL 0E4A7H E4A4 C34DE5 JP 0E54DH E4A7 3A65F3 LD A,(0F365H) E4AA B7 OR A E4AB C47FE6 CALL NZ,0E67FH E4AE AF XOR A E4AF 3265F3 LD (0F365H),A E4B2 C9 RET E4B3 CD80E9 CALL 0E980H E4B6 FD2A71F3 LD IY,(0F371H) E4BA FDCB00C6 SET 0,(IY+0) E4BE FD7E03 LD A,(IY+3) E4C1 D314 OUT (14H),A E4C3 CD1FE9 CALL 0E91FH E4C6 FD360500 LD (IY+5),0 E4CA C9 RET E4CB FD2A71F3 LD IY,(0F371H) E4CF FDCB0046 BIT 0,(IY+0) E4D3 CCB3E4 CALL Z,0E4B3H E4D6 FD7E03 LD A,(IY+3) E4D9 21C7F4 LD HL,0F4C7H E4DC 77 LD (HL),A E4DD AF XOR A E4DE 32C4F4 LD (0F4C4H),A E4E1 32CAF4 LD (0F4CAH),A E4E4 FD4E01 LD C,(IY+1) E4E7 3A6DF3 LD A,(0F36DH) E4EA FDCB0246 BIT 0,(IY+2) E4EE 280F JR Z,0E4FFH E4F0 CB39 SRL C E4F2 CB3F SRL A E4F4 3009 JR NC,0E4FFH E4F6 CBD6 SET 2,(HL) E4F8 F5 PUSH AF E4F9 3E01 LD A,1 E4FB 32C4F4 LD (0F4C4H),A E4FE F1 POP AF E4FF 32C3F4 LD (0F4C3H),A E502 CB39 SRL C E504 B9 CP C E505 3002 JR NC,0E509H E507 CBE6 SET 4,(HL) E509 3A6EF3 LD A,(0F36EH) E50C E610 AND 10H E50E 3E00 LD A,0 E510 2802 JR Z,0E514H E512 3E08 LD A,8 E514 FD8606 ADD A,(IY+6) E517 32C9F4 LD (0F4C9H),A E51A C9 RET E51B 3AC9F4 LD A,(0F4C9H) E51E 21CAF4 LD HL,0F4CAH E521 86 ADD A,(HL) E522 32C6F4 LD (0F4C6H),A E525 3E08 LD A,8 E527 96 SUB (HL) E528 32C5F4 LD (0F4C5H),A E52B 115FF6 LD DE,0F65FH E52E 7E LD A,(HL) E52F 82 ADD A,D E530 57 LD D,A E531 ED53C1F4 LD (0F4C1H),DE E535 C9 RET E536 21C6F4 LD HL,0F4C6H E539 3ADDF4 LD A,(0F4DDH) E53C 96 SUB (HL) E53D C8 RET Z E53E 21CAF4 LD HL,0F4CAH E541 86 ADD A,(HL) E542 32CAF4 LD (0F4CAH),A E545 F6FF OR 0FFH E547 C9 RET E548 CD36E5 CALL 0E536H E54B 1805 JR 0E552H E54D CDCBE4 CALL 0E4CBH E550 1803 JR 0E555H E552 CDA0EB CALL 0EBA0H E555 AF XOR A E556 32CBF4 LD (0F4CBH),A E559 32CCF4 LD (0F4CCH),A E55C CD1BE5 CALL 0E51BH E55F CDC5EA CALL 0EAC5H E562 3AD9F4 LD A,(0F4D9H) E565 E69C AND 9CH E567 C8 RET Z E568 5F LD E,A E569 3ADDF4 LD A,(0F4DDH) E56C 21C6F4 LD HL,0F4C6H E56F BE CP (HL) E570 20D6 JR NZ,0E548H E572 7B LD A,E E573 CB7F BIT 7,A E575 20E5 JR NZ,0E55CH E577 CB57 BIT 2,A E579 20E1 JR NZ,0E55CH E57B 3A02E3 LD A,(0E302H) E57E CB57 BIT 2,A E580 C48BE7 CALL NZ,0E78BH E583 3AD9F4 LD A,(0F4D9H) E586 CB5F BIT 3,A E588 2024 JR NZ,0E5AEH E58A 3ACCF4 LD A,(0F4CCH) E58D B7 OR A E58E 3ACBF4 LD A,(0F4CBH) E591 2005 JR NZ,0E598H E593 3C INC A E594 32CBF4 LD (0F4CBH),A E597 3D DEC A E598 FE1D CP 1DH E59A D26DE7 JP NC,0E76DH E59D 115CE5 LD DE,0E55CH E5A0 D5 PUSH DE E5A1 5F LD E,A E5A2 1600 LD D,0 E5A4 21D6E5 LD HL,0E5D6H E5A7 19 ADD HL,DE E5A8 19 ADD HL,DE E5A9 5E LD E,(HL) E5AA 23 INC HL E5AB 56 LD D,(HL) E5AC EB EX DE,HL E5AD E9 JP (HL) E5AE AF XOR A E5AF 32CBF4 LD (0F4CBH),A E5B2 21CCF4 LD HL,0F4CCH E5B5 34 INC (HL) E5B6 7E LD A,(HL) E5B7 E603 AND 3 E5B9 20A1 JR NZ,0E55CH E5BB 7E LD A,(HL) E5BC CB3F SRL A E5BE CB3F SRL A E5C0 FE1D CP 1DH E5C2 D26DE7 JP NC,0E76DH E5C5 115CE5 LD DE,0E55CH E5C8 D5 PUSH DE E5C9 5F LD E,A E5CA 1600 LD D,0 E5CC 21D6E5 LD HL,0E5D6H E5CF 19 ADD HL,DE E5D0 19 ADD HL,DE E5D1 5E LD E,(HL) E5D2 23 INC HL E5D3 56 LD D,(HL) E5D4 EB EX DE,HL E5D5 E9 JP (HL) E5D6 A0EB dw 0eba0h E5D8 A0EB dw 0eba0h E5DA 10E6 dw 0e610h E5DC A0EB dw 0eba0h E5DE A0EB dw 0eba0h E5E0 3FE6 dw 0e63fh E5E2 A0EB dw 0eba0h E5E4 A0EB dw 0eba0h E5E6 4BE6 dw 0e64bh E5E8 A0EB dw 0eba0h E5EA A0EB dw 0eba0h E5EC A0EB dw 0eba0h E5EE A0EB dw 0eba0h E5F0 10E6 dw 0e610h E5F2 A0EB dw 0eba0h E5F4 A0EB dw 0eba0h E5F6 57E6 dw 0e657h E5F8 3FE6 dw 0e63fh E5FA A0EB dw 0eba0h E5FC A0EB dw 0eba0h E5FE 4BE6 dw 0e64bh E600 A0EB dw 0eba0h E602 A0EB dw 0eba0h E604 A0EB dw 0eba0h E606 A0EB dw 0eba0h E608 10E6 dw 0e610h E60A A0EB dw 0eba0h E60C A0EB dw 0eba0h E60E 57E6 dw 0e657h E610 AF XOR A E611 32CDF4 LD (0F4CDH),A E614 CDA0EB CALL 0EBA0H E617 CD5BEB CALL 0EB5BH E61A 3ADCF4 LD A,(0F4DCH) E61D E69C AND 9CH E61F 2818 JR Z,0E639H E621 CB7F BIT 7,A E623 20EB JR NZ,0E610H E625 CB57 BIT 2,A E627 20E7 JR NZ,0E610H E629 CB5F BIT 3,A E62B 2809 JR Z,0E636H E62D 21CDF4 LD HL,0F4CDH E630 34 INC (HL) E631 7E LD A,(HL) E632 FE14 CP 14H E634 38DE JR C,0E614H E636 C31FE9 JP 0E91FH E639 3ADEF4 LD A,(0F4DEH) E63C D30D OUT (0DH),A E63E C9 RET E63F CD37E9 CALL 0E937H E642 CD56E9 CALL 0E956H E645 CDA0EB CALL 0EBA0H E648 C310E6 JP 0E610H E64B CD56E9 CALL 0E956H E64E CD37E9 CALL 0E937H E651 CDA0EB CALL 0EBA0H E654 C310E6 JP 0E610H E657 CD80E9 CALL 0E980H E65A CDA0EB CALL 0EBA0H E65D C310E6 JP 0E610H E660 CD36E5 CALL 0E536H E663 181F JR 0E684H E665 217AE8 LD HL,0E87AH E668 CD4AF3 CALL 0F34AH E66B 210FF5 LD HL,0F50FH E66E CB46 BIT 0,(HL) E670 CA03E3 JP Z,0E303H E673 CDF9E6 CALL 0E6F9H E676 FE03 CP 03 E678 CA03E3 JP Z,0E303H E67B FE0D CP 0DH E67D 20F4 JR NZ,0E673H E67F CDCBE4 CALL 0E4CBH E682 1803 JR 0E687H E684 CDA0EB CALL 0EBA0H E687 AF XOR A E688 32CBF4 LD (0F4CBH),A E68B 32CCF4 LD (0F4CCH),A E68E CD1BE5 CALL 0E51BH E691 CDF7EA CALL 0EAF7H E694 3ADAF4 LD A,(0F4DAH) E697 B7 OR A E698 C8 RET Z E699 CB77 BIT 6,A E69B 20C8 JR NZ,0E665H E69D 21C6F4 LD HL,0F4C6H E6A0 3ADDF4 LD A,(0F4DDH) E6A3 96 SUB (HL) E6A4 20BA JR NZ,0E660H E6A6 3ADAF4 LD A,(0F4DAH) E6A9 E684 AND 84H E6AB 20E1 JR NZ,0E68EH E6AD 3A02E3 LD A,(0E302H) E6B0 CB57 BIT 2,A E6B2 C417E7 CALL NZ,0E717H E6B5 3ADAF4 LD A,(0F4DAH) E6B8 E608 AND 8 E6BA 2018 JR NZ,0E6D4H E6BC 3ACCF4 LD A,(0F4CCH) E6BF B7 OR A E6C0 20CC JR NZ,0E68EH E6C2 21CBF4 LD HL,0F4CBH E6C5 34 INC (HL) E6C6 7E LD A,(HL) E6C7 3D DEC A E6C8 FE1D CP 1DH E6CA D232E7 JP NC,0E732H E6CD 118EE6 LD DE,0E68EH E6D0 D5 PUSH DE E6D1 C3C9E5 JP 0E5C9H E6D4 AF XOR A E6D5 32CBF4 LD (0F4CBH),A E6D8 3ACCF4 LD A,(0F4CCH) E6DB 3C INC A E6DC 32CCF4 LD (0F4CCH),A E6DF 3D DEC A E6E0 5F LD E,A E6E1 E603 AND 3 E6E3 20A9 JR NZ,0E68EH E6E5 7B LD A,E E6E6 CB3F SRL A E6E8 CB3F SRL A E6EA FE1D CP 1DH E6EC D232E7 JP NC,0E732H E6EF 118EE6 LD DE,0E68EH E6F2 D5 PUSH DE E6F3 C3C9E5 JP 0E5C9H E6F6 CDFCF1 CALL 0F1FCH E6F9 3A0FF5 LD A,(0F50FH) E6FC E601 AND 1 E6FE 3E0D LD A,0DH E700 C8 RET Z E701 CD41F1 CALL 0F141H E704 B7 OR A E705 20EF JR NZ,0E6F6H E707 CDFCF1 CALL 0F1FCH E70A FE0D CP 0DH E70C C8 RET Z E70D FE03 CP 3 E70F CA03E3 JP Z,0E303H E712 FE12 CP 12H E714 20F1 JR NZ,0E707H E716 C9 RET E717 3ADAF4 LD A,(0F4DAH) E71A 32C8F4 LD (0F4C8H),A E71D 215EE8 LD HL,0E85EH E720 CD4AF3 CALL 0F34AH E723 216DE8 LD HL,0E86DH E726 CD4AF3 CALL 0F34AH E729 CDA7E7 CALL 0E7A7H E72C 215EE8 LD HL,0E85EH E72F C34AF3 JP 0F34AH E732 3ADAF4 LD A,(0F4DAH) E735 32C8F4 LD (0F4C8H),A E738 2151E8 LD HL,0E851H E73B CD4AF3 CALL 0F34AH E73E 216DE8 LD HL,0E86DH E741 CD4AF3 CALL 0F34AH E744 CDA7E7 CALL 0E7A7H E747 218CE8 LD HL,0E88CH E74A CD4AF3 CALL 0F34AH E74D CDF9E6 CALL 0E6F9H E750 FE0D CP 0DH E752 CA8EE6 JP Z,0E68EH E755 CD5CE7 CALL 0E75CH E758 C8 RET Z E759 C38EE6 JP 0E68EH E75C 3ADDF4 LD A,(0F4DDH) E75F 3C INC A E760 32DDF4 LD (0F4DDH),A E763 FD2A71F3 LD IY,(0F371H) E767 FD9606 SUB (IY+6) E76A E607 AND 7 E76C C9 RET E76D 2151E8 LD HL,0E851H E770 CD4AF3 CALL 0F34AH E773 CD91E7 CALL 0E791H E776 218CE8 LD HL,0E88CH E779 CD4AF3 CALL 0F34AH E77C CDF9E6 CALL 0E6F9H E77F FE0D CP 0DH E781 CA52E5 JP Z,0E552H E784 CD5CE7 CALL 0E75CH E787 C8 RET Z E788 C348E5 JP 0E548H E78B 215EE8 LD HL,0E85EH E78E CD4AF3 CALL 0F34AH E791 3AD9F4 LD A,(0F4D9H) E794 32C8F4 LD (0F4C8H),A E797 2161E8 LD HL,0E861H E79A CD4AF3 CALL 0F34AH E79D CDA7E7 CALL 0E7A7H E7A0 215EE8 LD HL,0E85EH E7A3 CD4AF3 CALL 0F34AH E7A6 C9 RET E7A7 FD2A71F3 LD IY,(0F371H) E7AB FD7E03 LD A,(IY+3) E7AE E601 AND 1 E7B0 21BAE8 LD HL,0E8BAH E7B3 2003 JR NZ,0E7B8H E7B5 21BEE8 LD HL,0E8BEH E7B8 CD4AF3 CALL 0F34AH E7BB 21C5E8 LD HL,0E8C5H E7BE CD4AF3 CALL 0F34AH E7C1 3AC4F4 LD A,(0F4C4H) E7C4 E601 AND 1 E7C6 CD22E8 CALL 0E822H E7C9 21D3E8 LD HL,0E8D3H E7CC CD4AF3 CALL 0F34AH E7CF 3AC3F4 LD A,(0F4C3H) E7D2 CD22E8 CALL 0E822H E7D5 21DCE8 LD HL,0E8DCH E7D8 CD4AF3 CALL 0F34AH E7DB 3ADDF4 LD A,(0F4DDH) E7DE CD22E8 CALL 0E822H E7E1 21E6E8 LD HL,0E8E6H E7E4 CD4AF3 CALL 0F34AH E7E7 3AC8F4 LD A,(0F4C8H) E7EA CDF3E7 CALL 0E7F3H E7ED 21F0E8 LD HL,0E8F0H E7F0 C34AF3 JP 0F34AH E7F3 F5 PUSH AF E7F6 CB3F SRL A E7F8 CB3F SRL A E7FA CB3F SRL A E7FC CD00E8 CALL 0E800H E7FF F1 POP AF E800 E60F AND 0FH E802 C630 ADD A,30H E804 FE3A CP ':' E806 3802 JR C,0E80AH E808 C607 ADD A,7 E80A FE30 CP 30H E80C 2802 JR Z,0E810H E80E 1601 LD D,1 E810 CB42 BIT 0,D E812 4F LD C,A E813 D5 PUSH DE E814 C419E8 CALL NZ,0E819H E817 D1 POP DE E818 C9 RET E819 210FF5 LD HL,0F50FH E81C CB46 BIT 0,(HL) E81E C8 RET Z E81F C3E9F1 JP 0F1E9H E822 5F LD E,A E823 210000 LD HL,0 E826 0608 LD B,8 E828 AF XOR A E829 CB13 RL E E82B 7D LD A,L E82C 8D ADC A,L E82D 27 DAA E82E 6F LD L,A E82F 7C LD A,H E830 8C ADC A,H E831 27 DAA E832 67 LD H,A E833 10F4 DJNZ 0E829H E835 1600 LD D,0 E837 E5 PUSH HL E838 7C LD A,H E839 CDF3E7 CALL 0E7F3H E83C E1 POP HL E83D E5 PUSH HL E83E 7D LD A,L E83F CB3F SRL A E841 CB3F SRL A E843 CB3F SRL A E845 CB3F SRL A E847 CD00E8 CALL 0E800H E84A E1 POP HL E84B 7D LD A,L E84C 1601 LD D,1 E84E C300E8 JP 0E800H E851 0D0A5065 db cr,lf,'Permanent ',0 E85E 0D0A00 db cr,lf,0 E861 72656164 db 'read error ',0 E86D 77726974 db 'write error ',0 E87A 0D0A5772 db cr,lf,'Write Protec' E888 7465642E db 'ted. ' E88D 52657475 db 'Return - retry,^C' E89E 202D2072 db ' - reboot,^R - ig' E8AF 6E6F7265 db 'nore error',0 E8BA 746F7000 db 'top',0 E8BE 626F7474 db 'bottom',0 E8C5 20647269 db ' drive, side ',0 E8D3 2C207472 db ', track ',0 E8DC 2C207365 db ', sector ',0 E8E6 2C207374 db ', status ',0 E8F0 480D0A00 db 'H',cr,lf,0 E8F4 3ED0 LD A,0D0H E8F6 D30C OUT (0CH),A E8F8 CDFFE8 CALL 0E8FFH E8FB 3ED0 LD A,0D0H E8FD D30C OUT (0CH),A E8FF 0608 LD B,8 E901 10FE DJNZ 0E901H E903 DB08 IN A,(8) E905 CB47 BIT 0,A E907 20FA JR NZ,0E903H E909 C9 RET E90A 0608 LD B,8 E90C 10FE DJNZ 0E90CH E90E DB08 IN A,(8) E910 CB7F BIT 7,A E912 2005 JR NZ,0E919H E914 CB47 BIT 0,A E916 20F6 JR NZ,0E90EH E918 C9 RET E919 CDF4E8 CALL 0E8F4H E91C F680 OR 80H E91E C9 RET E91F CDF4E8 CALL 0E8F4H E922 3E08 LD A,8 E924 D30C OUT (0CH),A E926 CDFFE8 CALL 0E8FFH E929 CDF4E8 CALL 0E8F4H E92C FD2A71F3 LD IY,(0F371H) E930 FD360500 LD (IY+5),0 E934 C3A0EB JP 0EBA0H E937 DB09 IN A,(9) E939 3C INC A E93A 32DEF4 LD (0F4DEH),A E93D CDF4E8 CALL 0E8F4H E940 3E58 LD A,58H E942 D30C OUT (0CH),A E944 CDFFE8 CALL 0E8FFH E947 3ADEF4 LD A,(0F4DEH) E94A FD2A71F3 LD IY,(0F371H) E94E FD7705 LD (IY+5),A E951 D30D OUT (0DH),A E953 C3F4E8 JP 0E8F4H E956 CDF4E8 CALL 0E8F4H E959 DB09 IN A,(9) E95B B7 OR A E95C 2804 JR Z,0E962H E95E 3D DEC A E95F 32DEF4 LD (0F4DEH),A E962 3E78 LD A,78H E964 2006 JR NZ,0E96CH E966 AF XOR A E967 32DEF4 LD (0F4DEH),A E96A 3E08 LD A,8 E96C D30C OUT (0CH),A E96E CDFFE8 CALL 0E8FFH E971 3ADEF4 LD A,(0F4DEH) E974 D30D OUT (0DH),A E976 FD2A71F3 LD IY,(0F371H) E97A FD7705 LD (IY+5),A E97D C3F4E8 JP 0E8F4H E980 CD15EA CALL 0EA15H E983 DB09 IN A,(9) E985 D30F OUT (0FH),A E987 AF XOR A E988 D314 OUT (14H),A E98A DB08 IN A,(8) E98C CB7F BIT 7,A E98E 28FA JR Z,0E98AH E990 CB47 BIT 0,A E992 20F6 JR NZ,0E98AH E994 C9 RET E995 3AC7F4 LD A,(0F4C7H) E998 21CAEB LD HL,0EBCAH E99B E603 AND 3 E99D 46 LD B,(HL) E99E 77 LD (HL),A E99F 78 LD A,B E9A0 B7 OR A E9A1 CD88EB CALL 0EB88H E9A4 C480E9 CALL NZ,0E980H E9A7 DB08 IN A,(8) E9A9 67 LD H,A E9AA CDF4E8 CALL 0E8F4H E9AD CD15EA CALL 0EA15H E9B0 FD2A71F3 LD IY,(0F371H) E9B4 FD7E05 LD A,(IY+5) E9B7 5F LD E,A E9B8 D30D OUT (0DH),A E9BA 3AC7F4 LD A,(0F4C7H) E9BD D314 OUT (14H),A E9BF 3AC3F4 LD A,(0F4C3H) E9C2 D30F OUT (0FH),A E9C4 B7 OR A E9C5 3E18 LD A,18H E9C7 2002 JR NZ,0E9CBH E9C9 3E08 LD A,8 E9CB D30C OUT (0CH),A E9CD CDFFE8 CALL 0E8FFH E9D0 F5 PUSH AF E9D1 DB09 IN A,(9) E9D3 FD7705 LD (IY+5),A E9D6 F1 POP AF E9D7 CB7F BIT 7,A E9D9 2816 JR Z,0E9F1H E9DB 21409C LD HL,09C40H E9DE DB08 IN A,(8) E9E0 CB7F BIT 7,A E9E2 280B JR Z,0E9EFH E9E4 2B DEC HL E9E5 7D LD A,L E9E6 B4 OR H E9E7 20F5 JR NZ,0E9DEH E9E9 CDF4E8 CALL 0E8F4H E9EC F6FF OR 0FFH E9EE C9 RET E9EF 2680 LD H,80H E9F1 CDF4E8 CALL 0E8F4H E9F4 7C LD A,H E9F5 CB7F BIT 7,A E9F7 C8 RET Z E9F8 CDFBE9 CALL 0E9FBH E9FB DB08 IN A,(8) E9FD CB7F BIT 7,A E9FF C2F4E8 JP NZ,0E8F4H EA02 CB4F BIT 1,A EA04 28F5 JR Z,0E9FBH EA06 CDA0EB CALL 0EBA0H EA09 DB08 IN A,(8) EA0B CB7F BIT 7,A EA0D C2F4E8 JP NZ,0E8F4H EA10 CB4F BIT 1,A EA12 20F5 JR NZ,0EA09H EA14 C9 RET EA15 F3 DI EA16 3E43 LD A,43H EA18 D31C OUT (1CH),A EA1A CDF4E8 CALL 0E8F4H EA1D FB EI EA1E C9 RET EA1F CD15EA CALL 0EA15H EA22 DB08 IN A,(8) EA24 CB7F BIT 7,A EA26 201B JR NZ,0EA43H EA28 3AC7F4 LD A,(0F4C7H) EA2B E607 AND 7 EA2D D314 OUT (14H),A EA2F FB EI EA30 3A10F5 LD A,(0F510H) EA33 B7 OR A EA34 C0 RET NZ EA35 3A0FF5 LD A,(0F50FH) EA38 E601 AND 1 EA3A C8 RET Z EA3B CD8DEA CALL 0EA8DH EA3E 3E3C LD A,3CH EA40 32CEF4 LD (0F4CEH),A EA43 FB EI EA44 ED4D RETI EA46 ED73DFF4 LD (0F4DFH),SP EA4A 3109F5 LD SP,0F509H EA4D F5 PUSH AF EA4E E5 PUSH HL EA4F D5 PUSH DE EA50 C5 PUSH BC EA51 DDE5 PUSH IX EA53 FDE5 PUSH IY EA55 DB08 IN A,(8) EA57 F5 PUSH AF EA58 CD15EA CALL 0EA15H EA5B F1 POP AF EA5C CB7F BIT 7,A EA5E 200F JR NZ,0EA6FH EA60 3ACEF4 LD A,(0F4CEH) EA63 B7 OR A EA64 2809 JR Z,0EA6FH EA66 3D DEC A EA67 32CEF4 LD (0F4CEH),A EA6A CD8DEA CALL 0EA8DH EA6D 180F JR 0EA7EH EA6F CD15EA CALL 0EA15H EA72 AF XOR A EA73 D314 OUT (14H),A EA75 32CAEB LD (0EBCAH),A EA78 CD8AEA CALL 0EA8AH EA7B CD88EB CALL 0EB88H EA7E FDE1 POP IY EA80 DDE1 POP IX EA82 C1 POP BC EA83 D1 POP DE EA84 E1 POP HL EA85 F1 POP AF EA86 ED7BDFF4 LD SP,(0F4DFH) EA8A FB EI EA8B ED4D RETI EA8D F3 DI EA8E CDF4E8 CALL 0E8F4H EA91 3EDF LD A,0DFH EA93 D31C OUT (1CH),A EA95 3E01 LD A,1 EA97 D31C OUT (1CH),A EA99 3ED6 LD A,0D6H EA9B D30C OUT (0CH),A EA9D C9 RET EA9E CD95E9 CALL 0E995H EAA1 3AC6F4 LD A,(0F4C6H) EAA4 3D DEC A EAA5 D30E OUT (0EH),A EAA7 3AC5F4 LD A,(0F4C5H) EAAA 5F LD E,A EAAB 0E10 LD C,10H EAAD 0608 LD B,8 EAAF 1604 LD D,4 EAB1 2AC1F4 LD HL,(0F4C1H) EAB4 DB08 IN A,(8) EAB6 CB7F BIT 7,A EAB8 20E4 JR NZ,0EA9EH EABA F3 DI EABB 3AC7F4 LD A,(0F4C7H) EABE E607 AND 7 EAC0 F620 OR 20H EAC2 D314 OUT (14H),A EAC4 C9 RET EAC5 CD9EEA CALL 0EA9EH EAC8 DB0A IN A,(0AH) EACA 3C INC A EACB D30E OUT (0EH),A EACD 3E80 LD A,80H EACF B2 OR D EAD0 D30C OUT (0CH),A EAD2 10FE DJNZ 0EAD2H EAD4 ED50 IN D,(C) EAD6 FAD4EA JP M,0EAD4H EAD9 DB0B IN A,(0BH) EADB 77 LD (HL),A EADC 23 INC HL EADD 10F5 DJNZ 0EAD4H EADF CD0AE9 CALL 0E90AH EAE2 E69C AND 9CH EAE4 32D9F4 LD (0F4D9H),A EAE7 2006 JR NZ,0EAEFH EAE9 1600 LD D,0 EAEB 1D DEC E EAEC C2C8EA JP NZ,0EAC8H EAEF DB0A IN A,(0AH) EAF1 32DDF4 LD (0F4DDH),A EAF4 C31FEA JP 0EA1FH EAF7 CD9EEA CALL 0EA9EH EAFA DB0A IN A,(0AH) EAFC 3C INC A EAFD D30E OUT (0EH),A EAFF 3EA0 LD A,0A0H EB01 B2 OR D EB02 D30C OUT (0CH),A EB04 10FE DJNZ 0EB04H EB06 7E LD A,(HL) EB07 23 INC HL EB08 ED50 IN D,(C) EB0A FA08EB JP M,0EB08H EB0D D30F OUT (0FH),A EB0F 10F5 DJNZ 0EB06H EB11 CD0AE9 CALL 0E90AH EB14 E6DC AND 0DCH EB16 32DAF4 LD (0F4DAH),A EB19 2006 JR NZ,0EB21H EB1B 1D DEC E EB1C 1600 LD D,0 EB1E C2FAEA JP NZ,0EAFAH EB21 DB0A IN A,(0AH) EB23 32DDF4 LD (0F4DDH),A EB26 C31FEA JP 0EA1FH EB29 CD9EEA CALL 0EA9EH ... EB2C DB0A IN A,(00AH) .. EB2E 3C INC A < EB2F D30E OUT (00EH),A .. EB31 3E80 LD A,080H >. EB33 B2 OR D . EB34 D30C OUT (00CH),A .. EB36 10FE DJNZ 01F36H .. EB38 ED50 IN D,(C) .P EB3A FA38EB JP M,0EB38H .8. EB3D DB0B IN A,(00BH) .. EB3F 77 LD (HL),A w EB40 23 INC HL # EB41 10F5 DJNZ 01F38H .. EB43 CD0AE9 CALL 0E90AH ... EB46 E69C AND 09CH .. EB48 32DBF4 LD (0F4DBH),A 2.. EB4B 2006 JR NZ,01F53H . EB4D 1600 LD D,000H .. EB4F 1D DEC E . EB50 C22CEB JP NZ,0EB2CH .,. EB53 DB0A IN A,(00AH) .. EB55 32DDF4 LD (0F4DDH),A 2.. EB58 C31FEA JP 0EA1FH ... EB5B CD9EEA CALL 0EA9EH EB5E 21CFF4 LD HL,0F4CFH EB61 3EC0 LD A,0C0H EB63 B2 OR D EB64 D30C OUT (0CH),A EB66 10FE DJNZ 0EB66H EB68 0606 LD B,6 EB6A ED50 IN D,(C) EB6C FA6AEB JP M,0EB6AH EB6F DB0B IN A,(0BH) EB71 77 LD (HL),A EB72 23 INC HL EB73 10F5 DJNZ 0EB6AH EB75 CD0AE9 CALL 0E90AH EB78 E69C AND 9CH EB7A 32DCF4 LD (0F4DCH),A EB7D 3ACFF4 LD A,(0F4CFH) EB80 32DEF4 LD (0F4DEH),A EB83 D30D OUT (0DH),A EB85 C31FEA JP 0EA1FH EB88 210FF5 LD HL,0F50FH EB8B CB46 BIT 0,(HL) EB8D C8 RET Z EB8E 3A10F5 LD A,(0F510H) EB91 B7 OR A EB92 C0 RET NZ EB93 3E01 LD A,1 EB95 32C6EB LD (0EBC6H),A EB98 FB EI EB99 C9 RET EB9A 2B DEC HL EB9B 7D LD A,L EB9C B4 OR H EB9D 20FB JR NZ,0EB9AH EB9F C9 RET EBA0 3AC7F4 LD A,(0F4C7H) EBA3 E607 AND 7 EBA5 F628 OR 28H EBA7 D314 OUT (14H),A EBA9 21D007 LD HL,7D0H EBAC CD9AEB CALL 0EB9AH EBAF 3AC7F4 LD A,(0F4C7H) EBB2 E60F AND 0FH EBB4 F620 OR 20H EBB6 D314 OUT (14H),A EBB8 218813 LD HL,01388H EBBB CD9AEB CALL 0EB9AH EBBE 3AC7F4 LD A,(0F4C7H) EBC1 E607 AND 7 EBC3 D314 OUT (14H),A EBC5 C9 RET EBC6 00 db 0 EBC7 05000000 db 5,0,0,0 EBCB FF db 0ffh EBCC 54584645 db 'TXFER OA1000.TRM' EBDC 21CBEB LD HL,0EBCBH EBDF 7E LD A,(HL) EBE0 B7 OR A EBE1 C8 RET Z EBE2 3600 LD (HL),0 EBE4 1107CD LD DE,0CD07H EBE7 21CCEB LD HL,0EBCCH EBEA 011000 LD BC,10H EBED 79 LD A,C EBEE 12 LD (DE),A EBEF 13 INC DE EBF0 EDB0 LDIR EBF2 F6FF OR 0FFH EBF4 C9 RET EBF5 79 LD A,C EBF6 FE10 CP 10H EBF8 2015 JR NZ,0EC0FH EBFA ED7311F5 LD (0F511H),SP EBFE 3143F5 LD SP,0F543H EC01 D5 PUSH DE EC02 CDA7E4 CALL 0E4A7H EC05 D1 POP DE EC06 ED7B11F5 LD SP,(0F511H) EC0A 0E10 LD C,10H EC0C C311D5 JP 0D511H EC0F FEC8 CP 0C8H EC11 DA11D5 JP C,0D511H EC14 210000 LD HL,0 EC17 FED3 CP 0D3H EC19 D211D5 JP NC,0D511H EC1C 0600 LD B,0 EC1E 79 LD A,C EC1F D6C8 SUB 0C8H EC21 4F LD C,A EC22 212CEC LD HL,0EC2CH EC25 09 ADD HL,BC EC26 09 ADD HL,BC EC27 7E LD A,(HL) EC28 23 INC HL EC29 66 LD H,(HL) EC2A 6F LD L,A EC2B E9 JP (HL) EC2C ABF2 dw 0f2abh EC2E 42EC dw 0ec42h EC30 9AF1 dw 0f19ah EC32 8CEC dw 0ec8ch EC34 A6EC dw 0eca6h EC36 CEEC dw 0ecceh EC38 EAEC dw 0eceah EC3A 72F1 dw 0f172h EC3C 6BF1 dw 0f16bh EC3E 00ED dw 0ed00h EC40 04ED dw 0ed04h EC42 4B LD C,E EC43 CD97EC CALL 0EC97H EC46 B7 OR A EC47 C0 RET NZ EC48 7E LD A,(HL) EC49 FE01 CP 1 EC4B 2172EC LD HL,0EC72H EC4E 2806 JR Z,0EC56H EC50 217DEC LD HL,0EC7DH EC53 B7 OR A EC54 2031 JR NZ,0EC87H EC56 E5 PUSH HL EC57 C3AEF0 JP 0F0AEH EC5A 010101 db 1,1,1 EC5D 0202 db 2,2 EC5F 000000 db 0,0,0 EC62 02020202 db 2,2,2,2,2,2,2,2 EC6A 000000 db 0,0,0 EC6D 0202 db 2,2 EC6F 010101 db 1,1,1 EC72 FEFF CP 0FFH EC74 2811 JR Z,0EC87H EC76 47 LD B,A EC77 79 LD A,C EC78 B7 OR A EC79 C8 RET Z EC7A 3EFF LD A,0FFH EC7C C9 RET EC7D FEFF CP 0FFH EC7F 2806 JR Z,0EC87H EC81 47 LD B,A EC82 B7 OR A EC83 C8 RET Z EC84 3EFF LD A,0FFH EC86 C9 RET EC87 010000 LD BC,0 EC8A AF XOR A EC8B C9 RET EC8C 4B LD C,E EC8D CD97EC CALL 0EC97H EC90 B7 OR A EC91 C0 RET NZ EC92 CD34F1 CALL 0F134H EC95 AF XOR A EC96 C9 RET EC97 1D DEC E EC98 1600 LD D,0 EC9A 215AEC LD HL,0EC5AH EC9D 19 ADD HL,DE EC9E 7E LD A,(HL) EC9F B7 OR A ECA0 C8 RET Z ECA1 3D DEC A ECA2 C8 RET Z ECA3 3EFF LD A,0FFH ECA5 C9 RET ECA6 42 LD B,D ECA7 4B LD C,E ECA8 7A LD A,D ECA9 B7 OR A ECAA 28F7 JR Z,0ECA3H ECAC FE09 CP 9 ECAE 30F3 JR NC,0ECA3H ECB0 5F LD E,A ECB1 CD97EC CALL 0EC97H ECB4 B7 OR A ECB5 C0 RET NZ ECB6 79 LD A,C ECB7 FE1F CP 1FH ECB9 280E JR Z,0ECC9H ECBB FE11 CP 11H ECBD 38E4 JR C,0ECA3H ECBF FE19 CP 19H ECC1 30E0 JR NC,0ECA3H ECC3 59 LD E,C ECC4 CD97EC CALL 0EC97H ECC7 B7 OR A ECC8 C0 RET NZ ECC9 CD21F0 CALL 0F021H ECCC AF XOR A ECCD C9 RET ECCE 2109F6 LD HL,0F609H ECD1 3606 LD (HL),6 ECD3 EB EX DE,HL ECD4 CDF8EC CALL 0ECF8H ECD7 AF XOR A ECD8 3208F6 LD (0F608H),A ECDB 3A08F6 LD A,(0F608H) ECDE B7 OR A ECDF 28FA JR Z,0ECDBH ECE1 2109F6 LD HL,0F609H ECE4 3A08F6 LD A,(0F608H) ECE7 D606 SUB 6 ECE9 C9 RET ECEA 2109F6 LD HL,0F609H ECED E5 PUSH HL ECEE 3686 LD (HL),86H ECF0 23 INC HL ECF1 010300 LD BC,3 ECF4 EB EX DE,HL ECF5 EDB0 LDIR ECF7 D1 POP DE ECF8 2103F6 LD HL,0F603H ECFB CD9EF1 CALL 0F19EH ECFE FB EI ECFF C9 RET ED00 1607 LD D,7 ED02 1802 JR 0ED06H ED04 1687 LD D,87H ED06 7B LD A,E ED07 D616 SUB 16H ED09 D8 RET C ED0A FE03 CP 3 ED0C D0 RET NC ED0D 2116F6 LD HL,0F616H ED10 73 LD (HL),E ED11 2B DEC HL ED12 2B DEC HL ED13 2B DEC HL ED14 72 LD (HL),D ED15 EB EX DE,HL ED16 CDF8EC CALL 0ECF8H ED19 AF XOR A ED1A C9 RET ED1B 0D43502F db cr,'CP/M 2.2 v.08/82',0 ED2D 310000 LD SP,0 ;cold boot ED30 21FE00 LD HL,0FEH ED33 DD2187E3 LD IX,0E387H ED37 7E LD A,(HL) ED38 DD7703 LD (IX+3),A ED3B 32CAEB LD (0EBCAH),A ED3E DDCB00C6 SET 0,(IX+0) ED42 3D DEC A ED43 32C8EB LD (0EBC8H),A ED46 23 INC HL ED47 DD218EE3 LD IX,0E38EH ED4B 7E LD A,(HL) ED4C DD7703 LD (IX+3),A ED4F 215FF3 LD HL,0F35FH ED52 3600 LD (HL),0 ED54 23 INC HL ED55 7D LD A,L ED56 B4 OR H ED57 20F9 JR NZ,0ED52H ED59 AF XOR A ED5A 3287E3 LD (0E387H),A ED5D CDFEF2 CALL 0F2FEH ED60 0E00 LD C,0 ED62 ED7311F5 LD (0F511H),SP ED66 3143F5 LD SP,0F543H ED69 C5 PUSH BC ED6A 3EC3 LD A,0C3H ED6C 320000 LD (0),A ED6F 320500 LD (5),A ED72 2103E3 LD HL,0E303H ED75 220100 LD (1),HL ED78 2106D5 LD HL,0D506H ED7B 220600 LD (6),HL ED7E 11F5EB LD DE,0EBF5H ED81 23 INC HL ED82 73 LD (HL),E ED83 23 INC HL ED84 72 LD (HL),D ED85 AF XOR A ED86 FD218EE3 LD IY,0E38EH ED8A FD7700 LD (IY+0),A ED8D CDDCEB CALL 0EBDCH ED90 201C JR NZ,0EDAEH ED92 3A0FF5 LD A,(0F50FH) ED95 B7 OR A ED96 2016 JR NZ,0EDAEH ED98 21B6ED LD HL,0EDB6H ED9B 1106E3 LD DE,0E306H ED9E 011200 LD BC,12H EDA1 EDB0 LDIR EDA3 3E01 LD A,1 EDA5 320FF5 LD (0F50FH),A EDA8 211BED LD HL,0ED1BH EDAB CD4AF3 CALL 0F34AH EDAE AF XOR A EDAF 3210F5 LD (0F510H),A EDB2 C1 POP BC EDB3 C300CD JP 0CD00H ;start CP/M EDB6 C341F1 JP 0F141H ;const? EDB9 C3FCF1 JP 0F1FCH ;conin? EDBC C3E9F1 JP 0F1E9H :conout EDBF C3C9F2 JP 0F2C9H ;list? EDC2 C3D6F2 JP 0F2D6H ;punch? EDC5 C3CBF1 JP 0F1CBH ;reader? EDC8 F3 DI EDC9 3A0400 LD A,(4) EDCC 4F LD C,A EDCD FE02 CP 2 EDCF 3891 JR C,0ED62H EDD1 0E00 LD C,0 EDD3 188D JR 0ED62H EDD5 F3 DI ;warm boot? EDD6 3143F5 LD SP,0F543H EDD9 21C8E3 LD HL,0E3C8H EDDC 7C LD A,H EDDD ED47 LD I,A EDDF 7D LD A,L EDE0 D31C OUT (1CH),A EDE2 AF XOR A EDE3 3266F3 LD (0F366H),A EDE6 6F LD L,A EDE7 67 LD H,A EDE8 3D DEC A EDE9 3210F5 LD (0F510H),A EDEC 2209F5 LD (0F509H),HL EDEF 23 INC HL EDF0 23 INC HL EDF1 220BF5 LD (0F50BH),HL EDF4 2100CD LD HL,0CD00H EDF7 220DF5 LD (0F50DH),HL EDFA 010000 LD BC,0 EDFD CDA9E3 CALL 0E3A9H EE00 ED4B09F5 LD BC,(0F509H) EE04 CD97E3 CALL 0E397H EE07 ED4B0BF5 LD BC,(0F50BH) EE0B CD9CE3 CALL 0E39CH EE0E ED4B0DF5 LD BC,(0F50DH) EE12 CDA1E3 CALL 0E3A1H EE15 CDE0E3 CALL 0E3E0H EE18 2A0DF5 LD HL,(0F50DH) EE1B 118000 LD DE,80H EE1E 19 ADD HL,DE EE1F 220DF5 LD (0F50DH),HL EE22 1100E3 LD DE,0E300H EE25 7C LD A,H EE26 BA CP D EE27 309F JR NC,0EDC8H EE29 2A0BF5 LD HL,(0F50BH) EE2C 23 INC HL EE2D 220BF5 LD (0F50BH),HL EE30 7D LD A,L EE31 FE20 CP 20H EE33 38D2 JR C,0EE07H EE35 210000 LD HL,0 EE38 220BF5 LD (0F50BH),HL EE3B 2A09F5 LD HL,(0F509H) EE3E 23 INC HL EE3F 2209F5 LD (0F509H),HL EE42 18BC JR 0EE00H EE44 ED734DF6 LD (0F64DH),SP .sM. EE48 315FF6 LD SP,0F65FH 1_. EE4B E5 PUSH HL . EE4C D5 PUSH DE . EE4D C5 PUSH BC . EE4E F5 PUSH AF . EE4F 3E8F LD A,08FH >. EE51 D31F OUT (01FH),A .. EE53 3E01 LD A,001H >. EE55 D31F OUT (01FH),A .. EE57 0E04 LD C,004H .. EE59 216AF2 LD HL,0F26AH !j. EE5C 7E LD A,(HL) ~ EE5D 2B DEC HL + EE5E B7 OR A . EE5F 202B JR NZ,0228CH + EE61 2103F6 LD HL,0F603H !.. EE64 CB46 BIT 0,(HL) .F EE66 2021 JR NZ,02289H ! EE68 3AC6EB LD A,(0EBC6H) :.. EE6B B7 OR A . EE6C 2813 JR Z,02281H (. EE6E 21C7EB LD HL,0EBC7H !.. EE71 0E03 LD C,003H .. EE73 0604 LD B,004H .. EE75 0C INC C . EE76 EDA3 OUTI .. EE78 20FB JR NZ,02275H . EE7A AF XOR A . EE7B 32C6EB LD (0EBC6H),A 2.. EE7E C33BEF JP 0EF3BH .;. EE81 210DF6 LD HL,0F60DH !.. EE84 CB46 BIT 0,(HL) .F EE86 CA09EF JP Z,0EF09H ... EE89 CB86 RES 0,(HL) .. EE8B 23 INC HL # EE8C 0604 LD B,004H .. EE8E 0D DEC C . EE8F 0C INC C . EE90 EDA3 OUTI .. EE92 20FB JR NZ,0228FH . EE94 AF XOR A . EE95 326AF2 LD (0F26AH),A 2j. EE98 C33BEF JP 0EF3BH .;. EE9B 23 INC HL # EE9C 23 INC HL # EE9D 23 INC HL # EE9E CB46 BIT 0,(HL) .F EEA0 C225EF JP NZ,0EF25H .%. EEA3 2B DEC HL + EEA4 E5 PUSH HL . EEA5 2156F3 LD HL,0F356H !V. EEA8 58 LD E,B X EEA9 1600 LD D,000H .. EEAB 19 ADD HL,DE . EEAC 46 LD B,(HL) F EEAD E1 POP HL . EEAE 0E05 LD C,005H .. EEB0 ED41 OUT (C),B .A EEB2 0C INC C . EEB3 CD79F1 CALL 0F179H .y. EEB6 F5 PUSH AF . EEB7 78 LD A,B x EEB8 FE80 CP 080H .. EEBA 2007 JR NZ,022C3H . EEBC F1 POP AF . EEBD ED41 OUT (C),B .A EEBF 0600 LD B,000H .. EEC1 1838 JR 022FBH .8 EEC3 B7 OR A . EEC4 201C JR NZ,022E2H . EEC6 3E80 LD A,080H >. EEC8 ED79 OUT (C),A .y EECA 0601 LD B,001H .. EECC F1 POP AF . EECD 282C JR Z,022FBH (, EECF C5 PUSH BC . EED0 23 INC HL # EED1 23 INC HL # EED2 CD8FF1 CALL 0F18FH ... EED5 78 LD A,B x EED6 B7 OR A . EED7 C1 POP BC . EED8 2021 JR NZ,022FBH ! EEDA 04 INC B . EEDB 7B LD A,E { EEDC 3D DEC A = EEDD CD84F1 CALL 0F184H ... EEE0 18EB JR 022CDH .. EEE2 ED41 OUT (C),B .A EEE4 F1 POP AF . EEE5 C5 PUSH BC . EEE6 281C JR Z,02304H (. EEE8 23 INC HL # EEE9 23 INC HL # EEEA CD8FF1 CALL 0F18FH ... EEED 78 LD A,B x EEEE B7 OR A . EEEF 2813 JR Z,02304H (. EEF1 FE80 CP 080H .. EEF3 280F JR Z,02304H (. EEF5 7B LD A,E { EEF6 3D DEC A = EEF7 CD84F1 CALL 0F184H ... EEFA E1 POP HL . EEFB 3E81 LD A,081H >. EEFD 0C INC C . EEFE D304 OUT (004H),A .. EF00 ED41 OUT (C),B .A EF02 1837 JR 0233BH .7 EF04 3E01 LD A,001H >. EF06 C1 POP BC . EF07 18F4 JR 022FDH .. EF09 215FF3 LD HL,0F35FH !_. EF0C 7E LD A,(HL) ~ EF0D 3C INC A < EF0E FE03 CP 003H .. EF10 3801 JR C,02313H 8. EF12 AF XOR A . EF13 77 LD (HL),A w EF14 4F LD C,A O EF15 47 LD B,A G EF16 0F RRCA . EF17 0F RRCA . EF18 0F RRCA . EF19 5F LD E,A _ EF1A 1600 LD D,000H .. EF1C 21A3F5 LD HL,0F5A3H !.. EF1F 19 ADD HL,DE . EF20 7E LD A,(HL) ~ EF21 B7 OR A . EF22 C29BEE JP NZ,0EE9BH ... EF25 215FF3 LD HL,0F35FH !_. EF28 7E LD A,(HL) ~ EF29 3C INC A < EF2A FE03 CP 003H .. EF2C 3801 JR C,0232FH 8. EF2E AF XOR A . EF2F 77 LD (HL),A w EF30 B9 CP C . EF31 20E2 JR NZ,02315H . EF33 3EA7 LD A,0A7H >. EF35 D31F OUT (01FH),A .. EF37 3EB4 LD A,0B4H >. EF39 D31F OUT (01FH),A .. EF3B F1 POP AF . EF3C C1 POP BC . EF3D D1 POP DE . EF3E E1 POP HL . EF3F ED7B4DF6 LD SP,(0F64DH) .{M. EF43 FB EI . EF44 ED4D RETI .M EF46 ED733BF6 LD (0F63BH),SP .s;. EF4A 314DF6 LD SP,0F64DH 1M. EF4D E5 PUSH HL . EF4E D5 PUSH DE . EF4F C5 PUSH BC . EF50 F5 PUSH AF . EF51 3E8F LD A,08FH >. EF53 D31E OUT (01EH),A .. EF55 3E01 LD A,001H >. EF57 D31E OUT (01EH),A .. EF59 DB00 IN A,(000H) .. EF5B 0E01 LD C,001H .. EF5D 47 LD B,A G EF5E E67F AND 07FH .. EF60 185A JR 023BCH .Z EF62 ED78 IN A,(C) .x EF64 3263F3 LD (0F363H),A 2c. EF67 3D DEC A = EF68 2156F3 LD HL,0F356H !V. EF6B 5F LD E,A _ EF6C 1600 LD D,000H .. EF6E 19 ADD HL,DE . EF6F 7E LD A,(HL) ~ EF70 D611 SUB 011H .. EF72 0C INC C . EF73 0F RRCA . EF74 0F RRCA . EF75 0F RRCA . EF76 5F LD E,A _ EF77 2143F5 LD HL,0F543H !C. EF7A 19 ADD HL,DE . EF7B 7E LD A,(HL) ~ EF7C FE15 CP 015H .. EF7E 3806 JR C,02386H 8. EF80 3A6AF2 LD A,(0F26AH) :j. EF83 B7 OR A . EF84 2022 JR NZ,023A8H " EF86 78 LD A,B x EF87 FE81 CP 081H .. EF89 2827 JR Z,023B2H (' EF8B 0C INC C . EF8C ED78 IN A,(C) .x EF8E 4F LD C,A O EF8F CDB4F1 CALL 0F1B4H ... EF92 7E LD A,(HL) ~ EF93 FE17 CP 017H .. EF95 3837 JR C,023CEH 87 EF97 23 INC HL # EF98 23 INC HL # EF99 23 INC HL # EF9A CB46 BIT 0,(HL) .F EF9C 2030 JR NZ,023CEH 0 EF9E CBC6 SET 0,(HL) .. EFA0 3A63F3 LD A,(0F363H) :c. EFA3 326AF2 LD (0F26AH),A 2j. EFA6 1826 JR 023CEH .& EFA8 3EA7 LD A,0A7H >. EFAA D31E OUT (01EH),A .. EFAC 3EB4 LD A,0B4H >. EFAE D31E OUT (01EH),A .. EFB0 181C JR 023CEH .. EFB2 ED78 IN A,(C) .x EFB4 4F LD C,A O EFB5 CDB4F1 CALL 0F1B4H ... EFB8 0E03 LD C,003H .. EFBA 18D0 JR 0238CH .. EFBC 3D DEC A = EFBD 28A3 JR Z,02362H (. EFBF 3D DEC A = EFC0 2829 JR Z,023EBH () EFC2 D604 SUB 004H .. EFC4 2813 JR Z,023D9H (. EFC6 78 LD A,B x EFC7 FE05 CP 005H .. EFC9 CA39F1 JP Z,0F139H .9. EFCC DB03 IN A,(003H) .. EFCE F1 POP AF . EFCF C1 POP BC . EFD0 D1 POP DE . EFD1 E1 POP HL . EFD2 ED7B3BF6 LD SP,(0F63BH) .{;. EFD6 FB EI . EFD7 ED4D RETI .M EFD9 78 LD A,B x EFDA 3208F6 LD (0F608H),A 2.. EFDD 2109F6 LD HL,0F609H !.. EFE0 0E00 LD C,000H .. EFE2 0603 LD B,003H .. EFE4 0C INC C . EFE5 EDA2 INI .. EFE7 20FB JR NZ,023E4H . EFE9 18E3 JR 023CEH .. EFEB 78 LD A,B x EFEC FE82 CP 082H .. EFEE 280C JR Z,023FCH (. EFF0 DB03 IN A,(003H) .. EFF2 3261F3 LD (0F361H),A 2a. EFF5 3EFF LD A,0FFH >. EFF7 3260F3 LD (0F360H),A 2`. EFFA 18D2 JR 023CEH .. EFFC ED78 IN A,(C) .x EFFE CDE3F2 CALL 0F2E3H ... F001 FEFF CP 0FFH .. F003 28C7 JR Z,023CCH (. F005 B7 OR A . F006 3D DEC A = F007 0F RRCA . F008 0F RRCA . F009 0F RRCA . F00A 5F LD E,A _ F00B 1600 LD D,000H .. F00D 21A3F5 LD HL,0F5A3H !.. F010 19 ADD HL,DE . F011 23 INC HL # F012 23 INC HL # F013 23 INC HL # F014 DB03 IN A,(003H) .. F016 B7 OR A . F017 2004 JR NZ,0241DH . F019 CB86 RES 0,(HL) .. F01B 18B1 JR 023CEH .. F01D CBC6 SET 0,(HL) .. F01F 18AD JR 023CEH .. F021 ED732FF6 LD (0F62FH),SP .s/. F025 313BF6 LD SP,0F63BH 1;. F028 ED4377F0 LD (0F077H),BC .Cw. F02C 79 LD A,C y F02D CDE3F2 CALL 0F2E3H ... F030 FEFF CP 0FFH .. F032 280D JR Z,02441H (. F034 CD79F0 CALL 0F079H .y. F037 2156F3 LD HL,0F356H !V. F03A 3D DEC A = F03B 5F LD E,A _ F03C 1600 LD D,000H .. F03E 19 ADD HL,DE . F03F AF XOR A . F040 77 LD (HL),A w F041 3A78F0 LD A,(0F078H) :x. F044 2156F3 LD HL,0F356H !V. F047 5F LD E,A _ F048 1D DEC E . F049 1600 LD D,000H .. F04B 19 ADD HL,DE . F04C 4E LD C,(HL) N F04D E5 PUSH HL . F04E CD79F0 CALL 0F079H .y. F051 E1 POP HL . F052 3A77F0 LD A,(0F077H) :w. F055 77 LD (HL),A w F056 FE16 CP 016H .. F058 381A JR C,02474H 8. F05A 3A78F0 LD A,(0F078H) :x. F05D FE06 CP 006H .. F05F 3813 JR C,02474H 8. F061 216DF2 LD HL,0F26DH !m. F064 3603 LD (HL),003H 6. F066 23 INC HL # F067 77 LD (HL),A w F068 23 INC HL # F069 23 INC HL # F06A 3A77F0 LD A,(0F077H) :w. F06D 77 LD (HL),A w F06E 116DF2 LD DE,0F26DH .m. F071 CD9AF1 CALL 0F19AH ... F074 C328F1 JP 0F128H .(. F077 0000 dw 0 . F079 47 LD B,A G F07A FE06 CP 006H .. F07C DA96F0 JP C,0F096H ... F07F 79 LD A,C y F080 FE16 CP 016H .. F082 3810 JR C,02494H 8. F084 C5 PUSH BC . F085 216DF2 LD HL,0F26DH !m. F088 3683 LD (HL),083H 6. F08A 23 INC HL # F08B 70 LD (HL),B p F08C 116DF2 LD DE,0F26DH .m. F08F CD9AF1 CALL 0F19AH ... F092 FB EI . F093 C1 POP BC . F094 78 LD A,B x F095 C9 RET . F096 21A3F5 LD HL,0F5A3H !.. F099 3D DEC A = F09A 280C JR Z,024A8H (. F09C 21C3F5 LD HL,0F5C3H !.. F09F 3D DEC A = F0A0 2806 JR Z,024A8H (. F0A2 21E3F5 LD HL,0F5E3H !.. F0A5 3D DEC A = F0A6 20EC JR NZ,02494H . F0A8 7E LD A,(HL) ~ F0A9 B7 OR A . F0AA 20FC JR NZ,024A8H . F0AC 18E6 JR 02494H .. F0AE 0600 LD B,000H .. F0B0 ED732FF6 LD (0F62FH),SP .s/. F0B4 313BF6 LD SP,0F63BH 1;. F0B7 79 LD A,C y F0B8 FE06 CP 006H .. F0BA 3834 JR C,024F0H 84 F0BC FE0A CP 00AH .. F0BE 3804 JR C,024C4H 8. F0C0 FE16 CP 016H .. F0C2 382C JR C,024F0H 8, F0C4 216DF2 LD HL,0F26DH !m. F0C7 3602 LD (HL),002H 6. F0C9 23 INC HL # F0CA 71 LD (HL),C q F0CB 23 INC HL # F0CC 23 INC HL # F0CD 70 LD (HL),B p F0CE AF XOR A . F0CF 3260F3 LD (0F360H),A 2`. F0D2 116DF2 LD DE,0F26DH .m. F0D5 C5 PUSH BC . F0D6 CD9AF1 CALL 0F19AH ... F0D9 FB EI . F0DA C1 POP BC . F0DB 78 LD A,B x F0DC B7 OR A . F0DD 204A JR NZ,02529H J F0DF 3A60F3 LD A,(0F360H) :`. F0E2 B7 OR A . F0E3 28FA JR Z,024DFH (. F0E5 3A61F3 LD A,(0F361H) :a. F0E8 47 LD B,A G F0E9 3EFD LD A,0FDH >. F0EB 90 SUB B . F0EC 4F LD C,A O F0ED 78 LD A,B x F0EE 1838 JR 02528H .8 F0F0 21A3F5 LD HL,0F5A3H !.. F0F3 3D DEC A = F0F4 2827 JR Z,0251DH (' F0F6 21C3F5 LD HL,0F5C3H !.. F0F9 3D DEC A = F0FA 2821 JR Z,0251DH (! F0FC 21E3F5 LD HL,0F5E3H !.. F0FF 3D DEC A = F100 281B JR Z,0251DH (. F102 2143F5 LD HL,0F543H !C. F105 D60E SUB 00EH .. F107 2814 JR Z,0251DH (. F109 2163F5 LD HL,0F563H !c. F10C 3D DEC A = F10D 280E JR Z,0251DH (. F10F 2183F5 LD HL,0F583H !.. F112 3D DEC A = F113 2808 JR Z,0251DH (. F115 78 LD A,B x F116 B7 OR A . F117 2010 JR NZ,02529H . F119 3EFF LD A,0FFH >. F11B 180C JR 02529H .. F11D 78 LD A,B x F11E B7 OR A . F11F 280D JR Z,0252EH (. F121 F3 DI . F122 AF XOR A . F123 77 LD (HL),A w F124 23 INC HL # F125 77 LD (HL),A w F126 23 INC HL # F127 77 LD (HL),A w F128 FB EI . F129 ED7B2FF6 LD SP,(0F62FH) .{/. F12D C9 RET . F12E 7E LD A,(HL) ~ F12F 47 LD B,A G F130 3E1C LD A,01CH >. F132 18B7 JR 024EBH .. F134 0601 LD B,001H .. F136 C3B0F0 JP 0F0B0H ... F139 DB03 IN A,(003H) .. F13B CDD7EF CALL 0EFD7H ... F13E C3D5ED JP 0EDD5H ... F141 0E11 LD C,11H F143 2143F5 LD HL,0F543H F146 7E LD A,(HL) F147 B7 OR A F148 3EFF LD A,0FFH F14A 5F LD E,A F14B C0 RET NZ F14C 23 INC HL F14D 23 INC HL F14E 23 INC HL F14F 7E LD A,(HL) F150 E601 AND 1 F152 C8 RET Z F153 CB86 RES 0,(HL) F155 79 LD A,C F156 CDE3F2 CALL 0F2E3H F159 4F LD C,A F15A C5 PUSH BC F15B CDAEF0 CALL 0F0AEH F15E C1 POP BC F15F F5 PUSH AF F160 79 LD A,C F161 CD90F2 CALL 0F290H F164 F1 POP AF F165 B7 OR A F166 1EFF LD E,0FFH F168 C8 RET Z F169 18DD JR 0F148H F16B 0E13 LD C,13H F16D 2183F5 LD HL,0F583H F170 18D4 JR 0F146H F172 0E12 LD C,12H F174 2163F5 LD HL,0F563H F177 18CD JR 0F146H F179 7E LD A,(HL) ~ F17A 5F LD E,A _ F17B 1600 LD D,000H .. F17D 13 INC DE . F17E 13 INC DE . F17F 19 ADD HL,DE . F180 46 LD B,(HL) F F181 ED52 SBC HL,DE .R F183 3C INC A < F184 FE1C CP 01CH .. F186 3801 JR C,02589H 8. F188 AF XOR A . F189 F3 DI . F18A 77 LD (HL),A w F18B 2B DEC HL + F18C 2B DEC HL + F18D 35 DEC (HL) 5 F18E C9 RET . F18F 7E LD A,(HL) F190 5F LD E,A F191 1600 LD D,0 F193 13 INC DE F194 13 INC DE F195 19 ADD HL,DE F196 46 LD B,(HL) F197 ED52 SBC HL,DE F199 C9 RET F19A 210DF6 LD HL,0F60DH F19D FB EI F19E CB46 BIT 0,(HL) F1A0 F3 DI F1A1 20FA JR NZ,0F19DH F1A3 CBC6 SET 0,(HL) F1A5 23 INC HL F1A6 0604 LD B,4 F1A8 1A LD A,(DE) F1A9 77 LD (HL),A F1AA 13 INC DE F1AB 23 INC HL F1AC 10FA DJNZ 0F1A8H F1AE C9 RET F1AF 7E LD A,(HL) F1B0 FE1C CP 1CH F1B2 30FB JR NC,0F1AFH F1B4 F3 DI F1B5 23 INC HL F1B6 7E LD A,(HL) F1B7 5F LD E,A F1B8 1600 LD D,0 F1BA 13 INC DE F1BB 13 INC DE F1BC 13 INC DE F1BD 19 ADD HL,DE F1BE 71 LD (HL),C F1BF ED52 SBC HL,DE F1C1 3C INC A F1C2 FE1C CP 1CH F1C4 3801 JR C,0F1C7H F1C6 AF XOR A F1C7 77 LD (HL),A F1C8 2B DEC HL F1C9 34 INC (HL) F1CA C9 RET F1CB 3E12 LD A,12H ;reader? F1CD 3262F3 LD (0F362H),A F1D0 2163F5 LD HL,0F563H F1D3 7E LD A,(HL) F1D4 B7 OR A F1D5 202C JR NZ,0F203H F1D7 ED7317F6 LD (0F617H),SP F1DB 3123F6 LD SP,0F623H F1DE 3E12 LD A,12H F1E0 CDE3F2 CALL 0F2E3H F1E3 2163F5 LD HL,0F563H F1E6 C380F2 JP 0F280H F1E9 ED7323F6 LD (0F623H),SP ;conout? F1ED 312FF6 LD SP,0F62FH F1F0 21A3F5 LD HL,0F5A3H F1F3 CDAFF1 CALL 0F1AFH F1F6 FB EI F1F7 ED7B23F6 LD SP,(0F623H) F1FB C9 RET F1FC 2143F5 LD HL,0F543H F1FF 7E LD A,(HL) F200 B7 OR A F201 286E JR Z,0F271H F203 23 INC HL F204 23 INC HL F205 CD8FF1 CALL 0F18FH F208 48 LD C,B F209 78 LD A,B F20A 0600 LD B,0 F20C FE80 CP 80H F20E 202B JR NZ,0F23BH F210 7B LD A,E F211 3D DEC A F212 FE1C CP 1CH F214 3801 JR C,0F217H F216 AF XOR A F217 CD90F1 CALL 0F190H F21A 78 LD A,B F21B 0E80 LD C,80H F21D C602 ADD A,2 F21F FE03 CP 3 F221 3809 JR C,0F22CH F223 19 ADD HL,DE F224 010000 LD BC,0 F227 35 DEC (HL) F228 2029 JR NZ,0F253H F22A ED52 SBC HL,DE F22C 1B DEC DE F22D 7B LD A,E F22E FE1C CP 1CH F230 3801 JR C,0F233H F232 AF XOR A F233 F3 DI F234 77 LD (HL),A F235 2B DEC HL F236 2B DEC HL F237 35 DEC (HL) F238 35 DEC (HL) F239 180B JR 0F246H F23B B7 OR A F23C 2003 JR NZ,0F241H F23E 01FFFF LD BC,0FFFFH F241 1D DEC E F242 7B LD A,E F243 CD84F1 CALL 0F184H F246 FB EI F247 7E LD A,(HL) F248 23 INC HL F249 23 INC HL F24A 23 INC HL F24B CB46 BIT 0,(HL) F24D 2804 JR Z,0F253H F24F FE0E CP 0EH F251 3803 JR C,0F256H F253 79 LD A,C F254 58 LD E,B F255 C9 RET F256 CB86 RES 0,(HL) F258 C5 PUSH BC F259 3A62F3 LD A,(0F362H) F25C CDE3F2 CALL 0F2E3H F25F CD90F2 CALL 0F290H F262 C1 POP BC F263 18EE JR 0F253H F265 02 db 2 F266 00 db 0 F267 00 db 0 F268 02 db 2 F269 02 db 2 F26A 00 db 0 F26B 00 db 0 F26C 03 db 3 F26D 00 db 0 F26E 00 db 0 F26F 00 db 0 F270 00 db 0 F271 ED7317F6 LD (0F617H),SP F275 3123F6 LD SP,0F623H F278 3E11 LD A,11H F27A CDE3F2 CALL 0F2E3H F27D 2143F5 LD HL,0F543H F280 E5 PUSH HL F281 CD90F2 CALL 0F290H F284 E1 POP HL F285 7E LD A,(HL) F286 B7 OR A F287 28FC JR Z,0F285H F289 ED7B17F6 LD SP,(0F617H) F28D C303F2 JP 0F203H F290 3266F2 LD (0F266H),A F293 1165F2 LD DE,0F265H F296 CD9AF1 CALL 0F19AH F299 FB EI F29A C9 RET F29B F3 DI F29C 21E3F5 LD HL,0F5E3H F29F 7E LD A,(HL) F2A0 FB EI F2A1 FE1C CP 1CH F2A3 3003 JR NC,0F2A8H F2A5 3EFF LD A,0FFH F2A7 C9 RET F2A8 3E00 LD A,0 F2AA C9 RET F2AB 3E13 LD A,13H F2AD 3262F3 LD (0F362H),A F2B0 2183F5 LD HL,0F583H F2B3 7E LD A,(HL) F2B4 B7 OR A F2B5 C203F2 JP NZ,0F203H F2B8 ED7317F6 LD (0F617H),SP F2BC 3123F6 LD SP,0F623H F2BF 3E13 LD A,13H F2C1 CDE3F2 CALL 0F2E3H F2C4 2183F5 LD HL,0F583H F2C7 18B7 JR 0F280H F2C9 ED7323F6 LD (0F623H),SP ;list? F2CD 312FF6 LD SP,0F62FH F2D0 21E3F5 LD HL,0F5E3H F2D3 C3F3F1 JP 0F1F3H F2D6 ED7323F6 LD (0F623H),SP ;punch? F2DA 312FF6 LD SP,0F62FH F2DD 21C3F5 LD HL,0F5C3H F2E0 C3F3F1 JP 0F1F3H F2E3 1E00 LD E,0 F2E5 1600 LD D,0 F2E7 2156F3 LD HL,0F356H F2EA 19 ADD HL,DE F2EB BE CP (HL) F2EC 280A JR Z,0F2F8H F2EE 13 INC DE F2EF 47 LD B,A F2F0 7B LD A,E F2F1 FE09 CP 9 F2F3 2806 JR Z,0F2FBH F2F5 78 LD A,B F2F6 18EF JR 0F2E7H F2F8 7B LD A,E F2F9 3C INC A F2FA C9 RET F2FB 3EFF LD A,0FFH F2FD C9 RET F2FE F3 DI F2FF 21C8E3 LD HL,0E3C8H F302 7C LD A,H F303 ED47 LD I,A F305 ED5E IM 2 F307 0E1C LD C,1CH F309 ED69 OUT (C),L F30B 3E03 LD A,3 F30D ED79 OUT (C),A F30F 0C INC C F310 ED79 OUT (C),A F312 0C INC C F313 218F01 LD HL,18FH F316 ED69 OUT (C),L F318 ED61 OUT (C),H F31A 0C INC C F31B 21A7B4 LD HL,0B4A7H F31E ED69 OUT (C),L F320 ED61 OUT (C),H F322 0606 LD B,6 F324 112000 LD DE,20H F327 2146F5 LD HL,0F546H F32A CBC6 SET 0,(HL) F32C 19 ADD HL,DE F32D 10FB DJNZ 0F32AH F32F DB03 IN A,(3) F331 21AEF0 LD HL,0F0AEH F334 225000 LD (50H),HL F337 219AF1 LD HL,0F19AH F33A 225200 LD (52H),HL F33D 2121F0 LD HL,0F021H F340 225400 LD (54H),HL F343 2134F1 LD HL,0F134H F346 225600 LD (56H),HL F349 C9 RET F34A 7E LD A,(HL) ;print the string F34B B7 OR A ; pointed to by (HL) F34C C8 RET Z F34D 4F LD C,A F34E 23 INC HL F34F E5 PUSH HL F350 CDE9F1 CALL 0F1E9H F353 E1 POP HL F354 18F4 JR 0F34AH F356 1816 JR 0276EH .. F358 17 RLA . F359 00 NOP . F35A 00 NOP . F35B 12 LD (DE),A . F35C 13 INC DE . F35D 110000 LD DE,00000H ... F360 00 NOP . F361 00 NOP . F362 00 NOP . F363 00 NOP . F364 00 NOP . F365 00 NOP . F366 00 NOP . F367 00 db 0 ; drive F368 00 db 0 ; track F369 00 db 0 ; sector F36A 0000 dw 0 ; dma addr F36C 00 NOP . F36D 00 NOP . F36E 00 NOP . F36F 00 NOP . F370 00 NOP . F371 00 NOP . F372 00 NOP . F373 00 NOP . F374 00 NOP . F375 00 NOP . F376 00 NOP . F377 00 NOP . F378 00 NOP . F379 00 NOP . F37A 00 NOP . F37B 00 NOP . F37C 00 NOP . F37D 00 NOP . F37E 00 NOP . F37F 00 NOP . F380 00 NOP . F381 00 NOP . F382 00 NOP . F383 00 NOP . F384 00 NOP . F385 00 NOP . F386 00 NOP . F387 00 NOP . F388 00 NOP . F389 00 NOP . F38A 00 NOP . F38B 00 NOP . F38C 00 NOP . F38D 00 NOP . F38E 00 NOP . F38F 00 NOP . F390 00 NOP . F391 00 NOP . F392 00 NOP . F393 00 NOP . F394 00 NOP . F395 00 NOP . F396 00 NOP . F397 00 NOP . F398 00 NOP . F399 00 NOP . F39A 00 NOP . F39B 00 NOP . F39C 00 NOP . F39D 00 NOP . F39E 00 NOP . F39F 00 NOP . F3A0 00 NOP . F3A1 00 NOP . F3A2 00 NOP . F3A3 00 NOP . F3A4 00 NOP . F3A5 00 NOP . F3A6 00 NOP . F3A7 00 NOP . F3A8 00 NOP . F3A9 00 NOP . F3AA 00 NOP . F3AB 00 NOP . F3AC 00 NOP . F3AD 00 NOP . F3AE 00 NOP . F3AF 00 NOP . F3B0 00 NOP . F3B1 00 NOP . F3B2 00 NOP . F3B3 00 NOP . F3B4 00 NOP . F3B5 00 NOP . F3B6 00 NOP . F3B7 00 NOP . F3B8 00 NOP . F3B9 00 NOP . F3BA 00 NOP . F3BB 00 NOP . F3BC 00 NOP . F3BD 00 NOP . F3BE 00 NOP . F3BF 00 NOP . F3C0 00 NOP . F3C1 00 NOP . F3C2 00 NOP . F3C3 00 NOP . F3C4 00 NOP . F3C5 00 NOP . F3C6 00 NOP . F3C7 00 NOP . F3C8 00 NOP . F3C9 00 NOP . F3CA 00 NOP . F3CB 00 NOP . F3CC 00 NOP . F3CD 00 NOP . F3CE 00 NOP . F3CF 00 NOP . F3D0 00 NOP . F3D1 00 NOP . F3D2 00 NOP . F3D3 00 NOP . F3D4 00 NOP . F3D5 00 NOP . F3D6 00 NOP . F3D7 00 NOP . F3D8 00 NOP . F3D9 00 NOP . F3DA 00 NOP . F3DB 00 NOP . F3DC 00 NOP . F3DD 00 NOP . F3DE 00 NOP . F3DF 00 NOP . F3E0 00 NOP . F3E1 00 NOP . F3E2 00 NOP . F3E3 00 NOP . F3E4 00 NOP . F3E5 00 NOP . F3E6 00 NOP . F3E7 00 NOP . F3E8 00 NOP . F3E9 00 NOP . F3EA 00 NOP . F3EB 00 NOP . F3EC 00 NOP . F3ED 00 NOP . F3EE 00 NOP . F3EF 00 NOP . F3F0 00 NOP . F3F1 00 NOP . F3F2 00 NOP . F3F3 00 NOP . F3F4 00 NOP . F3F5 00 NOP . F3F6 00 NOP . F3F7 00 NOP . F3F8 00 NOP . F3F9 00 NOP . F3FA 00 NOP . F3FB 00 NOP . F3FC 00 NOP . F3FD 00 NOP . F3FE 00 NOP . F3FF 00 NOP . F400 00 NOP . F401 00 NOP . F402 00 NOP . F403 00 NOP . F404 00 NOP . F405 00 NOP . F406 00 NOP . F407 00 NOP . F408 00 NOP . F409 00 NOP . F40A 00 NOP . F40B 00 NOP . F40C 00 NOP . F40D 00 NOP . F40E 00 NOP . F40F 00 NOP . F410 00 NOP . F411 00 NOP . F412 00 NOP . F413 00 NOP . F414 00 NOP . F415 00 NOP . F416 00 NOP . F417 00 NOP . F418 00 NOP . F419 00 NOP . F41A 00 NOP . F41B 00 NOP . F41C 00 NOP . F41D 00 NOP . F41E 00 NOP . F41F 00 NOP . F420 00 NOP . F421 00 NOP . F422 00 NOP . F423 00 NOP . F424 00 NOP . F425 00 NOP . F426 00 NOP . F427 00 NOP . F428 00 NOP . F429 00 NOP . F42A 00 NOP . F42B 00 NOP . F42C 00 NOP . F42D 00 NOP . F42E 00 NOP . F42F 00 NOP . F430 00 NOP . F431 00 NOP . F432 00 NOP . F433 00 NOP . F434 00 NOP . F435 00 NOP . F436 00 NOP . F437 00 NOP . F438 00 NOP . F439 00 NOP . F43A 00 NOP . F43B 00 NOP . F43C 00 NOP . F43D 00 NOP . F43E 00 NOP . F43F 00 NOP . F440 00 NOP . F441 00 NOP . F442 00 NOP . F443 00 NOP . F444 00 NOP . F445 00 NOP . F446 00 NOP . F447 00 NOP . F448 00 NOP . F449 00 NOP . F44A 00 NOP . F44B 00 NOP . F44C 00 NOP . F44D 00 NOP . F44E 00 NOP . F44F 00 NOP . F450 00 NOP . F451 00 NOP . F452 00 NOP . F453 00 NOP . F454 00 NOP . F455 00 NOP . F456 00 NOP . F457 00 NOP . F458 00 NOP . F459 00 NOP . F45A 00 NOP . F45B 00 NOP . F45C 00 NOP . F45D 00 NOP . F45E 00 NOP . F45F 00 NOP . F460 00 NOP . F461 00 NOP . F462 00 NOP . F463 00 NOP . F464 00 NOP . F465 00 NOP . F466 00 NOP . F467 00 NOP . F468 00 NOP . F469 00 NOP . F46A 00 NOP . F46B 00 NOP . F46C 00 NOP . F46D 00 NOP . F46E 00 NOP . F46F 00 NOP . F470 00 NOP . F471 00 NOP . F472 00 NOP . F473 00 NOP . F474 00 NOP . F475 00 NOP . F476 00 NOP . F477 00 NOP . F478 00 NOP . F479 00 NOP . F47A 00 NOP . F47B 00 NOP . F47C 00 NOP . F47D 00 NOP . F47E 00 NOP . F47F 00 NOP . F480 00 NOP . F481 00 NOP . F482 00 NOP . F483 0000 dw 0 ; SP save for read/write F485 00 NOP . F486 00 NOP . F487 00 NOP . F488 00 NOP . F489 00 NOP . F48A 00 NOP . F48B 00 NOP . F48C 00 NOP . F48D 00 NOP . F48E 00 NOP . F48F 00 NOP . F490 00 NOP . F491 00 NOP . F492 00 NOP . F493 00 NOP . F494 00 NOP . F495 00 NOP . F496 00 NOP . F497 00 NOP . F498 00 NOP . F499 00 NOP . F49A 00 NOP . F49B 00 NOP . F49C 00 NOP . F49D 00 NOP . F49E 00 NOP . F49F 00 NOP . F4A0 00 NOP . F4A1 00 NOP . F4A2 00 NOP . F4A3 00 NOP . F4A4 00 NOP . F4A5 00 NOP . F4A6 00 NOP . F4A7 00 NOP . F4A8 00 NOP . F4A9 00 NOP . F4AA 00 NOP . F4AB 00 NOP . F4AC 00 NOP . F4AD 00 NOP . F4AE 00 NOP . F4AF 00 NOP . F4B0 00 NOP . F4B1 00 NOP . F4B2 00 NOP . F4B3 00 NOP . F4B4 00 NOP . F4B5 00 NOP . F4B6 00 NOP . F4B7 00 NOP . F4B8 00 NOP . F4B9 00 NOP . F4BA 00 NOP . F4BB 00 NOP . F4BC 00 NOP . F4BD 00 NOP . F4BE 00 NOP . F4BF 00 NOP . F4C0 00 NOP . F4C1 00 NOP . F4C2 00 NOP . F4C3 00 NOP . F4C4 00 NOP . F4C5 00 NOP . F4C6 00 NOP . F4C7 00 NOP . F4C8 00 NOP . F4C9 00 NOP . F4CA 00 NOP . F4CB 00 NOP . F4CC 00 NOP . F4CD 00 NOP . F4CE 00 NOP . F4CF 00 NOP . F4D0 00 NOP . F4D1 00 NOP . F4D2 00 NOP . F4D3 00 NOP . F4D4 00 NOP . F4D5 00 NOP . F4D6 00 NOP . F4D7 00 NOP . F4D8 00 NOP . F4D9 00 NOP . F4DA 00 NOP . F4DB 00 NOP . F4DC 00 NOP . F4DD 00 NOP . F4DE 00 NOP . F4DF 0000 dw 0 ;save SP for rd/wr F4E1 00 NOP . F4E2 00 NOP . F4E3 00 NOP . F4E4 00 NOP . F4E5 00 NOP . F4E6 00 NOP . F4E7 00 NOP . F4E8 00 NOP . F4E9 00 NOP . F4EA 00 NOP . F4EB 00 NOP . F4EC 00 NOP . F4ED 00 NOP . F4EE 00 NOP . F4EF 00 NOP . F4F0 00 NOP . F4F1 00 NOP . F4F2 00 NOP . F4F3 00 NOP . F4F4 00 NOP . F4F5 00 NOP . F4F6 00 NOP . F4F7 00 NOP . F4F8 00 NOP . F4F9 00 NOP . F4FA 00 NOP . F4FB 00 NOP . F4FC 00 NOP . F4FD 00 NOP . F4FE 00 NOP . F4FF 00 NOP . F500 00 NOP . F501 00 NOP . F502 00 NOP . F503 00 NOP . F504 00 NOP . F505 00 NOP . F506 00 NOP . F507 00 NOP . F508 00 NOP . F509 00 NOP . F50A 00 NOP . F50B 00 NOP . F50C 00 NOP . F50D 00 NOP . F50E 00 NOP . F50F 00 NOP . F510 00 NOP . F511 00 NOP . F512 00 NOP . F513 00 NOP . F514 00 NOP . F515 00 NOP . F516 00 NOP . F517 00 NOP . F518 00 NOP . F519 00 NOP . F51A 00 NOP . F51B 00 NOP . F51C 00 NOP . F51D 00 NOP . F51E 00 NOP . F51F 00 NOP . F520 00 NOP . F521 00 NOP . F522 00 NOP . F523 00 NOP . F524 00 NOP . F525 00 NOP . F526 00 NOP . F527 00 NOP . F528 00 NOP . F529 00 NOP . F52A 00 NOP . F52B 00 NOP . F52C 00 NOP . F52D 00 NOP . F52E 00 NOP . F52F 00 NOP . F530 00 NOP . F531 00 NOP . F532 00 NOP . F533 00 NOP . F534 00 NOP . F535 00 NOP . F536 00 NOP . F537 00 NOP . F538 00 NOP . F539 00 NOP . F53A 00 NOP . F53B 00 NOP . F53C 00 NOP . F53D 00 NOP . F53E 00 NOP . F53F 00 NOP . F540 00 NOP . F541 00 NOP . F542 00 NOP . F543 00 NOP . F544 00 NOP . F545 00 NOP . F546 00 NOP . F547 00 NOP . F548 00 NOP . F549 00 NOP . F54A 00 NOP . F54B 00 NOP . F54C 00 NOP . F54D 00 NOP . F54E 00 NOP . F54F 00 NOP . F550 00 NOP . F551 00 NOP . F552 00 NOP . F553 00 NOP . F554 00 NOP . F555 00 NOP . F556 00 NOP . F557 00 NOP . F558 00 NOP . F559 00 NOP . F55A 00 NOP . F55B 00 NOP . F55C 00 NOP . F55D 00 NOP . F55E 00 NOP . F55F 00 NOP . F560 00 NOP . F561 00 NOP . F562 00 NOP . F563 00 NOP . F564 00 NOP . F565 00 NOP . F566 00 NOP . F567 00 NOP . F568 00 NOP . F569 00 NOP . F56A 00 NOP . F56B 00 NOP . F56C 00 NOP . F56D 00 NOP . F56E 00 NOP . F56F 00 NOP . F570 00 NOP . F571 00 NOP . F572 00 NOP . F573 00 NOP . F574 00 NOP . F575 00 NOP . F576 00 NOP . F577 00 NOP . F578 00 NOP . F579 00 NOP . F57A 00 NOP . F57B 00 NOP . F57C 00 NOP . F57D 00 NOP . F57E 00 NOP . F57F 00 NOP . F580 00 NOP . F581 00 NOP . F582 00 NOP . F583 00 NOP . F584 00 NOP . F585 00 NOP . F586 00 NOP . F587 00 NOP . F588 00 NOP . F589 00 NOP . F58A 00 NOP . F58B 00 NOP . F58C 00 NOP . F58D 00 NOP . F58E 00 NOP . F58F 00 NOP . F590 00 NOP . F591 00 NOP . F592 00 NOP . F593 00 NOP . F594 00 NOP . F595 00 NOP . F596 00 NOP . F597 00 NOP . F598 00 NOP . F599 00 NOP . F59A 00 NOP . F59B 00 NOP . F59C 00 NOP . F59D 00 NOP . F59E 00 NOP . F59F 00 NOP . F5A0 00 NOP . F5A1 00 NOP . F5A2 00 NOP . F5A3 00 NOP . F5A4 00 NOP . F5A5 00 NOP . F5A6 00 NOP . F5A7 00 NOP . F5A8 00 NOP . F5A9 00 NOP . F5AA 00 NOP . F5AB 00 NOP . F5AC 00 NOP . F5AD 00 NOP . F5AE 00 NOP . F5AF 00 NOP . F5B0 00 NOP . F5B1 00 NOP . F5B2 00 NOP . F5B3 00 NOP . F5B4 00 NOP . F5B5 00 NOP . F5B6 00 NOP . F5B7 00 NOP . F5B8 00 NOP . F5B9 00 NOP . F5BA 00 NOP . F5BB 00 NOP . F5BC 00 NOP . F5BD 00 NOP . F5BE 00 NOP . F5BF 00 NOP . F5C0 00 NOP . F5C1 00 NOP . F5C2 00 NOP . F5C3 00 NOP . F5C4 00 NOP . F5C5 00 NOP . F5C6 00 NOP . F5C7 00 NOP . F5C8 00 NOP . F5C9 00 NOP . F5CA 00 NOP . F5CB 00 NOP . F5CC 00 NOP . F5CD 00 NOP . F5CE 00 NOP . F5CF 00 NOP . F5D0 00 NOP . F5D1 00 NOP . F5D2 00 NOP . F5D3 00 NOP . F5D4 00 NOP . F5D5 00 NOP . F5D6 00 NOP . F5D7 00 NOP . F5D8 00 NOP . F5D9 00 NOP . F5DA 00 NOP . F5DB 00 NOP . F5DC 00 NOP . F5DD 00 NOP . F5DE 00 NOP . F5DF 00 NOP . F5E0 00 NOP . F5E1 00 NOP . F5E2 00 NOP . F5E3 00 NOP . F5E4 00 NOP . F5E5 00 NOP . F5E6 00 NOP . F5E7 00 NOP . F5E8 00 NOP . F5E9 00 NOP . F5EA 00 NOP . F5EB 00 NOP . F5EC 00 NOP . F5ED 00 NOP . F5EE 00 NOP . F5EF 00 NOP . F5F0 00 NOP . F5F1 00 NOP . F5F2 00 NOP . F5F3 00 NOP . F5F4 00 NOP . F5F5 00 NOP . F5F6 00 NOP . F5F7 00 NOP . F5F8 00 NOP . F5F9 00 NOP . F5FA 00 NOP . F5FB 00 NOP . F5FC 00 NOP . F5FD 00 NOP . F5FE 00 NOP . F5FF 00 NOP . F600 00 NOP . F601 00 NOP . F602 00 NOP . F603 00 NOP . F604 00 NOP . F605 00 NOP . F606 00 NOP . F607 00 NOP . F608 00 NOP . F609 00 NOP . F60A 00 NOP . F60B 00 NOP . F60C 00 NOP . F60D 00 NOP . F60E 00 NOP . F60F 00 NOP . F610 00 NOP . F611 00 NOP . F612 00 NOP . F613 00 NOP . F614 00 NOP . F615 00 NOP . F616 00 NOP . F617 00 NOP . F618 00 NOP . F619 00 NOP . F61A 00 NOP . F61B 00 NOP . F61C 00 NOP . F61D 00 NOP . F61E 00 NOP . F61F 00 NOP . F620 00 NOP . F621 00 NOP . F622 00 NOP . F623 00 NOP . F624 00 NOP . F625 00 NOP . F626 00 NOP . F627 00 NOP . F628 00 NOP . F629 00 NOP . F62A 00 NOP . F62B 00 NOP . F62C 00 NOP . F62D 00 NOP . F62E 00 NOP . F62F 00 NOP . F630 00 NOP . F631 00 NOP . F632 00 NOP . F633 00 NOP . F634 00 NOP . F635 00 NOP . F636 00 NOP . F637 00 NOP . F638 00 NOP . F639 00 NOP . F63A 00 NOP . F63B 00 NOP . F63C 00 NOP . F63D 00 NOP . F63E 00 NOP . F63F 00 NOP . F640 00 NOP . F641 00 NOP . F642 00 NOP . F643 00 NOP . F644 00 NOP . F645 00 NOP . F646 00 NOP . F647 00 NOP . F648 00 NOP . F649 00 NOP . F64A 00 NOP . F64B 00 NOP . F64C 00 NOP . F64D 00 NOP . F64E 00 NOP . F64F 00 NOP . F650 00 NOP . F651 00 NOP . F652 00 NOP . F653 00 NOP . F654 00 NOP . F655 00 NOP . F656 00 NOP . F657 00 NOP . F658 00 NOP . F659 00 NOP . F65A 00 NOP . F65B 00 NOP . F65C 00 NOP . F65D 00 NOP . F65E 00 NOP . F65F 00 NOP . F660 00 NOP . F661 00 NOP . F662 00 NOP . F663 00 NOP . F664 00 NOP . F665 00 NOP . F666 00 NOP . F667 00 NOP . F668 00 NOP . F669 00 NOP . F66A 00 NOP . F66B 00 NOP . F66C 00 NOP . F66D 00 NOP . F66E 00 NOP . F66F 00 NOP . F670 00 NOP . F671 00 NOP . F672 00 NOP . F673 00 NOP . F674 00 NOP . F675 00 NOP . F676 00 NOP . F677 00 NOP . F678 00 NOP . F679 00 NOP . F67A 00 NOP . F67B 00 NOP . F67C 00 NOP . F67D 00 NOP . F67E 00 NOP . F67F 00 NOP . F680 00 NOP . F681 00 NOP . F682 00 NOP . F683 00 NOP . F684 00 NOP . F685 00 NOP . F686 00 NOP . F687 00 NOP . F688 00 NOP . F689 00 NOP . F68A 00 NOP . F68B 00 NOP . F68C 00 NOP . F68D 00 NOP . F68E 00 NOP . F68F 00 NOP . F690 00 NOP . F691 00 NOP . F692 00 NOP . F693 00 NOP . F694 00 NOP . F695 00 NOP . F696 00 NOP . F697 00 NOP . F698 00 NOP . F699 00 NOP . F69A 00 NOP . F69B 00 NOP . F69C 00 NOP . F69D 00 NOP . F69E 00 NOP . F69F 00 NOP . F6A0 00 NOP . F6A1 00 NOP . F6A2 00 NOP . F6A3 00 NOP . F6A4 00 NOP . F6A5 00 NOP . F6A6 00 NOP . F6A7 00 NOP . F6A8 00 NOP . F6A9 00 NOP . F6AA 00 NOP . F6AB 00 NOP . F6AC 00 NOP . F6AD 00 NOP . F6AE 00 NOP . F6AF 00 NOP . F6B0 00 NOP . F6B1 00 NOP . F6B2 00 NOP . F6B3 00 NOP . F6B4 00 NOP . F6B5 00 NOP . F6B6 00 NOP . F6B7 00 NOP . F6B8 00 NOP . F6B9 00 NOP . F6BA 00 NOP . F6BB 00 NOP . F6BC 00 NOP . F6BD 00 NOP . F6BE 00 NOP . F6BF 00 NOP . F6C0 00 NOP . F6C1 00 NOP . F6C2 00 NOP . F6C3 00 NOP . F6C4 00 NOP . F6C5 00 NOP . F6C6 00 NOP . F6C7 00 NOP . F6C8 00 NOP . F6C9 00 NOP . F6CA 00 NOP . F6CB 00 NOP . F6CC 00 NOP . F6CD 00 NOP . F6CE 00 NOP . F6CF 00 NOP . F6D0 00 NOP . F6D1 00 NOP . F6D2 00 NOP . F6D3 00 NOP . F6D4 00 NOP . F6D5 00 NOP . F6D6 00 NOP . F6D7 00 NOP . F6D8 00 NOP . F6D9 00 NOP . F6DA 00 NOP . F6DB 00 NOP . F6DC 00 NOP . F6DD 00 NOP . F6DE 00 NOP . F6DF 00 NOP . F6E0 00 NOP . F6E1 00 NOP . F6E2 00 NOP . F6E3 00 NOP . F6E4 00 NOP . F6E5 00 NOP . F6E6 00 NOP . F6E7 00 NOP . F6E8 00 NOP . F6E9 00 NOP . F6EA 00 NOP . F6EB 00 NOP . F6EC 00 NOP . F6ED 00 NOP . F6EE 00 NOP . F6EF 00 NOP . F6F0 00 NOP . F6F1 00 NOP . F6F2 00 NOP . F6F3 00 NOP . F6F4 00 NOP . F6F5 00 NOP . F6F6 00 NOP . F6F7 00 NOP . F6F8 00 NOP . F6F9 00 NOP . F6FA 00 NOP . F6FB 00 NOP . F6FC 00 NOP . F6FD 00 NOP . F6FE 00 NOP . F6FF 00 NOP . F700 00 NOP . F701 00 NOP . F702 00 NOP . F703 00 NOP . F704 00 NOP . F705 00 NOP . F706 00 NOP . F707 00 NOP . F708 00 NOP . F709 00 NOP . F70A 00 NOP . F70B 00 NOP . F70C 00 NOP . F70D 00 NOP . F70E 00 NOP . F70F 00 NOP . F710 00 NOP . F711 00 NOP . F712 00 NOP . F713 00 NOP . F714 00 NOP . F715 08 EX AF,AF' . F716 00 NOP . F717 00 NOP . F718 00 NOP . F719 00 NOP . F71A 00 NOP . F71B 24 INC H $ F71C 210000 LD HL,00000H !.. F71F 00 NOP . F720 24 INC H $ F721 00 NOP . F722 00 NOP . F723 00 NOP . F724 00 NOP . F725 00 NOP . F726 00 NOP . F727 00 NOP . F728 00 NOP . F729 00 NOP . F72A 00 NOP . F72B 00 NOP . F72C 00 NOP . F72D 00 NOP . F72E 00 NOP . F72F 00 NOP . F730 00 NOP . F731 40 LD B,B @ F732 04 INC B . F733 08 EX AF,AF' . F734 42 LD B,D B F735 2011 JR NZ,02B48H . F737 00 NOP . F738 00 NOP . F739 81 ADD A,C . F73A 12 LD (DE),A . F73B 42 LD B,D B F73C 1092 DJNZ 02AD0H .. F73E 00 NOP . F73F 04 INC B . F740 90 SUB B . F741 84 ADD A,H . F742 00 NOP . F743 08 EX AF,AF' . F744 1010 DJNZ 02B56H .. F746 00 NOP . F747 112092 LD DE,09220H . . F74A 48 LD C,B H F74B 92 SUB D . F74C 48 LD C,B H F74D 09 ADD HL,BC . F74E 02 LD (BC),A . F74F 49 LD C,C I F750 12 LD (DE),A . F751 49 LD C,C I F752 24 INC H $ F753 90 SUB B . F754 82 ADD A,D . F755 40 LD B,B @ F756 88 ADC A,B . F757 44 LD B,H D F758 80 ADD A,B . F759 00 NOP . F75A 00 NOP . F75B 010092 LD BC,09200H ... F75E 49 LD C,C I F75F 2041 JR NZ,02BA2H A F761 12 LD (DE),A . F762 08 EX AF,AF' . F763 88 ADC A,B . F764 42 LD B,D B F765 49 LD C,C I F766 010000 LD BC,00000H ... F769 00 NOP . F76A 00 NOP . F76B 80 ADD A,B . F76C 24 INC H $ F76D 12 LD (DE),A . F76E 220401 LD (00104H),HL ".. F771 111024 LD DE,02410H ..$ F774 1082 DJNZ 02AF8H .. F776 48 LD C,B H F777 81 ADD A,C . F778 02 LD (BC),A . F779 24 INC H $ F77A 1082 DJNZ 02AFEH .. F77C 48 LD C,B H F77D 81 ADD A,C . F77E 00 NOP . F77F 88 ADC A,B . F780 010800 LD BC,00008H ... F783 00 NOP . F784 00 NOP . F785 00 NOP . F786 80 ADD A,B . F787 40 LD B,B @ F788 82 ADD A,D . F789 08 EX AF,AF' . F78A 111200 LD DE,00012H ... F78D 24 INC H $ F78E 81 ADD A,C . F78F 24 INC H $ F790 49 LD C,C I F791 210904 LD HL,00409H !.. F794 92 SUB D . F795 48 LD C,B H F796 92 SUB D . F797 00 NOP . F798 2AAA09 LD HL,(009AAH) *.. F79B 12 LD (DE),A . F79C 00 NOP . F79D 09 ADD HL,BC . F79E 00 NOP . F79F 24 INC H $ F7A0 48 LD C,B H F7A1 04 INC B . F7A2 04 INC B . F7A3 08 EX AF,AF' . F7A4 08 EX AF,AF' . F7A5 88 ADC A,B . F7A6 40 LD B,B @ F7A7 84 ADD A,H . F7A8 00 NOP . F7A9 40 LD B,B @ F7AA 41 LD B,C A F7AB 2084 JR NZ,02B31H . F7AD 82 ADD A,D . F7AE 12 LD (DE),A . F7AF 49 LD C,C I F7B0 04 INC B . F7B1 02 LD (BC),A . F7B2 09 ADD HL,BC . F7B3 24 INC H $ F7B4 00 NOP . F7B5 88 ADC A,B . F7B6 02 LD (BC),A . F7B7 44 LD B,H D F7B8 1092 DJNZ 02B4CH .. F7BA 12 LD (DE),A . F7BB 08 EX AF,AF' . F7BC 1021 DJNZ 02BDFH .! F7BE 02 LD (BC),A . F7BF 1021 DJNZ 02BE2H .! F7C1 24 INC H $ F7C2 49 LD C,C I F7C3 224249 LD (04942H),HL "BI F7C6 220449 LD (04904H),HL ".I F7C9 224001 LD (00140H),HL "@. F7CC 24 INC H $ F7CD 92 SUB D . F7CE 42 LD B,D B F7CF 08 EX AF,AF' . F7D0 88 ADC A,B . F7D1 04 INC B . F7D2 12 LD (DE),A . F7D3 49 LD C,C I F7D4 12 LD (DE),A . F7D5 49 LD C,C I F7D6 12 LD (DE),A . F7D7 48 LD C,B H F7D8 89 ADC A,C . F7D9 1000 DJNZ 02BDBH .. F7DB 80 ADD A,B . F7DC 24 INC H $ F7DD 84 ADD A,H . F7DE 92 SUB D . F7DF 24 INC H $ F7E0 92 SUB D . F7E1 00 NOP . F7E2 24 INC H $ F7E3 89 ADC A,C . F7E4 24 INC H $ F7E5 84 ADD A,H . F7E6 88 ADC A,B . F7E7 42 LD B,D B F7E8 12 LD (DE),A . F7E9 42 LD B,D B F7EA 1084 DJNZ 02B70H .. F7EC 92 SUB D . F7ED 49 LD C,C I F7EE 24 INC H $ F7EF 92 SUB D . F7F0 40 LD B,B @ F7F1 00 NOP . F7F2 84 ADD A,H . F7F3 42 LD B,D B F7F4 49 LD C,C I F7F5 212224 LD HL,02422H !"$ F7F8 92 SUB D . F7F9 08 EX AF,AF' . F7FA 89 ADC A,C . F7FB 24 INC H $ F7FC 04 INC B . F7FD 92 SUB D . F7FE 02 LD (BC),A . F7FF 04 INC B . F800 84 ADD A,H . F801 92 SUB D . F802 1084 DJNZ 02B88H .. F804 41 LD B,C A F805 09 ADD HL,BC . F806 08 EX AF,AF' . F807 44 LD B,H D F808 00 NOP . F809 82 ADD A,D . F80A 04 INC B . F80B 90 SUB B . F80C 49 LD C,C I F80D 24 INC H $ F80E 92 SUB D . F80F 40 LD B,B @ F810 00 NOP . F811 92 SUB D . F812 112000 LD DE,00020H . . F815 00 NOP . F816 00 NOP . F817 00 NOP . F818 00 NOP . F819 00 NOP . F81A 00 NOP . F81B 00 NOP . F81C 00 NOP . F81D 00 NOP . F81E 00 NOP . F81F 00 NOP . F820 00 NOP . F821 AA XOR D . F822 88 ADC A,B . F823 41 LD B,C A F824 12 LD (DE),A . F825 24 INC H $ F826 80 ADD A,B . F827 40 LD B,B @ F828 08 EX AF,AF' . F829 AA XOR D . F82A AA XOR D . F82B AA XOR D . F82C AA XOR D . F82D AA XOR D . F82E AA XOR D . F82F AA XOR D . F830 AA XOR D . F831 AA XOR D . F832 AA XOR D . F833 92 SUB D . F834 012492 LD BC,09224H .$. F837 00 NOP . F838 00 NOP . F839 00 NOP . F83A 00 NOP . F83B 00 NOP . F83C 00 NOP . F83D 90 SUB B . F83E 92 SUB D . F83F 24 INC H $ F840 04 INC B . F841 90 SUB B . F842 40 LD B,B @ F843 00 NOP . F844 04 INC B . F845 48 LD C,B H F846 212008 LD HL,00820H ! . F849 222108 LD (00821H),HL "!. F84C 84 ADD A,H . F84D 00 NOP . F84E 02 LD (BC),A . F84F 00 NOP . F850 24 INC H $ F851 1004 DJNZ 02C57H .. F853 24 INC H $ F854 221084 LD (08410H),HL ".. F857 92 SUB D . F858 04 INC B . F859 84 ADD A,H . F85A 2008 JR NZ,02C64H . F85C 92 SUB D . F85D 40 LD B,B @ F85E 1008 DJNZ 02C68H .. F860 42 LD B,D B F861 112421 LD DE,02124H .$! F864 04 INC B . F865 211211 LD HL,01112H !.. F868 010891 LD BC,09108H ... F86B 12 LD (DE),A . F86C 12 LD (DE),A . F86D 211008 LD HL,00810H !.. F870 08 EX AF,AF' . F871 44 LD B,H D F872 48 LD C,B H F873 92 SUB D . F874 24 INC H $ F875 02 LD (BC),A . F876 010081 LD BC,08100H ... F879 24 INC H $ F87A 90 SUB B . F87B 89 ADC A,C . F87C 224820 LD (02048H),HL "H F87F 04 INC B . F880 90 SUB B . F881 40 LD B,B @ F882 00 NOP . F883 00 NOP . F884 00 NOP . F885 00 NOP . F886 00 NOP . F887 00 NOP . F888 00 NOP . F889 40 LD B,B @ F88A 00 NOP . F88B 91 SUB C . F88C 00 NOP . F88D 42 LD B,D B F88E 1048 DJNZ 02CD8H .H F890 48 LD C,B H F891 84 ADD A,H . F892 88 ADC A,B . F893 2011 JR NZ,02CA6H . F895 04 INC B . F896 09 ADD HL,BC . F897 212424 LD HL,02424H !$$ F89A 90 SUB B . F89B 41 LD B,C A F89C 00 NOP . F89D 220044 LD (04400H),HL ".D F8A0 40 LD B,B @ F8A1 82 ADD A,D . F8A2 02 LD (BC),A . F8A3 08 EX AF,AF' . F8A4 81 ADD A,C . F8A5 00 NOP . F8A6 08 EX AF,AF' . F8A7 84 ADD A,H . F8A8 88 ADC A,B . F8A9 2022 JR NZ,02CCDH " F8AB 1080 DJNZ 02C2DH .. F8AD 88 ADC A,B . F8AE 00 NOP . F8AF 41 LD B,C A F8B0 220909 LD (00909H),HL ".. F8B3 220880 LD (08008H),HL ".. F8B6 80 ADD A,B . F8B7 04 INC B . F8B8 42 LD B,D B F8B9 48 LD C,B H F8BA 89 ADC A,C . F8BB 08 EX AF,AF' . F8BC 41 LD B,C A F8BD 00 NOP . F8BE 02 LD (BC),A . F8BF 1020 DJNZ 02CE1H . F8C1 220400 LD (00004H),HL ".. F8C4 91 SUB C . F8C5 02 LD (BC),A . F8C6 09 ADD HL,BC . F8C7 210200 LD HL,00002H !.. F8CA 92 SUB D . F8CB 24 INC H $ F8CC 90 SUB B . F8CD 1008 DJNZ 02CD7H .. F8CF 2044 JR NZ,02D15H D F8D1 02 LD (BC),A . F8D2 00 NOP . F8D3 00 NOP . F8D4 89 ADC A,C . F8D5 09 ADD HL,BC . F8D6 1042 DJNZ 02D1AH .B F8D8 2090 JR NZ,02C6AH . F8DA 92 SUB D . F8DB 49 LD C,C I F8DC 2091 JR NZ,02C6FH . F8DE 09 ADD HL,BC . F8DF 00 NOP . F8E0 111124 LD DE,02411H ..$ F8E3 90 SUB B . F8E4 09 ADD HL,BC . F8E5 04 INC B . F8E6 88 ADC A,B . F8E7 00 NOP . F8E8 00 NOP . F8E9 00 NOP . F8EA 1021 DJNZ 02D0DH .! F8EC 00 NOP . F8ED 84 ADD A,H . F8EE 00 NOP . F8EF 110100 LD DE,00001H ... F8F2 24 INC H $ F8F3 08 EX AF,AF' . F8F4 24 INC H $ F8F5 2080 JR NZ,02C77H . F8F7 48 LD C,B H F8F8 82 ADD A,D . F8F9 40 LD B,B @ F8FA 42 LD B,D B F8FB 44 LD B,H D F8FC 12 LD (DE),A . F8FD 2044 JR NZ,02D43H D F8FF 24 INC H $ F900 92 SUB D . F901 1000 DJNZ 02D03H .. F903 09 ADD HL,BC . F904 12 LD (DE),A . F905 48 LD C,B H F906 49 LD C,C I F907 2044 JR NZ,02D4DH D F909 49 LD C,C I F90A 010410 LD BC,01004H ... F90D 41 LD B,C A F90E 211024 LD HL,02410H !.$ F911 24 INC H $ F912 02 LD (BC),A . F913 12 LD (DE),A . F914 12 LD (DE),A . F915 24 INC H $ F916 09 ADD HL,BC . F917 24 INC H $ F918 08 EX AF,AF' . F919 221020 LD (02010H),HL ". F91C 221080 LD (08010H),HL ".. F91F 80 ADD A,B . F920 02 LD (BC),A . F921 112484 LD DE,08424H .$. F924 80 ADD A,B . F925 44 LD B,H D F926 09 ADD HL,BC . F927 212024 LD HL,02420H ! $ F92A 84 ADD A,H . F92B 88 ADC A,B . F92C 220900 LD (00009H),HL ".. F92F 00 NOP . F930 1084 DJNZ 02CB6H .. F932 00 NOP . F933 00 NOP . F934 04 INC B . F935 92 SUB D . F936 2024 JR NZ,02D5CH $ F938 08 EX AF,AF' . F939 41 LD B,C A F93A 1042 DJNZ 02D7EH .B F93C 09 ADD HL,BC . F93D 220810 LD (01008H),HL ".. F940 2004 JR NZ,02D46H . F942 00 NOP . F943 12 LD (DE),A . F944 42 LD B,D B F945 44 LD B,H D F946 84 ADD A,H . F947 88 ADC A,B . F948 00 NOP . F949 1012 DJNZ 02D5DH .. F94B 44 LD B,H D F94C 91 SUB C . F94D 00 NOP . F94E 111120 LD DE,02011H .. F951 04 INC B . F952 24 INC H $ F953 91 SUB C . F954 24 INC H $ F955 92 SUB D . F956 44 LD B,H D F957 90 SUB B . F958 84 ADD A,H . F959 92 SUB D . F95A 212244 LD HL,04422H !"D F95D 92 SUB D . F95E 49 LD C,C I F95F 24 INC H $ F960 212492 LD HL,09224H !$. F963 12 LD (DE),A . F964 42 LD B,D B F965 48 LD C,B H F966 1084 DJNZ 02CECH .. F968 212204 LD HL,00422H !". F96B 49 LD C,C I F96C 1000 DJNZ 02D6EH .. F96E 82 ADD A,D . F96F 42 LD B,D B F970 02 LD (BC),A . F971 2049 JR NZ,02DBCH I F973 08 EX AF,AF' . F974 89 ADC A,C . F975 08 EX AF,AF' . F976 112422 LD DE,02224H .$" F979 44 LD B,H D F97A 00 NOP . F97B 2012 JR NZ,02D8FH . F97D 12 LD (DE),A . F97E 48 LD C,B H F97F 44 LD B,H D F980 222000 LD (00020H),HL " . F983 00 NOP . F984 00 NOP . F985 04 INC B . F986 00 NOP . F987 1002 DJNZ 02D8BH .. F989 1022 DJNZ 02DADH ." F98B 00 NOP . F98C 12 LD (DE),A . F98D 2024 JR NZ,02DB3H $ F98F 221101 LD (00111H),HL ".. F992 212090 LD HL,09020H ! . F995 00 NOP . F996 00 NOP . F997 00 NOP . F998 00 NOP . F999 00 NOP . F99A 02 LD (BC),A . F99B 40 LD B,B @ F99C 02 LD (BC),A . F99D 48 LD C,B H F99E 2000 JR NZ,02DA0H . F9A0 80 ADD A,B . F9A1 90 SUB B . F9A2 82 ADD A,D . F9A3 00 NOP . F9A4 12 LD (DE),A . F9A5 211042 LD HL,04210H !.B F9A8 49 LD C,C I F9A9 2084 JR NZ,02D2FH . F9AB 81 ADD A,C . F9AC 09 ADD HL,BC . F9AD 220920 LD (02009H),HL ". F9B0 2091 JR NZ,02D43H . F9B2 04 INC B . F9B3 92 SUB D . F9B4 49 LD C,C I F9B5 2012 JR NZ,02DC9H . F9B7 09 ADD HL,BC . F9B8 09 ADD HL,BC . F9B9 24 INC H $ F9BA 92 SUB D . F9BB 49 LD C,C I F9BC 24 INC H $ F9BD 92 SUB D . F9BE 49 LD C,C I F9BF 24 INC H $ F9C0 92 SUB D . F9C1 44 LD B,H D F9C2 92 SUB D . F9C3 49 LD C,C I F9C4 24 INC H $ F9C5 91 SUB C . F9C6 09 ADD HL,BC . F9C7 211249 LD HL,04912H !.I F9CA 24 INC H $ F9CB 04 INC B . F9CC 04 INC B . F9CD 40 LD B,B @ F9CE 222422 LD (02224H),HL "$" F9D1 24 INC H $ F9D2 91 SUB C . F9D3 04 INC B . F9D4 212000 LD HL,00020H ! . F9D7 00 NOP . F9D8 00 NOP . F9D9 00 NOP . F9DA 00 NOP . F9DB 00 NOP . F9DC 00 NOP . F9DD 00 NOP . F9DE 00 NOP . F9DF 00 NOP . F9E0 04 INC B . F9E1 92 SUB D . F9E2 49 LD C,C I F9E3 24 INC H $ F9E4 92 SUB D . F9E5 49 LD C,C I F9E6 24 INC H $ F9E7 015500 LD BC,00055H .U. F9EA 55 LD D,L U F9EB 40 LD B,B @ F9EC 00 NOP . F9ED 00 NOP . F9EE 00 NOP . F9EF 00 NOP . F9F0 00 NOP . F9F1 00 NOP . F9F2 00 NOP . F9F3 210800 LD HL,00008H !.. F9F6 224110 LD (01041H),HL "A. F9F9 55 LD D,L U F9FA 08 EX AF,AF' . F9FB 08 EX AF,AF' . F9FC 00 NOP . F9FD 88 ADC A,B . F9FE 92 SUB D . F9FF 210482 LD HL,08204H !.. FA02 41 LD B,C A FA03 08 EX AF,AF' . FA04 00 NOP . FA05 81 ADD A,C . FA06 210012 LD HL,01200H !.. FA09 00 NOP . FA0A 09 ADD HL,BC . FA0B 02 LD (BC),A . FA0C 110920 LD DE,02009H .. FA0F 92 SUB D . FA10 12 LD (DE),A . FA11 48 LD C,B H FA12 48 LD C,B H FA13 44 LD B,H D FA14 92 SUB D . FA15 44 LD B,H D FA16 44 LD B,H D FA17 40 LD B,B @ FA18 04 INC B . FA19 02 LD (BC),A . FA1A 04 INC B . FA1B 1090 DJNZ 02DADH .. FA1D 40 LD B,B @ FA1E 00 NOP . FA1F 04 INC B . FA20 40 LD B,B @ FA21 1000 DJNZ 02E23H .. FA23 44 LD B,H D FA24 88 ADC A,B . FA25 24 INC H $ FA26 08 EX AF,AF' . FA27 90 SUB B . FA28 88 ADC A,B . FA29 210892 LD HL,09208H !.. FA2C 48 LD C,B H FA2D 12 LD (DE),A . FA2E 00 NOP . FA2F 04 INC B . FA30 24 INC H $ FA31 08 EX AF,AF' . FA32 82 ADD A,D . FA33 09 ADD HL,BC . FA34 02 LD (BC),A . FA35 00 NOP . FA36 48 LD C,B H FA37 00 NOP . FA38 09 ADD HL,BC . FA39 02 LD (BC),A . FA3A 015555 LD BC,05555H .UU FA3D 55 LD D,L U FA3E 55 LD D,L U FA3F 55 LD D,L U FA40 55 LD D,L U FA41 55 LD D,L U FA42 12 LD (DE),A . FA43 48 LD C,B H FA44 00 NOP . FA45 010090 LD BC,09000H ... FA48 49 LD C,C I FA49 24 INC H $ FA4A 92 SUB D . FA4B 49 LD C,C I FA4C 212424 LD HL,02424H !$$ FA4F 2042 JR NZ,02E93H B FA51 24 INC H $ FA52 92 SUB D . FA53 012081 LD BC,08120H . . FA56 09 ADD HL,BC . FA57 02 LD (BC),A . FA58 08 EX AF,AF' . FA59 09 ADD HL,BC . FA5A 112200 LD DE,00022H .". FA5D 02 LD (BC),A . FA5E 44 LD B,H D FA5F 90 SUB B . FA60 1040 DJNZ 02EA2H .@ FA62 40 LD B,B @ FA63 49 LD C,C I FA64 24 INC H $ FA65 92 SUB D . FA66 49 LD C,C I FA67 24 INC H $ FA68 92 SUB D . FA69 49 LD C,C I FA6A 09 ADD HL,BC . FA6B 12 LD (DE),A . FA6C 220124 LD (02401H),HL ".$ FA6F 92 SUB D . FA70 12 LD (DE),A . FA71 24 INC H $ FA72 92 SUB D . FA73 49 LD C,C I FA74 24 INC H $ FA75 2021 JR NZ,02E98H ! FA77 24 INC H $ FA78 90 SUB B . FA79 92 SUB D . FA7A 49 LD C,C I FA7B 24 INC H $ FA7C 92 SUB D . FA7D 49 LD C,C I FA7E 2002 JR NZ,02E82H . FA80 00 NOP . FA81 00 NOP . FA82 02 LD (BC),A . FA83 1040 DJNZ 02EC5H .@ FA85 00 NOP . FA86 00 NOP . FA87 1000 DJNZ 02E89H .. FA89 40 LD B,B @ FA8A 80 ADD A,B . FA8B 00 NOP . FA8C 00 NOP . FA8D 00 NOP . FA8E 00 NOP . FA8F 00 NOP . FA90 00 NOP . FA91 00 NOP . FA92 00 NOP . FA93 00 NOP . FA94 00 NOP . FA95 00 NOP . FA96 00 NOP . FA97 00 NOP . FA98 00 NOP . FA99 00 NOP . FA9A 00 NOP . FA9B 00 NOP . FA9C 00 NOP . FA9D 00 NOP . FA9E 00 NOP . FA9F 2000 JR NZ,02EA1H . FAA1 00 NOP . FAA2 00 NOP . FAA3 1040 DJNZ 02EE5H .@ FAA5 91 SUB C . FAA6 02 LD (BC),A . FAA7 09 ADD HL,BC . FAA8 02 LD (BC),A . FAA9 44 LD B,H D FAAA 04 INC B . FAAB 80 ADD A,B . FAAC 40 LD B,B @ FAAD 40 LD B,B @ FAAE 90 SUB B . FAAF 41 LD B,C A FAB0 2000 JR NZ,02EB2H . FAB2 012012 LD BC,01220H . . FAB5 09 ADD HL,BC . FAB6 1008 DJNZ 02EC0H .. FAB8 40 LD B,B @ FAB9 010000 LD BC,00000H ... FABC 00 NOP . FABD 1010 DJNZ 02ECFH .. FABF 2040 JR NZ,02F01H @ FAC1 81 ADD A,C . FAC2 00 NOP . FAC3 08 EX AF,AF' . FAC4 40 LD B,B @ FAC5 2021 JR NZ,02EE8H ! FAC7 04 INC B . FAC8 2048 JR NZ,02F12H H FACA 00 NOP . FACB 2020 JR NZ,02EEDH FACD 48 LD C,B H FACE 41 LD B,C A FACF 24 INC H $ FAD0 00 NOP . FAD1 40 LD B,B @ FAD2 80 ADD A,B . FAD3 00 NOP . FAD4 90 SUB B . FAD5 40 LD B,B @ FAD6 1004 DJNZ 02EDCH .. FAD8 010000 LD BC,00000H ... FADB 80 ADD A,B . FADC 42 LD B,D B FADD 02 LD (BC),A . FADE 12 LD (DE),A . FADF 40 LD B,B @ FAE0 00 NOP . FAE1 08 EX AF,AF' . FAE2 1080 DJNZ 02E64H .. FAE4 84 ADD A,H . FAE5 90 SUB B . FAE6 00 NOP . FAE7 08 EX AF,AF' . FAE8 04 INC B . FAE9 2021 JR NZ,02F0CH ! FAEB 24 INC H $ FAEC 80 ADD A,B . FAED 02 LD (BC),A . FAEE 010921 LD BC,02109H ..! FAF1 2081 JR NZ,02E74H . FAF3 00 NOP . FAF4 2002 JR NZ,02EF8H . FAF6 40 LD B,B @ FAF7 04 INC B . FAF8 80 ADD A,B . FAF9 00 NOP . FAFA 00 NOP . FAFB 02 LD (BC),A . FAFC 02 LD (BC),A . FAFD 40 LD B,B @ FAFE 00 NOP . FAFF 04 INC B . FB00 88 ADC A,B . FB01 42 LD B,D B FB02 1010 DJNZ 02F14H .. FB04 08 EX AF,AF' . FB05 05 DEC B . FB06 55 LD D,L U FB07 55 LD D,L U FB08 44 LD B,H D FB09 04 INC B . FB0A 2040 JR NZ,02F4CH @ FB0C 00 NOP . FB0D 00 NOP . FB0E 00 NOP . FB0F 00 NOP . FB10 00 NOP . FB11 010808 LD BC,00808H ... FB14 00 NOP . FB15 00 NOP . FB16 1000 DJNZ 02F18H .. FB18 02 LD (BC),A . FB19 1082 DJNZ 02E9DH .. FB1B 24 INC H $ FB1C 12 LD (DE),A . FB1D 08 EX AF,AF' . FB1E 00 NOP . FB1F 24 INC H $ FB20 00 NOP . FB21 010080 LD BC,08000H ... FB24 00 NOP . FB25 00 NOP . FB26 02 LD (BC),A . FB27 04 INC B . FB28 04 INC B . FB29 2040 JR NZ,02F6BH @ FB2B 09 ADD HL,BC . FB2C 04 INC B . FB2D 80 ADD A,B . FB2E 08 EX AF,AF' . FB2F 2080 JR NZ,02EB1H . FB31 41 LD B,C A FB32 08 EX AF,AF' . FB33 24 INC H $ FB34 012444 LD BC,04424H .$D FB37 92 SUB D . FB38 49 LD C,C I FB39 00 NOP . FB3A 00 NOP . FB3B 90 SUB B . FB3C 04 INC B . FB3D 12 LD (DE),A . FB3E 12 LD (DE),A . FB3F 41 LD B,C A FB40 12 LD (DE),A . FB41 24 INC H $ FB42 49 LD C,C I FB43 2048 JR NZ,02F8DH H FB45 110024 LD DE,02400H ..$ FB48 41 LD B,C A FB49 2000 JR NZ,02F4BH . FB4B 1010 DJNZ 02F5DH .. FB4D 2080 JR NZ,02ECFH . FB4F 04 INC B . FB50 90 SUB B . FB51 80 ADD A,B . FB52 012021 LD BC,02120H . ! FB55 00 NOP . FB56 04 INC B . FB57 00 NOP . FB58 00 NOP . FB59 00 NOP . FB5A 08 EX AF,AF' . FB5B 010008 LD BC,00800H ... FB5E 00 NOP . FB5F 40 LD B,B @ FB60 00 NOP . FB61 1000 DJNZ 02F63H .. FB63 02 LD (BC),A . FB64 09 ADD HL,BC . FB65 00 NOP . FB66 00 NOP . FB67 00 NOP . FB68 2048 JR NZ,02FB2H H FB6A 00 NOP . FB6B 00 NOP . FB6C 02 LD (BC),A . FB6D 2000 JR NZ,02F6FH . FB6F 40 LD B,B @ FB70 2000 JR NZ,02F72H . FB72 40 LD B,B @ FB73 00 NOP . FB74 24 INC H $ FB75 00 NOP . FB76 010000 LD BC,00000H ... FB79 1004 DJNZ 02F7FH .. FB7B 09 ADD HL,BC . FB7C 00 NOP . FB7D 00 NOP . FB7E 08 EX AF,AF' . FB7F 40 LD B,B @ FB80 80 ADD A,B . FB81 010000 LD BC,00000H ... FB84 09 ADD HL,BC . FB85 110240 LD DE,04002H ..@ FB88 12 LD (DE),A . FB89 00 NOP . FB8A 88 ADC A,B . FB8B 08 EX AF,AF' . FB8C 1008 DJNZ 02F96H .. FB8E 92 SUB D . FB8F 02 LD (BC),A . FB90 010240 LD BC,04002H ..@ FB93 82 ADD A,D . FB94 08 EX AF,AF' . FB95 00 NOP . FB96 12 LD (DE),A . FB97 00 NOP . FB98 02 LD (BC),A . FB99 00 NOP . FB9A 48 LD C,B H FB9B 80 ADD A,B . FB9C 41 LD B,C A FB9D 00 NOP . FB9E 2082 JR NZ,02F22H . FBA0 08 EX AF,AF' . FBA1 1040 DJNZ 02FE3H .@ FBA3 00 NOP . FBA4 00 NOP . FBA5 08 EX AF,AF' . FBA6 00 NOP . FBA7 84 ADD A,H . FBA8 84 ADD A,H . FBA9 00 NOP . FBAA 00 NOP . FBAB 84 ADD A,H . FBAC 1001 DJNZ 02FAFH .. FBAE 02 LD (BC),A . FBAF 00 NOP . FBB0 00 NOP . FBB1 00 NOP . FBB2 00 NOP . FBB3 08 EX AF,AF' . FBB4 00 NOP . FBB5 00 NOP . FBB6 00 NOP . FBB7 00 NOP . FBB8 00 NOP . FBB9 012024 LD BC,02420H . $ FBBC 24 INC H $ FBBD 89 ADC A,C . FBBE 24 INC H $ FBBF 220100 LD (00001H),HL ".. FBC2 00 NOP . FBC3 40 LD B,B @ FBC4 00 NOP . FBC5 00 NOP . FBC6 00 NOP . FBC7 00 NOP . FBC8 04 INC B . FBC9 00 NOP . FBCA 00 NOP . FBCB 12 LD (DE),A . FBCC 40 LD B,B @ FBCD 00 NOP . FBCE 09 ADD HL,BC . FBCF 09 ADD HL,BC . FBD0 1009 DJNZ 02FDBH .. FBD2 24 INC H $ FBD3 82 ADD A,D . FBD4 00 NOP . FBD5 012112 LD BC,01221H .!. FBD8 12 LD (DE),A . FBD9 09 ADD HL,BC . FBDA 24 INC H $ FBDB 49 LD C,C I FBDC 2040 JR NZ,0301EH @ FBDE 00 NOP . FBDF 00 NOP . FBE0 40 LD B,B @ FBE1 00 NOP . FBE2 00 NOP . FBE3 00 NOP . FBE4 00 NOP . FBE5 40 LD B,B @ FBE6 1041 DJNZ 03029H .A FBE8 04 INC B . FBE9 00 NOP . FBEA 2000 JR NZ,02FECH . FBEC 00 NOP . FBED 00 NOP . FBEE 00 NOP . FBEF 00 NOP . FBF0 00 NOP . FBF1 00 NOP . FBF2 00 NOP . FBF3 00 NOP . FBF4 00 NOP . FBF5 00 NOP . FBF6 00 NOP . FBF7 00 NOP . FBF8 00 NOP . FBF9 00 NOP . FBFA 00 NOP . FBFB 00 NOP . FBFC 00 NOP . FBFD 00 NOP . FBFE 00 NOP . FBFF 00 NOP . FC00 end