TI ROM Disassembly
The Timex Interface is only used to connect the FDD/FDD3000 with a TC computer/ZX Spectrum. It contains an 8K ROM with ZX BASIC extension, 2K RAM to store system variables, and is used as a buffer between the computer and the FDD system. The user still needs a disk formatted by TOS to boot FDD/FDD3000.
This disassembly is from the ROM for 2048 and was made by Trojacek from speccy.pl and later corrected by ArthurM.
;
; CPU Type: Z80
;
; Created with dZ80 2.0
;
; on Thursday, 04 of April 2013 at 08:53 AM
;
; corrected on Monday, 18 of March 2024 at 01:38 PM
;
0000 f3 di
0001 c3e10e jp 0ee1h
0004 ff defb 255
0005 ff defb 255
0006 ff defb 255
0007 ff defb 255
; RST 8 – command execution, interface ROM/RAM ON
0008 f3 di
0009 e5 push hl
000a f5 push af
000b fde5 push iy
000d e1 pop hl
000e 7c ld a,h
000f b5 or l
0010 2027 jr nz,0039h
0012 f1 pop af
0013 e1 pop hl
0014 c9 ret
; test kbd
0015 fdcb01ae res 5,(iy+01h)
0019 fdcb01de set 3,(iy+01h)
001d cd1d03 call 031dh
0020 bf02 defw 02bfh ; call ZX ROM
0022 af xor a
0023 fdcb016e bit 5,(iy+01h)
0027 c8 ret z
0028 3a085c ld a,(5c08h)
002b fe61 cp 61h
002d d8 ret c
002e e6df and 0dfh
0030 c9 ret
; print a char
0031 3e0d ld a,0dh ; newline
0033 cd1d03 call 031dh
0036 1000 defw 0010h ; RST 16
0038 c9 ret
0039 f1 pop af
003a 213a21 ld hl,213ah
003d cb56 bit 2,(hl)
003f c22d02 jp nz,022dh
0042 cb66 bit 4,(hl)
0044 c24f06 jp nz,064fh
0047 cb6e bit 5,(hl)
0049 c25502 jp nz,0255h
004c cb46 bit 0,(hl)
004e cb86 res 0,(hl)
0050 e1 pop hl
0051 c0 ret nz
0052 2a5d5c ld hl,(5c5dh)
0055 223f21 ld (213fh),hl
0058 7e ld a,(hl)
0059 fe2a cp 2ah
005b 2021 jr nz,007eh
005d 2b dec hl
005e 7e ld a,(hl)
005f fea5 cp 0a5h
0061 381b jr c,007eh
0063 225d5c ld (5c5dh),hl
0066 116b02 ld de,026bh
0069 7e ld a,(hl)
006a 47 ld b,a
006b eb ex de,hl
006c 7e ld a,(hl)
006d b8 cp b
006e 281c jr z,008ch
0070 fefe cp 0feh
0072 23 inc hl
0073 7e ld a,(hl)
0074 20fa jr nz,0070h
0076 23 inc hl
0077 23 inc hl
0078 23 inc hl
0079 7e ld a,(hl)
007a feff cp 0ffh
007c 20ef jr nz,006dh
007e 2a3b21 ld hl,(213bh)
0081 e9 jp (hl)
0082 210b00 ld hl,000bh
0085 e5 push hl
0086 2a3f21 ld hl,(213fh)
0089 c30306 jp 0603h
008c 13 inc de
008d ed535d5c ld (5c5dh),de
0091 23 inc hl
0092 e5 push hl
0093 cd1d03 call 031dh
0096 2000 defw 0020h
0098 e1 pop hl
0099 11c500 ld de,00c5h
009c 7e ld a,(hl)
009d fefe cp 0feh
009f 2817 jr z,00b8h
00a1 83 add a,e
00a2 5f ld e,a
00a3 3001 jr nc,00a6h
00a5 14 inc d
00a6 e5 push hl
00a7 21b400 ld hl,00b4h
00aa e5 push hl
00ab eb ex de,hl
00ac 5e ld e,(hl)
00ad 23 inc hl
00ae 56 ld d,(hl)
00af d5 push de
00b0 2a5d5c ld hl,(5c5dh)
00b3 c9 ret
00b4 e1 pop hl
00b5 23 inc hl
00b6 18e1 jr 0099h
00b8 cd3e03 call 033eh
00bb 23 inc hl
00bc 5e ld e,(hl)
00bd 23 inc hl
00be 56 ld d,(hl)
00bf eb ex de,hl
00c0 11dc06 ld de,06dch
00c3 d5 push de
00c4 e9 jp (hl)
;TOS commands analyze jump table
00c5 ea00 defw 00eah
00c7 fa00 defw 00fah
00c9 1701 defw 0117h
00cb 4901 defw 0149h
00cd 4f01 defw 014fh
00cf 7901 defw 0179h
00d1 b101 defw 01b1h
00d3 be01 defw 01beh
00d5 ca01 defw 01cah
00d7 fe01 defw 01feh
00d9 1702 defw 0217h
00db ec01 defw 01ech
00dd f301 defw 01f3h
00df 6d09 defw 096dh
00e1 a80b defw 0ba8h
00e3 7208 defw 0872h
00e5 a407 defw 07a4h
00e7 c36a04 jp 046ah
00ea cd2302 call 0223h
00ed 28f8 jr z,00e7h
00ef cd6306 call 0663h
00f2 c8 ret z
00f3 cd4102 call 0241h
00f6 323421 ld (2134h),a
00f9 c9 ret
00fa cd2302 call 0223h
00fd 20e8 jr nz,00e7h
00ff 2a5d5c ld hl,(5c5dh)
0102 7e ld a,(hl)
0103 fe24 cp 24h
0105 2807 jr z,010eh
0107 fe22 cp 22h
0109 2803 jr z,010eh
010b 2b dec hl
010c 18f4 jr 0102h
010e 225d5c ld (5c5dh),hl
0111 cd1d03 call 031dh
0114 2000 defw 0020h
0116 c9 ret
0117 7e ld a,(hl)
0118 cd6502 call 0265h
011b 28ca jr z,00e7h
011d fe5b cp 5bh
011f 3802 jr c,0123h
0121 d620 sub 20h
0123 210000 ld hl,0000h
0126 39 add hl,sp
0127 23 inc hl
0128 23 inc hl
0129 5e ld e,(hl)
012a 23 inc hl
012b 56 ld d,(hl)
012c 13 inc de
012d 47 ld b,a
012e 1a ld a,(de)
012f a7 and a
0130 28b5 jr z,00e7h
0132 b8 cp b
0133 2803 jr z,0138h
0135 13 inc de
0136 18f6 jr 012eh
0138 323621 ld (2136h),a
013b 13 inc de
013c 1a ld a,(de)
013d a7 and a
013e 20fb jr nz,013bh
0140 72 ld (hl),d
0141 2b dec hl
0142 73 ld (hl),e
0143 cd1d03 call 031dh
0146 2000 defw 0020h
0148 c9 ret
0149 213a21 ld hl,213ah
014c cbce set 1,(hl)
014e c9 ret
014f 7e ld a,(hl)
0150 cd6502 call 0265h
0153 281d jr z,0172h
0155 cd1702 call 0217h
0158 cd2302 call 0223h
015b ca6a04 jp z,046ah
015e cd6306 call 0663h
0161 c8 ret z
0162 cd4b02 call 024bh
0165 ed434b21 ld (214bh),bc
0169 3a3a21 ld a,(213ah)
016c cbdf set 3,a
016e 323a21 ld (213ah),a
0171 c9 ret
0172 3a3a21 ld a,(213ah)
0175 cb9f res 3,a
0177 18f5 jr 016eh
0179 cd1702 call 0217h
017c cd2302 call 0223h
017f c26a04 jp nz,046ah
0182 2a5d5c ld hl,(5c5dh)
0185 7e ld a,(hl)
0186 cd6502 call 0265h
0189 281f jr z,01aah
018b cd1702 call 0217h
018e feac cp 0ach
0190 c26a04 jp nz,046ah
0193 cd1d03 call 031dh
0196 2000 defw 0020h
0198 cd2302 call 0223h
019b ca6a04 jp z,046ah
019e cd6306 call 0663h
01a1 c8 ret z
01a2 cd4b02 call 024bh
01a5 ed434b21 ld (214bh),bc
01a9 c9 ret
01aa 210000 ld hl,0000h
01ad 224b21 ld (214bh),hl
01b0 c9 ret
01b1 7e ld a,(hl)
01b2 cd6502 call 0265h
01b5 c2ea00 jp nz,00eah
01b8 3e80 ld a,80h
01ba 323421 ld (2134h),a
01bd c9 ret
01be 7e ld a,(hl)
01bf cd6502 call 0265h
01c2 3e80 ld a,80h
01c4 323421 ld (2134h),a
01c7 c2fa00 jp nz,00fah
01ca 7e ld a,(hl)
01cb e6df and 0dfh
01cd fe4e cp 4eh
01cf 2810 jr z,01e1h
01d1 fe0d cp 0dh
01d3 2807 jr z,01dch
01d5 fe1a cp 1ah
01d7 2803 jr z,01dch
01d9 c36a04 jp 046ah
01dc af xor a
01dd 323421 ld (2134h),a
01e0 c9 ret
01e1 3e01 ld a,01h
01e3 323421 ld (2134h),a
01e6 cd1d03 call 031dh
01e9 2000 defw 0020h
01eb c9 ret
01ec 7e ld a,(hl)
01ed e6df and 0dfh
01ef fe44 cp 44h
01f1 18dc jr 01cfh
01f3 3a3421 ld a,(2134h)
01f6 323921 ld (2139h),a
01f9 a7 and a
01fa 20f0 jr nz,01ech
01fc 18de jr 01dch
01fe af xor a
01ff 323421 ld (2134h),a
0202 7e ld a,(hl)
0203 cd6502 call 0265h
0206 c8 ret z
0207 fecc cp 0cch
0209 c26a04 jp nz,046ah
020c 323421 ld (2134h),a
020f cd1d03 call 031dh
0212 2000 defw 0020h
0214 c3fa00 jp 00fah
0217 7e ld a,(hl)
0218 fe3b cp 3bh
021a c26a04 jp nz,046ah
021d cd1d03 call 031dh
0220 2000 defw 0020h
0222 c9 ret
0223 213a21 ld hl,213ah
0226 cbd6 set 2,(hl)
0228 cd1d03 call 031dh
022b fb24 defw fb24h
022d cb96 res 2,(hl)
022f cb86 res 0,(hl)
0231 e1 pop hl
0232 d1 pop de
0233 212d02 ld hl,022dh
0236 a7 and a
0237 ed52 sbc hl,de
0239 c26204 jp nz,0462h
023c fdcb0176 bit 6,(iy+01h)
0240 c9 ret
0241 213a21 ld hl,213ah
0244 cbee set 5,(hl)
0246 cd1d03 call 031dh
0249 941e defw 1e94h ;zxrom:FIND-INT1
024a 213a21 ld hl,213ah
024c cbee bit 5,(hl)
024f cd1d03 call 031dh
0253 991e defw 1e99h ;zxrom:FIND-IN2
0254 cbae res 5,(hl)
0257 cb86 res 0,(hl)
0259 e1 pop hl
025a d1 pop de
025b 21a01e ld hl,1ea0h
025e a7 and a
025f ed52 sbc hl,de
0261 c0 ret nz
0262 c36204 jp 0462h
0265 fe0d cp 0dh
0267 c8 ret z
0268 fe3a cp 3ah
026a c9 ret
;syntax check table
;——-CAT*
026b cf defb cfh ;BASIC token of command
026c 0e defb 0eh
026d fe defb feh ;magic number
026e 02 defb 02h
026f 17 defb 17h
0270 07 defb 07h
;——-LOAD*
0271 ef defb efh
0272 1c defb 1ch
0273 06 defb 06h
0274 fe defb feh
0275 0a defb 0ah
0276 39 defb 39h
0277 0c defb 0ch
;——-SAVE*
0278 f8 defb f8h
0279 1a defb 1ah
027a 06 defb 06h
027b fe defb feh
027c 0a defb 0ah
027d ee defb eeh
027e 09 defb 09h
;——-OPEN #*
027f d3 defb d3h
0280 00 defb 00h
0281 14 defb 14h
0282 02 defb 02h
0283 14 defb 14h
0284 04 defb 04h
0285 49 defb 49h ;”I”
0286 4f defb 4fh ;”O”
0287 41 defb 41h ;”A”
0288 52 defb 52h ;”R”
0289 00 defb 00h
028a 08 defb 08h
028b 06 defb 06h
028c fe defb feh
028d 0a defb 0ah
028e e5 defb e5h
028f 08 defb 08h
;——-CLOSE #*
0290 d4 defb d4h
0291 0c defb 0ch
0292 06 defb 06h
0293 fe defb feh
0294 0a defb 0ah
0295 d5 defb d5h
0296 08 defb 08h
;——-PRINT*
0297 f5 defb f5h
0298 04 defb 04h
0299 23 defb 23h
029a 00 defb 00h
029b 00 defb 00h
029c 0a defb 0ah
029d 06 defb 06h
029e fe defb feh
029f 0c defb 0ch
02a0 48 defb 48h
02a1 07 defb 07h
;——-INPUT*
02a2 ee defb eeh
02a3 04 defb 04h
02a4 23 defb 23h
02a5 00 defb 00h
02a6 00 defb 00h
02a7 14 defb 14h
02a8 20 defb 20h
02a9 fe defb feh
02aa 00 defb 00h
02ab 00 defb 00h
02ac 00 defb 00h
;——-LIST*
02ad f0 defb f0h
02ae 1e defb 1eh
02af fe defb feh
02b0 00 defb 00h
02b1 80 defb 80h
02b2 08 defb 08h
;——-RESTORE*
02b3 e5 defb e5h
02b4 04 defb 04h
02b5 23 defb 23h ;”#”
02b6 00 defb 00h
02b7 00 defb 00h
02b8 06 defb 06h
02b9 fe defb feh
02ba 0c defb 0ch
02bb 53 defb 53h
02bc 08 defb 08h
;——-MERGE*
02bd d5 defb d5h
02be 02 defb 02h
02bf 06 defb 06h
02c0 fe defb feh
02c1 0a defb 0ah
02c2 a7 defb a7h
02c3 0c defb 0ch
;——-GOTO*
02c4 ec defb ech
02c5 02 defb 02h
02c6 16 defb 16h
02c7 06 defb 06h
02c8 fe defb feh
02c9 0a defb 0ah
02ca 44 defb 44h
02cb 08 defb 08h
;——-GOSUB*
02cc ed defb edh
02cd 0e defb 0eh
02ce 18 defb 18h
02cf 06 defb 06h
02d0 fe defb feh
02d1 0a defb 0ah
02d2 34 defb 34h
02d3 08 defb 08h
;——-DRAW*
02d4 fc defb fch
02d5 06 defb 06h
02d6 fe defb feh
02d7 0c defb 0ch
02d8 4e defb 4eh
02d9 08 defb 08h
;——-FORMAT*
02da d0 defb d0h
02db 02 defb 02h
02dc 12 defb 12h
02dd 18 defb 18h
02de 06 defb 06h
02df fe defb feh
02e0 0a defb 0ah
02e1 9e defb 9eh
02e2 0e defb 0eh
;——-ERASE*
02e3 d2 defb d2h
02e4 02 defb 02h
02e5 10 defb 10h
02e6 06 defb 06h
02e7 fe defb feh
02e8 0a defb 0ah
02e9 bb defb bbh
02ea 08 defb 08h
;——-LET*
02eb f1 defb f1h
02ec 02 defb 02h
02ed 04 defb 04h
02ee ac defb ach ;”AT” keyword?
02ef 00 defb 00h
02f0 02 defb 02h
02f1 06 defb 06h
02f2 fe defb feh
02f3 08 defb 08h
02f4 69 defb 69h
02f5 09 defb 09h
;——-MOVE*
02f6 d1 defb d1h
02f7 02 defb 02h
02f8 04 defb 04h
02f9 ac defb ach ;”AT” keyword?
02fa 00 defb 00h
02fb 02 defb 02h
02fc 06 defb 06h
02fd fe defb feh
02fe 0a defb 0ah
02ff 2f defb 2fh
0300 09 defb 09h
;——-DIM*
0301 e9 defb e9h
0302 02 defb 02h
0303 06 defb 06h
0304 fe defb feh
0305 06 defb 06h
0306 c6 defb c6h
0307 08 defb 08h
;——-ATTR*
0308 ab defb abh
0309 02 defb 02h
030a 04 defb 04h
030b 50 defb 50h ;”P”
030c 55 defb 55h ;”U”
030d 56 defb 56h ;”V”
030e 49 defb 49h ;”I”
030f 00 defb 00h
0310 06 defb 06h
0311 fe defb feh
0312 04 defb 04h
0313 ba defb bah
0314 0e defb 0eh
;——-NEXT*
0315 ff defb ffh ;error in table! that’s why NEXT didn’t work
0316 0e defb 0eh
0317 06 defb 06h
0318 fe defb feh
0319 08 defb 08h
031a 5e defb 5eh
031b 08 defb 08h
;end table with magic number
031c ff defb ffh
; CBAS – call ZX ROM proc (call + defw)
031d 223f21 ld (213fh),hl
0320 ed534121 ld (2141h),de
0324 e1 pop hl
0325 5e ld e,(hl)
0326 23 inc hl
0327 56 ld d,(hl)
0328 23 inc hl
0329 e5 push hl
032a 213a21 ld hl,213ah
032d cbc6 set 0,(hl)
032f 210800 ld hl,0008h
0332 e5 push hl
0333 d5 push de
0334 2a3f21 ld hl,(213fh)
0337 ed5b4121 ld de,(2141h)
033b c30306 jp 0603h
033e 23 inc hl
033f 223f21 ld (213fh),hl
0342 7e ld a,(hl)
0343 b7 or a
0344 2806 jr z,034ch
0346 47 ld b,a
0347 e1 pop hl
0348 33 inc sp
0349 10fd djnz 0348h
034b e5 push hl
034c 2a5d5c ld hl,(5c5dh)
034f 7e ld a,(hl)
0350 cd6502 call 0265h
0353 c26a04 jp nz,046ah
0356 2a3f21 ld hl,(213fh)
0359 cd6306 call 0663h
035c c0 ret nz
035d 21f41b ld hl,1bf4h
0360 e3 ex (sp),hl
0361 c30306 jp 0603h
; PUTCOM
0364 ed430321 ld (2103h),bc
0368 ed530521 ld (2105h),de
036c 220721 ld (2107h),hl
036f f5 push af
0370 e1 pop hl
0371 220121 ld (2101h),hl
0374 dd220921 ld (2109h),ix
0378 fd220b21 ld (210bh),iy
037c 3ec0 ld a,0c0h
037e 322f21 ld (212fh),a
0381 3e0d ld a,0dh
0383 323021 ld (2130h),a
0386 210021 ld hl,2100h
0389 cd9504 call 0495h
038c c8 ret z
038d cd1204 call 0412h
0390 38f4 jr c,0386h
0392 c36c04 jp 046ch
; PUTDAT
0395 323021 ld (2130h),a
0398 3ed0 ld a,0d0h
039a 322f21 ld (212fh),a
039d 210020 ld hl,2000h
03a0 cd9504 call 0495h
03a3 c8 ret z
03a4 cd1204 call 0412h
03a7 38f4 jr c,039dh
03a9 c36c04 jp 046ch
; receive data block or command from fdd
03ac cdd604 call 04d6h
03af 2808 jr z,03b9h
03b1 cd1204 call 0412h
03b4 38f6 jr c,03ach
03b6 c36a04 jp 046ah
03b9 3a2f21 ld a,(212fh)
03bc fec0 cp 0c0h
03be 2802 jr z,03c2h
03c0 a7 and a
03c1 c9 ret
03c2 2a0121 ld hl,(2101h)
03c5 e5 push hl
03c6 f1 pop af
03c7 ed4b0321 ld bc,(2103h)
03cb ed5b0521 ld de,(2105h)
03cf 2a0721 ld hl,(2107h)
03d2 dd2a0921 ld ix,(2109h)
03d6 37 scf
03d7 c9 ret
; PR_ERR – hl = txt addr, b = limit, max 33 chars
03d8 e5 push hl
03d9 3efe ld a,0feh
03db cd1d03 call 031dh
03de 0116 defw 1601h
03e0 3eff ld a,0ffh
03e2 328c5c ld (5c8ch),a
03e5 cd1500 call 0015h
03e8 fe53 cp 53h
03ea 2007 jr nz,03f3h
03ec cd1500 call 0015h
03ef fe51 cp 51h
03f1 20f9 jr nz,03ech
03f3 cd3100 call 0031h
03f6 e1 pop hl
03f7 e5 push hl
03f8 7c ld a,h
03f9 1f rra
03fa 0600 ld b,00h
03fc 3802 jr c,0400h
03fe 0621 ld b,21h
0400 e1 pop hl
0401 04 inc b
0402 78 ld a,b
0403 fe21 cp 21h
0405 c8 ret z
0406 7e ld a,(hl)
0407 b7 or a
0408 c8 ret z
0409 23 inc hl
040a e5 push hl
040b cd1d03 call 031dh
040e 1000 defw 0010h
0410 18ee jr 0400h
0412 3e7f ld a,7fh
0414 dbfe in a,(0feh)
0416 1f rra
0417 d8 ret c
0418 3efe ld a,0feh
041a dbfe in a,(0feh)
041c 1f rra
041d d8 ret c
041e 3e14 ld a,14h
0420 c9 ret
0421 320221 ld (2102h),a
0424 a7 and a
0425 c8 ret z
0426 fe81 cp 81h
0428 113f04 ld de,043fh
042b 2806 jr z,0433h
042d fe4b cp 4bh
042f 115204 ld de,0452h
0432 c0 ret nz
0433 e5 push hl
0434 210d21 ld hl,210dh
0437 eb ex de,hl
0438 012000 ld bc,0020h
043b edb0 ldir
043d e1 pop hl
043e c9 ret
043f defs “Supersede (Y/N) ? “
0451 00 defb 0
0452 defs “Wrong data type”
0461 00 defb 0
0462 eb ex de,hl
0463 cd1d03 call 031dh
0466 7b00 defw 007bh
0468 1802 jr 046ch
046a 3e0b ld a,0bh
046c ed7b3d5c ld sp,(5c3dh)
0470 fd7700 ld (iy+00h),a
0473 2a5d5c ld hl,(5c5dh)
0476 225f5c ld (5c5fh),hl
0479 21c516 ld hl,16c5h
047c e5 push hl
047d c30306 jp 0603h
0480 fd3600ff ld (iy+00h),0ffh
0484 213a21 ld hl,213ah
0487 cb4e bit 1,(hl)
0489 cb8e res 1,(hl)
048b ca0306 jp z,0603h
048e 21761b ld hl,1b76h
0491 e5 push hl
0492 c30306 jp 0603h
; low-level operations
; send block to fdd, hl – block address
0495 d5 push de
0496 c5 push bc
0497 e5 push hl
0498 3e0a ld a,0ah
049a 323221 ld (2132h),a ; retry count
049d 212f21 ld hl,212fh ; address for block type variable (3 bytes)
04a0 0603 ld b,03h ; 3 bytes to send
04a2 0e00 ld c,00h
04a4 cd2e05 call 052eh ; send b bytes from (hl++)
04a7 3a3021 ld a,(2130h) ; block length
04aa 47 ld b,a
04ab e1 pop hl ; restore hl
04ac e5 push hl
04ad cd2e05 call 052eh ; send b bytes from (hl++)
04b0 79 ld a,c ; c=0?
04b1 ed44 neg
04b3 cd2a05 call 052ah
04b6 213121 ld hl,2131h
04b9 cd8105 call 0581h
04bc 3a3121 ld a,(2131h)
04bf feb0 cp 0b0h ; b0h = OK
04c1 2005 jr nz,04c8h
04c3 af xor a
04c4 e1 pop hl
04c5 c1 pop bc
04c6 d1 pop de
04c7 c9 ret
; send byte to fdd
04c8 3a3221 ld a,(2132h)
04cb 3d dec a ; decrease retry count
04cc 323221 ld (2132h),a
04cf 20cc jr nz,049dh ; not 0 yet -> jump to retry
; return with error
04d1 3e03 ld a,03h ; 0 -> error code = 3
04d3 a7 and a
04d4 18ee jr 04c4h return
; receive data block (or command) from fdd
04d6 d5 push de
04d7 c5 push bc
04d8 e5 push hl
04d9 3e0a ld a,0ah
04db 323221 ld (2132h),a
04de 212f21 ld hl,212fh
04e1 0603 ld b,03h ; 3 bytes
04e3 0e00 ld c,00h
04e5 cd8305 call 0583h ; receive b bytes
04e8 3a2f21 ld a,(212fh)
04eb fec0 cp 0c0h
04ed 2806 jr z,04f5h
04ef fed0 cp 0d0h
04f1 2807 jr z,04fah
04f3 18e9 jr 04deh
04f5 210021 ld hl,2100h
04f8 1803 jr 04fdh
04fa 210020 ld hl,2000h
04fd 3a3021 ld a,(2130h)
0500 47 ld b,a
0501 cd8305 call 0583h
0504 213121 ld hl,2131h
0507 cd8105 call 0581h
050a 79 ld a,c
050b a7 and a
050c 2815 jr z,0523h
050e 3a3221 ld a,(2132h)
0511 3d dec a
0512 323221 ld (2132h),a
0515 2807 jr z,051eh
0517 3ee0 ld a,0e0h
0519 cd2a05 call 052ah ; send E0h
051c 18c0 jr 04deh ; go to receive data
; set code to 4 then pop/ret
051e 3e04 ld a,04h
0520 a7 and a
0521 18a1 jr 04c4h
; send b0h to fdd then pop/ret
0523 3eb0 ld a,0b0h
0525 cd2a05 call 052ah
0528 189a jr 04c4h
; send 1 byte from a
052a 0601 ld b,01h
052c 1801 jr 052fh
; send b bytes from (hl++)
;
; 1 byte transmission model:
; (b7: 0 – left nibble, 1 – right nibble)
; (b6: 0 – data valid, 1 – data req)
;
; Send 0000 rrrr (right nibble)
; wait for 01xx xxxx
; Send 1000 rrrr (right nibble)
; wait for 11xx xxxx
; Send 1000 llll (left nibble)
; Send 0000 llll (left nibble)
; wait for 00xx xxxx
; Send 0000 0000 (clear port)
052e 7e ld a,(hl)
052f 57 ld d,a
0530 81 add a,c
0531 4f ld c,a
0532 c5 push bc
0533 7a ld a,d ; get byte
0534 e60f and 0fh ; separate right nibble
0536 d3ef out (0efh),a ; send right nibble with b7=0
0538 5f ld e,a ; e=right nibble
0539 7a ld a,d
053a e6f0 and 0f0h
053c 0f rrca
053d 0f rrca
053e 0f rrca
053f 0f rrca
0540 57 ld d,a ; d=shifted left nibble
0541 01c000 ld bc,00c0h
0544 dbef in a,(0efh) ; check status
0546 a1 and c ; C0h (b7=1, b6=1)
0547 fe40 cp 40h ; test b7=0, b6=1
0549 2804 jr z,054fh ; status OK
054b 10f7 djnz 0544h ; loop for status check
054d 1823 jr 0572h ; error handling
054f 7b ld a,e
0550 f680 or 80h
0552 d3ef out (0efh),a ; send right nibble with b7=1
0554 0600 ld b,00h
0556 dbef in a,(0efh) ; check status
0558 a1 and c ; C0h
0559 fec0 cp 0c0h ; test b7=1, b6=1
055b 2804 jr z,0561h ; status OK
055d 10f7 djnz 0556h
055f 1811 jr 0572h ; error handling
0561 7a ld a,d
0562 f680 or 80h
0564 d3ef out (0efh),a ; send left nibble with b7=1
0566 7a ld a,d
0567 d3ef out (0efh),a ; send left nibble with b7=0
0569 0600 ld b,00h
056b dbef in a,(0efh)
056d a1 and c ; test b7=0, b6=0
056e 280b jr z,057bh
0570 10f9 djnz 056bh
; error handling
0572 3e00 ld a,00h ; clear port
0574 d3ef out (0efh),a
0576 c1 pop bc
0577 e1 pop hl
0578 c3d104 jp 04d1h ; jump to error handling
; continue loop
057b c1 pop bc
057c 23 inc hl
057d 10af djnz 052eh
057f af xor a ; return with code 0 (OK)
0580 c9 ret
; receive byte from fdd
0581 0601 ld b,01h
; receive b bytes from fdd to (hl++)
;
; 1 byte transmission model:
; (b7: 0 – left nibble, 1 – right nibble)
; (b6: 0 – data valid, 1 – data req)
;
; Send 0100 0000
; wait for 10xx rrrr (right nibble)
; Send 1100 0000
; wait for 00xx llll (left nibble)
; send 0000 0000 (clear port)
;
0583 c5 push bc
0584 3e40 ld a,40h
0586 d3ef out (0efh),a; send 40h (b7=0, b6=1)
0588 01c000 ld bc,00c0h
058b dbef in a,(0efh)
058d 5f ld e,a
058e a1 and c ; c0h = 1100 0000
058f fe80 cp 80h ; wait for b7=1, b6=0
0591 2804 jr z,0597h
0593 10f6 djnz 058bh
0595 18db jr 0572h ; jump to error handling (timeout)
0597 3ec0 ld a,0c0h
0599 d3ef out (0efh),a ; send C0h command (b7=1, b6=1)
059b 0600 ld b,00h
059d dbef in a,(0efh)
059f 57 ld d,a
05a0 a1 and c ; test b7 and b6
05a1 2804 jr z,05a7h ; b7=0 and b6=0
05a3 10f8 djnz 059dh
05a5 18cb jr 0572h ; jump to error handling (timeout)
05a7 d3ef out (0efh),a ; send 0
05a9 7b ld a,e ; e is right nibble
05aa e60f and 0fh
05ac 5f ld e,a
05ad 7a ld a,d ; d is left nibble
05ae e60f and 0fh
05b0 07 rlca
05b1 07 rlca
05b2 07 rlca
05b3 07 rlca
05b4 b3 or e ; l+r nibbles
05b5 77 ld (hl),a
05b6 c1 pop bc
05b7 81 add a,c
05b8 4f ld c,a
05b9 23 inc hl
05ba 10c7 djnz 0583h
05bc af xor a
05bd c9 ret
05be 53 defb 83 ; “S”
05bf 54 defb 84 ; “T”
05c0 41 defb 65 ; “A”
05c1 52 defb 82 ; “R”
05c2 54 defb 84 ; “T”
05c3 00 defb 0
05c4 ff defb 255
05c5 ff defb 255
05c6 ff defb 255
05c7 ff defb 255
05c8 ff defb 255
05c9 ff defb 255
05ca ff defb 255
05cb ff defb 255
05cc ff defb 255
05cd ff defb 255
05ce ff defb 255
05cf ff defb 255
05d0 ff defb 255
05d1 ff defb 255
05d2 ff defb 255
05d3 ff defb 255
05d4 ff defb 255
05d5 ff defb 255
05d6 ff defb 255
05d7 ff defb 255
05d8 ff defb 255
05d9 ff defb 255
05da ff defb 255
05db ff defb 255
05dc ff defb 255
05dd ff defb 255
05de ff defb 255
05df ff defb 255
05e0 ff defb 255
05e1 ff defb 255
05e2 ff defb 255
05e3 ff defb 255
05e4 ff defb 255
05e5 ff defb 255
05e6 ff defb 255
05e7 ff defb 255
05e8 ff defb 255
05e9 ff defb 255
05ea ff defb 255
05eb ff defb 255
05ec ff defb 255
05ed ff defb 255
05ee ff defb 255
05ef ff defb 255
05f0 ff defb 255
05f1 ff defb 255
05f2 ff defb 255
05f3 ff defb 255
05f4 ff defb 255
05f5 ff defb 255
05f6 ff defb 255
05f7 ff defb 255
05f8 ff defb 255
05f9 ff defb 255
05fa ff defb 255
05fb ff defb 255
05fc ff defb 255
05fd ff defb 255
05fe ff defb 255
05ff ff defb 255
0600 ff defb 255
0601 ff defb 255
0602 ff defb 255
0603 fb ei
0604 c9 ret ; interface ROM/RAM OFF
0605 c39503 jp 0395h ; PUTDAT
0608 c36403 jp 0364h ; PUTCOM
060b c3ac03 jp 03ach ; GETBLOCK
060e c39504 jp 0495h ; SENDBL
0611 c3d604 jp 04d6h ; GETBL
0614 c3940d jp 0d94h ; RDBLOC
0617 c3bf0d jp 0dbfh ; RDMEM
061a c3540b jp 0b54h ; WRTMEM
061d c31d03 jp 031dh ; CBAS
0620 c3610a jp 0a61h ; SAVEP
0623 c3c10c jp 0cc1h ; LOADP
0626 c38806 jp 0688h ; CONVMD
0629 3a3621 ld a,(2136h)
062c cb7f bit 7,a
062e c0 ret nz
062f 2a4921 ld hl,(2149h)
0632 cd6306 call 0663h
0635 c8 ret z
0636 e5 push hl
0637 23 inc hl
0638 4e ld c,(hl)
0639 23 inc hl
063a 46 ld b,(hl)
063b 03 inc bc
063c 03 inc bc
063d 03 inc bc
063e e1 pop hl
063f cd1d03 call 031dh
0642 e819 defw 19e8h
0644 c9 ret
0645 213a21 ld hl,213ah
0648 cbe6 set 4,(hl)
064a cd1d03 call 031dh
064d b228 defw 28b2h
064f cba6 res 4,(hl)
0651 cb86 res 0,(hl)
0653 e1 pop hl
0654 e3 ex (sp),hl
0655 f5 push af
0656 114f06 ld de,064fh
0659 eb ex de,hl
065a a7 and a
065b ed52 sbc hl,de
065d c26204 jp nz,0462h
0660 f1 pop af
0661 e1 pop hl
0662 c9 ret
0663 fdcb017e bit 7,(iy+01h)
0667 c9 ret
; CONV – FDD takes control of printing
0668 cd1d03 call 031dh
066b f12b defw 2bf1h
; text -> buffer + hr(0)
066d 210020 ld hl,2000h
0670 e5 push hl
0671 a7 and a
0672 214000 ld hl,0040h
0675 ed42 sbc hl,bc
0677 e1 pop hl
0678 3808 jr c,0682h
067a 78 ld a,b
067b b1 or c
067c 2804 jr z,0682h
067e eb ex de,hl
067f edb0 ldir
0681 eb ex de,hl
0682 3600 ld (hl),00h
0684 23 inc hl
0685 3c inc a
0686 47 ld b,a
0687 c9 ret
;
0688 cdac03 call 03ach
068b 30fb jr nc,0688h
068d 3a0021 ld a,(2100h)
0690 fe80 cp 80h
0692 c8 ret z
0693 fe83 cp 83h
0695 281a jr z,06b1h
0697 fe82 cp 82h
0699 2809 jr z,06a4h
069b fe81 cp 81h
069d 20e9 jr nz,0688h
069f cdd506 call 06d5h
06a2 1824 jr 06c8h
06a4 cdd506 call 06d5h
06a7 3ebf ld a,0bfh
06a9 dbfe in a,(0feh)
06ab cb47 bit 0,a
06ad 20f8 jr nz,06a7h
06af 1817 jr 06c8h
06b1 cdd506 call 06d5h
06b4 cd1d03 call 031dh
06b7 8e02 defw 028eh
06b9 13 inc de
06ba 7a ld a,d
06bb b3 or e
06bc 20f6 jr nz,06b4h
06be cd1500 call 0015h
06c1 28fb jr z,06beh
06c3 cd1d03 call 031dh
06c6 1000 defw 0010h
06c8 3e91 ld a,91h
06ca 320021 ld (2100h),a
06cd 3a085c ld a,(5c08h)
06d0 cd6403 call 0364h ; PUTCOM
06d3 18b3 jr 0688h
06d5 210020 ld hl,2000h
06d8 cdd803 call 03d8h
06db c9 ret
06dc cd8806 call 0688h
06df 2a3d21 ld hl,(213dh)
06e2 e9 jp (hl)
06e3 fdcb0c7e bit 7,(iy+0ch)
06e7 2803 jr z,06ech
06e9 cd3100 call 0031h
06ec 3a0221 ld a,(2102h)
06ef 47 ld b,a
06f0 3ab15c ld a,(5cb1h)
06f3 fe00 cp 00h
06f5 78 ld a,b
06f6 2019 jr nz,0711h
06f8 b7 or a
06f9 ca8004 jp z,0480h
06fc cd3100 call 0031h
06ff cd3100 call 0031h
0702 210d21 ld hl,210dh
0705 cdd803 call 03d8h
0708 cd3100 call 0031h
070b cd3100 call 0031h
070e c36a04 jp 046ah
0711 32b05c ld (5cb0h),a
0714 c38004 jp 0480h
0717 3a3421 ld a,(2134h)
071a b7 or a
071b 280e jr z,072bh
071d cd6806 call 0668h
0720 cd9503 call 0395h ; PUTDAT
0723 3e0c ld a,0ch
0725 320021 ld (2100h),a
0728 c36403 jp 0364h ; PUTCOM
072b 3e0b ld a,0bh
072d 18f6 jr 0725h
072f 3e13 ld a,13h
0731 320021 ld (2100h),a
0734 3a3421 ld a,(2134h)
0737 322e21 ld (212eh),a
073a cd6403 call 0364h ; PUTCOM
073d cdac03 call 03ach
0740 30fb jr nc,073dh
0742 c9 ret
0743 2a3d21 ld hl,(213dh)
0746 e3 ex (sp),hl
0747 c9 ret
0748 cd2f07 call 072fh
074b 20f6 jr nz,0743h
074d 3a0420 ld a,(2004h)
0750 b7 or a
0751 2822 jr z,0775h
0753 2a4b21 ld hl,(214bh)
0756 7c ld a,h
0757 b5 or l
0758 20e9 jr nz,0743h
075a cd7f07 call 077fh
075d 30e4 jr nc,0743h
075f ed434b21 ld (214bh),bc
0763 79 ld a,c
0764 cd9503 call 0395h ; PUTDAT
0767 0e00 ld c,00h
0769 3a3421 ld a,(2134h)
076c 47 ld b,a
076d ed5b4b21 ld de,(214bh)
0771 3e0f ld a,0fh
0773 18b0 jr 0725h
0775 3a0c20 ld a,(200ch)
0778 f5 push af
0779 cd7f07 call 077fh
077c f1 pop af
077d 18e5 jr 0764h
077f 210020 ld hl,2000h
0782 0600 ld b,00h
0784 3620 ld (hl),20h
0786 23 inc hl
0787 10fb djnz 0784h
0789 cd1d03 call 031dh
078c f12b defw 2bf1h
078e 78 ld a,b
078f b1 or c
0790 2001 jr nz,0793h
0792 c9 ret
0793 78 ld a,b
0794 b7 or a
0795 2803 jr z,079ah
0797 010001 ld bc,0100h
079a c5 push bc
079b 210020 ld hl,2000h
079e eb ex de,hl
079f edb0 ldir
07a1 c1 pop bc
07a2 37 scf
07a3 c9 ret
07a4 cd4506 call 0645h
07a7 7e ld a,(hl)
07a8 3012 jr nc,07bch
07aa fe61 cp 61h
07ac 3802 jr c,07b0h
07ae d620 sub 20h
07b0 f680 or 80h
07b2 47 ld b,a
07b3 23 inc hl
07b4 7e ld a,(hl)
07b5 fe24 cp 24h
07b7 c26a04 jp nz,046ah
07ba 2b dec hl
07bb 78 ld a,b
07bc 323621 ld (2136h),a
07bf 224921 ld (2149h),hl
07c2 cb7e bit 7,(hl)
07c4 2808 jr z,07ceh
07c6 23 inc hl
07c7 23 inc hl
07c8 23 inc hl
07c9 7e ld a,(hl)
07ca 3d dec a
07cb c26a04 jp nz,046ah
07ce 79 ld a,c
07cf e660 and 60h
07d1 fe40 cp 40h
07d3 c26a04 jp nz,046ah
07d6 cd8201 call 0182h
07d9 cd4901 call 0149h
07dc 0610 ld b,10h
07de cd4703 call 0347h
07e1 21df06 ld hl,06dfh
07e4 e5 push hl
07e5 cd2f07 call 072fh
07e8 c0 ret nz
07e9 3a0420 ld a,(2004h)
07ec b7 or a
07ed 2029 jr nz,0818h
07ef 3a3421 ld a,(2134h)
07f2 ed5b4b21 ld de,(214bh)
07f6 0e00 ld c,00h
07f8 cd940d call 0d94h
07fb c5 push bc
07fc cd2906 call 0629h
07ff c1 pop bc
0800 cd1f08 call 081fh
0803 3a3621 ld a,(2136h)
0806 e67f and 7fh
0808 77 ld (hl),a
0809 23 inc hl
080a 71 ld (hl),c
080b 23 inc hl
080c 70 ld (hl),b
080d 23 inc hl
080e 110020 ld de,2000h
0811 eb ex de,hl
0812 78 ld a,b
0813 b1 or c
0814 c8 ret z
0815 edb0 ldir
0817 c9 ret
0818 110000 ld de,0000h
081b 0eff ld c,0ffh
081d 18d9 jr 07f8h
081f c5 push bc
0820 79 ld a,c
0821 c603 add a,03h
0823 4f ld c,a
0824 3001 jr nc,0827h
0826 04 inc b
0827 2a595c ld hl,(5c59h)
082a 2b dec hl
082b e5 push hl
082c cd1d03 call 031dh
082f 5516 defw 1655h
0831 e1 pop hl
0832 c1 pop bc
0833 c9 ret
0834 3e0a ld a,0ah
0836 cd2507 call 0725h
0839 3a3921 ld a,(2139h)
083c b7 or a
083d c8 ret z
083e cd7e0e call 0e7eh
0841 c2df06 jp nz,06dfh
0844 cd6806 call 0668h
0847 cd9503 call 0395h ; PUTDAT
084a 3e07 ld a,07h
084c 1807 jr 0855h
084e 3e09 ld a,09h
0850 c32507 jp 0725h
0853 3e16 ld a,16h
0855 320021 ld (2100h),a
0858 3a3421 ld a,(2134h)
085b c36403 jp 0364h ; PUTCOM
085e 3a3421 ld a,(2134h)
0861 a7 and a
0862 3e1f ld a,1fh
0864 ca2507 jp z,0725h
0867 cd6806 call 0668h
086a cd9503 call 0395h ; PUTDAT
086d 3e20 ld a,20h
086f c32507 jp 0725h
0872 2a5d5c ld hl,(5c5dh)
0875 7e ld a,(hl)
0876 fe23 cp 23h
0878 281a jr z,0894h
087a cd6502 call 0265h
087d c26a04 jp nz,046ah
0880 3e03 ld a,03h
0882 320021 ld (2100h),a
0885 060e ld b,0eh
0887 cd4703 call 0347h
088a 21dc06 ld hl,06dch
088d e5 push hl
088e cd4901 call 0149h
0891 c37c03 jp 037ch
0894 cd1d03 call 031dh
0897 2000 defw 0020h
0899 2a5d5c ld hl,(5c5dh)
089c 7e ld a,(hl)
089d cd6502 call 0265h
08a0 2004 jr nz,08a6h
08a2 3e0e ld a,0eh
08a4 18dc jr 0882h
08a6 cd2302 call 0223h
08a9 ca6c04 jp z,046ch
08ac cd6306 call 0663h
08af 28d1 jr z,0882h
08b1 cd4102 call 0241h
08b4 320421 ld (2104h),a
08b7 3e0d ld a,0dh
08b9 18c7 jr 0882h
08bb cd6806 call 0668h
08be cd9503 call 0395h ; PUTDAT
08c1 3e04 ld a,04h
08c3 c35508 jp 0855h
08c6 cd6806 call 0668h
08c9 cd9503 call 0395h ; PUTDAT
08cc 3e02 ld a,02h
08ce 320021 ld (2100h),a
08d1 af xor a
08d2 c36403 jp 0364h ; PUTCOM
08d5 3a3421 ld a,(2134h)
08d8 fe80 cp 80h
08da 3005 jr nc,08e1h
08dc 3e01 ld a,01h
08de c35508 jp 0855h
08e1 3e1d ld a,1dh
08e3 18f9 jr 08deh
08e5 3a3621 ld a,(2136h)
08e8 1600 ld d,00h
08ea fe49 cp 49h
08ec 2004 jr nz,08f2h
08ee cbc2 set 0,d
08f0 1817 jr 0909h
08f2 fe4f cp 4fh
08f4 2004 jr nz,08fah
08f6 cbca set 1,d
08f8 180f jr 0909h
08fa fe52 cp 52h
08fc 2006 jr nz,0904h
08fe cbc2 set 0,d
0900 cbca set 1,d
0902 1805 jr 0909h
0904 fe41 cp 41h
0906 c26a04 jp nz,046ah
0909 7a ld a,d
090a 323621 ld (2136h),a
090d cd1d03 call 031dh
0910 f12b defw 2bf1h
0912 cd6d06 call 066dh
0915 cd9503 call 0395h ; PUTDAT
0918 1e01 ld e,01h
091a 3a3a21 ld a,(213ah)
091d cb5f bit 3,a
091f 2805 jr z,0926h
0921 1d dec e
0922 dd2a4b21 ld ix,(214bh)
0926 3a3621 ld a,(2136h)
0929 57 ld d,a
092a 3e00 ld a,00h
092c c35508 jp 0855h
092f 212017 ld hl,1720h
0932 22825c ld (5c82h),hl
0935 21e050 ld hl,50e0h
0938 22865c ld (5c86h),hl
093b 212117 ld hl,1721h
093e 228a5c ld (5c8ah),hl
0941 3e06 ld a,06h
0943 320021 ld (2100h),a
0946 cd1d03 call 031dh
0949 f12b defw 2bf1h
094b 218020 ld hl,2080h
094e c5 push bc
094f e5 push hl
0950 cd7006 call 0670h
0953 cd6806 call 0668h
0956 eb ex de,hl
0957 e1 pop hl
0958 c1 pop bc
0959 81 add a,c
095a 3c inc a
095b edb0 ldir
095d eb ex de,hl
095e 3600 ld (hl),00h
0960 cd9503 call 0395h ; PUTDAT
0963 3a0221 ld a,(2102h)
0966 c36403 jp 0364h ; PUTCOM
0969 3e05 ld a,05h
096b 18d6 jr 0943h
096d cd2302 call 0223h
0970 2019 jr nz,098bh
0972 2a5d5c ld hl,(5c5dh)
0975 7e ld a,(hl)
0976 323321 ld (2133h),a
0979 feca cp 0cah
097b 2811 jr z,098eh
097d feaf cp 0afh
097f 281b jr z,099ch
0981 feaa cp 0aah
0983 2837 jr z,09bch
0985 fee4 cp 0e4h
0987 283c jr z,09c5h
0989 185a jr 09e5h
098b c36a04 jp 046ah
098e cd1d03 call 031dh
0991 2000 defw 0020h
0993 cd2302 call 0223h
0996 28f3 jr z,098bh
0998 3e02 ld a,02h
099a 1849 jr 09e5h
099c cd1d03 call 031dh
099f 2000 defw 0020h
09a1 cd2302 call 0223h
09a4 28e5 jr z,098bh
09a6 2a5d5c ld hl,(5c5dh)
09a9 7e ld a,(hl)
09aa fe2c cp 2ch
09ac 20dd jr nz,098bh
09ae cd1d03 call 031dh
09b1 2000 defw 0020h
09b3 cd2302 call 0223h
09b6 28d3 jr z,098bh
09b8 3e03 ld a,03h
09ba 1829 jr 09e5h
09bc cd1d03 call 031dh
09bf 2000 defw 0020h
09c1 3e04 ld a,04h
09c3 1820 jr 09e5h
09c5 cd1d03 call 031dh
09c8 2000 defw 0020h
09ca cd4506 call 0645h
09cd 38bc jr c,098bh
09cf 79 ld a,c
09d0 e660 and 60h
09d2 2804 jr z,09d8h
09d4 fe40 cp 40h
09d6 20b3 jr nz,098bh
09d8 224521 ld (2145h),hl
09db 2a5d5c ld hl,(5c5dh)
09de 23 inc hl
09df 23 inc hl
09e0 225d5c ld (5c5dh),hl
09e3 3e05 ld a,05h
09e5 323321 ld (2133h),a
09e8 2a5d5c ld hl,(5c5dh)
09eb c3ca01 jp 01cah
09ee 21df06 ld hl,06dfh
09f1 e3 ex (sp),hl
09f2 3a3321 ld a,(2133h)
09f5 fe05 cp 05h
09f7 ca470a jp z,0a47h
09fa fe04 cp 04h
09fc ca3d0a jp z,0a3dh
09ff fe03 cp 03h
0a01 ca280a jp z,0a28h
0a04 fe02 cp 02h
0a06 ca220a jp z,0a22h
0a09 210000 ld hl,0000h
0a0c e5 push hl
0a0d cd6806 call 0668h
0a10 08 ex af,af’
0a11 2a535c ld hl,(5c53h)
0a14 eb ex de,hl
0a15 2a595c ld hl,(5c59h)
0a18 37 scf
0a19 ed52 sbc hl,de
0a1b 44 ld b,h
0a1c 4d ld c,l
0a1d e1 pop hl
0a1e 3e00 ld a,00h
0a20 183f jr 0a61h
0a22 cd4b02 call 024bh
0a25 c5 push bc
0a26 18e5 jr 0a0dh
0a28 cd4b02 call 024bh
0a2b c5 push bc
0a2c cd4b02 call 024bh
0a2f c5 push bc
0a30 cd6806 call 0668h
0a33 08 ex af,af’
0a34 d1 pop de
0a35 c1 pop bc
0a36 210000 ld hl,0000h
0a39 3e03 ld a,03h
0a3b 1824 jr 0a61h
0a3d 21001b ld hl,1b00h
0a40 e5 push hl
0a41 210040 ld hl,4000h
0a44 e5 push hl
0a45 18e9 jr 0a30h
0a47 cd6806 call 0668h
0a4a 08 ex af,af’
0a4b 2a4521 ld hl,(2145h)
0a4e cb76 bit 6,(hl)
0a50 3e01 ld a,01h
0a52 2802 jr z,0a56h
0a54 3e02 ld a,02h
0a56 23 inc hl
0a57 4e ld c,(hl)
0a58 23 inc hl
0a59 46 ld b,(hl)
0a5a 2b dec hl
0a5b 03 inc bc
0a5c 03 inc bc
0a5d eb ex de,hl
0a5e 210000 ld hl,0000h
; SAVEP
0a61 e5 push hl
0a62 d5 push de
0a63 c5 push bc
0a64 f5 push af
0a65 ed534721 ld (2147h),de
0a69 ed434521 ld (2145h),bc
0a6d 3e12 ld a,12h
0a6f 320021 ld (2100h),a
0a72 cd6403 call 0364h ; PUTCOM
0a75 cd7e0e call 0e7eh
0a78 204f jr nz,0ac9h
0a7a 3a0421 ld a,(2104h)
0a7d 322e21 ld (212eh),a
0a80 08 ex af,af’
0a81 cd9503 call 0395h ; PUTDAT
0a84 3e02 ld a,02h
0a86 320021 ld (2100h),a
0a89 3e01 ld a,01h
0a8b cd4e0b call 0b4eh
0a8e 2849 jr z,0ad9h
0a90 fe21 cp 21h
0a92 2845 jr z,0ad9h
0a94 fe20 cp 20h
0a96 2841 jr z,0ad9h
0a98 fe23 cp 23h
0a9a 202d jr nz,0ac9h
0a9c 3a3421 ld a,(2134h)
0a9f a7 and a
0aa0 202f jr nz,0ad1h
0aa2 210d21 ld hl,210dh
0aa5 e5 push hl
0aa6 cdd803 call 03d8h
0aa9 3e81 ld a,81h
0aab 320221 ld (2102h),a
0aae cd2104 call 0421h
0ab1 e1 pop hl
0ab2 cdd803 call 03d8h
0ab5 cd1500 call 0015h
0ab8 fe59 cp 59h
0aba 2810 jr z,0acch
0abc fe4e cp 4eh
0abe 20f5 jr nz,0ab5h
0ac0 cd1d03 call 031dh
0ac3 1000 defw 0010h
0ac5 af xor a
0ac6 320221 ld (2102h),a
0ac9 c3360b jp 0b36h
0acc cd1d03 call 031dh
0acf 1000 defw 0010h
0ad1 cd3f0b call 0b3fh
0ad4 cc460b call z,0b46h
0ad7 20f0 jr nz,0ac9h
0ad9 cd3f0b call 0b3fh
0adc 20eb jr nz,0ac9h
0ade f1 pop af
0adf c1 pop bc
0ae0 d1 pop de
0ae1 e1 pop hl
0ae2 e5 push hl
0ae3 d5 push de
0ae4 c5 push bc
0ae5 f5 push af
0ae6 320020 ld (2000h),a
0ae9 fe00 cp 00h
0aeb 2014 jr nz,0b01h
0aed 220120 ld (2001h),hl
0af0 2a4b5c ld hl,(5c4bh)
0af3 a7 and a
0af4 ed52 sbc hl,de
0af6 220520 ld (2005h),hl
0af9 ed430320 ld (2003h),bc
0afd 3e07 ld a,07h
0aff 180a jr 0b0bh
0b01 ed430120 ld (2001h),bc
0b05 ed530320 ld (2003h),de
0b09 3e05 ld a,05h
0b0b 322d21 ld (212dh),a
0b0e cd9503 call 0395h ; PUTDAT
0b11 3a2e21 ld a,(212eh)
0b14 47 ld b,a
0b15 0e00 ld c,00h
0b17 51 ld d,c
0b18 3a2d21 ld a,(212dh)
0b1b 5f ld e,a
0b1c 3e0f ld a,0fh
0b1e 320021 ld (2100h),a
0b21 cd4e0b call 0b4eh
0b24 2006 jr nz,0b2ch
0b26 cd540b call 0b54h
0b29 2001 jr nz,0b2ch
0b2b af xor a
0b2c f5 push af
0b2d cd460b call 0b46h
0b30 2803 jr z,0b35h
0b32 e1 pop hl
0b33 1801 jr 0b36h
0b35 f1 pop af
0b36 b7 or a
0b37 cd2104 call 0421h
0b3a f1 pop af
0b3b c1 pop bc
0b3c d1 pop de
0b3d e1 pop hl
0b3e c9 ret
0b3f 110102 ld de,0201h
0b42 3e00 ld a,00h
0b44 1802 jr 0b48h
0b46 3e01 ld a,01h
0b48 320021 ld (2100h),a
0b4b 3a2e21 ld a,(212eh)
0b4e cd6403 call 0364h ; PUTCOM
0b51 c37e0e jp 0e7eh
; WRTMEM (memory -> file)
0b54 c5 push bc
0b55 d5 push de
0b56 e5 push hl
0b57 2a4521 ld hl,(2145h)
0b5a 010001 ld bc,0100h
0b5d b7 or a
0b5e ed42 sbc hl,bc
0b60 300c jr nc,0b6eh
0b62 2a4521 ld hl,(2145h)
0b65 7c ld a,h
0b66 b5 or l
0b67 2839 jr z,0ba2h
0b69 4d ld c,l
0b6a 44 ld b,h
0b6b 210000 ld hl,0000h
0b6e 224521 ld (2145h),hl
0b71 110020 ld de,2000h
0b74 2a4721 ld hl,(2147h)
0b77 c5 push bc
0b78 edb0 ldir
0b7a 224721 ld (2147h),hl
0b7d c1 pop bc
0b7e 79 ld a,c
0b7f c5 push bc
0b80 cd9503 call 0395h ; PUTDAT
0b83 d1 pop de
0b84 2019 jr nz,0b9fh
0b86 3a2e21 ld a,(212eh)
0b89 47 ld b,a
0b8a 0e00 ld c,00h
0b8c 3e0f ld a,0fh
0b8e 320021 ld (2100h),a
0b91 cd6403 call 0364h ; PUTCOM
0b94 2009 jr nz,0b9fh
0b96 cd7e0e call 0e7eh
0b99 3804 jr c,0b9fh
0b9b 2006 jr nz,0ba3h
0b9d 18b8 jr 0b57h
0b9f 37 scf
0ba0 1802 jr 0ba4h
0ba2 af xor a
0ba3 b7 or a
0ba4 e1 pop hl
0ba5 d1 pop de
0ba6 c1 pop bc
0ba7 c9 ret
0ba8 cd2302 call 0223h
0bab 2017 jr nz,0bc4h
0bad 2a5d5c ld hl,(5c5dh)
0bb0 7e ld a,(hl)
0bb1 323321 ld (2133h),a
0bb4 cd6502 call 0265h
0bb7 c8 ret z
0bb8 feaf cp 0afh
0bba 280b jr z,0bc7h
0bbc feaa cp 0aah
0bbe 2834 jr z,0bf4h
0bc0 fee4 cp 0e4h
0bc2 2839 jr z,0bfdh
0bc4 c36a04 jp 046ah
0bc7 cd1d03 call 031dh
0bca 2000 defw 0020h
0bcc cd6502 call 0265h
0bcf 2811 jr z,0be2h
0bd1 cd2302 call 0223h
0bd4 28ee jr z,0bc4h
0bd6 2a5d5c ld hl,(5c5dh)
0bd9 7e ld a,(hl)
0bda fe2c cp 2ch
0bdc 2808 jr z,0be6h
0bde 3e02 ld a,02h
0be0 1853 jr 0c35h
0be2 3e15 ld a,15h
0be4 184f jr 0c35h
0be6 cd1d03 call 031dh
0be9 2000 defw 0020h
0beb cd2302 call 0223h
0bee 28d4 jr z,0bc4h
0bf0 3e16 ld a,16h
0bf2 1841 jr 0c35h
0bf4 cd1d03 call 031dh
0bf7 2000 defw 0020h
0bf9 3e03 ld a,03h
0bfb 1838 jr 0c35h
0bfd cd1d03 call 031dh
0c00 2000 defw 0020h
0c02 cd4506 call 0645h
0c05 224e21 ld (214eh),hl
0c08 3e00 ld a,00h
0c0a 3802 jr c,0c0eh
0c0c 3e80 ld a,80h
0c0e 323921 ld (2139h),a
0c11 79 ld a,c
0c12 cbff set 7,a
0c14 323621 ld (2136h),a
0c17 e660 and 60h
0c19 280b jr z,0c26h
0c1b fe40 cp 40h
0c1d 2803 jr z,0c22h
0c1f f1 pop af
0c20 18a2 jr 0bc4h
0c22 3e02 ld a,02h
0c24 1802 jr 0c28h
0c26 3e01 ld a,01h
0c28 323421 ld (2134h),a
0c2b 2a5d5c ld hl,(5c5dh)
0c2e 23 inc hl
0c2f 23 inc hl
0c30 225d5c ld (5c5dh),hl
0c33 3e04 ld a,04h
0c35 323321 ld (2133h),a
0c38 c9 ret
0c39 21df06 ld hl,06dfh
0c3c e3 ex (sp),hl
0c3d 3a3321 ld a,(2133h)
0c40 fe04 cp 04h
0c42 2858 jr z,0c9ch
0c44 fe03 cp 03h
0c46 2846 jr z,0c8eh
0c48 fe16 cp 16h
0c4a 2832 jr z,0c7eh
0c4c fe15 cp 15h
0c4e 2820 jr z,0c70h
0c50 fe02 cp 02h
0c52 2804 jr z,0c58h
0c54 3e00 ld a,00h
0c56 1810 jr 0c68h
0c58 cd4b02 call 024bh
0c5b ed435021 ld (2150h),bc
0c5f 010000 ld bc,0000h
0c62 ed434e21 ld (214eh),bc
0c66 3e03 ld a,03h
0c68 324d21 ld (214dh),a
0c6b cd6806 call 0668h
0c6e 1851 jr 0cc1h ; LOADP
0c70 21ffff ld hl,0ffffh
0c73 224e21 ld (214eh),hl
0c76 210000 ld hl,0000h
0c79 225021 ld (2150h),hl
0c7c 18e8 jr 0c66h
0c7e cd4b02 call 024bh
0c81 ed434e21 ld (214eh),bc
0c85 cd4b02 call 024bh
0c88 ed435021 ld (2150h),bc
0c8c 18d8 jr 0c66h
0c8e 21001b ld hl,1b00h
0c91 224e21 ld (214eh),hl
0c94 210040 ld hl,4000h
0c97 225021 ld (2150h),hl
0c9a 18ca jr 0c66h
0c9c 3a3421 ld a,(2134h)
0c9f 324d21 ld (214dh),a
0ca2 cd6806 call 0668h
0ca5 181a jr 0cc1h ; LOADP
0ca7 3e80 ld a,80h
0ca9 323821 ld (2138h),a
0cac 21df06 ld hl,06dfh
0caf e3 ex (sp),hl
0cb0 cd540c call 0c54h
0cb3 3a0221 ld a,(2102h)
0cb6 b7 or a
0cb7 c0 ret nz
0cb8 2a3f21 ld hl,(213fh)
0cbb cd1d03 call 031dh
0cbe ce08 defw 08ceh
0cc0 c9 ret
; LOADP
0cc1 dd214d21 ld ix,214dh
0cc5 3e12 ld a,12h
0cc7 320021 ld (2100h),a
0cca cd4e0b call 0b4eh
0ccd c2910d jp nz,0d91h
0cd0 3a0421 ld a,(2104h)
0cd3 322e21 ld (212eh),a
0cd6 78 ld a,b
0cd7 cd9503 call 0395h ; PUTDAT
0cda 110101 ld de,0101h
0cdd cd420b call 0b42h
0ce0 c2910d jp nz,0d91h
0ce3 110100 ld de,0001h
0ce6 cd940d call 0d94h
0ce9 c2840d jp nz,0d84h
0cec 7e ld a,(hl)
0ced ddbe00 cp (ix+00h)
0cf0 2008 jr nz,0cfah
0cf2 fe00 cp 00h
0cf4 2809 jr z,0cffh
0cf6 fe04 cp 04h
0cf8 380a jr c,0d04h
0cfa 3e4b ld a,4bh
0cfc c3840d jp 0d84h
0cff 110600 ld de,0006h
0d02 1803 jr 0d07h
0d04 110400 ld de,0004h
0d07 7b ld a,e
0d08 322d21 ld (212dh),a
0d0b cd940d call 0d94h
0d0e 2074 jr nz,0d84h
0d10 dd7e00 ld a,(ix+00h)
0d13 fe00 cp 00h
0d15 280a jr z,0d21h
0d17 fe03 cp 03h
0d19 283e jr z,0d59h
0d1b 381e jr c,0d3bh
0d1d 3e4b ld a,4bh
0d1f 1863 jr 0d84h
0d21 dde5 push ix
0d23 d1 pop de
0d24 13 inc de
0d25 010600 ld bc,0006h
0d28 edb0 ldir
0d2a cd010e call 0e01h
0d2d b7 or a
0d2e 2054 jr nz,0d84h
0d30 dd6e03 ld l,(ix+03h)
0d33 dd6604 ld h,(ix+04h)
0d36 224521 ld (2145h),hl
0d39 1846 jr 0d81h
0d3b 2a4e21 ld hl,(214eh)
0d3e 3a3921 ld a,(2139h)
0d41 b7 or a
0d42 c43206 call nz,0632h
0d45 2a0020 ld hl,(2000h)
0d48 224521 ld (2145h),hl
0d4b 4d ld c,l
0d4c 44 ld b,h
0d4d 0b dec bc
0d4e 0b dec bc
0d4f cd1f08 call 081fh
0d52 3a3621 ld a,(2136h)
0d55 77 ld (hl),a
0d56 23 inc hl
0d57 1825 jr 0d7eh
0d59 dd5e01 ld e,(ix+01h)
0d5c dd5602 ld d,(ix+02h)
0d5f 2a0020 ld hl,(2000h)
0d62 224521 ld (2145h),hl
0d65 7b ld a,e
0d66 b2 or d
0d67 2808 jr z,0d71h
0d69 ed52 sbc hl,de
0d6b 3804 jr c,0d71h
0d6d ed534521 ld (2145h),de
0d71 dd6e03 ld l,(ix+03h)
0d74 dd6604 ld h,(ix+04h)
0d77 7d ld a,l
0d78 b4 or h
0d79 2003 jr nz,0d7eh
0d7b 2a0220 ld hl,(2002h)
0d7e 224721 ld (2147h),hl
0d81 cdbf0d call 0dbfh
0d84 f5 push af
0d85 cd460b call 0b46h
0d88 2006 jr nz,0d90h
0d8a f1 pop af
0d8b 320221 ld (2102h),a
0d8e 1801 jr 0d91h
0d90 e1 pop hl
0d91 c32104 jp 0421h
; read file (max 256b) to buffer
0d94 d5 push de
0d95 3a2e21 ld a,(212eh)
0d98 47 ld b,a
0d99 3e10 ld a,10h
0d9b 320021 ld (2100h),a
0d9e cd6403 call 0364h ; PUTCOM
0da1 2019 jr nz,0dbch
0da3 cdac03 call 03ach
0da6 30fb jr nc,0da3h
0da8 3a0021 ld a,(2100h)
0dab fe80 cp 80h
0dad 200d jr nz,0dbch
0daf 3a0221 ld a,(2102h)
0db2 ed4b0521 ld bc,(2105h)
0db6 210020 ld hl,2000h
0db9 b7 or a
0dba d1 pop de
0dbb c9 ret
0dbc 37 scf
0dbd d1 pop de
0dbe c9 ret
; RDMEM (file -> memory)
0dbf c5 push bc
0dc0 d5 push de
0dc1 e5 push hl
0dc2 2a4521 ld hl,(2145h)
0dc5 110001 ld de,0100h
0dc8 b7 or a
0dc9 ed52 sbc hl,de
0dcb 300b jr nc,0dd8h
0dcd 2a4521 ld hl,(2145h)
0dd0 7d ld a,l
0dd1 b4 or h
0dd2 2824 jr z,0df8h
0dd4 eb ex de,hl
0dd5 210000 ld hl,0000h
0dd8 224521 ld (2145h),hl
0ddb cd940d call 0d94h
0dde 381d jr c,0dfdh
0de0 2804 jr z,0de6h
0de2 fe48 cp 48h
0de4 2016 jr nz,0dfch
0de6 f5 push af
0de7 78 ld a,b
0de8 b1 or c
0de9 2810 jr z,0dfbh
0deb ed5b4721 ld de,(2147h)
0def edb0 ldir
0df1 ed534721 ld (2147h),de
0df5 f1 pop af
0df6 18ca jr 0dc2h
0df8 af xor a
0df9 1802 jr 0dfdh
0dfb f1 pop af
0dfc b7 or a
0dfd e1 pop hl
0dfe d1 pop de
0dff c1 pop bc
0e00 c9 ret
0e01 3a3821 ld a,(2138h)
0e04 b7 or a
0e05 205d jr nz,0e64h
0e07 dde5 push ix
0e09 ed5b535c ld de,(5c53h)
0e0d 2a595c ld hl,(5c59h)
0e10 2b dec hl
0e11 dd4e03 ld c,(ix+03h)
0e14 dd4604 ld b,(ix+04h)
0e17 c5 push bc
0e18 cd1d03 call 031dh
0e1b e519 defw 19e5h
0e1d c1 pop bc
0e1e e5 push hl
0e1f 2a655c ld hl,(5c65h)
0e22 09 add hl,bc
0e23 115000 ld de,0050h
0e26 19 add hl,de
0e27 3837 jr c,0e60h
0e29 ed72 sbc hl,sp
0e2b 3033 jr nc,0e60h
0e2d e1 pop hl
0e2e cd1d03 call 031dh
0e31 6416 defw 1664
0e33 2a655c ld hl,(5c65h)
0e36 eb ex de,hl
0e37 edb8 lddr
0e39 23 inc hl
0e3a dd4e05 ld c,(ix+05h)
0e3d dd4606 ld b,(ix+06h)
0e40 09 add hl,bc
0e41 224b5c ld (5c4bh),hl
0e44 dd6e01 ld l,(ix+01h)
0e47 dd6602 ld h,(ix+02h)
0e4a 22425c ld (5c42h),hl
0e4d 7c ld a,h
0e4e b5 or l
0e4f 3e00 ld a,00h
0e51 2001 jr nz,0e54h
0e53 3d dec a
0e54 32445c ld (5c44h),a
0e57 2a535c ld hl,(5c53h)
0e5a 224721 ld (2147h),hl
0e5d e1 pop hl
0e5e af xor a
0e5f c9 ret
0e60 3eff ld a,0ffh
0e62 e1 pop hl
0e63 c9 ret
0e64 dd4e03 ld c,(ix+03h)
0e67 dd4604 ld b,(ix+04h)
0e6a 03 inc bc
0e6b cd1d03 call 031dh
0e6e 3000 defw 0030h
0e70 3680 ld (hl),80h
0e72 eb ex de,hl
0e73 224721 ld (2147h),hl
0e76 223f21 ld (213fh),hl
0e79 af xor a
0e7a 323821 ld (2138h),a
0e7d c9 ret
0e7e cdd604 call 04d6h
0e81 cd1204 call 0412h
0e84 d26c04 jp nc,046ch
0e87 20f5 jr nz,0e7eh
0e89 3a2f21 ld a,(212fh)
0e8c fec0 cp 0c0h
0e8e 200c jr nz,0e9ch
0e90 3a0021 ld a,(2100h)
0e93 fe80 cp 80h
0e95 2005 jr nz,0e9ch
0e97 3a0221 ld a,(2102h)
0e9a b7 or a
0e9b c9 ret
0e9c 37 scf
0e9d c9 ret
0e9e 3a3921 ld a,(2139h)
0ea1 b7 or a
0ea2 280b jr z,0eafh
0ea4 3a3421 ld a,(2134h)
0ea7 320221 ld (2102h),a
0eaa 3e11 ld a,11h
0eac c34309 jp 0943h
0eaf cd6806 call 0668h
0eb2 cd9503 call 0395h ; PUTDAT
0eb5 3e15 ld a,15h
0eb7 c32507 jp 0725h
0eba 3a3621 ld a,(2136h)
0ebd 0601 ld b,01h
0ebf fe50 cp 50h
0ec1 280e jr z,0ed1h
0ec3 0600 ld b,00h
0ec5 fe55 cp 55h
0ec7 2808 jr z,0ed1h
0ec9 0602 ld b,02h
0ecb fe56 cp 56h
0ecd 2802 jr z,0ed1h
0ecf 0603 ld b,03h
0ed1 c5 push bc
0ed2 cd6806 call 0668h
0ed5 cd9503 call 0395h ; PUTDAT
0ed8 3e14 ld a,14h
0eda 320021 ld (2100h),a
0edd f1 pop af
0ede c36403 jp 0364h ; PUTCOM
; INIT
; clear i/f RAM (2000-23FF), 1FFFh is last ROM cell
0ee1 21ff23 ld hl,23ffh ; top of i/f RAM
0ee4 3600 ld (hl),00h ; fill with 0
0ee6 2b dec hl
0ee7 7c ld a,h
0ee8 fe1f cp 1fh ; 1Fxxh?
0eea 20f8 jr nz,0ee4h
0eec 21e306 ld hl,06e3h
0eef 223d21 ld (213dh),hl ; init variable
0ef2 218200 ld hl,0082h
0ef5 223b21 ld (213bh),hl ; init variable
0ef8 3e07 ld a,07h ; 0000 0111
0efa d3fe out (0feh),a ; send init !!!!!!
0efc 3e3f ld a,3fh ; loop for filling
0efe ed47 ld i,a ; all RAM with 0
0f00 21ffff ld hl,0ffffh ; start = 65535
0f03 3600 ld (hl),00h ; end = 3Fxx+1 = 16384
0f05 2b dec hl
0f06 bc cp h
0f07 20fa jr nz,0f03h
0f09 21ffff ld hl,0ffffh ; detect 16/48 memory
0f0c 3e55 ld a,55h
0f0e 77 ld (hl),a
0f0f 2f cpl ; reverse bits
0f10 ae xor (hl) ; if (hl)=55h -> a=FFh, otherwise a=55h
0f11 3c inc a
0f12 2802 jr z,0f16h ; if 48K -> jump
0f14 267f ld h,7fh ; MSB for 16K
0f16 eb ex de,hl ; highest RAM addr goes to DE
0f17 2157ff ld hl,0ff57h ; -169
0f1a 19 add hl,de ; subtract
0f1b f9 ld sp,hl ; set stack to FF56h (65366) for 48K
0f1c d5 push de ; push FFFFh (48K)
0f1d 11c65c ld de,5cc6h
0f20 d5 push de ; push 5CC6h
0f21 21a50f ld hl,0fa5h
0f24 014d00 ld bc,004dh
0f27 edb0 ldir ; copy 4Dh (77) bytes from 0FA5h to 5CC6h
0f29 e1 pop hl ; 5CC6h
0f2a e3 ex (sp),hl ; pop FFFFh to HL, push 5CC6
0f2b c30406 jp 0604h ; i/f memory OFF, jump to 5CC6h (0FA5h)
;
0f2e 06ff ld b,0ffh
0f30 3ec0 ld a,0c0h
0f32 322f21 ld (212fh),a
0f35 3e0d ld a,0dh
0f37 323021 ld (2130h),a
0f3a 210021 ld hl,2100h
0f3d 3617 ld (hl),17h
0f3f cd9504 call 0495h
0f42 2805 jr z,0f49h
0f44 05 dec b
0f45 2843 jr z,0f8ah
0f47 18f1 jr 0f3ah
0f49 cdac03 call 03ach
0f4c 3a0221 ld a,(2102h)
0f4f b7 or a
0f50 2038 jr nz,0f8ah
0f52 eb ex de,hl
0f53 21105d ld hl,5d10h
0f56 7a ld a,d
0f57 ed67 rrd
0f59 c631 add a,31h
0f5b 77 ld (hl),a
0f5c 23 inc hl
0f5d 23 inc hl
0f5e 7a ld a,d
0f5f e60f and 0fh
0f61 c6b1 add a,0b1h
0f63 77 ld (hl),a
0f64 21ed5c ld hl,5cedh
0f67 e5 push hl
0f68 c30406 jp 0604h
; load “START”
0f6b 3e7f ld a, 7fh ; makes no sense? Maybe D15..D8 on IORQ?
0f6d dbfe in a,(0feh)
0f6f 1f rra
0f70 3018 jr nc,0f8ah
;—-ARTUR COMMENT—-
;Code above have sense:
; Activate the keyboard address line with SPACE.
; Shift captured byte.
; Conditional jump to skip “START” load if SPACE pressed.
;—-ARTUR COMMENT—-
0f72 21be05 ld hl,05beh ; “START”
0f75 110020 ld de,2000h ; buffer
0f78 010800 ld bc,0008h ; Why 8???
0f7b edb0 ldir
0f7d af xor a
0f7e 324d21 ld (214dh),a
0f81 cdc10c call 0cc1h ; LOADP
0f84 3a0221 ld a,(2102h)
0f87 a7 and a
0f88 2807 jr z,0f91h
0f8a 21a912 ld hl,12a9h
0f8d e5 push hl
0f8e c30306 jp 0603h
0f91 cd1d03 call 031dh
0f94 6e0d defw 0d6eh
0f96 210313 ld hl,1303h
0f99 e5 push hl
0f9a fdcb01fe set 7,(iy+01h)
0f9e fd3600ff ld (iy+00h),0ffh
0fa2 c38e04 jp 048eh
; This code (0FA5h-0FF2h) has been copied to 5CC6h
0fa5 e5 push hl
0fa6 11135d ld de,5d13h ; new place for the code
0fa9 210012 ld hl,1200h ; ???
0fac 01a000 ld bc,00a0h
0faf edb0 ldir ; copy 160 bytes ???
0fb1 eb ex de,hl
0fb2 36c9 ld (hl),0c9h ; add RET at the end
0fb4 af xor a
0fb5 323b5d ld (5d3bh),a
0fb8 e1 pop hl
0fb9 cd135d call 5d13h ; call the moved code
0fbc 212e0f ld hl,0f2eh ; after RST 8, JP 0f2eh
; enable i/f ROM/RAM and JP (HL)
0fbf f3 di
0fc0 fde5 push iy
0fc2 fd210000 ld iy,0000h ; command code 0 (nop) = RET
0fc6 cd0800 call 0008h ; execute
0fc9 fde1 pop iy
0fcb e9 jp (hl)
;
0fcc af xor a ; a=0
0fcd 11f95c ld de,5cf9h
0fd0 cd0a0c call 0c0ah
0fd3 216b0f ld hl,0f6bh ; after RST 8, JP to load “START”
0fd6 18e7 jr 0fbfh ; go to RST 8
0fd8 80 defb 128
0fd9 0d defb 13 ; new line
0fda 7f defb 127 ; copyright
0fdb defs ” 1984 TIMEX – TOS V . “
; end of moved code
0ff2 ff rst 38h
0ff3 ff rst 38h
0ff4 ff rst 38h
0ff5 ff rst 38h
0ff6 ff rst 38h
0ff7 ff rst 38h
0ff8 ff rst 38h
0ff9 ff rst 38h
0ffa ff rst 38h
0ffb ff rst 38h
0ffc ff rst 38h
0ffd ff rst 38h
0ffe ff rst 38h
0fff ff rst 38h