FUZER EQU #1A
KARLAP EQU #66
KEYCSAT EQU #69
SPECIAL EQU #0B
EXOS MACRO @P
 RST 30H
 DEFB @P
 ENDM
SZET MACRO @VSZAM @ERTEK
 LD B,1
 LD C,@VSZAM
 LD D,@ERTEK
 EXOS #10
 ENDM
OPEN MACRO @CSAT,@STRING
 LD A,@CSAT
 LD DE,@STRING
 EXOS 1
 ENDM
GETCHAR MACRO @CSAT
 LD A,@CSAT
 EXOS 5
 ENDM
BLKOUT MACRO @CSAT,@PUFF,@HOSSZ
 LD A,@CSAT
 LD DE,@PUFF
 LD BC,@HOSSZ
 EXOS 8
 ENDM
L000C EQU #000C
L0015 EQU #0015
L0017 EQU #0017
L0023 EQU #0023
L002F EQU #002F
L0038 EQU #0038
L0056 EQU #0056
L005A EQU #005A
L0079 EQU #0079
L0138 EQU #0138
 LD SP,UJSTACK
 EI 
 JR KEZD
IRQ BIT 5,D
 RET Z 
 LD A,#00 
 LD (L0056),A 
 LD A,#C9 
 LD (L0038),A 
 CALL CSIKOK
 LD A,#F5 
 LD (L0038),A 
 LD A,#B7 
 LD (L0056),A 
 RET 
