asm
org $0000
boot:
di
im 1
ld sp,$dff0
jp main

pause:
push af
ld a,$ff
ld ($C000),a
pop af
retn

org $0038
push af 
in a,($bf) 
pop af 
ei 
reti

org $0066
jp pause

org $0070
main:
ld sp,$87FF

end asm

q1:
poke $A000,peek($C000)
poke $A001,peek($C001)
poke $A002,peek($C002)
poke $A003,peek($C003)
poke $A004,peek($C004)
poke $A005,peek($C005)
poke $A006,peek($C006)
poke $A007,peek($C007)

'if peek($E000)<>0 then
'  poke $E000,0
'  poke $A000+($400*(peek($E004)band 3)),peek($E006)
'  end if

goto q1


