*----------------------------------------------------------- * Written by : Chuck Kelly * Date Created : Nov-10-2005 * Description : IRQ from user mode * Toggles the corresponding LED on/off when IRQ occurs. * Make sure "Enable Exceptions" is checked in the simulator Options menu. *----------------------------------------------------------- ORG $1000 start ; Initialize IRQ vectors move.l #irq1,$64 move.l #irq2,$68 move.l #irq3,$6C move.l #irq4,$70 move.l #irq5,$74 move.l #irq6,$78 move.l #irq7,$7C move.b #32,d0 ;get address of LEDs in D1.L move.b #2,d1 ; " trap #15 ; " move.l d1,A1 ; put LED address in A1 move.b #32,d0 ;display hardware window move.b #0,d1 ; " trap #15 ; " andi.w #$00,SR ;put CPU in User mode loop nop nop nop bra loop * IRQ handlers irq1 eori.b #$02,(a1) ; toggle LED rte irq2 eori.b #$04,(a1) rte irq3 eori.b #$08,(a1) rte irq4 eori.b #$10,(a1) rte irq5 eori.b #$20,(a1) rte irq6 eori.b #$40,(a1) rte irq7 eori.b #$80,(a1) rte END START *~Font name~Courier New~ *~Font size~18~ *~Tab type~1~ *~Tab size~4~