KS57C2308/P2308/C2316/P2316
SAM47 INSTRUCTION SET
5-75
REF
— Reference Instruction
REF
dst
Operation:
Operand
Operation Summary
Bytes
Cycles
memc
Reference code
1
1
(note)
NOTE
:
The instruction referenced by REF determines the instruction cycles.
Description:
The REF instruction is used to rewrite into 1-byte form, arbitrary 2-byte or 3-byte instructions (or
two 1-byte instructions) stored in the REF instruction reference area in program memory. REF
reduces the number of program memory accesses for a program.
Operand
Binary Code
Operation Notation
memc
t7
t6
t5
t4
t3
t2
t1
t0
PC13–0
←
memc.5–0 + (memc +
1).7–0
TJP and TCALL are 2-byte pseudo-instructions that are used only to specify the reference area:
1.
When the reference area is specified by the TJP instruction,
memc.7–6 = 00
PC13–0
←
memc.5–0 + (memc + 1).7–0
2.
When the reference area is specified by the TCALL instruction,
memc.7–6 = 01
(SP–4) (SP–1) (SP–2)
←
PC12–0
SP–3
←
EMB, ERB, PC13–12
PC13–0
←
memc.5–0 + (memc + 1).7–0
SP
←
SP–4
When the reference area is specified by any other instruction, the “memc” and “memc + 1”
instructions are executed.
Instructions referenced by REF occupy 2 bytes of memory space (for two 1-byte instructions or
one 2-byte instruction) and must be written as an even number from 0020H to 007FH in ROM. In
addition, the destination address of the TJP and TCALL instructions must be located with the
3FFFH address. TJP and TCALL are reference instructions for JP/JPS and CALL/CALLS.
If the instruction following a REF is subject to the “redundancy effect”, the redundant instruction
is skipped. If, however, the REF follows a redundant instruction, it is executed.
On the other hand, the binary code of a REF instruction is 1 byte. The upper 4 bits become the
higher address bits of the referenced instruction, and the lower 4 bits of the referenced instruction
becomes the lower address, producing a total of 8 bits or 1 byte (see Example 3 below).
NOTE
If the MSB value of the first one-byte binary code in instruction is “0”, the instruction cannot be
referenced by a REF instruction.
Содержание C2316
Страница 30: ...ADDRESS SPACES KS57C2308 P2308 C2316 P2316 2 22 NOTES ...
Страница 168: ...SAM47 INSTRUCTION SET KS57C2308 P2308 C2316 P2316 5 94 NOTES ...
Страница 170: ......
Страница 206: ...POWER DOWN KS57C2308 P2308 C2316 P2316 8 8 NOTES ...
Страница 210: ...RESET KS57C2308 P2308 C2316 P2316 9 4 NOTES ...
Страница 222: ...I O PORTS KS57C2308 P2308 C2316 P2316 10 12 NOTES ...
Страница 272: ...LCD CONTROLLER DRIVER KS57C2308 P2308 C2316 P2316 12 24 NOTES ...
Страница 280: ...SERIAL I O INTERFACE KS57C2308 P2308 C2316 P2316 13 8 NOTES ...
Страница 294: ...MECHANICAL DATA KS57C2308 P2308 C2316 P2316 15 2 NOTES ...
Страница 310: ...KS57P2308 P2316 OTP KS57C2308 P2308 C2316 P2316 16 16 NOTES ...
Страница 318: ......
Страница 320: ......
Страница 322: ......
Страница 325: ......
Страница 327: ......