Guardian Procedure Calls Reference Manual (G06.25+)
Guardian Procedure Calls (A-B)
Guardian Procedure Calls Reference Manual—522629-013
2-20
ADDRTOPROCNAME Procedure
Considerations
•
The maximum value of proc-name-length, and hence the address space that
must be available at the location given by
proc-name, depends on the language
that was used to create the code to which
p-reg, stack-env, and the optional
pin refer.
•
Read access to the associated object file is not required in order to obtain the
requested output parameters associated with the given
p-reg, stack-env, and
optional
pin.
Example
INT STACK^ENV = 'L' - 1; ! calling procedure’s stack
ENV
INT P^REG = 'L' - 2; ! calling procedure’s P
register
LITERAL PROC^NAME^SIZE = 80;
STRING PROC^NAME ! returned ASCII procedure
name
[ 0:PROC^NAME^SIZE-1 ];
INT LENGTH; ! length of returned proc
name
INT BASE; ! procedure base address
INT OFFSET; ! word offset within
procedure
IF (ERROR := ADDRTOPROCNAME ( P^REG, STACK^ENV, PROC^NAME,
PROC^NAME^SIZE, LENGTH,
BASE ) ) THEN
! an error occurred, ERROR has the error code
ELSE
OFFSET := P^REG '-' BASE;