KS57C2308/P2308/C2316/P2316
ADDRESS SPACES
2-3
+
+
PROGRAMMING TIP — Defining Vectored Interrupts
The following examples show you several ways you can define the vectored interrupt and instruction reference
areas in program memory:
1.
When all vector interrupts are used:
ORG
0000H
VENT0
1,0,RESET
; EMB
←
1, ERB
←
0; Jump to RESET address by
RESET
VENT1
0,0,INTB
; EMB
←
0, ERB
←
0; Jump to INTB address by INTB
VENT2
0,0,INT0
; EMB
←
0, ERB
←
0; Jump to INT0 address by INT0
VENT3
0,0,INT1
; EMB
←
0, ERB
←
0; Jump to INT1 address by INT1
VENT4
0,0,INTS
; EMB
←
0, ERB
←
0; Jump to INTS address by INTS
VENT5
0,0,INTT0
; EMB
←
0, ERB
←
0; Jump to INTT0 address by INTT0
2.
When a specific vectored interrupt such as INT0, and INTT0 is not used, the unused vector interrupt
locations must be skipped with the assembly instruction ORG so that jumps will address the correct locations:
ORG
0000H
VENT0
1,0,RESET
; EMB
←
1, ERB
←
0; Jump to RESET address by
RESET
VENT1
0,0,INTB
; EMB
←
0, ERB
←
0; Jump to INTB address by INTB
ORG
0006H
; INT0 interrupt not used
VENT3
0,0,INT1
; EMB
←
0, ERB
←
0; Jump to INT1 address by INT1
VENT4
0,0,INTS
; EMB
←
0, ERB
←
0; Jump to INTS address by INTS
ORG
000CH
; INTT0 interrupt not used
ORG
0010H
3.
If an INT0 interrupt is not used and if its corresponding vector interrupt area is not fully utilized, or if it is not
written by a ORG instruction in Example 2, a CPU malfunction will occur:
ORG
0000H
VENT0
1,0,RESET
; EMB
←
1, ERB
←
0; Jump to RESET address by
RESET
VENT1
0,0,INTB
; EMB
←
0, ERB
←
0; Jump to INTB address by INTB
VENT3
0,0,INT1
; EMB
←
0, ERB
←
0; Jump to INT1 address by INT0
VENT4
0,0,INTS
; EMB
←
0, ERB
←
0; Jump to INTS address by INT1
VENT5
0,0,INTT0
; EMB
←
0, ERB
←
0; Jump to INTT0 address by INTS
ORG
0010H
General-purpose ROM area
In this example, when an INTS interrupt is generated, the corresponding vector area is not VENT4 INTS, but
VENT5 INTT0. This causes an INTS interrupt to jump incorrectly to the INTT0 address and causes a CPU
malfunction to occur.
Summary of Contents for KS57C2308
Page 30: ...ADDRESS SPACES KS57C2308 P2308 C2316 P2316 2 22 NOTES ...
Page 168: ...SAM47 INSTRUCTION SET KS57C2308 P2308 C2316 P2316 5 94 NOTES ...
Page 170: ......
Page 206: ...POWER DOWN KS57C2308 P2308 C2316 P2316 8 8 NOTES ...
Page 210: ...RESET KS57C2308 P2308 C2316 P2316 9 4 NOTES ...
Page 222: ...I O PORTS KS57C2308 P2308 C2316 P2316 10 12 NOTES ...
Page 272: ...LCD CONTROLLER DRIVER KS57C2308 P2308 C2316 P2316 12 24 NOTES ...
Page 280: ...SERIAL I O INTERFACE KS57C2308 P2308 C2316 P2316 13 8 NOTES ...
Page 294: ...MECHANICAL DATA KS57C2308 P2308 C2316 P2316 15 2 NOTES ...
Page 310: ...KS57P2308 P2316 OTP KS57C2308 P2308 C2316 P2316 16 16 NOTES ...
Page 318: ......
Page 320: ......
Page 322: ......
Page 325: ......
Page 327: ......