.ptr pseudo-op
Purpose
Assembles expressions into consecutive pointer-size elements.
Syntax
Item | Description |
---|---|
.ptr | Expression[, Expression, ...] |
Description
The .ptr pseudo-op assembles expressions into consecutive words in 32-bit mode and consecutive doublewords in 64-bit mode. The .ptr pseudo-op allows the same source code to be used in both 32 and 64-bit modes, and is most useful when the expression includes a relocatable reference. The .ptr pseudo-op is equivalent to the .long pseudo-op in 32-bit mode and the .llong pseudo-op in 64-bit mode.
Fullword alignment occurs as necessary, unless the current section is a DWARF section.
Parameters
Item | Description |
---|---|
Expression | An absolute expression. |
Examples
The following example illustrates the use of the .ptr pseudo-op:
.extern foo{RW]
.csect mydata[RW]
.ptr foo[RW] # Pointer to foo with appropriate relocation
# 4 bytes in 32-bit mode
# 8 bytes in 32-bit mode