Tuesday, March 10, 2009

Interrupts!

Time to quit for the night. I now have interrupts working as expected. The following small program runs fine:

.ORG $1000
; initial IRQ/BRK interrupt vector to handler 1
LDA #$00
STA $FFFE
LDA #$04
STA $FFFF

; Nestled loop, 16*16
LDY #$10
LDX #$10
DEX
BNE #-3
BRK
NOP
DEY
BNE #-10

; Set interrupt vector to handler 2
LDA #$00
STA $FFFE
LDA #$05
STA $FFFF

BRK

.ORG $0400
; interrupt handler 1
NOP
NOP
NOP
RTI

.ORG $0500
; interrupt handler 2 - loop forever
JMP $0500

I really need an assembler for my small programs. It is pretty painful to assembler them by hand. I also need to add more testing of my opcodes. Guess this might be the time for me to learn unit testing.

No comments:

Post a Comment