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

Chapter 11 System Debug Standard Functions

MPE documents

Complete PDF
Table of Contents
Index

E0201 Edition 4 ♥
E0300 Edition 3
E0692 Edition 3

Table of Contents
func civar
Syntax
Formal Declaration
Parameters
Examples
Limitations, Restrictions
func strrtrim
Syntax
Formal Declaration
Parameters
Examples
Limitations, Restrictions
func strwrite
Syntax
Formal Declaration
Parameters
Examples
Limitations, Restrictions
func symaddr
Syntax
Formal Declaration
Parameters
Examples
Limitations, Restrictions
func symconst
Syntax
Formal Declaration
Parameters
Examples
Limitations, Restrictions
func syminset
Syntax
Formal Declaration
Parameters
Examples
Limitations, Restrictions
func symlen
Syntax
Formal Declaration
Parameters
Examples
Limitations, Restrictions
func symtype
Syntax
Formal Declaration
Parameters
Examples
Limitations, Restrictions
func symval
Syntax
Formal Declaration
Parameters
Examples
Limitations, Restrictions
func sys
Syntax
Formal Declaration
Parameters
Examples
Limitations, Restrictions
func tcb
Syntax
Formal Declaration
Parameters
Examples
Limitations, Restrictions
func trans
Syntax
Formal Declaration
Parameters
Examples
Limitations, Restrictions
func typeof
Syntax
Formal Declaration
Parameters
Examples
Limitations, Restrictions
func u16
Syntax
Formal Declaration
Parameters
Examples
Limitations, Restrictions
func u32
Syntax
Formal Declaration
Parameters
Examples
Limitations, Restrictions
func user
Syntax
Formal Declaration
Parameters
Examples
Limitations, Restrictions
func vainfo
Syntax
Formal Declaration
Parameters
Examples
Limitations, Restrictions
func vtor
Syntax
Formal Declaration
Parameters
Examples
Limitations, Restrictions
This chapter presents the full formal declaration for each of the standard functions which are defined in System Debug.

All functions are callable from both DAT and Debug. All functions can be called from both Native Mode (NM) and Compatibility Mode (CM). Some functions, however, deal specifically with NM or CM attributes. Input parameters are always interpreted based on the current mode, so care must be exercised when specifying procedure names and numeric literals.

Functions are logically divided into groups and can be listed with the FUNCL[IST] command, filtered by the group name.

The following table lists all functions, sorted by group name. For each function, the name, type, and a brief description is presented.

COERCION Functions

Name Type Description
ASCC: STRCoerces an expression to ASCII
BOOL: BOOLCoerces an expression to Boolean
CST: CSTCoerces an expression to CST ACPTR
CSTX: CSTXCoerces an expression to CSTX ACPTR
EADDR: EADDRCoerces an expression to extended address.
GRP: GRPCoerces an expression to GRP LCPTR
LGRP: LGRPCoerces an expression to LGRP LCPTR
LPTR: LPTRCoerces an expression to long pointer.
LPUB : LPUBCoerces an expression to LPUB LCPTR
PUB: PUBCoerces an expression to PUB LCPTR
S16: S16Coerces an expression to signed 16-bit INT
S32: S32Coerces an expression to signed 32-bit INT
S64: S64Coerces an expression to signed 64-bit INT
SADDR: SADDRCoerces an expression to secondary address.
SPTR: SPTRCoerces an expression to short pointer
SYS: SYSCoerces an expression to SYS LCPTR
TRANS: TRANSCoerces an expression to TRANS LCPTR
USER: USERCoerces an expression to USER LCPTR
U16: U16Coerces an expression to unsigned 16-bit INT
U32: U32Coerces an expression to unsigned 32-bit INT

UTILITY Functions

Name Type Description
ASC : STR Converts an expression to an ASCII string
BIN : INT Converts an ASCII string to binary value
BITD : ANY Bit deposit
BITX : ANY Bit extract
BOUND: STR Tests for current definition of an operand
CISETVAR: BOOLSets a new value for a CI variable
CIVAR: ANY Returns the current value of a CI variable
ERRMSG: STR Returns an error message string
MACBODY : STR Returns the macro body of a specified macro
TYPEOF: STR Returns the type of an expression
MAPINDEX: U16 Returns the index number of a mapped file
MAPSIZE: U32 Returns the size of a mapped file
MAPVA: LPTR Returns the virtual address of a mapped file

ADDRESS Functions