KEZD SZET #16 0
 SZET #17,0
 SZET #18,#26
 SZET #19,#82
 SZET #4F,#B9
 OPEN KARLAP,VIDEO
 SZET #16,1
 SZET #17,2
 SZET #18,#2A
 SZET #19,3
 OPEN 1,VIDEO
 OPEN KEYCSAT,KEYBOARD
 SZET 6,0
 SZET 10,2
 SZET 11,10
 SZET #1A,0
 SZET 4,KARLAP
 LD A,#01 
 LD B,#01 
 LD C,#01 
 LD D,#03 
 LD E,#01 
 EXOS SPECIAL
 LD A,#FF 
 OUT (#B2),A 
 LD HL,LB900 
 LD DE,L0015 
 ADD HL,DE 
 CALL L02BA 
 CALL CSIKOK
 LD DE,(L02D7) 
 LD HL,L0493 
 LD B,#1B 
LLL1 PUSH BC
 LD A,(HL)
 LD B,#54
LLL2 LD (DE),A
 INC DE 
 DJNZ LLL2
 POP BC 
 INC HL 
 DJNZ LLL1
 BLKOUT 1,L0436,L005A
 LD HL,L04AE 
 LD DE,LBEBD 
 LD BC,L0023 
 LDIR 
L01ED BLKOUT KARLAP,L0490,3
 LD A,KARLAP
 LD B,#01 
 LD C,#01 
 LD D,#18 
 LD E,#04 
 EXOS SPECIAL
 LD B,#01 
 SZET #20,#14
 CALL IRQKI
 LD DE,DIR
 EXOS FUZER
 CALL IRQBE
 BLKOUT KARLAP,L02D3,2
 GETCHAR KARLAP
 LD A,B 
 CP #26 
 JR NC,L022B 
 LD A,#26 
L022B LD B,#25 
 SUB B 
 LD (L02D5),A 
 GETCHAR 1
 CALL L02AB 
 CALL L0290 
KEYCIK EI
 GETCHAR KEYCSAT
 EI 
 LD A,B 
 CP #0D 
 JP Z,STARTOL
 CP #20 
 JP Z,STARTOL
 CP #B0 
 JR Z,L0267 
 CP #B4 
 JR Z,L027A 
 CP #B1 
 JR Z,JOYUP
 CP #B5 
 JR Z,JOYDOWN
 CP #1B 
 JP Z,ESCAPE
 CP #64 
 JR Z,L01ED 
 JR KEYCIK
L0267 CALL L026C 
 JR KEYCIK
L026C LD A,(L02D6) 
 CP #02 
 RET C 
 DEC A 
L0273 CALL L029C 
 CALL L02AB 
 RET 
L027A CALL L027F 
 JR KEYCIK
L027F LD A,(L02D5) 
 LD B,A 
 LD A,(L02D6) 
 CP B 
 RET NC 
 INC A 
 JR L0273 
JOYUP CALL L0290
 JR KEYCIK
L0290 LD A,#01 
 JR L0273 
JOYDOWN LD A,(L02D5)
 CALL L0273 
 JR KEYCIK
L029C LD (L02D6),A 
 LD B,#01 
 LD C,A 
 LD A,KARLAP
 LD D,#18 
 LD E,#04 
 EXOS SPECIAL
 RET 
L02AB LD HL,LB900 
 LD DE,L0079 
 ADD HL,DE 
 LD (HL),#0C 
 DEC HL 
 LD (HL),#F6 
 DEC HL 
 DEC HL 
 DEC HL 
L02BA LD A,(HL) 
 DEC HL 
 PUSH AF 
 RLCA 
 RLCA 
 OR #FC 
 OUT (#B1),A 
 POP AF 
 AND #3F 
 OR #40 
 LD (L02D8),A 
 LD A,(HL) 
 LD (L02D7),A 
 LD HL,(L02D7) 
 RET 
L02D3 DEFB #1B,#3F 
L02D5 DEFB #00 
L02D6 DEFB #00 
L02D7 DEFB #00 
L02D8 DEFB #00 
CSIKOK BLKOUT 1,CSPUFFER,10
 LD A,(L0339) 
 LD HL,L0338 
 LD DE,L0339 
 LD BC,L0017 
 LDDR 
 LD (L0322),A 
 LD DE,L0138
 XOR A 
 LD HL,(L035A) 
 INC HL 
 LD (L035A),HL 
 SBC HL,DE 
 RET NZ 
 LD HL,0
 LD (L035A),HL 
 LD B,#10 
L030A PUSH BC 
 LD A,(L0359) 
 LD HL,L0358 
 LD DE,L0359 
 LD BC,L002F 
 LDDR 
 LD (L032A),A 
 POP BC 
 DJNZ L030A 
 RET 
CSPUFFER DEFB #1B,#43
L0322 DEFS 8
L032A DEFB #28,#68,#A1 
 DEFB #71,#B9,#6B 
 DEFB #EB,#FB,#FB 
 DEFB #EB,#6B,#B9 
 DEFB #71,#A1 
L0338 DEFB #68 
L0339 DEFB #28,#10,#90 
 DEFB #02,#82,#12 
 DEFB #5A,#13,#53 
 DEFB #53,#13,#5A 
 DEFB #12,#82,#02 
 DEFB #90,#10,#04 
 DEFB #14,#94,#06 
 DEFB #A6,#FE,#B7 
 DEFB #F7,#F7,#B7 
 DEFB #FE,#A6,#06 
 DEFB #94 
L0358 DEFB #14 
L0359 DEFB #04 
L035A DEFB #00,#00 
IRQBE LD HL,IRQ
 JR IRQKAP
IRQKI LD HL,0
IRQKAP DI
 LD (0BFEDH),HL
 EI 
 RET 
STARTOL LD HL,(L02D7)
 LD DE,MPUFF
 LD BC,12
 LDIR 
ESCAPE XOR A
 LD B,12
 LD HL,L040D 
 LD DE,L041D 
TOROL LD (HL),A
 LD (DE),A 
 INC HL 
 INC DE 
 DJNZ TOROL
 LD HL,MPUFF
 LD DE,L040D 
 LD B,#09 
ELLEN LD A,(HL)
 CP #20 
 JR Z,SZVEGE
 LD (DE),A 
 INC HL 
 INC DE 
 DJNZ ELLEN
SZVEGE LD A,(L0404)
 CP #20 
 JR Z,NEMKIT
 LD A,"."
 LD (DE),A 
 INC DE 
 LD HL,L0404 
 LD BC,3
 LDIR 
NEMKIT LD HL,L040D
 LD DE,L041D 
 LD BC,12
 LDIR 
 CALL IRQKI
 LD DE,LOAD
 EXOS FUZER
 LD DE,LOAD
 EXOS FUZER
 AND A
 JP Z,L01ED 
 LD DE,BRD
 EXOS FUZER
 LD DE,BASIC
 EXOS FUZER
 LD DE,WP
 EXOS FUZER
EDITOR DEFB #07
 DEFM "EDITOR"
VIDEO DEFB 6
 DEFM "VIDEO:"
KEYBOARD DEFB 9
 DEFM "KEYBOARD:"
DIR DEFB #03
 DEFM "DIR"
MPUFF DEFS 9
L0404 DEFS 3
LOAD DEFB 17
 DEFM "LOAD "
L040D DEFS 12
CHDIR DEFB 15
 DEFM "CD "
L041D DEFS 12
BRD DEFB 3
 DEFM "BRD"
BASIC DEFB 5
 DEFM "BASIC"
WP DEFB 2
 DEFM "WP"
L0436 DEFB #1B,#49,#08 
 DEFB #1B,#41,#D0 
 DEFB #00,#4C,#00 
 DEFB #1B,#73,#1B 
 DEFB #49,#08,#50 
 DEFB #52,#4F,#47 
 DEFB #52,#41,#4D 
 DEFB #20,#4C,#4F 
 DEFB #41,#44,#45 
 DEFB #52,#1B,#49 
 DEFB #08,#1B,#41 
 DEFB #D8,#00,#50 
 DEFB #00,#1B,#49 
 DEFB #0A,#50,#1B 
 DEFB #49,#0B,#52 
 DEFB #1B,#49,#0C 
 DEFB #4F,#1B,#49 
 DEFB #0D,#47,#1B 
 DEFB #49,#0E,#52 
 DEFB #1B,#49,#0F 
 DEFB #41,#1B,#49 
 DEFB #09,#4D,#20 
 DEFB #1B,#49,#0A 
 DEFB #4C,#1B,#49 
 DEFB #0B,#4F,#1B 
 DEFB #49,#0C,#41 
 DEFB #1B,#49,#0D 
 DEFB #44,#1B,#49 
 DEFB #0E,#45,#1B 
 DEFB #49,#0F,#52 
L0490 DEFB #1A,#1B,#6F 
L0493 DEFB #00,#00,#C0 
 DEFB #C0,#0C,#0C 
 DEFB #CC,#CC,#30 
 DEFB #30,#F0,#F0 
 DEFB #3C,#FC,#3C 
 DEFB #F0,#F0,#30 
 DEFB #30,#CC,#CC 
 DEFB #0C,#0C,#C0 
 DEFB #C0,#00,#00 
L04AE DEFB #3C,#45,#53 
 DEFB #43,#3E,#2D 
 DEFB #51,#55,#49 
 DEFB #54,#20,#20 
 DEFB #3C,#44,#3E 
 DEFB #2D,#44,#49 
 DEFB #52,#20,#20 
 DEFB #20,#20,#20 
 DEFB #20,#20,#80 
 DEFB #20,#B1,#B9 
 DEFB #B9,#B1,#20 
 DEFB #D0,#C7 
UJSTACK EQU $+40
LB900 EQU #B900
LBEBD EQU #BEBD
LBFED EQU #BFED
