
CHAPTER 2: ARCHITECTURE
This instruction permits the extended addressing with the E flag, and the
Examples: |
| |
CALR | ...Calls the subroutine 49 steps before | |
LDB | %EXT,50 | ...(50 ⋅ 256) = 17800 |
CALR | 50 | ...Calls the subroutine 17851 steps after |
(2)Instruction with a data memory address within 0000H to 003FH in which the content specifies a
CALR [addr6]
This instruction branches the program sequence with the content of the data memory specified by the [addr6] as an unsigned
Example: When the content of the address 0010H is 4 (0100B).
SET [0x0010],0 ...Sets the bit 0 in the address 0010H to "1" ([0010H] = 5)
CALR [0x0010] ...Calls the subroutine 6 steps after
Figure 2.2.3.2 shows the operation of the call instructions and the branch range.
| Program memory |
| Program memory |
| Program memory | Data memory | ||||||||
0000H |
|
| 0000H |
|
|
|
|
|
|
|
|
|
| 0000H |
|
|
|
| ∗ |
|
|
|
|
|
|
|
|
| addr6 |
|
|
|
|
|
|
|
|
|
|
|
|
| ||
|
|
|
|
|
|
|
|
|
|
| 003FH | |||
|
|
|
|
|
|
|
|
|
|
|
| |||
|
|
|
|
|
|
|
|
|
|
|
| |||
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
|
| LDB %EXT,imm8 |
|
|
|
|
|
|
|
|
|
| ||
xxxxH | CALR sign8 |
| xxxxH | CALR sign8 |
| xxxxH | CALR [addr6] |
|
|
|
|
| ||
xxxxH+128 |
|
|
|
|
| xxxxH+16 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| ||
| xxxxH+32768 |
|
|
|
|
|
|
|
|
|
|
| ||
|
|
|
|
|
|
|
|
|
|
|
|
| ||
|
|
|
| ∗ |
|
|
|
|
|
|
|
|
|
|
FFFFH |
|
| FFFFH |
|
| FFFFH |
|
|
|
|
|
|
| FFFFH |
|
| ∗ | In the extended addressing mode, | [addr6]=0 → | xxxxH+1 |
|
|
| ||||||
|
|
| this instruction can call subroutines | : |
|
|
|
|
|
|
| |||
|
|
| over a 64K program memory. |
| [addr6]=15 → | xxxxH+16 |
|
|
|
PC relative call instructions
Program memory
0000H
00FFH
CALZ imm8
FFFFH
imm → Branch destination absolute address
Absolute call instruction
Fig. 2.2.3.2 Operation of call instructions
S1C63000 CORE CPU MANUAL | EPSON | 15 |