bottom_estack Variable (ROM Call 0x432)

estack.h

CESI bottom_estack;

Points to the bottom of the expression stack.

bottom_estack is a global variable which points to the bottom of the expression stack, i.e. the first byte used. The quantum at bottom_estack is always ENDSTACK_TAG. Usually, you should not change this pointer, although it seems that it is possible to change it temporarily. If you do this, however, you need to make sure that it is changed back in any case, even if an error occurs.

This variable can be used together with top_estack to determine the amount of memory on the expression stack which is currently used.

The following example (called "Print EStack") prints the values of bottom_estack and top_estack:

// Print bottom_estack and top_estack

#define USE_TI89              // Compile for TI-89
#define USE_TI92PLUS          // Compile for TI-92 Plus
#define USE_V200              // Compile for V200

#define MIN_AMS 100           // Compile for AMS 1.00 or higher
#define SAVE_SCREEN           // Save/Restore LCD Contents

#include <tigcclib.h>         // Include All Header Files

// Main Function
void _main(void)
{
  ClrScr ();
  printf_xy (0, 40, "Bottom = 0x%lp", bottom_estack);
  printf_xy (0, 50, "Top = 0x%lp", top_estack);
  ngetchx ();
}


Used by: push_internal_simplify, reset_estack_size, HeapAllocESTACK, cmd_disphome, cmd_try, HomeExecute, HS_popEStack, OSLinkCmd, push_user_func, store_func_def, time_loop


See also: top_estack