Intel 8XC251SA User Manual page 311

Embedded microcontroller
Hide thumbs Also See for 8XC251SA:
Table of Contents

Advertisement

Operation:
DJNZ
(PC) ← (PC) + 2
(Rn) ← (Rn) – 1
IF (Rn) > 0 or (Rn) < 0
THEN
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:
CY
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
Variations
ECALL addr24
Binary Mode
Bytes:
States:
[Encoding]
1 0 0 1
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)
(PC) ← (PC) + rel
AC
45H,
respectively; and the PC contains 123456H.
Source Mode
5
4
14
13
1 0 1 0
INSTRUCTION SET REFERENCE
OV
N
addr23–
addr15–addr8
addr16
Z
addr7–addr0
A-59

Advertisement

Table of Contents
loading

This manual is also suitable for:

8xc251sb8xc251sp8xc251sq

Table of Contents