Name Type Description
ABSTOLOG: LCPTRCM absolute address to logical code address
BTOW: U16Converts a CM byte offset to a word offset
CMNODE: LCPTR CM address of closest CM node point
CMTONMNODE: TRANSNM address of closest CM node point
CMVA: LPTRConverts CM code address to a virtual address
DSTVA: LPTRConverts CM dst.off to virtual address
HASH: S32Hashes a virtual address
LOGTOABS: ACPTRCM logical code address to absolute address
LTOLOG: LCPTRLong pointer to logical code address
LTOS: SPTRLong pointer to short pointer
NMNODE: TRANS NMAddress of closest NM node point
NMTOCMNODE: LCPTRCM address of closest NM node point
OFF: U32Extracts offset part of a virtual address
PHYSTOLOG: LCPTRCM physical segment/map bit to logical
RTOV: LPTRreal to virtual
SID: U32Extracts the SID (space) part of a long pointer
STOL: LPTRShort pointer to long pointer
STOLOG: LCPTRShort pointer to logical code address
VTOR : U32Virtual to real
VTOS: SADDRVirtual to secondary store address

PROCESS Functions

Name Type Description
CMG: SPTRShort pointer address of CMGLOBALS record
CMSTACKBASE: LPTRVirtual address of the CM stack base
CMSTACKDST : U16Data segment number of the CM stack
CMSTACKLIMIT: LPTRVirtual address of the CM stack limit
NMSTACKBASE: LPTRVirtual address of the NM stack base
NMSTACKLIMIT: LPTRVirtual address of the NM stack limit
PCB: SPTRAddress of process control block
PCBX: SPTRAddress of process control block extension
PIB: SPTRAddress of process information block
PIBX: SPTRAddress process information block extension
PSTATE: STRReturns the process state for specified PIN
TCB: U32Real address of the task control block
VAINFO: ANYReturns virtual object information

PROCEDURE Functions

Name Type Description
CMADDR: LCPTR Logical address of a CM procedure name
CMBPADDR: LCPTR Logical address of a CM breakpoint index
CMBPINDEX: S16Index number of a CM breakpoint address
CMBPINSTR: S16CMInstruction at a CM breakpoint address
CMENTRY: LCPTR Logical entry address of a CM procedure
CMPROC: STRReturns the name of a CM procedure
CMPROCLEN: U16Returns the length of CM procedure
CMSEG: STRReturns the CM segment name at logical address
CMSTART: LCPTR Logical start address of CM procedure
NMADDR: LCPTR Logical address of NM procedure name
NMBPADDR: LCPTR Logical address of NM breakpoint index
NMBPINDEX: S16Index number of a NM breakpoint address
NMBPINSTR: S32NMInstruction at a NM breakpoint address
NMCALL: S32NMDynamically invokes the specified NM routine
NMENTRY: LCPTR Logical entry address of NM procedure
NMFILE: STRName of file containing NM logical address
NMMOD: STRName of NM module at NM logical address
NMPATH: STRReturns the full code path of a NM procedure
NMPROC: STRName of NM procedure at NM logical address

STRING Functions

Name Type Description
STR: STRExtracts a substring from a string
STRAPP: STRString append
STRDEL: STRString delete
STRDOWN: STRDownshifts a string
STREXTRACT: STRExtracts a string at a virtual address
STRINPUT: STRPrompts for and reads string input
STRINS: STRString insert
STRLEN: U16Returns the current length of a string
STRLTRIM: STRRemoves leading blanks from a string
STRMAX: U16Returns the maximum length of a string
STRPOS: U16Locates a substring within a string
STRRPT: STRString repeat
STRRTRIM: STRRemoves trailing blanks from a string
STRUP: STRUpshifts a string
STRWRITE: STRBuilds a string from a value list

SYMBOLIC Functions

Name Type Description
SYMADDR: U32Returns the offset within a type to the specified symbolic field
SYMCONST : ANYReturns the value of a declared constant
SYMINSET : BOOLTests for set inclusion
SYMLEN : U32Returns the length of the field based on a symbolic path
SYMTYPE: STRReturns the symbolic type based on a symbolic path
SYMVAL : ANYReturns the value found at a virtual address based on a symbolic path

The formal declaration of functions are presented with the following format:

   function_name : function_return_type ( function_ parameters )

The function parameters are presented as follows:

   parm_name : parm_type [=default_parm_value]




func vtos


func civar