KS57C2308/P2308/C2316/P2316
SAM47 INSTRUCTION SET
5-3
Reducing Instruction Redundancy
When redundant instructions such as LD A,#im and LD EA,#imm are used consecutively in a program sequence,
only the first instruction is executed, but the following redundant instructions are ignored, that is, they are handled
like a NOP instruction. When LD HL,#imm instructions are used consecutively, the following redundant
instructions are also ignored.
In the following example, only the “LD A, #im” instruction will be executed. The 8-bit load instruction which
follows it is interpreted as redundant and is ignored:
LD
A,#im
;
Load 4-bit immediate data (#im) to accumulator
LD
EA,#imm
;
Load 8-bit immediate data (#imm) to extended accumulator
In this example, the statements “LD A,#2H” and “LD A,#3H” are ignored:
BITR
EMB
LD
A,#1H
;
Execute instruction
LD
A,#2H
;
Ignore, redundant instruction
LD
A,#3H
;
Ignore, redundant instruction
LD
23H,A
;
Execute instruction, 023H
←
#1H
If consecutive LD HL, #imm instructions (load 8-bit immediate data to the 8-bit memory pointer pair, HL) are
detected, only the first LD is executed and the LDs which immediately follow are ignored. For example,
LD
HL,#10H
;
HL
←
10H
LD
HL,#20H
;
Ignore, redundant instruction
LD
A,#3H
;
A
←
3H
LD
EA,#35H
;
Ignore, redundant instruction
LD
@HL,A
;
(10H)
←
3H
If an instruction reference with a REF instruction has a redundancy effect, the following conditions apply:
— If the instruction
preceding
the REF has a redundancy effect, this effect is cancelled and the referenced
instruction is not skipped.
— If the instruction
following
the REF has a redundancy effect, the instruction following the REF is skipped.
+
+
PROGRAMMING TIP — Example of the Instruction Redundancy Effect
ORG
0020H
ABC
LD
EA,#30H
; Stored in REF instruction reference area
ORG
0080H
•
•
•
LD
EA,#40H
; Redundancy effect is encountered
REF
ABC
; No skip (EA
←
#30H)
•
•
•
REF
ABC
; EA
←
#30H
LD
EA,#50H
; Skip
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: ......