; ; Disassembly of SD's DDBIOS ROM ; ver. 4.2 (256b sects.) ; rzh 2/14/92 ; cr equ 0dh lf equ 0ah ; org 0f000h ; bios: NOP ;cold LD E,0 ; JP 0F063H ;warm JP 0E006H ;console status JP 0E009H ;console input JP 0E00CH ;console output JP 0F10AH db 0,0,0 db 0,0,0 JP 0F159H ;home JP 0F168H ;select JP 0F16DH ;track JP 0F172H ;sector JP 0F177H ;dma JP 0F17CH ;read JP 0F198H ;write JP 0F3B4H ;load JP 0F3C1H ;save JP 0F406H ;format db 22h,97h,26h db 21h,0ffh,0ffh db 22h,9ch,26h ; 8" single density db 26 ;sectors/track db 77 ;tracks/side db 100-27 ;index header gap db 6 ;gap 1 db 11 ;gap 2 db 27 ;gap 3 db 8 ;restore command db 1ah ;seek no verify cmd. db 1eh ;seek with verify ; 8" double density db 26 ;sectors/track db 77 ;tracks/side db 100-54 ;index header gap db 8 ;gap 1 (pre ID gap) db 22 ;gap 2 (ID->data gap) db 54 ;gap 3 (data->ID gap) db 0ah ;restore command db 1ah ;seek no verify cmd. db 1eh ;seek with verify ; 5" single density db 18 ;sectors/track db 35 ;tracks/side db 20-8 ;index header gap db 6 ;gap 1 (pre ID gap) db 11 ;gap 2 (ID->data gap) db 8 ;gap 3 (data->ID gap) db 0bh ;restore command db 1bh ;seek no verify cmd. db 1fh ;seek with verify ; 5" double density db 18 ;sectors/track db 80 ;tracks/side db 100-16 ;header gap bytes db 8 ;gap 1 (pre ID gap) db 22 ;gap 2 (ID->data gap) db 16 ;gap 3 (data->ID gap) db 0bh ;restore command db 1bh ;seek no verify cmd. db 1fh ;seek with verify warm: LD SP,80H IN A,(7FH) LD A,0 LD (42H),A LD A,E CP 4 JP NC,0E803H PUSH AF LD A,0EFH PUSH HL LD (4DH),SP POP HL RRCA JR NC,0F099H OUT (63H),A CALL 0F3A8H AND 4 JR Z,0F095H XOR A OUT (65H),A LD A,2 LD (44H),A LD A,1AH CALL 0F2FAH IN A,(63H) JR 0F07CH POP AF PUSH AF CALL 0F159H POP AF CALL 0F10AH JR NZ,0F0BDH CALL 0F0C7H LD HL,80H LD A,(HL) AND 0CEH JR NZ,0F0B4H BIT 0,(HL) JP NZ,80H LD A,31H LD HL,0E800H CP (HL) JP Z,0E800H LD A,0E0H LD HL,0E002H CP (HL) JP Z,0E003H HALT LD HL,80H LD (40H),HL XOR A LD (44H),A INC A LD (43H),A CALL 0F17CH RET Z JR 0F0BDH LD A,(42H) LD E,A LD A,4 DEC A CP B JR Z,0F0F1H DEC A CP B JR Z,0F0F8H DEC A CP B JR Z,0F101H OR 1 POP HL RET LD A,E AND 0FH LD (42H),A RET LD A,E AND 0FH OR 20H LD (42H),A RET LD A,E AND 0FH OR 60H LD (42H),A RET LD B,4 AND 0FH OR 40H LD (42H),A LD HL,(40H) LD (51H),HL CALL 0F13CH LD HL,(51H) LD (40H),HL LD A,(42H) RET NZ JR NC,0F12AH SET 6,A LD E,A LD A,(49H) OR A LD A,E RES 4,A JP P,0F137H SET 4,A LD (42H),A XOR A RET PUSH BC PUSH IX PUSH HL LD (4DH),SP POP HL CALL 0F1D3H CALL 0F226H POP IX POP BC LD A,(4BH) RRCA RET Z DEC B CALL 0F0DBH JR 0F13CH LD (4DH),SP PUSH IX CALL 0F1D3H CALL 0F1C7H POP IX RET LD A,C LD (42H),A RET LD A,C LD (44H),A RET LD A,C LD (43H),A RET LD (40H),BC RET LD BC,301H LD (56H),BC PUSH IX LD IX,(53H) PUSH BC CALL 0F25CH POP BC JR Z,0F195H CALL 0F1B1H JR 0F189H POP IX RET LD BC,301H LD (56H),BC PUSH IX LD IX,(53H) PUSH BC CALL 0F2ADH POP BC JR Z,0F195H CALL 0F1B1H JR 0F1A5H DJNZ 0F1C6H LD A,(57H) LD B,A DEC C JP P,0F1C1H POP AF POP IX XOR A INC A RET PUSH BC CALL 0F1C7H POP BC RET LD (4DH),SP LD A,(IX+6) CALL 0F2FAH XOR A RET LD DE,42H LD A,(DE) AND 60H LD C,A LD A,(DE) AND 3 LD B,A LD A,1 JR Z,0F1E5H RLCA DJNZ 0F1E2H OR C AND 7FH LD B,A LD A,C LD IX,0F03FH CP 0 JR Z,0F20EH LD IX,0F048H CP 40H JR Z,0F20EH LD IX,0F048H CP 0C0H JR Z,0F20EH LD IX,0F051H CP 20H JR Z,0F20EH LD IX,0F05AH LD (53H),IX PUSH BC POP AF CPL OUT (63H),A LD A,(DE) LD (55H),A CALL 0F249H IN A,(64H) AND 80H JP NZ,0F2D1H RET CALL 0F332H LD HL,48H LD BC,667H LD A,0F8H LD (46H),A CALL 0F365H LD A,0C0H CALL 0F267H LD A,(48H) CP (IX+1) JP NC,0F2EEH OUT (65H),A XOR A RET LD A,(42H) BIT 5,A LD A,27H JR Z,0F254H LD A,3CH LD B,0 DJNZ 0F256H DEC A JR NZ,0F254H RET CALL 0F28CH LD A,88H CALL 0F280H LD HL,(40H) LD (4CH),A LD DE,(4CH) PUSH DE DI OUT (64H),A JR 0F274H JR 0F276H INIR POP DE LD (4CH),DE EI JR 0F2C5H LD H,A LD A,(49H) LD L,A AND 1 LD A,H RET Z SET 1,A RET POP HL LD (4DH),SP PUSH HL LD A,(42H) LD D,A LD A,(55H) CP D JR Z,0F2A2H CALL 0F1D3H CALL 0F226H CALL 0F2E1H LD A,0FEH LD (46H),A JP 0F36CH CALL 0F28CH LD A,0A8H CALL 0F280H LD HL,(40H) LD (4CH),A DI OUT (64H),A JR 0F2C0H JR 0F2C2H OTIR EI CALL 0F332H IN A,(64H) LD D,A LD A,(46H) AND D RET Z LD A,D LD (47H),A CALL 0F249H OR 1 LD SP,(4DH) CALL 0F7F6H RET CALL 0F21EH LD A,(IX+1) LD C,A LD A,(44H) CP C JR C,0F2F2H LD A,0FH JR 0F2D1H LD C,A IN A,(65H) CP C RET Z LD A,(IX+8) LD (4CH),A LD B,0D2H DJNZ 0F2FFH CALL 0F332H LD A,(44H) OUT (67H),A LD A,80H LD (46H),A LD A,(4CH) OUT (64H),A LD B,0AH DJNZ 0F315H CALL 0F2C5H CALL 0F249H LD A,(4CH) CP (IX+6) RET Z IN A,(64H) AND 10H JR NZ,0F32EH IN A,(65H) CP C RET Z LD A,20H JR 0F2D1H LD E,0 PUSH BC LD C,2 IN A,(64H) AND 1 JR Z,0F35DH DJNZ 0F337H DEC E JR NZ,0F337H DEC C JR NZ,0F337H POP BC IN A,(63H) OR 80H OUT (60H),A DJNZ 0F34CH IN A,(60H) CALL 0F3A8H LD A,(IX+6) CALL 0F2FAH LD A,0FEH JR 0F330H POP BC IN A,(63H) OR 80H OUT (63H),A RET IN A,(63H) AND 7FH OUT (63H),A RET LD B,0 LD A,(IX+0) INC A LD C,A LD A,(43H) CP C JR C,0F37DH LD B,10H DEC C SUB C PUSH AF CALL 0F392H POP AF OUT (66H),A LD BC,8067H LD A,(42H) BIT 6,A JR Z,0F365H LD B,0 JR 0F365H IN A,(63H) CPL LD E,A AND 10H CP B RET Z LD A,E AND 6FH OR B CPL OUT (63H),A LD B,0D2H DJNZ 0F3A3H JP 0F226H LD A,0D0H OUT (64H),A LD A,0AH DEC A JR NZ,0F3AEH IN A,(64H) RET CALL 0F7F6H CALL 0F17CH RET NZ CALL 0F3CEH JR NZ,0F3B7H RET CALL 0F7F6H CALL 0F198H RET NZ CALL 0F3CEH JR NZ,0F3C4H RET LD HL,(40H) LD DE,80H LD A,(42H) BIT 6,A JR Z,0F3DEH LD DE,100H ADD HL,DE LD (40H),HL LD HL,45H DEC (HL) RET Z DEC HL DEC HL INC (HL) LD A,(49H) OR A PUSH IX LD IX,(53H) LD A,(IX+0) POP IX JP P,0F3FDH RLCA INC A CP (HL) RET NZ LD (HL),1 INC HL INC (HL) OR A RET CALL 0F7F6H LD (51H),SP PUSH IY PUSH IX PUSH HL LD HL,800H LD (40H),HL LD (4DH),SP POP HL CALL 0F1D3H CALL Z,0F1C7H JR NZ,0F455H CALL 0F45CH CALL 0F4CCH XOR A CALL 0F500H PUSH BC CALL 0F555H CALL 0F59FH POP BC JR NZ,0F43EH CP (IX+1) JR NZ,0F42CH LD A,4CH LD (44H),A IN A,(63H) RES 5,A OUT (63H),A LD DE,55H LD A,(DE) SET 5,A LD (DE),A POP IX POP IY RET POP IX LD SP,(51H) RET LD HL,(40H) LD A,(IX+4) RRCA LD A,4EH JP NC,0F46AH LD A,0FFH LD E,A LD B,(IX+2) CALL 0F4C7H LD B,(IX+5) CALL 0F4C7H XOR A LD B,(IX+3) CALL 0F4C7H CALL 0F4C0H LD A,0FEH LD (HL),A INC HL PUSH HL EXX POP DE EXX XOR A LD B,4 CALL 0F4C7H LD A,0F7H LD (HL),A INC HL LD B,(IX+4) LD A,B SRL A INC A LD C,A LD A,E CALL 0F4C7H LD B,C XOR A CALL 0F4C7H CALL 0F4C0H LD A,0FBH LD (HL),A INC HL LD B,80H LD A,(42H) BIT 6,A JR Z,0F4B6H LD B,0 LD A,0E5H CALL 0F4C7H LD A,0F7H LD (HL),A INC HL RET LD A,E OR A RET M LD A,0F5H LD B,3 LD (HL),A INC HL DJNZ 0F4C7H RET EXX LD B,(IX+0) DEC B EXX LD DE,(40H) PUSH HL OR A LD C,(IX+2) LD B,0 EX DE,HL ADD HL,BC EX DE,HL SBC HL,DE PUSH HL POP BC POP HL PUSH BC EX DE,HL EXX EXX LDIR POP BC PUSH BC EXX DJNZ 0F4E8H EXX POP BC EX DE,HL LD A,(42H) BIT 4,A LD A,80H JR NZ,0F4FDH XOR A LD L,A LD H,L RET PUSH HL PUSH BC EXX POP BC POP HL PUSH DE POP IY PUSH DE EX AF,AF' LD D,1 LD A,(IX+0) CP 1AH LD A,1 JR Z,0F51DH LD A,(IX+0) SRL A INC A JR NC,0F544H EX AF,AF' LD (IY+0),A OR L JP P,0F52AH LD (IY+1),H RES 7,A EX AF,AF' LD (IY+2),A PUSH AF LD A,(42H) BIT 6,A JR Z,0F53BH LD A,1 LD (IY+3),A POP AF CP (IX+0) JR Z,0F551H ADD IY,BC INC A LD E,A LD A,1AH CP (IX+0) LD A,E JR Z,0F51DH LD A,D LD D,E JR 0F51DH EX AF,AF' POP DE EXX RET PUSH DE PUSH BC EXX EX AF,AF' POP BC PUSH DE LD E,A LD D,C LD B,(IX+2) LD C,67H LD HL,(40H) LD A,80H LD (46H),A CALL 0F365H LD A,(42H) BIT 6,A LD A,0 JR Z,0F578H LD A,1 LD (50H),A LD A,0F4H LD (4CH),A DI OUT (64H),A LD A,(50H) OTIR LD B,D OTIR OR A JR Z,0F590H OTIR LD B,D DEC E JR NZ,0F589H POP DE POP HL LD A,(HL) OUT (C),A DJNZ 0F596H EI EXX EX AF,AF' RET EX AF,AF' LD A,2FH DJNZ 0F5A2H DEC A JR NZ,0F5A2H IN A,(63H) OR 80H BIT 7,L JR Z,0F5BFH BIT 0,H RES 0,H JR NZ,0F5BFH INC H RES 4,A OUT (63H),A DJNZ 0F5BAH EX AF,AF' CP A RET SET 4,A OUT (63H),A EX AF,AF' INC A CP (IX+1) RET Z LD (44H),A PUSH HL LD (4DH),SP POP HL DJNZ 0F5D2H EXX EX DE,HL LD A,(IX+7) CALL 0F2FAH EX DE,HL EXX IN A,(65H) LD B,A LD A,(44H) CP B LD B,0 RET db 0ah db 0c3h,0ach,0bh db 21h,0a2h,26h db 7eh db 36h,0 db 0c9h db 21h,0a0h,26h db 0beh db 0c9h db 0cdh,9ah,24h db 0cdh,4ch,16h db 3ah,83h LD SP,80H LD HL,0F65BH CALL 0F638H CALL 0F641H JR NZ,0F62EH LD A,L LD (42H),A LD A,H LD (39H),A CALL 0F018H LD IX,(53H) LD A,(39H) CALL 0F67CH CALL 0F018H LD HL,0F66EH CALL 0F638H JR 0F600H LD C,'?' CALL 0F00CH CALL 0F6C6H JR 0F600H CALL 0F653H JP NZ,0E741H JP 0E707H CALL 0F653H JP NZ,0E79AH JP 0E760H CALL 0F653H JP NZ,0E74DH JP 0E713H LD B,A LD A,(0E028H) CP 1 LD A,B RET db 'TEST#DRV# (TTDD)' db ': ',3 db lf,cr,'TASK DONE' db cr,lf,3 CP 0 JP Z,0F7D3H CP 5 JR Z,0F69EH JR C,0F6E7H CP 0FFH RET NZ LD HL,0F694H CALL 0F638H CALL 0F641H JP (HL) db 'ADDRESS: ',3 CALL 0F033H RET LD HL,0F6CFH CALL 0F638H LD A,(4CH) CALL 0F7EEH LD A,(47H) CALL 0F7EEH LD A,(42H) CALL 0F7EEH LD A,(44H) CALL 0F7EEH LD A,(43H) CALL 0F64AH CALL 0F653H JP NZ,0E72FH JP 0E6F5H db 'CMD STAT DRV TRK' db ' SCTR> ',3 XOR A LD (44H),A INC A LD (43H),A JR 0F745H LD HL,800H LD (40H),HL CALL 0F02AH CALL NZ,0F6A2H LD HL,900H LD (40H),HL CALL 0F027H CALL NZ,0F6A2H LD A,(39H) CP 2 JR Z,0F71FH PUSH AF CALL 0F759H POP AF CP 3 JP Z,0F7B0H CP 4 JP Z,0F7A0H LD HL,43H INC (HL) LD A,(IX+0) PUSH HL LD HL,42H BIT 4,(HL) POP HL JR Z,0F730H RLCA INC A CP (HL) JR NZ,0F745H LD (HL),1 INC HL INC (HL) LD A,(IX+1) CP (HL) JR NZ,0F745H LD (HL),0 LD C,'P' CALL 0F00CH CALL 0F006H JR Z,0F750H CALL 0F009H CP '.' RET Z LD A,(39H) CP 2 JR Z,0F6FDH JR 0F6F1H LD HL,900H EX DE,HL LD HL,800H LD A,(42H) BIT 6,A LD B,80H JR Z,0F76BH LD B,0 LD A,(DE) CP (HL) LD A,0FFH LD (47H),A JP NZ,0F6A2H INC HL INC DE DJNZ 0F76BH LD HL,38H LD DE,800H LD B,40H LD A,(42H) BIT 6,A JR NZ,0F78AH SLA B LD A,(HL) RRCA JR C,0F78FH INC DE LD A,R LD (DE),A INC DE INC DE DJNZ 0F78FH LD A,(HL) RRCA JR C,0F79DH INC A LD (HL),A RET XOR A LD (HL),A RET PUSH HL LD HL,42H LD A,(HL) AND 0F0H LD (HL),A LD A,R NOP AND 1 OR (HL) LD (HL),A POP HL LD A,(IX+0) INC A LD B,A LD A,R AND 1FH OR A JR Z,0F7B0H LD (43H),A CP B JR NC,0F7B0H LD A,(IX+1) LD B,A LD A,R AND 7FH LD (44H),A CP B JR NC,0F7C2H JP 0F745H CALL 0F018H LD A,(IX+1) DEC A OUT (67H),A LD A,(IX+7) OUT (64H),A CALL 0F006H JR Z,0F7D3H CALL 0F009H CP '.' RET Z JR 0F7D3H CALL 0F64AH LD C,' ' JP 0F00CH LD A,0FFH LD (55H),A RET db 0ffh,0ffh,0ffh,0ffh end