157
6.9 Sample Programs for Interrupt Processing
NOP
RETI
;Return from interrupt
CODE
ENDS
;--------Vector setting---------------------------------------------
VECT
CSEGABS=0FFH
ORG
0FF98H
;Sets vector for interrupt #25 (19H).
DSL
ED_INT1
ORG
0FFDCH
;Sets reset vector.
DSL
START
DB
00H
;Sets single-chip mode.
VECT
ENDS
END
START
s Processing Specifications of Sample Program for Extended Intelligent I/O Service (EI2OS)
r Processing Specifications
1. This program detects the H level signal input to the INT0 pin and activates the extended
intelligent I/O service (EI2OS).
2. When the H level is input to the INT0 pin, El2OS is activated. Data is transferred from port 0
to the memory at the 3000H address.
3. The number of transfer data bytes is 100 bytes. After 100 bytes are transferred, an interrupt
is generated because EI2OS transfer has terminated.
r Sample coding
DDR1
EQU
000011H
;Port 1-direction register
ENIR
EQU
000030H
;DTP/interrupt permission register
EIRR
EQU
000031H
;DTP/interrupt cause register
ELVR
EQU
000032H
;Request level setting register
ICR00
EQU
0000B0H
;Interrupt control register 00
BAPL
EQU
000100H
;Lower buffer address pointer
BAPM
EQU
000101H
;Middle buffer address pointer
BAPH
EQU
000102H
;Upper buffer address pointer
ISCS
EQU
000103H
;EI2OS status
I/OAL
EQU
000104H
;Lower I/O address pointer
I/OAH
EQU
000105H
;Upper I/O address pointer
DCTL
EQU
000106H
;Low-order data counter
DCTH
EQU
000107H
;High-order data counter
ER0
EQU
EIRR:0
;Definition of external interrupt
request flag bit
STACK
SSEG
;Stack
RW
100
STACK_T RW
1
STACK
ENDS
;-------------------Main program------------------------------------
CODE
CSEG
START:
AND
CCR, #0BFH
;Clears the I flag of the CCR in the
PS and prohibits interrupts.
MOV
RP, #00
;Sets the register bank pointer.
MOV
A, #!STACK_T
;Sets the system stack.
MOV
SSB, A