Datasheet

9.0 Interrupts (Continued)
Programming Example: External Interrupt
PSW =00EF
CNTRL =00EE
RBIT 0,PORTGC
RBIT 0,PORTGD ; G0 pin configured Hi-Z
SBIT IEDG, CNTRL ; Ext interrupt polarity; falling edge
SBIT GIE, PSW ; Set the GIE bit
SBIT EXEN, PSW ; Enable the external interrupt
WAIT: JP WAIT ; Wait for external interrupt
.
.
.
.=0FF ; The interrupt causes a
VIS ; branch to address 0FF
;The VIS causes a branch to
;interrupt vector table
.
.
.
.=01FA ; Vector table (within 256 byte
.ADDRW SERVICE ; of VIS inst.) containing the ext
;interrupt service routine
.
.
.
SERVICE: ; Interrupt Service Routine
RBIT, EXPND, PSW ; Reset ext interrupt pend. bit
.
.
.
RET ; Return, set the GIE bit
COP8SA Family
www.national.com 32