mirror of
https://github.com/catseye/SixtyPical.git
synced 2024-09-30 14:57:03 +00:00
Wow, we have an interrupt handler. Well, a cinv. Good enough!
This commit is contained in:
parent
c441f96921
commit
cb0fe91a8a
@ -559,4 +559,28 @@ Installing an interrupt handler (at the Kernal level, i.e. with CINV)
|
|||||||
| inc screen
|
| inc screen
|
||||||
| jmp save_cinv
|
| jmp save_cinv
|
||||||
| }
|
| }
|
||||||
= story checks out
|
= .org 0
|
||||||
|
= .word $0801
|
||||||
|
= .org $0801
|
||||||
|
= .byte $10, $08, $c9, $07, $9e, $32, $30, $36, $31, $00, $00, $00
|
||||||
|
= jmp main
|
||||||
|
= .alias screen 1024
|
||||||
|
= .alias cinv 788
|
||||||
|
= save_cinv: .word 0
|
||||||
|
= main:
|
||||||
|
= sei
|
||||||
|
= lda cinv
|
||||||
|
= sta save_cinv
|
||||||
|
= lda cinv+1
|
||||||
|
= sta save_cinv+1
|
||||||
|
= lda #<our_cinv
|
||||||
|
= sta cinv
|
||||||
|
= lda #>our_cinv
|
||||||
|
= sta cinv+1
|
||||||
|
= cli
|
||||||
|
= rts
|
||||||
|
=
|
||||||
|
= our_cinv:
|
||||||
|
= inc screen
|
||||||
|
= jmp (save_cinv)
|
||||||
|
= rts
|
||||||
|
15
eg/cinv.60pical
Normal file
15
eg/cinv.60pical
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
assign byte screen 1024
|
||||||
|
assign vector cinv 788
|
||||||
|
reserve vector save_cinv
|
||||||
|
|
||||||
|
routine main {
|
||||||
|
sei {
|
||||||
|
copy vector cinv to save_cinv
|
||||||
|
copy routine our_cinv to cinv
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
routine our_cinv {
|
||||||
|
inc screen
|
||||||
|
jmp save_cinv
|
||||||
|
}
|
@ -92,10 +92,16 @@ emitInstr p r (SEI blk) =
|
|||||||
" cli"
|
" cli"
|
||||||
|
|
||||||
emitInstr p r (COPYVECTOR (NamedLocation src) (NamedLocation dst)) =
|
emitInstr p r (COPYVECTOR (NamedLocation src) (NamedLocation dst)) =
|
||||||
"COPYVECTOR " ++ src ++ " " ++ dst
|
"lda " ++ src ++ "\n" ++
|
||||||
|
" sta " ++ dst ++ "\n" ++
|
||||||
|
" lda " ++ src ++ "+1\n" ++
|
||||||
|
" sta " ++ dst ++ "+1"
|
||||||
|
|
||||||
emitInstr p r (COPYROUTINE src (NamedLocation dst)) =
|
emitInstr p r (COPYROUTINE src (NamedLocation dst)) =
|
||||||
"COPYROUTINE " ++ src ++ " " ++ dst
|
"lda #<" ++ src ++ "\n" ++
|
||||||
|
" sta " ++ dst ++ "\n" ++
|
||||||
|
" lda #>" ++ src ++ "\n" ++
|
||||||
|
" sta " ++ dst ++ "+1"
|
||||||
|
|
||||||
emitInstr p r (JMPVECTOR (NamedLocation dst)) =
|
emitInstr p r (JMPVECTOR (NamedLocation dst)) =
|
||||||
"jmp (" ++ dst ++ ")"
|
"jmp (" ++ dst ++ ")"
|
||||||
|
Loading…
Reference in New Issue
Block a user