HP 3000 Manuals

func s32 [ System Debug Reference Manual ] MPE/iX 5.0 Documentation


System Debug Reference Manual

func s32 

Coerces an expression into a signed 32-bit value.

Syntax 

      s32 (value)

Formal Declaration 

     s32:s32 (value:any)

Parameters 

 value           An expression to be coerced.  All types are valid.

          Derivation of the S32 Bit Pattern 

--------------------------------------------------------------------------------------------
|                           |                                                              |
|      Parameter Type       |                            Action                            |
|                           |                                                              |
--------------------------------------------------------------------------------------------
|                           |                                                              |
| BOOL                      | 1 if TRUE, 0 if FALSE.                                       |
|                           |                                                              |
--------------------------------------------------------------------------------------------
|                           |                                                              |
| U16                       | Right justify the original 16-bit value in 32 bits with zero |
|                           | fill.                                                        |
|                           |                                                              |
--------------------------------------------------------------------------------------------
|                           |                                                              |
| S16                       | Right justify the original 16-bit value in 32 bits with sign |
|                           | extension.                                                   |
|                           |                                                              |
--------------------------------------------------------------------------------------------
|                           |                                                              |
| U32                       | Transfer the original bit pattern unchanged.                 |
| S32                       |                                                              |
| SPTR                      |                                                              |
|                           |                                                              |
--------------------------------------------------------------------------------------------
|                           |                                                              |
| LPTR                      | Transfer the low-order 32 bits of the address (offset part)  |
| PROG                      | unchanged.  The segment number or SID part of the address is |
| GRP                       | discarded.                                                   |
| PUB                       |                                                              |
| LGRP                      |                                                              |
| LPUB                      |                                                              |
| SYS                       |                                                              |
| USER                      |                                                              |
| TRANS                     |                                                              |
| CST                       |                                                              |
| CSTX                      |                                                              |
|                           |                                                              |
--------------------------------------------------------------------------------------------
|                           |                                                              |
| 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 s32( 1 ) 
     $1

     $nmdat > wl s32( ffff ) 
     $ffff

     $nmdat > wl s32( ffff ):"#" 
     #65535

     $nmdat > wl s32( 1234abcd ) 
     $1234abcd

     $nmdat > wl s32( -1 ) 
     $ffffffff

     $nmdat > wl s32( ffffffff ):"#" 
     $#-1

     $nmdat > wl s32( 1234.5678 ) 
     $5678

     $nmdat > wl s32( true ) 
     $1

     $nmdat > wl s32( "ABCDEFG" ) 
     $44454647

     $nmdat > wl s32( prog(1.2) ) 
     $2

Limitations, Restrictions 

none



MPE/iX 5.0 Documentation