; enum Equates wboot equ 0 bdos equ 5 ; ; +-------------------------------------------------------------------------+ ; | This file has been generated by The Interactive Disassembler (IDA) | ; | Copyright (c) 2017 Hex-Rays, | ; | License info: 48-3FBD-7F04-2C | ; | Jiang Ying, Personal license | ; +-------------------------------------------------------------------------+ ; ; Input SHA256 : 9FDAEBA9DAA44558D7C66812258E00CA3452CB668AB29B16D42B0BA57C50D890 ; Input MD5 : 13B48CBA0FAAF194FA13890C0EDC7674 ; Input CRC32 : 4078CDAA ; Processor : z80 [] ; Target assembler: ZMAC 1.3 by Bruce Norskog / Z80ASM 1.32 by SLR Systems ; =========================================================================== ; Segment type: Pure code org 100h jp Start Copyright db ' copyright(c) 1977, digital research ' CrLf db 0Dh,0Ah,'$' aErrorOnLine db 'Error On Line $' ; ... aSub db 'SUB' ; ... aNoSubFile db 'No ',27h,'SUB',27h,' File Present$' ; ... aDiskWriteError db 'Disk Write Error$' ; ... aBufferOverflow db 'Command Buffer Overflow$' ; ... aCommandTooLong db 'Command Too Long$' ; ... aParameterError db 'Parameter Error$' ; ... aInvalidControl db 'Invalid Control Character$' ; ... aDirectoryFull db 'Directory Full$' ; ... aCannotClose db 'Cannot Close, Read/Only?$' ; ... Start: ; ... ld hl, 0 add hl, sp ld (word_5F0), hl ld hl, 0E93h ld sp, hl call sub_2CC call sub_38A call sub_4FE call GoBOOT ret ; =============== S U B R O U T I N E ======================================= sub_1F7: ; ... ld hl, 5DDh ld (hl), b dec hl ld (hl), c ld hl, (word_5DC) ex de, hl ld c, 9 call GoBDOS1 ret ; End of function sub_1F7 ; =============== S U B R O U T I N E ======================================= sub_207: ; ... ld hl, 5E0h ld (hl), b dec hl ld (hl), c ld hl, (word_5DF) ex de, hl ld c, 0Fh call GoBDOS2 ld (byte_5DE), a ret ; End of function sub_207 ; =============== S U B R O U T I N E ======================================= sub_21A: ; ... ld hl, 5E2h ld (hl), b dec hl ld (hl), c ld hl, (word_5E1) ex de, hl ld c, 10h call GoBDOS2 ld (byte_5DE), a ret ; End of function sub_21A ; =============== S U B R O U T I N E ======================================= sub_22D: ; ... ld hl, 5E4h ld (hl), b dec hl ld (hl), c ld hl, (word_5E3) ex de, hl ld c, 13h call GoBDOS1 ret ; End of function sub_22D ; =============== S U B R O U T I N E ======================================= sub_23D: ; ... ld hl, 5E6h ld (hl), b dec hl ld (hl), c ld hl, (word_5E5) ex de, hl ld c, 14h call GoBDOS2 ret ; End of function sub_23D ; =============== S U B R O U T I N E ======================================= sub_24D: ; ... ld hl, 5E8h ld (hl), b dec hl ld (hl), c ld hl, (word_5E7) ex de, hl ld c, 15h call GoBDOS2 ret ; End of function sub_24D ; =============== S U B R O U T I N E ======================================= sub_25D: ; ... ld hl, 5EAh ld (hl), b dec hl ld (hl), c ld hl, (word_5E9) ex de, hl ld c, 16h call GoBDOS2 ld (byte_5DE), a ret ; End of function sub_25D ; =============== S U B R O U T I N E ======================================= sub_270: ; ... ld hl, 5EFh ld (hl), e dec hl ld (hl), b dec hl ld (hl), c dec hl pop de pop bc ld (hl), b dec hl ld (hl), c push de loc_27F: ; ... ld a, (byte_5EF) dec a ld (byte_5EF), a cp 0FFh jp z, locret_2A6 ld hl, (word_5EB) push hl ld hl, (word_5ED) pop bc ld a, (bc) ld (hl), a ld hl, (word_5EB) inc hl ld (word_5EB), hl ld hl, (word_5ED) inc hl ld (word_5ED), hl jp loc_27F locret_2A6: ; ... ret ; End of function sub_270 ; =============== S U B R O U T I N E ======================================= sub_2A7: ; ... ld hl, 5F3h ld (hl), b dec hl ld (hl), c ld bc, 128h call sub_1F7 ld bc, aErrorOnLine call sub_1F7 ld bc, 5B6h call sub_1F7 ld hl, (word_5F2) ld b, h ld c, l call sub_1F7 ld hl, (word_5F0) ld sp, hl ret ; End of function sub_2A7 ; =============== S U B R O U T I N E ======================================= sub_2CC: ; ... ld bc, 81h push bc ld e, 7Fh ld bc, 5F4h call sub_270 ld hl, (80h) ld h, 0 ld bc, 5F4h add hl, bc ld (hl), 0 ld bc, aSub push bc ld e, 3 ld bc, 65h call sub_270 ld bc, 5Ch call sub_207 ld a, (byte_5DE) cp 0FFh jp nz, loc_303 ld bc, aNoSubFile call sub_2A7 loc_303: ; ... ld hl, 674h ld (hl), 80h ret ; End of function sub_2CC ; =============== S U B R O U T I N E ======================================= sub_309: ; ... ld a, 7Fh ld hl, 674h cp (hl) jp nc, loc_325 ld bc, 5Ch call sub_23D cp 0 jp z, loc_320 ld a, 1Ah ret loc_320: ; ... ld hl, 674h ld (hl), 0 loc_325: ; ... ld a, (674h) inc a ld (674h), a dec a ld c, a ld b, 0 ld hl, 80h add hl, bc ld a, (hl) ld (675h), a cp 0Dh jp nz, loc_362 ld a, (byte_5B8) inc a ld (byte_5B8), a ld c, a ld a, 39h cp c jp nc, loc_362 ld hl, 5B8h ld (hl), 30h dec hl ld a, (hl) inc a ld (hl), a ld c, a ld a, 39h cp c jp nc, loc_362 ld hl, 5B7h ld (hl), 30h dec hl inc (hl) loc_362: ; ... ld a, (675h) sub 61h cp 1Ah jp nc, loc_374 ld a, (675h) and 5Fh ld (675h), a loc_374: ; ... ld a, (675h) ret ; End of function sub_309 ; =============== S U B R O U T I N E ======================================= sub_378: ; ... ld bc, 5BBh call sub_24D cp 0 jp z, locret_389 ld bc, aDiskWriteError call sub_2A7 locret_389: ; ... ret ; End of function sub_378 ; =============== S U B R O U T I N E ======================================= sub_38A: ; ... ld hl, 676h ld (hl), 0 ld hl, 0 ld (0E76h), hl ld hl, 0E7Ch ld (hl), 1 loc_39A: ; ... ld a, (0E7Ch) rra jp nc, locret_480 ld hl, 0E78h ld (hl), 0 loc_3A6: ; ... call sub_309 ld (0E7Dh), a sub 1Ah add a, 0FFh sbc a, a push af ld a, (0E7Dh) sub 0Dh add a, 0FFh sbc a, a pop bc ld c, b and c rra jp nc, loc_46B ld a, (0E7Dh) cp 0Ah jp z, loc_468 ld a, (0E7Dh) cp 24h jp nz, loc_436 call sub_309 ld (0E7Dh), a cp 24h jp nz, loc_3E6 ld hl, (0E7Dh) ld c, l call sub_4C4 jp loc_433 loc_3E6: ; ... ld a, (0E7Dh) sub 30h ld (0E7Dh), a ld c, a ld a, 9 cp c jp nc, loc_3FE ld bc, aParameterError call sub_2A7 jp loc_433 loc_3FE: ; ... ld hl, 0E7Ah ld (hl), 0 call sub_4AD loc_406: ; ... ld a, (0E7Dh) cp 0 jp z, loc_422 ld hl, 0E7Dh dec (hl) loc_412: ; ... call sub_481 rra jp nc, loc_41C jp loc_412 loc_41C: ; ... call sub_4AD jp loc_406 loc_422: ; ... call sub_481 rra jp nc, loc_433 ld hl, (0E79h) ld c, l call sub_4C4 jp loc_422 loc_433: ; ... jp loc_468 loc_436: ; ... ld a, (0E7Dh) cp 5Eh jp nz, loc_461 call sub_309 sub 61h ld (0E7Dh), a ld c, a ld a, 19h cp c jp nc, loc_456 ld bc, aInvalidControl call sub_2A7 jp loc_45E loc_456: ; ... ld a, (0E7Dh) inc a ld c, a call sub_4C4 loc_45E: ; ... jp loc_468 loc_461: ; ... ld hl, (0E7Dh) ld c, l call sub_4C4 loc_468: ; ... jp loc_3A6 loc_46B: ; ... ld a, (0E7Dh) sub 0Dh sub 1 sbc a, a ld (0E7Ch), a ld hl, (0E78h) ld c, l call sub_4C4 jp loc_39A locret_480: ; ... ret ; End of function sub_38A ; =============== S U B R O U T I N E ======================================= sub_481: ; ... ld hl, (0E7Ah) ld h, 0 ld bc, 5F4h add hl, bc ld a, (hl) ld (0E79h), a sub 20h sub 1 sbc a, a push af ld a, (0E79h) sub 0 sub 1 sbc a, a pop bc ld c, b or c rra jp c, loc_4AA ld hl, 0E7Ah inc (hl) ld a, 1 ret loc_4AA: ; ... ld a, 0 ret ; End of function sub_481 ; =============== S U B R O U T I N E ======================================= sub_4AD: ; ... ld hl, (0E7Ah) ld h, 0 ld bc, 5F4h add hl, bc ld a, (hl) cp 20h jp nz, locret_4C3 ld hl, 0E7Ah inc (hl) jp sub_4AD locret_4C3: ; ... ret ; End of function sub_4AD ; =============== S U B R O U T I N E ======================================= sub_4C4: ; ... ld hl, 0E7Bh ld (hl), c ld hl, (0E76h) inc hl ld (0E76h), hl ld de, 7FFh call sub_599 jp nc, loc_4DE ld bc, aBufferOverflow call sub_2A7 loc_4DE: ; ... ld hl, (0E76h) ld bc, 676h add hl, bc ld a, (0E7Bh) ld (hl), a ld a, (0E78h) inc a ld (0E78h), a ld c, a ld a, 7Dh cp c jp nc, locret_4FD ld bc, aCommandTooLong call sub_2A7 locret_4FD: ; ... ret ; End of function sub_4C4 ; =============== S U B R O U T I N E ======================================= sub_4FE: ; ... ld bc, 5BBh call sub_22D ld hl, 5DBh ld (hl), 0 ld bc, 5BBh call sub_25D ld a, (byte_5DE) cp 0FFh jp nz, loc_51D ld bc, aDirectoryFull call sub_2A7 loc_51D: ; ... call sub_57A ld (0E7Eh), a cp 0 jp z, loc_565 ld a, (0E7Eh) ld (80h), a ld c, a ld b, 0 ld hl, 81h add hl, bc ld (hl), 0 ld hl, (0E7Eh) ld h, 0 ld bc, 82h add hl, bc ld (hl), 24h loc_542: ; ... ld a, 0 ld hl, 0E7Eh cp (hl) jp nc, loc_55F call sub_57A ld hl, (0E7Eh) ld h, 0 ld bc, 80h add hl, bc ld (hl), a ld hl, 0E7Eh dec (hl) jp loc_542 loc_55F: ; ... call sub_378 jp loc_51D loc_565: ; ... ld bc, 5BBh call sub_21A ld a, (byte_5DE) cp 0FFh jp nz, locret_579 ld bc, aCannotClose call sub_2A7 locret_579: ; ... ret ; End of function sub_4FE ; =============== S U B R O U T I N E ======================================= sub_57A: ; ... ld hl, (0E76h) dec hl ld (0E76h), hl ld bc, 676h add hl, bc ld a, (hl) ret ; End of function sub_57A ; =============== S U B R O U T I N E ======================================= GoBOOT: ; ... jp 0 ; End of function GoBOOT ; =============== S U B R O U T I N E ======================================= GoBDOS1: ; ... jp 5 ; End of function GoBDOS1 ; =============== S U B R O U T I N E ======================================= GoBDOS2: ; ... jp 5 ; End of function GoBDOS2 db 0CDh db 5 db 0 db 0C9h db 0C9h db 0C9h db 5Fh db 16h db 0 ; =============== S U B R O U T I N E ======================================= sub_599: ; ... ld a, e sub l ld l, a ld a, d sbc a, h ld h, a ret ; End of function sub_599 db 0 db 0 db 0 db 0 db 0 db 0 db 0 db 0 db 0 db 0 db 0 db 0 db 0 db 0 db 0 db 0 db 0 db 0 db 0 db 0 db 0 db 0 db 30h db 30h byte_5B8 db 31h ; ... db 20h db 24h db 1 db 24h db 24h db 24h db 20h db 20h db 20h db 20h db 20h db 53h db 55h db 42h db 0 db 0 db 0 db 1Ah db 1Ah db 1Ah db 1Ah db 1Ah db 1Ah db 1Ah db 1Ah db 1Ah db 1Ah db 1Ah db 1Ah db 1Ah db 1Ah db 1Ah db 1Ah db 1Ah db 1Ah word_5DC dw 1A1Ah ; ... byte_5DE db 1Ah ; ... word_5DF dw 1A1Ah ; ... word_5E1 dw 1A1Ah ; ... word_5E3 dw 1A1Ah ; ... word_5E5 dw 1A1Ah ; ... word_5E7 dw 1A1Ah ; ... word_5E9 dw 1A1Ah ; ... word_5EB dw 1A1Ah ; ... word_5ED dw 1A1Ah ; ... byte_5EF db 1Ah ; ... word_5F0 dw 1A1Ah ; ... word_5F2 dw 1A1Ah ; ... db 1Ah db 1Ah db 1Ah db 1Ah db 1Ah db 1Ah db 1Ah db 1Ah db 1Ah db 1Ah db 1Ah db 1Ah ; end of 'ROM' end