Permalink
Browse files

IRQ test with MIDI input added.

  • Loading branch information...
1 parent e5760f9 commit 802e3572da31320b127111bdd43f047735a352b9 @dcliche committed Dec 25, 2011
Showing with 88 additions and 0 deletions.
  1. +11 −0 src/irqtest/Makefile
  2. +77 −0 src/irqtest/irqtest.asm
View
@@ -0,0 +1,11 @@
+AS=../../tools/bin/as09
+
+.PHONY: all
+
+all: irqtest.s19
+
+irqtest.s19: irqtest.asm
+ ${AS} $<
+
+clean:
+ rm -f *.s19
@@ -0,0 +1,77 @@
+* 6809
+* IRQ Test
+*
+ NAM IRQTEST
+ OPT l
+ PAGE
+
+VDU EQU $E030
+MACIA EQU $E010
+
+IRQ EQU $7FC8
+
+
+ ORG $0F00
+STACK EQU *
+CURX RMB 1
+CURY RMB 1
+
+ ORG $1000
+ LDS #STACK
+
+ LDA #0
+ STA CURX
+ STA CURY
+ BSR MOVECUR
+
+* We set the interrupt handler
+
+ LDX #IRQ
+ LDD #IRQH
+ STD ,X
+
+* We configure the MIDI ACIA
+
+ LDX #MACIA
+ LDA #$D5
+ STA ,X
+
+* We enable the interrupts
+ ANDCC #$EF
+ BRA *
+
+IRQH LDY #MACIA
+ LDA 0,Y
+ BITA #$80
+ BEQ IRQH1
+ LDX #MSG
+ BSR PRINTS
+ LDA 1,Y
+IRQH1 RTI
+
+MOVECUR PSHS A,Y
+ LDY #VDU
+ LDA CURX
+ STA 2,Y
+ LDA CURY
+ STA 3,Y
+ PULS A,Y
+ RTS
+
+PRINTS PSHS A,Y
+ LDY #VDU
+PRINTS0 LDA ,X+
+ CMPA #0
+ BEQ PRINTS1
+ STA ,Y
+ LDA CURX
+ INCA
+ STA 2,Y
+ STA CURX
+ JMP PRINTS0
+PRINTS1 PULS A,Y
+ RTS
+
+MSG FCC '[IRQ]'
+ FCB 0
+ END

0 comments on commit 802e357

Please sign in to comment.