Stack routines.


Defines

#define STACKpush(src)   sat_pushptr(src)
 push an address on the stack

Functions

SatAddr STACKpop ()
 Pop an address off the stack.
SatAddr STACKpick (int level)
 pick an object on the stack from an arbitrary level.
int STACKdepth ()
 Get the stack depth.

Detailed Description

Although very similar to the routines that are included with HPGCC, there were enough small differences that I decided to create my own functions to manipulate the stack.

Define Documentation

#define STACKpush ( src   )     sat_pushptr(src)

push an address on the stack

Parameters:
src Saturn address of an object to push
Returns:
void


Function Documentation

int STACKdepth (  ) 

Get the stack depth.

This is faster and more accurate than sat_stack_depth(), which will return the wrong value if you push zero on the stack.

Returns:
the number of items on the stack.

SatAddr STACKpick ( int  level  ) 

pick an object on the stack from an arbitrary level.

Parameters:
the stack level (1, 2, 3, etc).
Returns:
Saturn address of the object at the given level, or zero if no object is at that level.

SatAddr STACKpop (  ) 

Pop an address off the stack.

Returns:
The Saturn address of the object on level 1, or 0 if stack is empty.


Generated on Sat Apr 3 16:38:31 2010 for HPObjects by  doxygen 1.5.0