getsp(3C)
_________________________________________________________________
getsp $builtin function
Return the current stack pointer.
_________________________________________________________________
Calling Sequence
#include <dglib.h>
short int *getsp(), *curwsp;
curwsp = getsp();
(or)
$builtin short *getsp();
short int *curwsp;
curwsp = getsp();
where curwsp is the current wide stack pointer.
Description
The getsp function retrieves the value of the wide stack pointer
(WSP). The first version noted above uses a function call. The
second might generate smaller or faster code, but may not run
under other C compilers.
Returns
The getsp function returns a pointer to the value.
Related Functions
See also the getsb and getsl functions.
Example
/* Program test for the getsp() function */
#include <stdio.h>
#include <dglib.h>
short int *curwsp, *getsp();
main() {
printf("Value at WSP = %o.\n", curwsp = getsp());
}
DG/UX 4.00 Page 1
Licensed material--property of copyright holder(s)
getsp(3C)
A call to the program test generates the output
Value at WSP = 16000012570.
(This value will vary.)
DG/UX 4.00 Page 2
Licensed material--property of copyright holder(s)