; On RESET, ROM is paged into low memory. ROM is paged out by an ; instruction fetch from an address in the top 32k of memory. F000 F3 ó DI F001 11 00 F0 ..ð LD DE,&F000 F004 21 00 00 !.. LD HL,&0000 F007 01 00 10 ... LD BC,&1000 ; Copy code from low memory to F00A ED B0 í° LDIR ; high memory F00C C3 80 F2 Ã.ò JP &F280 ; Enter code in high memory F00F 43 6F 70 79 72 69 67 68 Copyrigh F017 74 20 41 63 6F 72 6E 20 t Acorn F01F 43 6F 6D 70 75 74 65 72 Computer F027 73 20 4C 74 64 2E 20 31 s Ltd. 1 F02F 39 38 34 0D 48 3A 7D 3C 984.H:}< ; Unused data F02F 39 38 34 0D 48 3A 7D 3C 984.H:}< F037 B7 C4 C0 2C 3A 22 3A B7 ·ÄÀ,:":· F03F C4 F1 2C F1 21 1B 3A 34 Äñ,ñ!.:4 F047 7E 3D C2 AB 2B 21 EC 3B ~=«+!ì; F04F 7E B7 C2 34 2B 21 4A 3B ~·Â4+!J; F057 7E B7 C2 34 2B 21 58 3D ~·Â4+!X= F05F 23 01 06 00 11 EC 3B C3 #....ì;à ; NMI code, paged in when NMI occurs F066 C3 61 FC Ãaü JP &FC61 ; Acknowledgments F069 54 68 65 20 42 75 73 69 The Busi F071 6E 65 73 73 20 53 79 73 ness Sys F079 74 65 6D 73 20 47 72 6F tems Gro F081 75 70 20 77 6F 75 6C 64 up would F089 20 6C 69 6B 65 20 74 6F like to F091 20 74 68 61 6E 6B 4D 69 thankMi F099 6B 65 20 42 6F 6C 6C 65 ke Bolle F0A1 79 2C 4D 69 6B 65 20 26 y,Mike & F0A9 20 41 6C 6C 65 6E 20 42 Allen B F0B1 6F 6F 74 68 72 6F 79 64 oothroyd F0B9 2C 52 69 63 68 61 72 64 ,Richard F0C1 20 43 6C 61 79 74 6F 6E Clayton F0C9 2C 41 6E 64 72 65 77 20 ,Andrew F0D1 47 6F 72 64 6F 6E 2C 43 Gordon,C F0D9 68 72 69 73 20 48 61 6C hris Hal F0E1 6C 2C 4B 69 6D 20 53 70 l,Kim Sp F0E9 65 6E 63 65 2D 4A 6F 6E ence-Jon F0F1 65 73 2C 50 61 75 6C 20 es,Paul F0F9 4F 76 65 72 65 6C 6C 2C Overell, F101 44 61 76 69 64 20 50 61 David Pa F109 72 6B 69 6E 73 6F 6E 2C rkinson, F111 4A 6F 68 6E 20 54 75 74 John Tut F119 65 6E 20 61 6E 64 20 45 en and E F121 72 69 63 20 74 68 65 20 ric the F129 68 61 6C 66 20 54 55 42 half TUB F131 45 54 68 65 20 42 53 47 EThe BSG F139 20 69 73 20 42 69 67 20 is Big F140 20 41 72 74 68 75 72 20 Arthur F148 54 68 65 20 54 6F 75 63 The Touc F150 61 6E 2C 4A 20 4D 61 72 an,J Mar F158 6B 20 43 61 72 72 69 6E k Carrin F160 67 74 6F 6E 2C 48 6F 77 gton,How F168 61 72 64 20 46 69 73 68 ard Fish F170 65 72 2C 49 61 6E 20 47 er,Ian G F178 20 4A 61 63 6B 2C 4E 65 Jack,Ne F180 69 6C 20 52 6F 62 69 6E il Robin F188 73 6F 6E 2C 53 69 6D 6F son,Simo F190 6E 20 57 6F 6F 64 77 61 n Woodwa F198 72 64 2C 4A 6F 68 6E 20 rd,John F1A0 43 6F 72 72 61 6C 6C 2C Corrall, F1A8 54 6F 62 79 20 43 72 6F Toby Cro F1B0 73 73 2C 49 61 6E 20 4D ss,Ian M F1B8 69 6C 6C 65 72 2C 42 6F iller,Bo F1C0 72 69 73 20 53 6F 75 74 ris Sout F1C8 68 65 61 72 73 72 6F 72 hearsror ; Uninitialised data F1D0 28 73 29 00 20 57 61 72 (s). War F1D8 6E 69 6E 67 28 73 29 00 ning(s). F1E0 0E 00 3A 00 3B 47 CD 48 ..:.;GÍH F1E8 1A C3 6B 2B CD 16 2D 21 .Ãk+Í.-! F1F0 CF 2C CD 19 2D CD CA 19 Ï,Í.-ÍÊ. F1F8 C3 FD 2C 52 45 50 54 2F Ãý,REPT/ F200 49 52 50 2F 49 52 50 43 IRP/IRPC F208 2F 4D 41 43 52 4F 00 55 /MACRO.U F210 6E 74 65 72 6D 69 6E 61 ntermina F218 74 65 64 20 00 CD 16 2D ted .Í.- F220 21 26 2D CD 19 2D CD CA !&-Í.-ÍÊ F228 19 3E 0D CD FC 18 3E 0A .>.Íü.>. F230 CD FC 18 3A 37 3D 3C C8 Íü.:7=<È F238 3E 0D CD 4E 47 3E 0A C3 >.ÍNG>.à F240 4E 47 21 E3 2C E5 CD 77 NG!ã,åÍw F248 19 E1 3A 37 3D 3C C8 C3 .á:7=<Èà F250 4F 43 43 6F 6E 64 69 74 OCCondit F258 69 6F 6E 61 6C 00 53 79 ional.Sy F260 6D 62 6F 6C 73 3A 0D 0A mbols:.. F268 00 4D 61 63 72 6F 73 3A .Macros: F270 0D 0A 00 21 E2 FF 39 EB ...!â.9ë F278 2A AC 3C CD 82 0D D2 5D *¬<Í..Ò] ; Reset startup routine F280 31 80 FF 1.. LD SP,&FF80 ; Initialise a stack F283 CD 5E F6 Í^ö CALL &F65E ; Initialise RST &38 error call F286 3E FF >. LD A,&FF ; Set interrupts to vector via &FFFE F288 ED 47 íG LD I,A F28A ED 5E í^ IM 2 F28C FB û EI ; Set interrupts going F28D CD 0E F6 Í.ö CALL &F60E ; Print inline string: F290 16 08 DEFB 22,8 ; MODE 8, usually gives MODE 0 F292 0D DEFB 13 ; NEWL F293 41 63 6F 72 6E 20 54 55 DEFS "Acorn TUBE Z80 64K 1.20" F29B 42 45 20 5A 38 30 20 36 F2A3 34 4B 20 31 2E 32 30 F2AA 0D 0D DEFB 13,13 ; NEWL, NEWL F2AC 00 DEFB 0 ; Terminator F2AD CD 9A F6 Í.ö CALL &F69A ; Wait for response from Tube0 F2B0 CD AE F5 Í®õ CALL &F5AE ; Set up OSWORD &FF code F2B3 3E FD >ý LD A,&FD F2B5 21 00 FF !.. LD HL,&FF00 F2B8 CD 8E F8 Í.ø CALL osBYTE ; Fetch BREAK type F2BB 7D } LD A,L F2BC B7 · OR A F2BD CA CE F2 ÊÎò JP Z,&F2CE ; If a soft BREAK, enter CliCom F2C0 3E 0F >. LD A,&0F F2C2 21 01 00 !.. LD HL,&0001 F2C5 CD 8E F8 Í.ø CALL osBYTE ; Clear buffers F2C8 C3 EB F7 Ãë÷ JP &F7EB ; Try to enter current program or boot CPM F2CB CD E7 FF Íç. CALL OSNEWL .CliCom ; Default language F2CE 31 80 FF 1.. LD SP,&FF80 ; Set up a stack F2D1 3A 80 FF :.. LD A,(&FF80) ; Get escape flag F2D4 CB 7F Ë. BIT 7,A F2D6 28 08 (. JR Z,&F2E0 F2D8 3E 7E >~ LD A,&7E F2DA 21 00 00 !.. LD HL,&0000 F2DD CD 8E F8 Í.ø CALL osBYTE ; Acknowledge Escape F2E0 3E 2A >* LD A,&2A F2E2 CD 71 F6 Íqö CALL &F671 ; Print '*' prompt F2E5 21 9D FC !.ü LD HL,&FC9D F2E8 AF ¯ XOR A F2E9 CD EF F8 Íïø CALL osWORD ; Read a line F2EC DA FA F2 Úúò JP C,&F2FA ; Jump if Escape pressed F2EF 21 B0 FC !°ü LD HL,&FCB0 F2F2 CD B7 F6 Í·ö CALL osCLI ; Pass line to OSCLI F2F5 18 D7 .× JR &F2CE ; Loop back for another F2F7 CD E7 FF Íç. CALL OSNEWL F2FA 3E 7E >~ LD A,&7E F2FC CD 8E F8 Í.ø CALL osBYTE ; Ack. escape condition F2FF FF . RST &38 ; Generate error F300 00 . DEFB 0 F301 45 73 63 61 70 65 DEFS "Escape" F307 00 . DEFB 0 F308 13 . INC DE F309 1A . LD A,(DE) F30A E6 DF æß AND &DF F30C FE 4F þO CP &4F F30E C2 CC F7 ÂÌ÷ JP NZ,&F7CC F311 CD 76 F8 Ívø CALL &F876 F314 06 00 .. LD B,&00 F316 CD 39 F4 Í9ô CALL &F439 F319 CD 77 F8 Íwø CALL &F877 F31C FE 0D þ. CP &0D F31E C2 CC F7 ÂÌ÷ JP NZ,&F7CC F321 3A AA FC :ªü LD A,(&FCAA) F324 32 A8 FC 2¨ü LD (&FCA8),A F327 3A AB FC :«ü LD A,(&FCAB) F32A 32 A9 FC 2©ü LD (&FCA9),A F32D C3 DF F7 Ãß÷ JP &F7DF F330 CD 76 F8 Ívø CALL &F876 F333 06 00 .. LD B,&00 F335 CD 39 F4 Í9ô CALL &F439 F338 CD 77 F8 Íwø CALL &F877 F33B FE 0D þ. CP &0D F33D C2 CC F7 ÂÌ÷ JP NZ,&F7CC F340 3E 04 >. LD A,&04 F342 21 01 00 !.. LD HL,&0001 F345 CD F4 FF Íô. CALL &FFF4 :\ OSBYTE F348 7D } LD A,L F349 32 AE FC 2®ü LD (&FCAE),A F34C 2A AA FC *ªü LD HL,(&FCAA) F34F CD E7 FF Íç. CALL &FFE7 :\ OSNEWL F352 CD 71 F4 Íqô CALL &F471 F355 CD 1D F4 Í.ô CALL &F41D F358 7E ~ LD A,(HL) F359 CD 0D F4 Í.ô CALL &F40D F35C CD 1D F4 Í.ô CALL &F41D F35F 7E ~ LD A,(HL) F360 CD 76 F4 Ívô CALL &F476 F363 E5 å PUSH HL F364 06 01 .. LD B,&01 F366 21 00 00 !.. LD HL,&0000 F369 CD E0 FF Íà. CALL &FFE0 :\ OSRDCH F36C CD 40 F4 Í@ô CALL &F440 F36F 06 00 .. LD B,&00 F371 5D ] LD E,L F372 E1 á POP HL F373 FE 8A þ. CP &8A F375 28 27 (' JR Z,&F39E F377 FE 8B þ. CP &8B F379 28 20 ( JR Z,&F39B F37B FE 01 þ. CP &01 F37D C2 A1 F3 ¡ó JP NZ,&F3A1 F380 7E ~ LD A,(HL) F381 CB 27 Ë' SLA A F383 CB 27 Ë' SLA A F385 CB 27 Ë' SLA A F387 CB 27 Ë' SLA A F389 83 . ADD A,E F38A 77 w LD (HL),A F38B 3E 08 >. LD A,&08 F38D CD 71 F6 Íqö CALL &F671 F390 CD 71 F6 Íqö CALL &F671 F393 CD 71 F6 Íqö CALL &F671 F396 CD 71 F6 Íqö CALL &F671 F399 18 BD .½ JR &F358 F39B 23 # INC HL F39C 18 B1 .± JR &F34F F39E 2B + DEC HL F39F 18 AE .® JR &F34F F3A1 3A AE FC :®ü LD A,(&FCAE) F3A4 6F o LD L,A F3A5 26 00 &. LD H,&00 F3A7 3E 04 >. LD A,&04 F3A9 CD F4 FF Íô. CALL &FFF4 :\ OSBYTE F3AC CD E7 FF Íç. CALL &FFE7 :\ OSNEWL F3AF D1 Ñ POP DE F3B0 C1 Á POP BC F3B1 F1 ñ POP AF F3B2 C9 É RET F3B3 CD 76 F8 Ívø CALL &F876 F3B6 06 00 .. LD B,&00 F3B8 CD 39 F4 Í9ô CALL &F439 F3BB FE 0D þ. CP &0D F3BD 28 10 (. JR Z,&F3CF F3BF FE 20 þ CP &20 F3C1 C2 CC F7 ÂÌ÷ JP NZ,&F7CC F3C4 2A AA FC *ªü LD HL,(&FCAA) F3C7 CD 77 F8 Íwø CALL &F877 F3CA CD 39 F4 Í9ô CALL &F439 F3CD 18 03 .. JR &F3D2 F3CF 2A AA FC *ªü LD HL,(&FCAA) F3D2 ED 5B AA FC í[ªü LD DE,(&FCAA) F3D6 3A 80 FF :.. LD A,(&FF80) F3D9 CB 7F Ë. BIT 7,A F3DB C2 F7 F2 Â÷ò JP NZ,&F2F7 F3DE CD E7 FF Íç. CALL &FFE7 :\ OSNEWL F3E1 CD 71 F4 Íqô CALL &F471 F3E4 06 08 .. LD B,&08 F3E6 E5 å PUSH HL F3E7 CD 1D F4 Í.ô CALL &F41D F3EA 7E ~ LD A,(HL) F3EB CD 76 F4 Ívô CALL &F476 F3EE 23 # INC HL F3EF 10 F6 .ö DJNZ &F3E7 F3F1 06 08 .. LD B,&08 F3F3 E1 á POP HL F3F4 CD 1D F4 Í.ô CALL &F41D F3F7 7E ~ LD A,(HL) F3F8 CD 0D F4 Í.ô CALL &F40D F3FB 23 # INC HL F3FC 10 F9 .ù DJNZ &F3F7 F3FE CD 23 F4 Í#ô CALL &F423 F401 D2 06 F4 Ò.ô JP NC,&F406 F404 18 D0 .Ð JR &F3D6 F406 CD E7 FF Íç. CALL &FFE7 :\ OSNEWL F409 D1 Ñ POP DE F40A C1 Á POP BC F40B F1 ñ POP AF F40C C9 É RET F40D FE 20 þ CP &20 F40F 38 06 8. JR C,&F417 F411 FE 7F þ. CP &7F F413 30 02 0. JR NC,&F417 F415 18 02 .. JR &F419 F417 3E 2E >. LD A,&2E F419 CD 71 F6 Íqö CALL &F671 F41C C9 É RET F41D 3E 20 > LD A,&20 F41F CD 71 F6 Íqö CALL &F671 F422 C9 É RET F423 E5 å PUSH HL F424 01 08 00 ... LD BC,&0008 F427 BF ¿ CP A F428 ED 42 íB SBC HL,BC F42A 30 06 0. JR NC,&F432 F42C 21 00 00 !.. LD HL,&0000 F42F BF ¿ CP A F430 18 02 .. JR &F434 F432 E1 á POP HL F433 E5 å PUSH HL F434 2B + DEC HL F435 ED 52 íR SBC HL,DE F437 E1 á POP HL F438 C9 É RET F439 22 AC FC "¬ü LD (&FCAC),HL F43C 21 00 00 !.. LD HL,&0000 F43F 1A . LD A,(DE) F440 CB 77 Ëw BIT 6,A F442 28 02 (. JR Z,&F446 F444 E6 DF æß AND &DF F446 FE 30 þ0 CP &30 F448 FA 6D F4 úmô JP M,&F46D F44B FE 47 þG CP &47 F44D F2 6D F4 òmô JP P,&F46D F450 FE 3A þ: CP &3A F452 38 07 8. JR C,&F45B F454 FE 41 þA CP &41 F456 FA 6D F4 úmô JP M,&F46D F459 C6 09 Æ. ADD A,&09 F45B E6 0F æ. AND &0F F45D 29 ) ADD HL,HL F45E 29 ) ADD HL,HL F45F 29 ) ADD HL,HL F460 29 ) ADD HL,HL F461 B5 µ OR L F462 6F o LD L,A F463 3E 01 >. LD A,&01 F465 B8 ¸ CP B F466 C8 È RET Z F467 13 . INC DE F468 22 AA FC "ªü LD (&FCAA),HL F46B 18 D2 .Ò JR &F43F F46D 2A AC FC *¬ü LD HL,(&FCAC) F470 C9 É RET F471 7C | LD A,H F472 CD 76 F4 Ívô CALL &F476 F475 7D } LD A,L F476 F5 õ PUSH AF F477 0F . RRCA F478 0F . RRCA F479 0F . RRCA F47A 0F . RRCA F47B CD 7F F4 Í.ô CALL &F47F F47E F1 ñ POP AF F47F E6 0F æ. AND &0F F481 C6 30 Æ0 ADD A,&30 F483 FE 3A þ: CP &3A F485 FA 71 F6 úqö JP M,&F671 F488 C6 07 Æ. ADD A,&07 F48A C3 71 F6 Ãqö JP &F671 F48D 13 . INC DE F48E 1A . LD A,(DE) F48F E6 DF æß AND &DF F491 FE 50 þP CP &50 F493 C2 CC F7 ÂÌ÷ JP NZ,&F7CC F496 13 . INC DE F497 1A . LD A,(DE) F498 E6 DF æß AND &DF F49A FE 4D þM CP &4D F49C C2 CC F7 ÂÌ÷ JP NZ,&F7CC F49F CD 76 F8 Ívø CALL &F876 F4A2 FE 0D þ. CP &0D F4A4 C2 CC F7 ÂÌ÷ JP NZ,&F7CC F4A7 18 26 .& JR &F4CF F4A9 CD 0E F6 Í.ö CALL &F60E ; Print in-line text F4AC DEFS "Insert CP/M System disc in drive A" F4CE DEFB 0 F4CF 3E E5 >å LD A,&E5 F4D1 21 01 00 !.. LD HL,&0001 F4D4 CD 8E F8 Í.ø CALL osBYTE F4D7 21 82 F5 !.õ LD HL,&F582 F4DA CD 4A F5 ÍJõ CALL &F54A F4DD 21 00 EB !.ë LD HL,&EB00 F4E0 11 F0 EA .ðê LD DE,&EAF0 F4E3 01 F0 00 .ð. LD BC,&00F0 F4E6 ED B0 í° LDIR F4E8 21 F0 EB !ðë LD HL,&EBF0 F4EB 11 E0 EB .àë LD DE,&EBE0 F4EE 01 00 06 ... LD BC,&0600 F4F1 ED B0 í° LDIR F4F3 CD 3B F5 Í;õ CALL &F53B F4F6 3A 00 D4 :.Ô LD A,(&D400) F4F9 FE C3 þà CP &C3 F4FB CA 22 F5 Ê"õ JP Z,&F522 F4FE 3E E5 >å LD A,&E5 F500 21 00 00 !.. LD HL,&0000 F503 CD 8E F8 Í.ø CALL osBYTE F506 CD E7 FF Íç. CALL &FFE7 :\ OSNEWL F509 FF . RST &38 F50A DEFB 0 F50B DEFS "Not a CP/M System disc" F521 DEFB 0 F522 21 B2 FA !²ú LD HL,&FAB2 F525 22 FA FF "ú. LD (&FFFA),HL F528 3E 90 >. LD A,&90 F52A 32 A3 FC 2£ü LD (&FCA3),A F52D 21 00 01 !.. LD HL,&0100 F530 CD 8E F8 Í.ø CALL osBYTE F533 CD 0E F6 Í.ö CALL &F60E F536 16 00 .. LD D,&00 F538 C3 00 EA Ã.ê JP &EA00 ._LD_CCP: ; Load CCP. Also loads BDOS F53B 21 8D F5 !.õ LD HL,&F58D F53E CD 4A F5 ÍJõ CALL &F54A F541 21 98 F5 !.õ LD HL,&F598 F544 CD 4A F5 ÍJõ CALL &F54A F547 21 A3 F5 !£õ LD HL,&F5A3 F54A CD 5C F5 Í\õ CALL &F55C F54D B7 · OR A ; Check returned status F54E C8 È RET Z ; Return if no error F54F FF . RST &38 ; Generate error F550 DEFB &C7 F551 DEFS "Disc fault" F55B DEFB 0 ; Load from FM disk using control block pointed to by HL F55C 06 04 .. LD B,&04 ; We're going to do four main passes, F55E 48 H LD C,B ; and in each pass we try ten times F55F 06 0A .. LD B,&0A ; before reseeking track zero F561 3E 7F >. LD A,&7F ; OSWORD &7F - DiskOpFM F563 CD EF F8 Íïø CALL osWORD ; Call WORD code F566 11 0A 00 ... LD DE,&000A F569 EB ë EX DE,HL ; Save pointer in DE F56A 19 . ADD HL,DE ; Point to result byte F56B 7E ~ LD A,(HL) ; Fetch it F56C 32 A7 FC 2§ü LD (&FCA7),A ; Store it in main result store F56F EB ë EX DE,HL ; Get pointer back to HL F570 FE 12 þ. CP &12 ; DskFM_ReadOnly? F572 C8 È RET Z ; Return if so F573 B7 · OR A ; DskFM_Ok? F574 C8 È RET Z ; Return is so F575 10 EA .ê DJNZ &F561 ; Loop back up to ten times to retry F577 7E ~ LD A,(HL) ; Get drive number from control block F578 CD 1B F6 Í.ö CALL &F61B ; Seek track 0 on this drive F57B 41 A LD B,C F57C 10 E0 .à DJNZ &F55E ; Loop back up to 4 times F57E 3A A7 FC :§ü LD A,(&FCA7) ; Get result byte. By here it will be F581 C9 É RET ; a error other than ReadOnly F582 00 . NOP F583 F0 ð RET P F584 E9 é JP (HL) F585 00 . NOP F586 00 . NOP F587 03 . INC BC F588 53 S LD D,E F589 00 . NOP F58A 00 . NOP F58B 28 FF (. JR Z,&F58C F58D 00 . NOP F58E 00 . NOP F58F D4 00 00 Ô.. CALL NC,&0000 F592 03 . INC BC F593 53 S LD D,E F594 00 . NOP F595 08 . EX AF,AF' F596 22 FF 00 ".. LD (&00FF),HL F599 00 . NOP F59A D6 00 Ö. SUB A,&00 F59C 00 . NOP F59D 03 . INC BC F59E 53 S LD D,E F59F 01 00 2A ..* LD BC,&2A00 F5A2 FF . RST &38 F5A3 00 . NOP F5A4 00 . NOP F5A5 E0 à RET PO F5A6 00 . NOP F5A7 00 . NOP F5A8 03 . INC BC F5A9 53 S LD D,E F5AA 02 . LD (BC),A F5AB 00 . NOP F5AC 2A FF *. DEFW &FF2A ; Initialise OSWORD &FF code in the i/o processor ; Copies the code over, copies USERV to the code, and then sets ; USERV to call the code. F5AE F3 ó DI ; Disable interrupts while copying code F5AF 21 00 25 !.% LD HL,&2500 ; Copy to &2500 in i/o processor F5B2 11 30 FD .0ý LD DE,&FD30 ; from &FD30 in Z80 processor F5B5 06 AA .ª LD B,&AA ; 170 bytes F5B7 CD F3 F5 Íóõ CALL &F5F3 ; Copy OSWORD &FF code over F5BA 21 00 02 !.. LD HL,&0200 ; Copy from &0200 in i/o processor F5BD 11 DC FD .Üý LD DE,&FDDC ; to &FDDC in Z80 processor F5C0 06 02 .. LD B,&02 ; 2 bytes F5C2 CD DD F5 ÍÝõ CALL &F5DD ; Fetch USERV F5C5 21 03 25 !.% LD HL,&2503 ; Copy to &2503 in i/o processor F5C8 11 DC FD .Üý LD DE,&FDDC ; from &FDDC in Z80 processor F5CB 06 02 .. LD B,&02 ; 2 bytes F5CD CD F3 F5 Íóõ CALL &F5F3 ; Set oldUSERV in OSWORD &FF code F5D0 21 00 02 !.. LD HL,&0200 ; Copy to &0200 in i/o processor F5D3 11 DA FD .Úý LD DE,&FDDA ; from &FDDA in Z80 processor F5D6 06 02 .. LD B,&02 ; 2 bytes F5D8 CD F3 F5 Íóõ CALL &F5F3 ; Set USERV to point to OSWORD &FF code F5DB FB û EI ; Turn interrupts back on F5DC C9 É RET F5DD 22 09 F6 ".ö LD (&F609),HL F5E0 E5 å PUSH HL F5E1 21 09 F6 !.ö LD HL,&F609 F5E4 3E 05 >. LD A,&05 F5E6 CD F1 FF Íñ. CALL &FFF1 :\ OSWORD F5E9 3A 0D F6 :.ö LD A,(&F60D) F5EC 12 . LD (DE),A F5ED 13 . INC DE F5EE E1 á POP HL F5EF 23 # INC HL F5F0 10 EB .ë DJNZ &F5DD F5F2 C9 É RET F5F3 22 09 F6 ".ö LD (&F609),HL F5F6 1A . LD A,(DE) F5F7 32 0D F6 2.ö LD (&F60D),A F5FA E5 å PUSH HL F5FB 21 09 F6 !.ö LD HL,&F609 F5FE 3E 06 >. LD A,&06 F600 CD F1 FF Íñ. CALL &FFF1 :\ OSWORD F603 13 . INC DE F604 E1 á POP HL F605 23 # INC HL F606 10 EB .ë DJNZ &F5F3 F608 C9 É RET F609 01 02 00 ... LD BC,&0002 F60C 00 . NOP F60D 25 % DEC H F60E E3 ã EX (SP),HL F60F F5 õ PUSH AF F610 7E ~ LD A,(HL) F611 CD E3 FF Íã. CALL &FFE3 :\ OSASCI F614 23 # INC HL F615 B7 · OR A F616 20 F8 ø JR NZ,&F610 F618 F1 ñ POP AF F619 E3 ã EX (SP),HL F61A C9 É RET ; Seek to track zero on drive supplied in A F61B F5 õ PUSH AF F61C E5 å PUSH HL F61D 32 36 F6 26ö LD (&F636),A F620 21 36 F6 !6ö LD HL,&F636 F623 3E 7F >. LD A,&7F F625 ED 73 A5 FC ís¥ü LD (&FCA5),SP F629 31 80 FF 1.. LD SP,&FF80 F62C CD EF F8 Íïø CALL osWORD F62F ED 7B A5 FC í{¥ü LD SP,(&FCA5) F633 E1 á POP HL F634 F1 ñ POP AF F635 C9 É RET F636 00 . NOP F637 00 . NOP F638 00 . NOP F639 00 . NOP F63A 00 . NOP F63B 01 69 00 .i. LD BC,&0069 F63E 00 . NOP F63F E5 å PUSH HL F640 21 FF FF !.. LD HL,&FFFF F643 3E 80 >. LD A,&80 F645 CD 8E F8 Í.ø CALL osBYTE F648 7D } LD A,L F649 B7 · OR A F64A 28 02 (. JR Z,&F64E F64C 18 0C .. JR &F65A F64E 3E D8 >Ø LD A,&D8 F650 21 00 FF !.. LD HL,&FF00 F653 CD 8E F8 Í.ø CALL osBYTE F656 7D } LD A,L F657 B7 · OR A F658 28 02 (. JR Z,&F65C F65A 3E FF >. LD A,&FF F65C E1 á POP HL F65D C9 É RET F65E C5 Å PUSH BC F65F D5 Õ PUSH DE F660 E5 å PUSH HL F661 21 BC FF !¼. LD HL,&FFBC F664 11 38 00 .8. LD DE,&0038 F667 01 03 00 ... LD BC,&0003 F66A ED B0 í° LDIR F66C E1 á POP HL F66D D1 Ñ POP DE F66E C1 Á POP BC F66F C9 É RET F670 C9 É RET F671 F5 õ PUSH AF F672 DB 00 Û. IN A,(&00) F674 CB 77 Ëw BIT 6,A F676 28 FA (ú JR Z,&F672 F678 F1 ñ POP AF F679 D3 01 Ó. OUT (&01),A F67B C9 É RET Wait for byte in R1 while allowing requests via R4 ================================================== F67C DB 00 Û. IN A,(&00) ; Check R1 status F67E CB 7F Ë. BIT 7,A F680 20 0B . JR NZ,&F68D ; Data present, fetch it F682 DB 06 Û. IN A,(&06) ; Check R4 status F684 CB 7F Ë. BIT 7,A F686 28 F4 (ô JR Z,&F67C ; No data, loop back to check R1 F688 CD 0B FB Í.û CALL &FB0B ; Process R4 interrupt F68B 18 EF .ï JR &F67C ; Jump back to wait for R1 F68D DB 01 Û. IN A,(&01) ; Read byte from R1 F68F C9 É RET F690 3E 00 >. LD A,&00 F692 CD A3 F6 Í£ö CALL &F6A3 F695 CD 9A F6 Í.ö CALL &F69A F698 CB 27 Ë' SLA A F69A DB 02 Û. IN A,(&02) F69C CB 7F Ë. BIT 7,A F69E 28 FA (ú JR Z,&F69A F6A0 DB 03 Û. IN A,(&03) F6A2 C9 É RET F6A3 F5 õ PUSH AF F6A4 DB 02 Û. IN A,(&02) F6A6 CB 77 Ëw BIT 6,A F6A8 28 FA (ú JR Z,&F6A4 F6AA F1 ñ POP AF F6AB D3 03 Ó. OUT (&03),A F6AD C9 É RET Wait for byte in R4 =================== F6AE DB 06 Û. IN A,(&06) F6B0 CB 7F Ë. BIT 7,A F6B2 28 FA (ú JR Z,&F6AE F6B4 DB 07 Û. IN A,(&07) F6B6 C9 É RET F6B7 F5 õ PUSH AF F6B8 C5 Å PUSH BC F6B9 D5 Õ PUSH DE F6BA 54 T LD D,H F6BB 5D ] LD E,L F6BC CD 7E F8 Í~ø CALL &F87E F6BF CD 77 F8 Íwø CALL &F877 F6C2 FE 2A þ* CP &2A F6C4 28 F6 (ö JR Z,&F6BC F6C6 E6 DF æß AND &DF F6C8 FE 48 þH CP &48 F6CA 28 20 ( JR Z,&F6EC F6CC 4F O LD C,A F6CD 3A A3 FC :£ü LD A,(&FCA3) F6D0 B7 · OR A F6D1 79 y LD A,C F6D2 C2 CC F7 ÂÌ÷ JP NZ,&F7CC F6D5 FE 47 þG CP &47 F6D7 CA 08 F3 Ê.ó JP Z,&F308 F6DA FE 44 þD CP &44 F6DC CA B3 F3 ʳó JP Z,&F3B3 F6DF FE 53 þS CP &53 F6E1 CA 30 F3 Ê0ó JP Z,&F330 F6E4 FE 43 þC CP &43 F6E6 CA 8D F4 Ê.ô JP Z,&F48D F6E9 C3 CC F7 ÃÌ÷ JP &F7CC F6EC 13 . INC DE F6ED 1A . LD A,(DE) F6EE FE 2E þ. CP &2E F6F0 28 2E (. JR Z,&F720 F6F2 E6 DF æß AND &DF F6F4 FE 45 þE CP &45 F6F6 C2 CC F7 ÂÌ÷ JP NZ,&F7CC F6F9 13 . INC DE F6FA 1A . LD A,(DE) F6FB FE 2E þ. CP &2E F6FD 28 21 (! JR Z,&F720 F6FF E6 DF æß AND &DF F701 FE 4C þL CP &4C F703 C2 CC F7 ÂÌ÷ JP NZ,&F7CC F706 13 . INC DE F707 1A . LD A,(DE) F708 FE 2E þ. CP &2E F70A 28 14 (. JR Z,&F720 F70C E6 DF æß AND &DF F70E FE 50 þP CP &50 F710 C2 CC F7 ÂÌ÷ JP NZ,&F7CC F713 13 . INC DE F714 1A . LD A,(DE) F715 CD 6D F8 Ímø CALL &F86D F718 D2 CC F7 ÒÌ÷ JP NC,&F7CC F71B CD 77 F8 Íwø CALL &F877 F71E 18 03 .. JR &F723 F720 CD 76 F8 Ívø CALL &F876 F723 CD B3 FF ͳ. CALL &FFB3 :\ PR_TEXT F726 DEFB 13 ; NEWL F727 DEFS "Z80 TUBE 1.20":DEFB 13 F735 DEFB 0 F736 4F O LD C,A F737 3A A3 FC :£ü LD A,(&FCA3) F73A B7 · OR A F73B 79 y LD A,C F73C C2 CC F7 ÂÌ÷ JP NZ,&F7CC F73F FE 0D þ. CP &0D F741 28 29 () JR Z,&F76C F743 E6 DF æß AND &DF F745 FE 4D þM CP &4D F747 28 09 (. JR Z,&F752 F749 FE 0D þ. CP &0D F74B CA CC F7 ÊÌ÷ JP Z,&F7CC F74E 13 . INC DE F74F 1A . LD A,(DE) F750 18 F1 .ñ JR &F743 F752 13 . INC DE F753 1A . LD A,(DE) F754 E6 DF æß AND &DF F756 FE 4F þO CP &4F F758 20 F4 ô JR NZ,&F74E F75A 13 . INC DE F75B 1A . LD A,(DE) F75C E6 DF æß AND &DF F75E FE 4E þN CP &4E F760 20 EC ì JR NZ,&F74E F762 13 . INC DE F763 1A . LD A,(DE) F764 CD 6D F8 Ímø CALL &F86D F767 D2 4E F7 ÒN÷ JP NC,&F74E F76A 18 0C .. JR &F778 F76C CD 0E F6 Í.ö CALL &F60E ; Print inline text F76F DEFM " MON" F774 DEFB 13 F775 DEFB 0 F776 18 54 .T JR &F7CC F778 CD 0E F6 Í.ö CALL &F60E ; Print inline text F77B DEFM " CPM":DEFB 13 F781 DEFM " Dump ":DEFB 13 F7A6 DEFM " GO ":DEFB 13 F7.. DEFS " Set ":DEFB 13 F7CB DEFB 0 F7CC 3E 02 >. LD A,&02 F7CE CD A3 F6 Í£ö CALL &F6A3 F7D1 CD 84 F8 Í.ø CALL &F884 F7D4 CD 9A F6 Í.ö CALL &F69A F7D7 FE 80 þ. CP &80 F7D9 28 04 (. JR Z,&F7DF F7DB D1 Ñ POP DE F7DC C1 Á POP BC F7DD F1 ñ POP AF F7DE C9 É RET F7DF 3E 01 >. LD A,&01 F7E1 32 AF FC 2¯ü LD (&FCAF),A F7E4 CD EB F7 Íë÷ CALL &F7EB F7E7 D1 Ñ POP DE F7E8 C1 Á POP BC F7E9 F1 ñ POP AF F7EA C9 É RET ; Attempt to enter current program, or boot CPM F7EB 2A A8 FC *¨ü LD HL,(&FCA8) ; Fetch program address F7EE 11 07 00 ... LD DE,&0007 F7F1 19 . ADD HL,DE ; Point to copyright message F7F2 E5 å PUSH HL F7F3 7E ~ LD A,(HL) F7F4 2A A8 FC *¨ü LD HL,(&FCA8) F7F7 5F _ LD E,A F7F8 19 . ADD HL,DE F7F9 22 82 FF ".. LD (&FF82),HL F7FC 7E ~ LD A,(HL) F7FD FE 00 þ. CP &00 F7FF 20 25 % JR NZ,&F826 F801 23 # INC HL F802 7E ~ LD A,(HL) F803 FE 28 þ( CP &28 F805 20 1F . JR NZ,&F826 F807 23 # INC HL F808 7E ~ LD A,(HL) F809 FE 43 þC CP &43 F80B 20 19 . JR NZ,&F826 F80D 23 # INC HL F80E 7E ~ LD A,(HL) F80F FE 29 þ) CP &29 F811 20 13 . JR NZ,&F826 ; No ROM header, enter as raw code F813 E1 á POP HL ; Get address of copyright message F814 2B + DEC HL ; Point to rom type F815 3A AF FC :¯ü LD A,(&FCAF) ; Get a flag F818 B7 · OR A F819 20 0F . JR NZ,&F82A ; Jump to non-booting test F81B 7E ~ LD A,(HL) ; Get rom type F81C CB 77 Ëw BIT 6,A F81E CA A9 F4 Ê©ô JP Z,&F4A9 ; If not a language try boot CPM F821 CB 5F Ë_ BIT 3,A F823 CA A9 F4 Ê©ô JP Z,&F4A9 ; If not Z80 code try boot CPM F826 2A A8 FC *¨ü LD HL,(&FCA8) ; Fetch program address F829 E9 é JP (HL) ; And enter it F82A AF ¯ XOR A F82B 32 AF FC 2¯ü LD (&FCAF),A ; Set flag to reboot to CPM F82E 7E ~ LD A,(HL) ; Get romtype F82F CB 77 Ëw BIT 6,A F831 28 0A (. JR Z,&F83D ; If not a language, give error F833 CB 5F Ë_ BIT 3,A F835 28 1F (. JR Z,&F856 ; If not Z80 code, give error F837 3E 01 >. LD A,&01 ; Set 'starting language' F839 2A A8 FC *¨ü LD HL,(&FCA8) ; Fetch program address F83C E9 é JP (HL) ; And enter it F83D FF . RST &38 ; Error F83E DEFB 0 F83F DEFS "This is not a language" F855 DEFB 0 F856 FF . RST &38 ; Error F857 DEFB 0 F868 DEFS "This is not Z80 code" F86C DEFB 0 F86D E6 DF æß AND &DF F86F FE 41 þA CP &41 F871 D8 Ø RET C F872 FE 5B þ[ CP &5B F874 3F ? CCF F875 C9 É RET F876 13 . INC DE F877 1A . LD A,(DE) F878 FE 20 þ CP &20 F87A 28 FA (ú JR Z,&F876 F87C C9 É RET F87D 13 . INC DE F87E 1A . LD A,(DE) F87F FE 2A þ* CP &2A F881 28 FA (ú JR Z,&F87D F883 C9 É RET F884 7E ~ LD A,(HL) F885 CD A3 F6 Í£ö CALL &F6A3 F888 23 # INC HL F889 FE 0D þ. CP &0D F88B 20 F7 ÷ JR NZ,&F884 F88D C9 É RET F88E FE 80 þ. CP &80 F890 30 15 0. JR NC,&F8A7 F892 F5 õ PUSH AF F893 3E 04 >. LD A,&04 F895 CD A3 F6 Í£ö CALL &F6A3 F898 7D } LD A,L F899 CD A3 F6 Í£ö CALL &F6A3 F89C F1 ñ POP AF F89D F5 õ PUSH AF F89E CD A3 F6 Í£ö CALL &F6A3 F8A1 CD 9A F6 Í.ö CALL &F69A F8A4 6F o LD L,A F8A5 F1 ñ POP AF F8A6 C9 É RET F8A7 FE 82 þ. CP &82 F8A9 28 31 (1 JR Z,&F8DC F8AB FE 83 þ. CP &83 F8AD 28 31 (1 JR Z,&F8E0 F8AF FE 84 þ. CP &84 F8B1 28 31 (1 JR Z,&F8E4 F8B3 F5 õ PUSH AF F8B4 3E 06 >. LD A,&06 F8B6 CD A3 F6 Í£ö CALL &F6A3 F8B9 7D } LD A,L F8BA CD A3 F6 Í£ö CALL &F6A3 F8BD 7C | LD A,H F8BE CD A3 F6 Í£ö CALL &F6A3 F8C1 F1 ñ POP AF F8C2 F5 õ PUSH AF F8C3 CD A3 F6 Í£ö CALL &F6A3 F8C6 FE 9D þ. CP &9D F8C8 28 10 (. JR Z,&F8DA F8CA CD 9A F6 Í.ö CALL &F69A F8CD 6F o LD L,A F8CE F1 ñ POP AF F8CF CB 25 Ë% SLA L F8D1 F5 õ PUSH AF F8D2 CD 9A F6 Í.ö CALL &F69A F8D5 67 g LD H,A F8D6 CD 9A F6 Í.ö CALL &F69A F8D9 6F o LD L,A F8DA F1 ñ POP AF F8DB C9 É RET F8DC 21 00 00 !.. LD HL,&0000 F8DF C9 É RET F8E0 21 03 3B !.; LD HL,&3B03 F8E3 C9 É RET F8E4 21 00 DC !.Ü LD HL,&DC00 F8E7 C9 É RET F8E8 F5 õ PUSH AF F8E9 3E 01 >. LD A,&01 F8EB 32 A4 FC 2¤ü LD (&FCA4),A F8EE F1 ñ POP AF F8EF B7 · OR A F8F0 28 6B (k JR Z,&F95D F8F2 C5 Å PUSH BC F8F3 E5 å PUSH HL F8F4 DD E5 Ýå PUSH IX F8F6 F5 õ PUSH AF F8F7 3E 08 >. LD A,&08 F8F9 CD A3 F6 Í£ö CALL &F6A3 F8FC F1 ñ POP AF F8FD F5 õ PUSH AF F8FE CD A3 F6 Í£ö CALL &F6A3 F901 06 00 .. LD B,&00 F903 4F O LD C,A F904 FE 80 þ. CP &80 F906 38 06 8. JR C,&F90E F908 46 F LD B,(HL) F909 23 # INC HL F90A 4E N LD C,(HL) F90B 2B + DEC HL F90C 18 15 .. JR &F923 F90E FE 15 þ. CP &15 F910 38 05 8. JR C,&F917 F912 01 10 10 ... LD BC,&1010 F915 18 0C .. JR &F923 F917 DD 21 75 FC Ý!uü LD IX,&FC75 F91B DD 09 Ý. ADD IX,BC F91D DD 46 FF ÝF. LD B,(IX-1) F920 DD 4E 13 ÝN. LD C,(IX+19) F923 E5 å PUSH HL F924 C5 Å PUSH BC F925 48 H LD C,B F926 06 00 .. LD B,&00 F928 09 . ADD HL,BC F929 C1 Á POP BC F92A 78 x LD A,B F92B CD A3 F6 Í£ö CALL &F6A3 F92E B7 · OR A F92F 28 07 (. JR Z,&F938 F931 2B + DEC HL F932 7E ~ LD A,(HL) F933 CD A3 F6 Í£ö CALL &F6A3 F936 10 F9 .ù DJNZ &F931 F938 79 y LD A,C F939 CD A3 F6 Í£ö CALL &F6A3 F93C E1 á POP HL F93D F5 õ PUSH AF F93E 3A A4 FC :¤ü LD A,(&FCA4) F941 B7 · OR A F942 28 06 (. JR Z,&F94A F944 62 b LD H,D F945 6B k LD L,E F946 AF ¯ XOR A F947 32 A4 FC 2¤ü LD (&FCA4),A F94A F1 ñ POP AF F94B B7 · OR A F94C 28 09 (. JR Z,&F957 F94E 09 . ADD HL,BC F94F 41 A LD B,C F950 2B + DEC HL F951 CD 9A F6 Í.ö CALL &F69A F954 77 w LD (HL),A F955 10 F9 .ù DJNZ &F950 F957 F1 ñ POP AF F958 DD E1 Ýá POP IX F95A E1 á POP HL F95B C1 Á POP BC F95C C9 É RET F95D C5 Å PUSH BC F95E F5 õ PUSH AF F95F 3E 0A >. LD A,&0A F961 CD A3 F6 Í£ö CALL &F6A3 F964 23 # INC HL F965 23 # INC HL F966 23 # INC HL F967 23 # INC HL F968 06 03 .. LD B,&03 F96A 7E ~ LD A,(HL) F96B CD A3 F6 Í£ö CALL &F6A3 F96E 2B + DEC HL F96F 10 F9 .ù DJNZ &F96A F971 3E 07 >. LD A,&07 F973 CD A3 F6 Í£ö CALL &F6A3 F976 97 . SUB A,A F977 CD A3 F6 Í£ö CALL &F6A3 F97A CD 9A F6 Í.ö CALL &F69A F97D 07 . RLCA F97E 38 18 8. JR C,&F998 F980 7E ~ LD A,(HL) F981 2B + DEC HL F982 6E n LD L,(HL) F983 67 g LD H,A F984 06 FF .. LD B,&FF F986 CD 9A F6 Í.ö CALL &F69A F989 77 w LD (HL),A F98A 23 # INC HL F98B 04 . INC B F98C FE 0D þ. CP &0D F98E 20 F6 ö JR NZ,&F986 F990 2E 00 .. LD L,&00 F992 60 ` LD H,B F993 F1 ñ POP AF F994 C1 Á POP BC F995 37 7 SCF F996 3F ? CCF F997 C9 É RET F998 21 FF 00 !.. LD HL,&00FF F99B F1 ñ POP AF F99C C1 Á POP BC F99D 37 7 SCF F99E C9 É RET F99F E5 å PUSH HL F9A0 D5 Õ PUSH DE F9A1 C5 Å PUSH BC F9A2 F5 õ PUSH AF F9A3 3E 0C >. LD A,&0C F9A5 CD A3 F6 Í£ö CALL &F6A3 F9A8 7B { LD A,E F9A9 CD A3 F6 Í£ö CALL &F6A3 F9AC 23 # INC HL F9AD 23 # INC HL F9AE 23 # INC HL F9AF 06 04 .. LD B,&04 F9B1 7E ~ LD A,(HL) F9B2 CD A3 F6 Í£ö CALL &F6A3 F9B5 2B + DEC HL F9B6 10 F9 .ù DJNZ &F9B1 F9B8 23 # INC HL F9B9 F1 ñ POP AF F9BA CD A3 F6 Í£ö CALL &F6A3 F9BD CD 9A F6 Í.ö CALL &F69A F9C0 F5 õ PUSH AF F9C1 23 # INC HL F9C2 23 # INC HL F9C3 23 # INC HL F9C4 06 04 .. LD B,&04 F9C6 CD 9A F6 Í.ö CALL &F69A F9C9 77 w LD (HL),A F9CA 2B + DEC HL F9CB 10 F9 .ù DJNZ &F9C6 F9CD F1 ñ POP AF F9CE C1 Á POP BC F9CF D1 Ñ POP DE F9D0 E1 á POP HL F9D1 C9 É RET F9D2 F5 õ PUSH AF F9D3 3E 12 >. LD A,&12 F9D5 CD A3 F6 Í£ö CALL &F6A3 F9D8 F1 ñ POP AF F9D9 CD A3 F6 Í£ö CALL &F6A3 F9DC FE 00 þ. CP &00 F9DE 20 0A . JR NZ,&F9EA F9E0 F5 õ PUSH AF F9E1 7C | LD A,H F9E2 CD A3 F6 Í£ö CALL &F6A3 F9E5 CD 9A F6 Í.ö CALL &F69A F9E8 F1 ñ POP AF F9E9 C9 É RET F9EA CD 84 F8 Í.ø CALL &F884 F9ED C3 9A F6 Ã.ö JP &F69A F9F0 3E 0E >. LD A,&0E F9F2 CD A3 F6 Í£ö CALL &F6A3 F9F5 7C | LD A,H F9F6 CD A3 F6 Í£ö CALL &F6A3 F9F9 C3 95 F6 Ã.ö JP &F695 F9FC F5 õ PUSH AF F9FD 3E 10 >. LD A,&10 F9FF CD A3 F6 Í£ö CALL &F6A3 FA02 7C | LD A,H FA03 CD A3 F6 Í£ö CALL &F6A3 FA06 F1 ñ POP AF FA07 CD A3 F6 Í£ö CALL &F6A3 FA0A F5 õ PUSH AF FA0B CD 9A F6 Í.ö CALL &F69A FA0E F1 ñ POP AF FA0F C9 É RET ; OSFILE FA10 C5 Å PUSH BC FA11 F5 õ PUSH AF FA12 22 AC FC "¬ü LD (&FCAC),HL FA15 3E 14 >. LD A,&14 ; &14 - OSFILE FA17 CD A3 F6 Í£ö CALL &F6A3 ; Send to Tube R2 FA1A 01 11 00 ... LD BC,&0011 FA1D 09 . ADD HL,BC FA1E 06 10 .. LD B,&10 FA20 7E ~ LD A,(HL) FA21 CD A3 F6 Í£ö CALL &F6A3 ; Send control block FA24 2B + DEC HL FA25 10 F9 .ù DJNZ &FA20 FA27 7E ~ LD A,(HL) FA28 2B + DEC HL FA29 6E n LD L,(HL) FA2A 67 g LD H,A FA2B CD 84 F8 Í.ø CALL &F884 ; Send pathname FA2E F1 ñ POP AF FA2F CD A3 F6 Í£ö CALL &F6A3 ; Send OSFILE action FA32 CD 9A F6 Í.ö CALL &F69A ; Get result FA35 E6 7F æ. AND &7F ; Lose b7 - why? FA37 F5 õ PUSH AF FA38 2A AC FC *¬ü LD HL,(&FCAC) FA3B 01 11 00 ... LD BC,&0011 FA3E 09 . ADD HL,BC FA3F 06 10 .. LD B,&10 FA41 CD 9A F6 Í.ö CALL &F69A ; Get control block FA44 77 w LD (HL),A FA45 2B + DEC HL FA46 10 F9 .ù DJNZ &FA41 FA48 2A AC FC *¬ü LD HL,(&FCAC) FA4B F1 ñ POP AF FA4C C1 Á POP BC FA4D C9 É RET FA4E C5 Å PUSH BC FA4F F5 õ PUSH AF FA50 22 AC FC "¬ü LD (&FCAC),HL FA53 3E 16 >. LD A,&16 FA55 CD A3 F6 Í£ö CALL &F6A3 FA58 01 0C 00 ... LD BC,&000C FA5B 09 . ADD HL,BC FA5C 06 0D .. LD B,&0D FA5E 7E ~ LD A,(HL) FA5F CD A3 F6 Í£ö CALL &F6A3 FA62 2B + DEC HL FA63 10 F9 .ù DJNZ &FA5E FA65 F1 ñ POP AF FA66 CD A3 F6 Í£ö CALL &F6A3 FA69 2A AC FC *¬ü LD HL,(&FCAC) FA6C 01 0C 00 ... LD BC,&000C FA6F 09 . ADD HL,BC FA70 06 0D .. LD B,&0D FA72 CD 9A F6 Í.ö CALL &F69A FA75 77 w LD (HL),A FA76 2B + DEC HL FA77 10 F9 .ù DJNZ &FA72 FA79 2A AC FC *¬ü LD HL,(&FCAC) FA7C C1 Á POP BC FA7D C3 95 F6 Ã.ö JP &F695 Interrupt SP store ================== FA80 74 FF t. DEFW &FF74 Interupt handler ================ FA82 ED 73 80 FA ís.ú LD (&FA80),SP ; Save SP FA86 31 60 FF 1`. LD SP,&FF60 ; Point to temporary stack FA89 CD 93 FA Í.ú CALL &FA93 ; Process interrupt FA8C ED 7B 80 FA í{.ú LD SP,(&FA80) ; Restore SP FA90 FB û EI ; Enable INTs FA91 ED 4D íM RETI ; Return from INT handler Interrupt handler subcode ------------------------- FA93 F5 õ PUSH AF FA94 DB 06 Û. IN A,(&06) ; Check R4 status FA96 CB 7F Ë. BIT 7,A FA98 20 71 q JR NZ,&FB0B ; Jump to process errors and transfers FA9A DB 00 Û. IN A,(&00) ; Check R1 status FA9C CB 7F Ë. BIT 7,A FA9E 20 39 9 JR NZ,&FAD9 ; Jump to process Escape and events FAA0 F1 ñ POP AF FAA1 C3 B0 FF ð. JP &FFB0 ; Continue into INT2 vector .RestartHandler ; Enter here from CALL ERRJMP or RST &38 FAA4 E1 á POP HL FAA5 22 82 FF ".. LD (&FF82),HL FAA8 2A FA FF *ú. LD HL,(&FFFA) FAAB E9 é JP (HL) .ErrorHandler ; Default error handler FAAC CD C6 FA ÍÆú CALL &FAC6 ; Print error message FAAF C3 CB F2 ÃËò JP &F2CB ; Jump to CliCom FAB2 3E 03 >. LD A,&03 FAB4 2E 00 .. LD L,&00 FAB6 CD 8E F8 Í.ø CALL osBYTE FAB9 3E 02 >. LD A,&02 FABB 2E 02 .. LD L,&02 FABD CD 8E F8 Í.ø CALL osBYTE FAC0 CD C6 FA ÍÆú CALL &FAC6 FAC3 C3 00 00 Ã.. JP &0000 FAC6 2A 82 FF *.. LD HL,(&FF82) FAC9 3E 0D >. LD A,&0D FACB CD 71 F6 Íqö CALL &F671 FACE 3E 0A >. LD A,&0A FAD0 CD 71 F6 Íqö CALL &F671 FAD3 23 # INC HL FAD4 7E ~ LD A,(HL) FAD5 B7 · OR A FAD6 20 F8 ø JR NZ,&FAD0 FAD8 C9 É RET Interupt generated by data in R1 -------------------------------- FAD9 DB 01 Û. IN A,(&01) ; Get byte from R1 FADB CB 7F Ë. BIT 7,A ; Is b7 set? FADD 20 25 % JR NZ,&FB04 ; Jump to set Escape state FADF 3E 01 >. LD A,&01 ; Set flag to indicate within FAE1 32 A2 FC 2¢ü LD (&FCA2),A ; event handler FAE4 E5 å PUSH HL ; Save registers FAE5 DD E5 Ýå PUSH IX FAE7 CD 7C F6 Í|ö CALL &F67C ; Wait for byte via R1 FAEA 67 g LD H,A ; 6502 Y passed to H FAEB CD 7C F6 Í|ö CALL &F67C ; Wait for byte via R1 FAEE 6F o LD L,A ; 6502 X passed to L FAEF CD 7C F6 Í|ö CALL &F67C ; Wait for byte via R1 in A FAF2 CD FE FA Íþú CALL &FAFE ; Call event vector FAF5 AF ¯ XOR A ; Clear flag, indicate not within FAF6 32 A2 FC 2¢ü LD (&FCA2),A ; event handler FAF9 DD E1 Ýá POP IX ; Restore registers FAFB E1 á POP HL FAFC F1 ñ POP AF FAFD C9 É RET ; Return FAFE DD 2A FC FF Ý*ü. LD IX,(&FFFC) ; Get EVENTV contents FB02 DD E9 Ýé JP (IX) ; Jump to it Set Escape state ---------------- FB04 CB 27 Ë' SLA A ; Move escape flag to b7 FB06 32 80 FF 2.. LD (&FF80),A ; Store in Escape flag FB09 F1 ñ POP AF ; Restore A FB0A C9 É RET ; Return Interupt generated by data in R4 -------------------------------- FB0B DB 07 Û. IN A,(&07) ; Get byte from R4 FB0D CB 7F Ë. BIT 7,A FB0F 28 45 (E JR Z,&FB56 ; b7=0, jump for data transfer FB11 DB 02 Û. IN A,(&02) ; Get R2 status FB13 CB 7F Ë. BIT 7,A FB15 28 FA (ú JR Z,&FB11 ; Loop until data present FB17 DB 03 Û. IN A,(&03) ; Get (unused) byte from R2 FB19 FB û EI ; Enable INTs FB1A 21 B0 FC !°ü LD HL,&FCB0 ; Point to error buffer FB1D 36 CD 6Í LD (HL),&CD ; Put CALL opcode in FB1F 23 # INC HL FB20 3A BD FF :½. LD A,(&FFBD) ; Call destination of default FB23 77 w LD (HL),A ; error handler FB24 23 # INC HL FB25 3A BE FF :¾. LD A,(&FFBE) FB28 77 w LD (HL),A FB29 23 # INC HL FB2A CD 9A F6 Í.ö CALL &F69A ; Wait for byte from R2 FB2D 77 w LD (HL),A ; Store as ERR in error buffer FB2E B7 · OR A ; Was it error zero? FB2F 20 1A . JR NZ,&FB4B ; No, get rest of error block FB31 CD 0E F6 Í.ö CALL &F60E ; Print inline text FB34 DEFB 13 ; NEWL FB35 DEFS "Fatal error" FB40 DEFB 0 FB41 3A A3 FC :£ü LD A,(&FCA3) FB44 B7 · OR A FB45 C2 00 00 Â.. JP NZ,&0000 FB48 C3 CB F2 ÃËò JP &F2CB FB4B 23 # INC HL FB4C CD 9A F6 Í.ö CALL &F69A ; Wait for byte from R2 FB4F 77 w LD (HL),A ; Store in error buffer FB50 B7 · OR A FB51 20 F8 ø JR NZ,&FB4B ; Loop until final zero byte FB53 C3 B0 FC ðü JP &FCB0 ; Jump to error block to generate Data transfer initiated by INT via R4 ------------------------------------- FB56 C5 Å PUSH BC FB57 D5 Õ PUSH DE FB58 E5 å PUSH HL FB59 F5 õ PUSH AF Save transfer type FB5A 07 . RLCA FB5B 5F _ LD E,A FB5C 07 . RLCA FB5D 07 . RLCA FB5E 83 . ADD A,E FB5F 07 . RLCA FB60 5F _ LD E,A FB61 16 00 .. LD D,&00 FB63 21 C1 FB !Áû LD HL,&FBC1 FB66 19 . ADD HL,DE FB67 11 61 FC .aü LD DE,&FC61 FB6A 01 14 00 ... LD BC,&0014 FB6D ED B0 í° LDIR FB6F CD AE F6 Í®ö CALL &F6AE Wait for caller ID in R4 FB72 F1 ñ POP AF Get transfer type back FB73 FE 05 þ. CP &05 Is it 'release'? FB75 28 33 (3 JR Z,&FBAA Yes, exit FB77 F5 õ PUSH AF Save transfer type again FB78 CD AE F6 Í®ö CALL &F6AE Wait for byte in R4 FB7B CD AE F6 Í®ö CALL &F6AE Wait for byte in R4 FB7E CD AE F6 Í®ö CALL &F6AE Wait for byte in R4 FB81 67 g LD H,A High byte of address FB82 CD AE F6 Í®ö CALL &F6AE Wait for byte in R4 FB85 6F o LD L,A Low byte of address FB86 22 A8 FC "¨ü LD (&FCA8),HL Set data address FB89 0E 05 .. LD C,&05 Set C to R3 port address FB8B 06 00 .. LD B,&00 Set B for 256 bytes to transfer FB8D CD AE F6 Í®ö CALL &F6AE Wait for sync byte in R4 FB90 F1 ñ POP AF Get transfer type back FB91 FE 06 þ. CP &06 FB93 38 15 8. JR C,&FBAA Jump if not 256-byte transfers FB95 20 1D . JR NZ,&FBB4 Jump with 256-byte read Send 256 bytes to Tube via R3 ----------------------------- FB97 DB 04 Û. IN A,(&04) Check R3 status FB99 B7 · OR A FB9A F2 97 FB ò.û JP P,&FB97 Loop until port free FB9D ED A3 í£ OTI Send byte from (HL), increment HL FB9F C2 97 FB Â.û JP NZ,&FB97 Loop until 256 bytes done FBA2 DB 04 Û. IN A,(&04) Check R3 status FBA4 B7 · OR A FBA5 F2 A2 FB ò¢û JP P,&FBA2 Loop until port free FBA8 D3 05 Ó. OUT (&05),A Send final sync byte FBAA E1 á POP HL FBAB D1 Ñ POP DE FBAC C1 Á POP BC FBAD 3A A2 FC :¢ü LD A,(&FCA2) ; Are we in the event handler? FBB0 B7 · OR A FBB1 C0 À RET NZ FBB2 F1 ñ POP AF FBB3 C9 É RET Read 256 bytes from Tube via R3 ------------------------------- FBB4 DB 04 Û. IN A,(&04) ; Get R3 status FBB6 B7 · OR A FBB7 F2 B4 FB ò´û JP P,&FBB4 ; Loop until data present FBBA ED A2 í¢ INI ; Get a byte and increment HL FBBC C2 B4 FB ´û JP NZ,&FBB4 ; Loop for 256 bytes FBBF 18 E9 .é JR &FBAA ; Jump to restore and exit NMI data transfer routines ========================== Transfer 0 - Single byte write to host -------------------------------------- FBC1 E5 å PUSH HL FBC2 F5 õ PUSH AF FBC3 2A A8 FC *¨ü LD HL,(&FCA8) ; Get data address FBC6 7E ~ LD A,(HL) ; Get byte from memory FBC7 D3 05 Ó. OUT (&05),A ; Send to R3 FBC9 23 # INC HL ; Increment data address FBCA 22 A8 FC "¨ü LD (&FCA8),HL FBCD F1 ñ POP AF FBCE E1 á POP HL FBCF ED 45 íE RETN FBD1 3A 12 3B :.; LD A,(&3B12) FBD4 B7 · OR A Transfer 1 - Single byte read from host --------------------------------------- FBD5 E5 å PUSH HL FBD6 F5 õ PUSH AF FBD7 DB 05 Û. IN A,(&05) FBD9 2A A8 FC *¨ü LD HL,(&FCA8) FBDC 77 w LD (HL),A FBDD 23 # INC HL FBDE 22 A8 FC "¨ü LD (&FCA8),HL FBE1 F1 ñ POP AF FBE2 E1 á POP HL FBE3 ED 45 íE RETN FBE5 01 3B EB .;ë LD BC,&EB3B FBE8 CD E5 F5 Íåõ CALL &F5E5 Transfer 2 - Double byte write to host -------------------------------------- FBE9 E5 å PUSH HL FBEA F5 õ PUSH AF FBEB 2A A8 FC *¨ü LD HL,(&FCA8) FBEE 7E ~ LD A,(HL) FBEF D3 05 Ó. OUT (&05),A FBF1 23 # INC HL FBF2 7E ~ LD A,(HL) FBF3 D3 05 Ó. OUT (&05),A FBF5 23 # INC HL FBF6 22 A8 FC "¨ü LD (&FCA8),HL FBF9 F1 ñ POP AF FBFA E1 á POP HL FBFB ED 45 íE RETN Transfer 3 - Double byte read from host --------------------------------------- FBFD E5 å PUSH HL FBFE F5 õ PUSH AF FBFF DB 05 Û. IN A,(&05) FC01 2A A8 FC *¨ü LD HL,(&FCA8) FC04 77 w LD (HL),A FC05 23 # INC HL FC06 DB 05 Û. IN A,(&05) FC08 77 w LD (HL),A FC09 23 # INC HL FC0A 22 A8 FC "¨ü LD (&FCA8),HL FC0D F1 ñ POP AF FC0E E1 á POP HL FC0F ED 45 íE RETN Transfer 4 - Execute code ------------------------- FC11 D3 05 Ó. OUT (&05),A FC13 ED 45 íE RETN ; Code jumped to later FC15 23 # INC HL FC16 56 V LD D,(HL) FC17 2B + DEC HL FC18 C9 É RET FC19 2A A0 3C * < LD HL,(&3CA0) FC1C 19 . ADD HL,DE FC1D 23 # INC HL FC1E 23 # INC HL FC1F 5E ^ LD E,(HL) FC20 23 # INC HL FC21 56 V LD D,(HL) FC22 2B + DEC HL FC23 C9 É RET FC24 2A * DEFB &2A Transfer 5 - Release Tube ------------------------- FC25 D3 05 Ó. OUT (&05),A FC27 ED 45 íE RETN FC29 CA 0D 37 Ê.7 JP Z,&370D FC2C EB ë EX DE,HL FC2D D5 Õ PUSH DE FC2E CD ED 36 Íí6 CALL &36ED FC31 EB ë EX DE,HL FC32 22 A4 3C "¤< LD (&3CA4),HL FC35 D1 Ñ POP DE FC36 C3 39 37 Ã97 JP &3739 Transfer 6 - 256-byte transfer ------------------------------ FC39 D3 05 Ó. OUT (&05),A Write to R3 FC3B ED 45 íE RETN FC3D 20 00 . JR NZ,&FC3F FC3F EB ë EX DE,HL FC40 19 . ADD HL,DE FC41 22 A2 3C "¢< LD (&3CA2),HL FC44 D5 Õ PUSH DE FC45 EB ë EX DE,HL FC46 2A AC 3C *¬< LD HL,(&3CAC) FC49 CD 82 0D Í.. CALL &0D82 FC4C D1 Ñ POP DE Transfer 7 - 256-byte transfer ------------------------------ FC4D D3 05 Ó. OUT (&05),A Write to R3 FC4F ED 45 íE RETN FC51 7B { LD A,E FC52 3C < INC A FC53 25 % DEC H FC54 3A 7D 3C :}< LD A,(&3C7D) FC57 B7 · OR A FC58 CD 82 0D Í.. CALL &0D82 FC5B DA 87 38 Ú.8 JP C,&3887 FC5E 2A A0 3C * < LD HL,(&3CA0) Current data transfer NMI code copied to here ============================================= FC61 E5 å PUSH HL FC62 F5 õ PUSH AF FC63 2A A8 FC *¨ü LD HL,(&FCA8) FC66 7E ~ LD A,(HL) FC67 D3 05 Ó. OUT (&05),A FC69 23 # INC HL FC6A 7E ~ LD A,(HL) FC6B D3 05 Ó. OUT (&05),A FC6D 23 # INC HL FC6E 22 A8 FC "¨ü LD (&FCA8),HL FC71 F1 ñ POP AF FC72 E1 á POP HL FC73 ED 45 íE RETN FC75 00 . NOP FC76 05 . DEC B FC77 00 . NOP FC78 05 . DEC B FC79 02 . LD (BC),A FC7A 05 . DEC B FC7B 08 . EX AF,AF' FC7C 0E 04 .. LD C,&04 FC7E 01 01 05 ... LD BC,&0501 FC81 00 . NOP FC82 10 10 .. DJNZ &FC94 FC84 10 0D .. DJNZ &FC93 FC86 00 . NOP FC87 08 . EX AF,AF' FC88 80 . ADD A,B FC89 05 . DEC B FC8A 00 . NOP FC8B 05 . DEC B FC8C 00 . NOP FC8D 05 . DEC B FC8E 00 . NOP FC8F 00 . NOP FC90 00 . NOP FC91 05 . DEC B FC92 09 . ADD HL,BC FC93 05 . DEC B FC94 00 . NOP FC95 08 . EX AF,AF' FC96 10 10 .. DJNZ &FCA8 FC98 01 0D 80 ... LD BC,&800D FC9B 08 . EX AF,AF' FC9C 80 . ADD A,B FC9D B0 ° OR B FC9E FC 80 20 ü. CALL M,&2080 FCA1 FF . RST &38 ; Variables FCA2 00 . NOP ; Is code within the event handler? FCA3 00 . NOP FCA4 00 . NOP FCA5 D5 Õ PUSH DE FCA6 F5 õ PUSH AF FCA7 2A * DEFB &2A ; Variables FCA8 A8 FC ¨ü DEFW &FCA8 ; Current program start address FCAA 0A 00 .. DEFW &000A ; Temporary store FCAC B0 FC °ü DEFW &FCB0 ; Line pointer FCAE 00 . DEFB &00 ; Previous fx4 state FCAF 00 . DEFB &00 ; Reboot flag 0=CPM, <>0=Not CPM ; Input and error buffer FCB0 53 S LD D,E FCB1 41 A LD B,C FCB2 56 V LD D,(HL) FCB3 45 E LD B,L FCB4 20 5A Z JR NZ,&FD10 FCB6 20 46 F JR NZ,&FCFE FCB8 30 30 00 JR NC,&FCEA FCBA 30 2B 0+ JR NC,&FCE7 FCBC 31 30 30 100 LD SP,&3030 FCBF 30 0D 0. JR NC,&FCCE FCC1 CC 9F 37 Ì.7 CALL Z,&379F FCC4 EB ë EX DE,HL FCC5 22 A8 3C "¨< LD (&3CA8),HL FCC8 F1 ñ POP AF FCC9 D1 Ñ POP DE FCCA C9 É RET FCCB 7B { LD A,E FCCC E6 E0 æà AND &E0 FCCE 5F _ LD E,A FCCF CD ED 36 Íí6 CALL &36ED FCD2 7A z LD A,D FCD3 B3 ³ OR E FCD4 CA F8 36 Êø6 JP Z,&36F8 FCD7 13 . INC DE FCD8 13 . INC DE FCD9 13 . INC DE FCDA 13 . INC DE FCDB C9 É RET FCDC D5 Õ PUSH DE FCDD EB ë EX DE,HL FCDE 2A A0 3C * < LD HL,(&3CA0) FCE1 EB ë EX DE,HL FCE2 7D } LD A,L FCE3 E6 1F æ. AND &1F FCE5 C2 C0 37 ÂÀ7 JP NZ,&37C0 FCE8 7D } LD A,L FCE9 F6 04 ö. OR &04 FCEB 6F o LD L,A FCEC EB ë EX DE,HL FCED 19 . ADD HL,DE FCEE 7E ~ LD A,(HL) FCEF EB ë EX DE,HL FCF0 D1 Ñ POP DE FCF1 C9 É RET FCF2 CD B0 37 Í°7 CALL &37B0 FCF5 F5 õ PUSH AF FCF6 D5 Õ PUSH DE FCF7 EB ë EX DE,HL FCF8 7B { LD A,E FCF9 E6 1F æ. AND &1F FCFB FE 1F þ. CP &1F FCFD CA D5 37 ÊÕ7 JP Z,&37D5 FD00 13 . INC DE FD01 CC 9F 37 Ì.7 CALL Z,&379F FD04 EB ë EX DE,HL FD05 D1 Ñ POP DE FD06 F1 ñ POP AF FD07 C9 É RET FD08 EB ë EX DE,HL FD09 7B { LD A,E FD0A E6 E0 æà AND &E0 FD0C 5F _ LD E,A FD0D D5 Õ PUSH DE FD0E CD ED 36 Íí6 CALL &36ED FD11 7B { LD A,E FD12 B2 ² OR D FD13 C1 Á POP BC FD14 C8 È RET Z FD15 AF ¯ XOR A FD16 77 w LD (HL),A FD17 23 # INC HL FD18 77 w LD (HL),A FD19 2A A0 3C * < LD HL,(&3CA0) FD1C 19 . ADD HL,DE FD1D 73 s LD (HL),E FD1E 23 # INC HL FD1F 72 r LD (HL),D FD20 C5 Å PUSH BC FD21 CD D2 36 ÍÒ6 CALL &36D2 FD24 C1 Á POP BC FD25 2A A6 3C *¦< LD HL,(&3CA6) FD28 EB ë EX DE,HL FD29 CD E4 36 Íä6 CALL &36E4 FD2C 71 q LD (HL),C FD2D 23 # INC HL FD2E 70 p LD (HL),B FD2F C9 É RET FD30 4C L LD C,H FD31 05 . DEC B FD32 25 % DEC H FD33 10 E3 .ã DJNZ &FD18 FD35 C9 É RET FD36 FF . RST &38 FD37 F0 ð RET P FD38 03 . INC BC FD39 6C l LD L,H FD3A 03 . INC BC FD3B 25 % DEC H FD3C 86 . ADD A,(HL) FD3D 70 p LD (HL),B FD3E 84 . ADD A,H FD3F 71 q LD (HL),C FD40 85 . ADD A,L FD41 72 r LD (HL),D FD42 A0   AND B FD43 02 . LD (BC),A FD44 B1 ± OR C FD45 70 p LD (HL),B FD46 85 . ADD A,L FD47 74 t LD (HL),H FD48 C8 È RET Z FD49 B1 ± OR C FD4A 70 p LD (HL),B FD4B 85 . ADD A,L FD4C 75 u LD (HL),L FD4D 20 9C . JR NZ,&FCEB FD4F 25 % DEC H FD50 A0   AND B FD51 0C . INC C FD52 B1 ± OR C FD53 70 p LD (HL),B FD54 48 H LD C,B FD55 A5 ¥ AND L FD56 70 p LD (HL),B FD57 18 69 .i JR &FDC2 FD59 06 AA .ª LD B,&AA FD5B A9 © XOR C FD5C 00 . NOP FD5D 65 e LD H,L FD5E 71 q LD (HL),C FD5F A8 ¨ XOR B FD60 68 h LD L,B FD61 48 H LD C,B FD62 20 06 . JR NZ,&FD6A FD64 04 . INC B FD65 A0   AND B FD66 0A . LD A,(BC) FD67 B1 ± OR C FD68 70 p LD (HL),B FD69 AA ª XOR D FD6A C8 È RET Z FD6B B1 ± OR C FD6C 70 p LD (HL),B FD6D 85 . ADD A,L FD6E 76 v HALT FD6F D0 Ð RET NC FD70 03 . INC BC FD71 8A . ADC A,D FD72 F0 ð RET P FD73 4E N LD C,(HL) FD74 8A . ADC A,D FD75 F0 ð RET P FD76 02 . LD (BC),A FD77 E6 76 æv AND &76 FD79 68 h LD L,B FD7A 6A j LD L,D FD7B B0 ° OR B FD7C 28 20 ( JR Z,&FD9E FD7E 9B . SBC A,E FD7F 25 % DEC H FD80 20 9B . JR NZ,&FD1D FD82 25 % DEC H FD83 20 9B . JR NZ,&FD20 FD85 25 % DEC H FD86 A0   AND B FD87 00 . NOP FD88 AD ­ XOR L FD89 E5 å PUSH HL FD8A FE 91 þ. CP &91 FD8C 74 t LD (HL),H FD8D 20 9B . JR NZ,&FD2A FD8F 25 % DEC H FD90 20 9B . JR NZ,&FD2D FD92 25 % DEC H FD93 20 9B . JR NZ,&FD30 FD95 25 % DEC H FD96 E6 74 æt AND &74 FD98 D0 Ð RET NC FD99 02 . LD (BC),A FD9A E6 75 æu AND &75 FD9C CA D0 E9 ÊÐé JP Z,&E9D0 FD9F C6 76 Æv ADD A,&76 FDA1 D0 Ð RET NC FDA2 E5 å PUSH HL FDA3 F0 ð RET P FDA4 1D . DEC E FDA5 A0   AND B FDA6 00 . NOP FDA7 B1 ± OR C FDA8 74 t LD (HL),H FDA9 8D . ADC A,L FDAA E5 å PUSH HL FDAB FE 20 þ CP &20 FDAD 9B . SBC A,E FDAE 25 % DEC H FDAF 20 9B . JR NZ,&FD4C FDB1 25 % DEC H FDB2 20 9B . JR NZ,&FD4F FDB4 25 % DEC H FDB5 E6 74 æt AND &74 FDB7 D0 Ð RET NC FDB8 02 . LD (BC),A FDB9 E6 75 æu AND &75 FDBB CA D0 E9 ÊÐé JP Z,&E9D0 FDBE C6 76 Æv ADD A,&76 FDC0 D0 Ð RET NC FDC1 E5 å PUSH HL FDC2 20 A4 ¤ JR NZ,&FD68 FDC4 25 % DEC H FDC5 A6 ¦ AND (HL) FDC6 70 p LD (HL),B FDC7 A4 ¤ AND H FDC8 71 q LD (HL),C FDC9 A5 ¥ AND L FDCA 72 r LD (HL),D FDCB 60 ` LD H,B FDCC A9 © XOR C FDCD C7 Ç RST &00 FDCE 20 06 . JR NZ,&FDD6 FDD0 04 . INC B FDD1 90 . SUB A,B FDD2 F9 ù LD SP,HL FDD3 60 ` LD H,B FDD4 A9 © XOR C FDD5 87 . ADD A,A FDD6 20 06 . JR NZ,&FDDE FDD8 04 . INC B FDD9 60 ` LD H,B FDDA 00 . NOP FDDB 25 % DEC H FDDC 10 E3 .ã DJNZ &FDC1 ._TERM: ; Set/Read terminal destination FDDE FE 02 þ. CP &02 FDE0 30 22 0" JR NC,&FE04 FDE2 F5 õ PUSH AF FDE3 3A 81 FF :.. LD A,(&FF81) FDE6 E6 01 æ. AND &01 FDE8 32 AA FC 2ªü LD (&FCAA),A FDEB F1 ñ POP AF FDEC 32 81 FF 2.. LD (&FF81),A FDEF B7 · OR A FDF0 20 08 . JR NZ,&FDFA FDF2 21 71 F6 !qö LD HL,&F671 FDF5 22 9F FF ".. LD (&FF9F),HL FDF8 18 06 .. JR &FE00 FDFA 21 0D FE !.þ LD HL,&FE0D FDFD 22 9F FF ".. LD (&FF9F),HL FE00 3A AA FC :ªü LD A,(&FCAA) FE03 C9 É RET FE04 FE FF þ. CP &FF FE06 C0 À RET NZ FE07 3A 81 FF :.. LD A,(&FF81) FE0A E6 01 æ. AND &01 FE0C C9 É RET FE0D 4F O LD C,A FE0E 3A 81 FF :.. LD A,(&FF81) FE11 CB 7F Ë. BIT 7,A FE13 20 12 . JR NZ,&FE27 FE15 79 y LD A,C FE16 FE 1B þ. CP &1B FE18 28 04 (. JR Z,&FE1E FE1A CD 71 F6 Íqö CALL &F671 FE1D C9 É RET FE1E 3A 81 FF :.. LD A,(&FF81) FE21 CB FF Ë. SET 7,A FE23 32 81 FF 2.. LD (&FF81),A FE26 C9 É RET FE27 CB 77 Ëw BIT 6,A FE29 C2 A6 FE ¦þ JP NZ,&FEA6 FE2C CB 6F Ëo BIT 5,A FE2E C2 D9 FE ÂÙþ JP NZ,&FED9 FE31 79 y LD A,C FE32 FE 3D þ= CP &3D FE34 28 15 (. JR Z,&FE4B FE36 FE 3E þ> CP &3E FE38 28 1A (. JR Z,&FE54 FE3A FE 3F þ? CP &3F FE3C 28 1F (. JR Z,&FE5D FE3E FE 40 þ@ CP &40 FE40 28 3E (> JR Z,&FE80 FE42 3A 81 FF :.. LD A,(&FF81) FE45 CB BF Ë¿ RES 7,A FE47 32 81 FF 2.. LD (&FF81),A FE4A C9 É RET FE4B 3A 81 FF :.. LD A,(&FF81) FE4E CB F7 Ë÷ SET 6,A FE50 32 81 FF 2.. LD (&FF81),A FE53 C9 É RET FE54 3A 81 FF :.. LD A,(&FF81) FE57 CB EF Ëï SET 5,A FE59 32 81 FF 2.. LD (&FF81),A FE5C C9 É RET FE5D CD EC FE Íìþ CALL &FEEC FE60 28 08 (. JR Z,&FE6A FE62 FE 00 þ. CP &00 FE64 20 DC Ü JR NZ,&FE42 FE66 3E 1F >. LD A,&1F FE68 18 02 .. JR &FE6C FE6A 3E 18 >. LD A,&18 FE6C 32 18 FF 2.. LD (&FF18),A FE6F CD F5 FE Íõþ CALL &FEF5 FE72 06 10 .. LD B,&10 FE74 21 10 FF !.. LD HL,&FF10 FE77 7E ~ LD A,(HL) FE78 CD 71 F6 Íqö CALL &F671 FE7B 23 # INC HL FE7C 10 F9 .ù DJNZ &FE77 FE7E 18 C2 . JR &FE42 FE80 CD EC FE Íìþ CALL &FEEC FE83 28 04 (. JR Z,&FE89 FE85 FE 00 þ. CP &00 FE87 20 B9 ¹ JR NZ,&FE42 FE89 CD F5 FE Íõþ CALL &FEF5 FE8C 06 06 .. LD B,&06 FE8E 21 10 FF !.. LD HL,&FF10 FE91 7E ~ LD A,(HL) FE92 CD 71 F6 Íqö CALL &F671 FE95 23 # INC HL FE96 10 F9 .ù DJNZ &FE91 FE98 06 05 .. LD B,&05 FE9A 21 1B FF !.. LD HL,&FF1B FE9D 7E ~ LD A,(HL) FE9E CD 71 F6 Íqö CALL &F671 FEA1 23 # INC HL FEA2 10 F9 .ù DJNZ &FE9D FEA4 18 9C .. JR &FE42 FEA6 CB 67 Ëg BIT 4,A FEA8 20 0F . JR NZ,&FEB9 FEAA 79 y LD A,C FEAB D6 20 Ö SUB A,&20 FEAD 32 21 FF 2!. LD (&FF21),A FEB0 3A 81 FF :.. LD A,(&FF81) FEB3 CB E7 Ëç SET 4,A FEB5 32 81 FF 2.. LD (&FF81),A FEB8 C9 É RET FEB9 79 y LD A,C FEBA D6 20 Ö SUB A,&20 FEBC 32 20 FF 2 . LD (&FF20),A FEBF 3E 1F >. LD A,&1F FEC1 CD 71 F6 Íqö CALL &F671 FEC4 3A 20 FF : . LD A,(&FF20) FEC7 CD 71 F6 Íqö CALL &F671 FECA 3A 21 FF :!. LD A,(&FF21) FECD CD 71 F6 Íqö CALL &F671 FED0 3A 81 FF :.. LD A,(&FF81) FED3 E6 01 æ. AND &01 FED5 32 81 FF 2.. LD (&FF81),A FED8 C9 É RET FED9 79 y LD A,C FEDA B7 · OR A FEDB 28 06 (. JR Z,&FEE3 FEDD D6 20 Ö SUB A,&20 FEDF CD 71 F6 Íqö CALL &F671 FEE2 C9 É RET FEE3 3A 81 FF :.. LD A,(&FF81) FEE6 E6 01 æ. AND &01 FEE8 32 81 FF 2.. LD (&FF81),A FEEB C9 É RET FEEC 3E 87 >. LD A,&87 FEEE CD 8E F8 Í.ø CALL osBYTE FEF1 7C | LD A,H FEF2 FE 03 þ. CP &03 FEF4 C9 É RET FEF5 3E 86 >. LD A,&86 FEF7 CD 8E F8 Í.ø CALL osBYTE FEFA 7D } LD A,L FEFB 32 11 FF 2.. LD (&FF11),A FEFE 32 1E FF 2.. LD (&FF1E),A FF01 7C | LD A,H FF02 32 12 FF 2.. LD (&FF12),A FF05 32 14 FF 2.. LD (&FF14),A FF08 32 1F FF 2.. LD (&FF1F),A FF0B 3C < INC A FF0C 32 1A FF 2.. LD (&FF1A),A FF0F C9 É RET FF10 1C . INC E FF11 C4 48 4F ÄHO CALL NZ,&4F48 FF14 C1 Á POP BC FF15 0C . INC C FF16 1C . INC E FF17 00 . NOP FF18 1F . RRA FF19 4F O LD C,A FF1A 48 H LD C,B FF1B 0C . INC C FF1C 1A . LD A,(DE) FF1D 1F . RRA FF1E 22 28 00 "(. LD (&0028),HL FF21 00 . NOP FF22 6B k LD L,E FF23 17 . RLA FF24 2A 28 3B *(; LD HL,(&3B28) FF27 36 00 6. LD (HL),&00 FF29 21 2A 3B !*; LD HL,&3B2A FF2C C3 77 19 Ãw. JP &1977 FF2F C5 Å PUSH BC FF30 E5 å PUSH HL FF31 7E ~ LD A,(HL) FF32 E6 03 æ. AND &03 FF34 47 G LD B,A FF35 0E 06 .. LD C,&06 FF37 23 # INC HL FF38 5E ^ LD E,(HL) FF39 23 # INC HL FF3A 56 V LD D,(HL) FF3B CD 48 1A ÍH. CALL &1A48 FF3E E1 á POP HL FF3F C1 Á POP BC FF40 C9 É RET FF41 53 S LD D,E FF42 00 . NOP FF43 00 . NOP FF44 00 . NOP FF45 00 . NOP FF46 00 . NOP FF47 02 . LD (BC),A FF48 00 . NOP FF49 00 . NOP FF4A 00 . NOP FF4B 00 . NOP FF4C 0A . LD A,(BC) FF4D 00 . NOP FF4E 00 . NOP FF4F 00 . NOP FF50 00 . NOP FF51 00 . NOP FF52 90 . SUB A,B FF53 FB û EI FF54 93 . SUB A,E FF55 02 . LD (BC),A FF56 C1 Á POP BC FF57 FC AC FB ü¬û CALL M,&FBAC FF5A 53 S LD D,E FF5B 00 . NOP FF5C 7C | LD A,H FF5D 7F . LD A,A FF5E 8C . ADC A,H FF5F FA 00 00 ú.. JP M,&0000 FF62 00 . NOP FF63 00 . NOP FF64 00 . NOP FF65 00 . NOP FF66 00 . NOP FF67 00 . NOP FF68 00 . NOP FF69 00 . NOP FF6A 04 . INC B FF6B 00 . NOP FF6C 3C < INC A FF6D F9 ù LD SP,HL FF6E 04 . INC B FF6F 00 . NOP FF70 7C | LD A,H FF71 7F . LD A,A FF72 C1 Á POP BC FF73 FC 9C F6 ü.ö CALL M,&F69C FF76 D7 × RST &10 FF77 F7 ÷ RST &30 FF78 DC FD 00 Üý. CALL C,&00FD FF7B 00 . NOP FF7C 54 T LD D,H FF7D 00 . NOP FF7E F5 õ PUSH AF FF7F F2 ò DEFB &F2 ESCFLG: &FF80 DEFB &00 ; Escape flag - bit 7 is set on escape. TERMFLG: &FF81 DEFB &00 ; TERM flag. FAULT: &FF82 DEFW &0100 ; Fault pointer. DEF_ERR: &FF84 DEFW &FAB2 ; Address of default error handler. FF86 02 . LD (BC),A FF87 14 . INC D FF88 95 . SUB A,L FF89 00 . NOP FF8A 01 00 00 ... LD BC,&0000 FF8D 3C < INC A FF8E 1A . LD A,(DE) FF8F FF . RST &38 FF90 FF . RST &38 FF91 01 00 00 ... LD BC,&0000 FF94 00 . NOP FF95 00 . NOP FF96 00 . NOP FF97 00 . NOP FF98 00 . NOP FF99 00 . NOP FF9A 74 t LD (HL),H FF9B 4C L LD C,H FF9C D6 5E Ö^ SUB A,&5E PR_OUT: FF9E C3 71 F6 Ãqö JP &F671 INIT_FF: FFA1 C3 AE F5 îõ JP &F5AE MOSW_7F: FFA4 C3 5C F5 Ã\õ JP &F55C LD_CCP: FFA7 C3 3B F5 Ã;õ JP &F53B PR_HEX: FFAA C3 76 F4 Ãvô JP &F476 PR2HEX: FFAD C3 71 F4 Ãqô JP &F471 USR_INT: FFB0 C3 FD FA Ãýú JP &FAFD PR_TEXT: FFB3 C3 0E F6 Ã.ö JP &F60E PRINT_C: FFB6 C3 0E FE Ã.þ JP &FE0E CLI_COM: FFB9 C3 CE F2 ÃÎò JP &F2CE RST_38: FFBC C3 A4 FA äú JP &FAA4 INIT_ERR: FFBF C3 5E F6 Ã^ö JP &F65E SEEK_0: FFC2 C3 1B F6 Ã.ö JP &F61B KBD_TST: FFC5 C3 3F F6 Ã?ö JP &F63F TERM: FFC8 C3 DE FD ÃÞý JP &FDDE OSWRD2: FFCB C3 E8 F8 Ãèø JP &F8E8 OSFIND: FFCE C3 D2 F9 ÃÒù JP &F9D2 OSGBPB: FFD1 C3 4E FA ÃNú JP &FA4E OSBGET: FFD4 C3 FC F9 Ãüù JP &F9FC OSBPUT: FFD7 C3 F0 F9 Ãðù JP &F9F0 OSARGS: FFDA C3 9F F9 Ã.ù JP &F99F OSFILE: FFDD C3 10 FA Ã.ú JP &FA10 OSRDCH: FFE0 C3 90 F6 Ã.ö JP &F690 OSASCI: FFE3 FE 0D þ. CP &0D FFE5 20 07 . JR NZ,&FFEE :\ OSWRCH OSNEWL: FFE7 3E 0A >. LD A,&0A FFE9 CD EE FF Íî. CALL &FFEE :\ OSWRCH OSWRCR: FFEC 3E 0D >. LD A,&0D OSWRCH: FFEE C3 71 F6 Ãqö JP &F671 OSWORD: FFF1 C3 EF F8 Ãïø JP osWORD OSBYTE: FFF4 C3 8E F8 Ã.ø JP osBYTE OSCLI: FFF7 C3 B7 F6 ÷ö JP osCLI BRKV: FFFA AC FA ¬ú DEFW &FAAC ; Error vector EVENTV: FFFC 70 F6 pö DEFW &F670 ; Event vector INTV: FFFE 82 FA .ú DEFW &FA82 ; Interrupt vector