Pointer To Handle.c 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. // Return the EStack handle.
  2. #define USE_TI89 // Compile for TI-89
  3. #define USE_TI92PLUS // Compile for TI-92 Plus
  4. #define USE_V200 // Compile for V200
  5. #define RETURN_VALUE // Return Pushed Expression
  6. #define MIN_AMS 101 // Compile for AMS 1.01 or higher
  7. #include <tigcclib.h> // Include All Header Files
  8. // Main Function
  9. void _main(void)
  10. {
  11. push_END_TAG ();
  12. push_END_TAG ();
  13. // Outside all allocated blocks.
  14. push_shortint (HeapPtrToHandle((void *)1));
  15. // Strictly inside a block.
  16. push_shortint (HeapPtrToHandle((void *)estack_max_index));
  17. // Strictly inside a block, must be the same handle as estack_max_index.
  18. push_shortint (HeapPtrToHandle((void *)top_estack));
  19. // Beginning of a block.
  20. push_shortint (PtrToHandle(HeapDeref(1)));
  21. push_LIST_TAG ();
  22. push_END_TAG ();
  23. // Outside all allocated blocks.
  24. push_shortint (PtrToHandle((void *)1));
  25. // Strictly inside a block.
  26. push_shortint (PtrToHandle((void *)estack_max_index));
  27. // Strictly inside a block, must be the same handle as estack_max_index.
  28. push_shortint (PtrToHandle((void *)top_estack));
  29. // Beginning of a block.
  30. push_shortint (PtrToHandle(HeapDeref(1)));
  31. push_LIST_TAG ();
  32. push_LIST_TAG ();
  33. }