526
Appendix A: System Routines — EStack Utilities
TI
-
89 / TI
-
92 Plus Developer Guide
Not for Distribution
Beta Version January 26, 2001
moved_between_to_top
Declaration:
EStackDisplacement
moved_between_to_top
(EStackIndex
i
,
EStackIndex
j
)
Category(ies):
EStack Utilities
Description:
Copies elements from (
i
+ 1) through
j
to top of estack if space is available
or can be made available, then returns the number of elements copied
after deleting elements (
i
+ 1) through
j
.
Inputs:
i,
j
— Indexes into the estack.
Outputs:
Returns the number of quantums deleted.
Assumptions: bottom_estack
<=
i
and
i
<=
j
and
j
<=
top_estack
.
Side Effects:
The estack temporarily grows even though there is no net change in
top_estack
. Consequently, an ESTACK_OVERFLOW_ERROR may be
thrown or heap compression may have occurred.
Availability:
On AMS 1.05 and higher.
TI
-
89 / TI
-
92 Plus
Differences:
None
See Also: move_between_to_top
Example:
old_top = top_estack;
push_Float (3.7);
f = top_estack;
push_quantum_as_nonnegative_int (7u);
foo = top_estack;
push_quantum (8u); /* Push variable x */
delta = moved_between_to_top (old_top, f); /* Now f is on top */
foo -= delta; /* Adjust index of foo */
x = top_estack – delta; /* Adjust index of variable x */