English
Language : 

GMS30C2216 Datasheet, PDF (255/320 Pages) Hynix Semiconductor – 16/32 BIT RISC/DSP
Appendix A. Instruction Set Details
Frame
A-83
FRAME
Format:
LL format
15
OP-code
1110 1101
87
43
0
Ld-code
Ls-code
Ls-code encodes L0..L15 for Ls
Ld-code encodes L0..L15 for Ld
Notation:
FRAME Ld, Ls
Description:
A Frame instruction restructures the current stack frame by
l decreasing the frame pointer FP to include (optionally) passed parameters in the local
register addressing range; the first parameter passed is then addressable as L0;
l resetting the frame length FL to the actual number of registers needed for the current
stack frame.
The frame pointer FP is decreased by the value of the Ls-code and the Ld-code is placed in
the frame length FL (FL = 0 is always interpreted as FL = 16). Then the difference
(available number of registers) - (required number of registers + 10) is evaluated and
interpreted as a signed 7-bit integer.
If difference is not negative, all the registers required plus the reserve of 10 fit into the
register part of the stack; no further action is needed and the Frame instruction is finished.
If difference is negative, the content of the old stack pointer SP is compared with the
address in the upper stack bound UB. If the value in the SP is equal or higher than the
value in the UB, a temporary flag is set. Then the contents of the number of local registers
equal to the negative difference evaluated are pushed onto the memory part of the stack,
beginning with the content of the local register addressed absolutely by SP(7..2) being
pushed onto the location addressed by the SP.
All condition flags remain unchanged.
Attention: The Frame instruction must always be the first instruction executed in a
entered by a Call instruction, otherwise the Frame instruction could be separated form the
preceding Call instruction by an Interrupt, Parity Error, Extended Overflow of Trace