92432-90012 June
HP 9000 Computers
Legal Notices
Restricted Rights Legend
Hanover Street Palo Alto, California
Contents
Assembler Directives and Pseudo-Operations
Contents
Contents
Contents
Contents
Pseudo-Instruction Set Assembling Your Program
Diagnostic Messages
Programming Examples
Index
Preface
Printing History
Edition Date Software Version
Related Documentation
Audience
This Manual
Typographical Conventions
Summary of Technical Changes for HP-UX
Assembler Features
Assembly Language
Assembler Features
Summary of Changes for PA-RISC 2.0W Wide Mode, 64-bit
Summary of Changes for PA-RISC
Summary of Changes for PA-RISC
Chapter
Summary of Changes for PA-RISC 2.0W Wide Mode, 64-bit
Program Structure
Label Opcode Operands Comments
Program Structure
Symbols and Constants
Symbols and Constants
Integer Constants Signed Unsigned
Registers and Register Mnemonics
Registers and Register Mnemonics
Registers by using an L or R suffix
General Registers
Single-Precision Floating-Point Registers
Double-Precision Floating-Point Registers
Space Registers
Control Registers Synonyms
Register Synonyms Description
Register Procedure Calling Conventions
Expressions
Expressions
Standard Arithmetic Operators
Operator Operation
Legal Combinations For Relocatable Terms Operation Result
Available Field Selectors Meaning
Field Meaning Selector
Multiple of 2048 allows a three-instruction sequence
Parenthesized Subexpressions
Operands and Completers
Operands and Completers
Addi
Macro Processing
Defining New Instructions With Macros
Macro Processing
Contains general register 19, or binary 10011. These
Spaces
HP-UX Architecture Conventions
Spaces
Memory Layout on HP-UX Sr4 Sr5 Sr6
Subspaces
Attributes
Subspaces
Directives
Standard Subspaces and Sort Keys
Space Subspace Sort Key Use
Sections in 64-bit Mode
Sections in 64-bit Mode
$INIT$
Location Counters
Location Counters
Compiler Conventions
Compiler Conventions
Compiler Conventions
Global Symbol Usage
Mfctl
Assembly Listing
Shared Libraries
Shared Libraries
Assembly Listing
Introduction
Assembler Directives
Directive Function
Requests common storage for a specified number Bytes
Pseudo-Operations Directive Function
Reserves 16 bits a half word of storage
Syntax
Align Directive
Parameters
Example
Allow Directive
Discussion
Allow Directive
To the .LEVEL specified for the file
Block and .BLOCKZ Pseudo-Operations
Block and .BLOCKZ Pseudo-Operations
Space $TEXT$ Subspa $CODE$ Block
Byte Pseudo-Operation
Byte Pseudo-Operation
Byte initvalue , initvalue
Call Directive
Call Directive
Call argumentdescription argumentdescription
Return value for a procedure
Form of argument-description is Arg=location Where arg can
first word in the argument list
Second word in the argument list
LIT Align Word
Procend Export
Callinfo Directive
Callinfo Directive
Callinfo parameter , parameter
Register
ENTRYSR=
Unwound
It restores the RP value when it encounters a .LEAVE
Callinfo Directive Stack Frames
Re-enter code subspace
Comm Directive
Comm Directive
Label .COMM numbytes
Label Labels the location of the reserved storage
Copyright Directive
Copyright Directive
Company-name
Proc Callinfo Enter
Fraction E power
Integer .fraction E power
Double Pseudo-Operation
Double Pseudo-Operation
Dword Pseudo-Operation
Dword Pseudo-Operation
Dword initvalue , initvalue
END Directive
END Directive
Endm Directive
Endm Directive
Enter and .LEAVE Pseudo-Operations
Enter and .LEAVE Pseudo-Operations
Space $TEXT$
Entry and .EXIT Directives
Entry and .EXIT Directives
EQU Directive
Symbolicname .EQU value
EQU Directive
Value
Export Directive
Export Directive
Argument
Export proc,ENTRY,ARGW0=GR
Float Pseudo-Operation
Float Pseudo-Operation
Half Pseudo-Operation
Half Pseudo-Operation
Half initvalue , initvalue
Import Directive
Import Directive
NOP END
Label Directive
Label Directive
Label labelid
Labelid Names the label identifier
Level Directive
Level Directive
Level Directive
Listoff and .LISTON Directives
Listoff and .LISTON Directives
Liston Code Space $TEXT$ SPNUM=0,SORT=0 Subspa $CODE$
Locct Directive
Locct Directive
Macro Directive
Macro Directive
Label .MACRO formalparameter,formalparameter
Examples
100
Origin Directive
Origin Directive
Chapter 101
Proc and .PROCEND Directives
Proc and .PROCEND Directives
102
Chapter 103
REG Directive
REG Directive
Label .REG typedregister
Label User-defined register name
Shlibversion Directive
Shlibversion Directive
Chapter 105
Space Directive
Space Directive
106
Chapter 107
Spnum Pseudo-Operation
Spnum Pseudo-Operation
108
String and .STRINGZ Pseudo-Operations
String and .STRINGZ Pseudo-Operations
Chapter 109
110
Subspa Directive
Subspa Directive
Name An identifier that names the current subspace
Chapter 111
112
Chapter 113
Version Directive
Version Directive
114
Word Pseudo-Operation
Word Pseudo-Operation
Word initvalue , initvalue
Chapter 115
Programming Aids
Directive Space Name Default Parameters
Programming Aids
Predefined Subspace Directives
Chapter 117
Shortdata
Programming Aids 118
119
Pseudo-Instruction Set
120
Compare and Branch Conditions Comb and Comib
Cond Description
Chapter 121
122
Add and Branch Conditions Addb and Addib Description
123
Invoking the Assembler
Using the as Command
Using the as Command
Assemble code for the architecture
124
filename
Level
Chapter 125
Tables, see HP-UX Linker and Libraries
Wnumber
Online User Guide
126
Using the cc Command
Using the cc Command
Passing Arguments to the Assembler
Wa, ,as-argument as-argument
128
Cpp Preprocessor
129
Programming Examples
Binary Search for Highest Bit Position
Binary Search for Highest Bit Position
130
Chapter 131
Copying a String
Copying a String
132
Chapter 133
Dividing a Double-Word Dividend
Dividing a Double-Word Dividend
134
Chapter 135
Programming Examples
Demonstrating the Procedure Calling Convention
Demonstrating the Procedure Calling Convention
Program Listing
136
Chapter 137
Assembly Program Listing
Assembly Program Listing From the C Compiler
Output of the cc -S Command
Output of the cc -S Command
138
Chapter 139
Output of the cc -S Command 140
141
142
Option operand
Chapter 143
144
Reserve
Wrong register type used
Use a general register
Chapter 145
Use a space register
Use a control register
146
Chapter 147
148
Chapter 149
150
Chapter 151
152
Used to invoke the assembler
Chapter 153
Error Messages
Error Messages
154
Chapter 155
156
Chapter 157
158
1028
1027
1029
1030
1032
1031
1033
1034
1036
1035
1037
1038
162
Chapter 163
1055
1054
1056
1057
Chapter 165
166
Chapter 167
168
1080
Format keyword=value
1081
1082
170
1089
1088
1090
Chapter 171
1094
1091
1095
1096
1098
1097
1099
1100
1102
1101
1103
1104
Chapter 175
1105
Panic Messages
Panic Messages
176
2006
2005
2007
2008
User Warning Messages
User Warning Messages
178
7004
7003
7005
7006
180
Chapter 181
182
Limit Error Messages
Limit Error Messages
7200
7201
7203
7202
7204
184
Chapter 185
Diagnostic Messages
186
Branching Error Messages
Branching Error Messages
Chapter 187
188
Chapter 189
190
Chapter 191
192
7828
7827
7834
7835
7837
7836
Expr
194
Index 195
Index
Numerics
196
Copyright
Index 197
HP C/HP-UX,49
198
Mfctl
Index 199
Double
200
See also memory
Index 201
202