pTAL Reference Manual (G06.24+, H06.09+, J06.03+)
Converting Between Address Types
You can convert an address from one address type to another using either:
• Built-in address-conversion functions (see Table 61 (page 283))
• Shift operations and low-level built-in routines
These conversions are supported for compatibility with TAL. HP recommends that you use the
equivalent pTAL routine when you write pTAL code.
Equivalent Routine CallOperand TypeExpression
$WADDR_TO_BADDR(e )WADDRe '<<' 1
$SGWADDR_TO_SGBADDR(e )SGWADDRe '<<' 1
$SGWADDR_TO_SGBADDR(e )SGXWADDRe '<<' 1
$BADDR_TO_WADDR(e )BADDRe '>>' 1
$SGBADDR_TO_SGWADDR(e )SGBADDRe '>>' 1
$SGBADDR_TO_SGWADDR(e )SGXBADDRe '>>' 1
$BADDR_TO_EXTADDR(e )BADDR$UDBL(e )
$BADDR_TO_EXTADDR(e )BADDR$DBLL(0,e )
$WADDR_TO_EXTADDR(e )WADDR$UDBL(e ) '<<' 1
$WADDR_TO_EXTADDR(e )WADDR$DBLL(0,e ) '<<' 1
The compiler generates code for implicit conversions for the following operations:
• Block moves and compares
The compiler automatically converts an address type if required for the source or destination
pointer in a block move or block compare instruction.
• Call-by-reference actual parameters
The compiler automatically converts the address type of an actual parameter to the address
type of a formal parameter if the conversion could not cause data loss. For example:
◦ BADDR can be converted to EXTADDR
◦ WADDR can be converted to EXTADDR
◦ EXTADDR cannot be converted to WADDR
◦ EXTADDR and EXT32ADDR can be converted to EXT64ADDR
◦ PROCADDR and PROC32ADDR can be converted to PROC64ADDR
◦ PROCPTR and PROC32PTR can be converted to PROC64PTR (if same parameter profile.
For more information, see “Procedure Pointers” (page 263).)
52 Data Representation