After I found a very simple c64 interrupt routine here:
http://xabreman.wordpress.com/2011/0...rrupt-example/
I thought that I can do this too, so by adding some new routines into the Pascal language & their support framework (parsing + code generation), I can now actually do this very same interrupt routine using compiled Pascal routines:
which produces this:Code:program Test; procedure irqtest; interrupt; begin IncMemB($d020); StdIRQ; end; procedure Init; begin SetInterrupt(irqtest); end; begin Init; end.
and when run in the c64 VICE emulator, it hooks the interrupt routine into the interrupt vector and merrily runs in the background incrementing the background colour!Code::BasicUpstart2(main) // 10 sys <start address> .import source "rtl\Macros_RTL.asm" .import source "rtl\Consts_RTL.asm" int_irqtest: inc $d020 jmp STDIRQ rti proc_init: sei // disable interrupts // set a custom interrupt routine address to interrupt vector lda #<int_irqtest // low byte of irqtest start addr ldx #>int_irqtest // high byte of irqtest start addr sta IRQVECLO stx IRQVECHI cli // clear interrupt disable bit rts main: jsr proc_init rts
Now this is progress!! haha
cheers,
Paul
Bookmarks