#include "c:\miniide\hcs12.inc" org $1000 count ds.b 1 ; reserve one byte for count org $1500 lds #$1500 ; set up the stack pointer clr count movb #$FF,ddrb ; configure port B for output movb count,portb ; display the count value on LEDs movb #$C0,irqcr ; enable IRQ pin interrupt and select edge-triggering cli ; " forever nop bra forever ; wait for IRQ pin interrupt irq_isr inc count ; increment count movb count,portb ; and display it rti org UserIRQ ; establish IRQ interrupt vector entry fdb irq_isr end