A-59
INSTRUCTION SET REFERENCE
Operation:
DJNZ
(PC)
←
(PC) + 2
(Rn)
←
(Rn) – 1
IF (Rn) > 0 or (Rn) < 0
THEN
(PC)
←
(PC) + rel
ECALL <dest>
Function:
Extended call
Description:
Calls a subroutine located at the specified address. The instruction adds four to the program
counter to generate the address of the next instruction and then pushes the 24-bit result
onto the stack (high byte first), incrementing the stack pointer by three. The 8 bits of the high
word and the 16 bits of the low word of the PC are then loaded, respectively, with the
second, third and fourth bytes of the ECALL instruction. Program execution continues with
the instruction at this address. The subroutine may therefore begin anywhere in the full 16-
Mbyte memory space.
Flags:
Example:
The stack pointer contains 07H and the label “SUBRTN” is assigned to program memory
location 123456H. After executing the instruction
ECALL SUBRTN
at location 012345H, SP contains 0AH; on-chip RAM locations 08H, 09H and 0AH contain
01H, 23H and
45H,
respectively; and the PC contains 123456H.
Variations
ECALL addr24
Binary Mode
Source Mode
Bytes:
5
4
States:
14
13
Hex Code in:
Binary Mode = [A5][Encoding]
Source Mode = [Encoding]
Operation:
ECALL
(PC)
←
(PC) + 4
(SP)
←
(SP) + 1
((SP))
←
(PC.23:16)
(SP)
←
(SP) + 1
((SP))
←
(PC.15:8)
(SP)
←
(SP) + 1
((SP))
←
(PC.7:0)
(PC)
←
(addr.23:0)
CY
AC
OV
N
Z
—
—
—
—
—
[Encoding]
1 0 0 1
1 0 1 0
addr23–
addr16
addr15–addr8
addr7–addr0
Summary of Contents for 8XC251SA
Page 2: ......
Page 3: ...May 1996 8XC251SA 8XC251SB 8XC251SP 8XC251SQ Embedded Microcontroller User s Manual...
Page 18: ......
Page 19: ...1 Guide to This Manual...
Page 20: ......
Page 30: ......
Page 31: ...2 Architectural Overview...
Page 32: ......
Page 41: ...3 Address Spaces...
Page 42: ......
Page 63: ...4 Device Configuration...
Page 64: ......
Page 81: ...5 Programming...
Page 82: ......
Page 102: ......
Page 103: ...6 Interrupt System...
Page 104: ......
Page 120: ......
Page 121: ...7 Input Output Ports...
Page 122: ......
Page 132: ......
Page 133: ...8 Timer Counters and Watchdog Timer...
Page 134: ......
Page 153: ...9 Programmable Counter Array...
Page 154: ......
Page 170: ......
Page 171: ...10 Serial I O Port...
Page 172: ......
Page 187: ...11 Minimum Hardware Setup...
Page 188: ......
Page 197: ...12 Special Operating Modes...
Page 198: ......
Page 206: ......
Page 207: ...13 External Memory Interface...
Page 208: ......
Page 239: ...14 Programming and Verifying Nonvolatile Memory...
Page 240: ......
Page 250: ......
Page 251: ...A Instruction Set Reference...
Page 252: ......
Page 390: ......
Page 391: ...B Signal Descriptions...
Page 392: ......
Page 400: ......
Page 401: ...C Registers...
Page 402: ......
Page 436: ......
Page 437: ...Glossary...
Page 438: ......
Page 446: ......
Page 447: ...Index...
Page 448: ......
Page 458: ......