SN8P2604
8-Bit Micro-Controller
SONiX TECHNOLOGY CO., LTD
Page 94
Version 1.1
11.3 INTERRUPT VECTOR (ORG 8)
When one of interrupt requests occurs, system will jump to interrupt vector and execute interrupt service routine. The
first instruction of interrupt vector (ORG 8) must be “JMP” or “NOP”. The SN8ASM199L and later version compilers
alerts the message if the interrupt vector first instruction is not “JMP” or “NOP”.
Example: The interrupt service routine is following ORG 8.
.CODE
ORG 0
;
0000H
JMP
START
; Jump to user program address.
…
ORG 8
; Interrupt service routine
NOP
; The first instruction at ORG 8.
…
RETI
; End of interrupt service routine
…
START:
; The head of user program.
…
; User program
…
JMP
START
; End of user program
…
ENDP
; End of program
Example: The interrupt service routine is following user program.
.CODE
ORG
0
;
0000H
JMP
START
; Jump to user program address.
…
ORG
08
JMP
MY_IRQ
; 0008H, Jump to interrupt service routine address.
ORG
10H
START:
; 0010H, The head of user program.
…
; User program.
…
…
JMP
START
; End of user program.
…
MY_IRQ:
;The head of interrupt service routine.
…
RETI
; End of interrupt service routine.
…
ENDP
; End of program.