HPlogo System Debug Reference Manual > Chapter 10 System Debug Standard Functions

func stolog

MPE documents

Complete PDF
Table of Contents
Index

E0201 Edition 4 ♥
E0300 Edition 3
E0692 Edition 3

Short to logical. Converts a NM short pointer (SPTR) to a NM logical code address (LCPTR).

Syntax



   stolog (shortptr [logsel] [userfname])

Based on a logical file selector, logsel, the SID of a loaded NM executable library is used to build a logical code pointer.

This conversion is very different from the STOL conversion, which uses the current space registers SR4 - SR7 to determine the SID.

Formal Declaration



   stolog:lcptr (shortptr:sptr [logsel:str="PROG"] [userfname:str])

Parameters


shortptr

The short pointer to be converted into a logical code pointer.

logsel

A string which selects a particular logical file. The SID portion of the resulting logical pointer are based on the SID of the specified logical file selector. Valid selector strings are:

'PROG'

Program file

'GRP'

Group library

'PUB'

Account library

'SYS'

System library

'USER'

User library

By default, the selector 'PROG' will be used.

userfname

The file name of a user library file. Since multiple NM user libraries can be in use simultaneously, the userfname parameter is required when the logical file selector logsel is 'USER'.

If userfname is not fully qualified, the program file's group and account are used to fully qualify the file name.

Examples



   $nmdebug > wl stolog(104c)
   PROG $42.104c

By default, the logical selector 'PROG' is used to convert short pointer 104c to the logical code pointer PROG 42.104c.

   $nmdebug > wl stolog(20b34, 'sys')
   SYS $a.20b34

The logical selector 'SYS' is used to look up the SID for NL.PUB.SYS, and the resulting logical code pointer is SYS a.20b34.

   $nmdebug > wl stolog(1c68, 'user')
   Missing required user library filename for USER logical selector.

When the logical selector 'USER' is specified, the parameter userfname is required to specify which user library file, since several may be loaded simultaneously.

   $nmdebug > wl stolog(1c68, 'user', 'LIB3')
   USER $3c.1c68

The SID for user library is determined to be $3c. The short pointer is converted into logical code pointer USER 3c.1c68.

Limitations, Restrictions


none




func stol


func str