II-16
EPSON
S1C6S3N2 TECHNICAL SOFTWARE
CHAPTER 4: INTERRUPT AND HALT
Example of Main Routine: Entering HALT
and waiting for reactivation by interrupt
This main routine enables K00–K03 input interrupt and 2
Hz timer interrupt, after which it enters the HALT status to
wait for reactivation by interrupts.
At every loop, the EI instruction enables an interrupt after
execution of the display routine "DS" (of the watch or what-
ever the application happens to be).
LD
X,75H
;
Enable K00–K03 input interrupt
LD
MX,1111B
;
LD
X,78H
;
Enable 2 Hz timer interrupt
LD
MX,0100B
;
;
MAINLP:
CALL
DS
;
Execute display processing "DS"
EI
;
Enable interrupts
HALT
;
Enter HALT
JP
MAINLP
;
Interrupts' return address: Back to "MAINLP"
This routine assumes that "DS" has been prepared sepa-
rately.
1. This program example is one to follow the initialize
program. Even without executing the DI instruction,
writing to interrupt mask registers is done in the DI
status.
2. When an interrupt is generated, the DI status (interrupt
flag = "0") comes into effect automatically, so the EI
instruction is necessary for each loop.
4.3
Specifications
Program
Notes
Содержание S1C6S3N2
Страница 4: ......
Страница 6: ......
Страница 7: ...Hardware Hardware S1C6S3N2 I Technical Hardware ...
Страница 8: ......
Страница 141: ...Software Software S1C6S3N2 II Technical Software ...
Страница 142: ......
Страница 146: ......