
Instruction Set
4-53
ENTER* Enter High-Level Procedure
ENTER
What It Does
ENTER reserves storage on the stack for the local variables of a procedure.
Syntax
Description
ENTER creates the stack frame required by most block-structured high-level languages.
The microcontroller uses BP as a pointer to the stack frame and SP as a pointer to the top
of the stack.
The first operand (
bytes) specifies the number of stack bytes to allocate for the local
variables of the procedure.
The second operand (
level) specifies the lexical nesting level (0–31) of the procedure within
the high-level-language source code. The nesting level determines the number of stack-
frame pointers that are copied to the new stack frame from the preceding frame.
If
level is 0, ENTER pushes BP onto the stack, sets BP to the current value of SP, and
subtracts
bytes from SP.
* – This instruction was not available on the original 8086/8088 systems.
Form
Opcode
Description
Clocks
Am186 Am188
ENTER
imm16,imm8
C8
iw ib
Create stack frame for nested procedure
22+16(
n–1)
26+20(
n–1)
ENTER
imm16,0
C8
iw 00
Create stack frame for non-nested procedure
15
19
ENTER
imm16,1
C8
iw 01
Create stack frame for nested procedure
25
29
ENTER
bytes,level
4
Summary of Contents for Am186 Series
Page 1: ...Am186 and Am188 Family Instruction Set Manual February 1997...
Page 10: ...Table of Contents x...
Page 18: ...Programming 1 8...
Page 40: ...Instruction Set Listing 3 14...