HPlogo System Debug Reference Manual: HP 3000 MPE/iX Computer Systems > Chapter 8 System Debug Standard Functions

func sptr

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

 » Index

Coerces an expression into a short pointer.

Syntax

   sptr (value)  

Formal Declaration

   sptr:sptr (value:any) 

Parameters

value

An expression to be coerced. All types are valid.

Table 8-15 Derivation of the SPTR Bit Pattern

Parameter TypeAction

BOOL

1 if TRUE, 0 if FALSE.

U16 S16

Right justify the original 16-bit value in 32 bits with zero fill.

U32 S32 SPTR

Transfer the original bit pattern unchanged.

LONG Class

Transfer the low-order 32 bits of the address (offset part) unchanged. The segment number or SID part of the address is discarded.

EADDR SADDR

Transfer the low-order 32 bits of the address (offset part). All other parts of the address are discarded.

STR

Transfer the ASCII bit pattern for the last four characters in the string. Strings shorter than four characters are treated as if they were extended on the left with nulls.

 

Examples

   $nmdat > wl sptr( 1 )

   $1



   $nmdat > wl sptr( ffff )

   $ffff



   $nmdat > wl sptr( 1234abcd )

   $1234abcd



   $nmdat > wl sptr( -1 )

   $ffffffff



   $nmdat > wl sptr( 1234.5678 )

   $5678



   $nmdat > wl sptr( true )

   $1



   $nmdat > wl sptr( "ABCDEFG" )

   $44454647



   $nmdat > wl sptr( prog(1.2) )

   $2






Limitations, Restrictions

none

Feedback to webmaster