System Debug Reference Manual (32650-90888)

Chapter 10 417
System Debug Standard Functions
func nmcall
func nmcall
Dynamically calls a procedure/function, passing up to four parameters.
Syntax
nmcall (
path
) [
parm1
] [
parm2
] [
parm3
] [
parm4
]
This function is used to perform a dynamic procedure call. It is implemented by calling the
HPGETPROCPLABEL intrinsic to ensure the desired routine is loaded, and then uses the
FCALL routine in the Pascal/XL compiler to invoke the routine. The called code is invoked
at the same privilege level as the routine that invoked Debug (for example, the privilege
level contained in the PRIV environment variable). DAT invokes the routine from privilege
level 2. This function is not available from SAT. Four parameters are
always
passed to the
indicated routine. These values are placed in the argument registers (arg0..arg3). It is up
to the called code to correctly define its parameter list and interpret the parameters
appropriately.
If you are not familiar with the procedure calling conventions as used by the language
compilers, please refer to the Procedure Calling Conventions Reference Manual
The value returned by the called routine (if any) in the function return register (R28), is
used as the result of the NMCALL function. Because this register contains only a 32-bit
value, code that returns data larger than 32 bits should not be invoked. If the called
routine does not return a value, whatever value that happens to be in R28 is used as the
value of this function (for example, the function is undefined).
Formal Declaration
nmcall:s32 (
path
:str [
parm1
:sptr=0][
parm2
:sptr=0] [
parm3
:sptr=0]
[
parm4
:sptr=0]
Parameters
path
The code path specification for the NM procedure/function to be called. The
format of this parameter is:
file_name
/
procname
The
file_name
part specifies the library to be searched for
procname
. The
file_name
part is optional. If it is not provided, the current list of loaded
files for the process (see the LOADINFO command) will be searched. Refer to
the HPGETPROCPLABEL intrinsic for additional details, assumptions, and
restrictions involving searching libraries.
NOTE
Unlike the other forms of procedure PATH specifications (for example, the
NMADDR function), module names and nested procedures are not supported by
this function.
parm1,2,3,4
These parameters are used to pass values to the routine being called. They