Mac OS X Assembler Reference
PDF
Introduction
Using the Assembler
Command Syntax
Assembler Options
-o
--
-f
-g
-v
-n
-I
-L
-V
-W
-dynamic
-static
Architecture Options
-arch
-force_cpusubtype_ALL
-arch_multiple
PowerPC-Specific Options
-no_ppc601
-static_branch_prediction_Y_bit
-static_branch_prediction_AT_bits
Assembly Language Syntax
Elements of Assembly Language
Characters
Identifiers
Labels
Numeric Labels
The Scope of a Label
Constants
Numeric Constants
Character Constants
String Constants
Floating-Point Constants
Assembly Location Counter
Expression Syntax
Operators
Terms
Expressions
Absolute Expressions
Relocatable Expressions
External Expressions
Assembly Language Statements
Label Field
Operation Code Field
Intel i386 ArchitectureâÂÂSpecific Caveats
Operand Field
Intel 386 ArchitectureâÂÂSpecific Caveats
Comment Field
Direct Assignment Statements
Assembler Directives
Directives for Designating the Current Section
.section
.zerofill
Section Types and Attributes
Type Identifiers
regular (S_REGULAR)
cstring_literals (S_CSTRING_LITERALS)
4byte_literals (S_4BYTE_LITERALS)
8byte_literals (S_8BYTE_LITERALS)
literal_pointers (S_LITERAL_POINTERS)
symbol_stubs (S_SYMBOL_STUBS)
lazy_symbol_pointers (S_LAZY_SYMBOL_POINTERS)
non_lazy_symbol_pointers (S_NON_LAZY_SYMBOL_POINTERS)
mod_init_funcs (S_MOD_INIT_FUNC_POINTERS)
mod_term_funcs (S_MOD_TERM_FUNC_POINTERS)
coalesced (S_COALESCED)
Attribute Identifiers
none (0)
S_ATTR_SOME_INSTRUCTIONS
no_dead_strip (S_ATTR_NO_DEAD_STRIP)
no_toc (S_ATTR_NO_TOC)
live_support (S_ATTR_LIVE_SUPPORT)
pure_instructions (S_ATTR_PURE_INSTRUCTIONS)
strip_static_syms (S_ATTR_STRIP_STATIC_SYMS)
self_modifying_code (S_ATTR_SELF_MODIFYING_CODE)
Built-in Directives
Designating Sections in the __TEXT Segment
.text
.const
.static_const
.cstring
.literal4
.literal8
.literal16
.constructor
.destructor
.fvmlib_init0
.fvmlib_init1
.symbol_stub
.picsymbol_stub
Designating Sections in the __DATA Segment
.data
.static_data
.const_data
.lazy_symbol_ptr
.non_lazy_symbol_ptr
.mod_init_func
.mod_term_func
.dyld
Designating Sections in the __OBJC Segment
Directives for Moving the Location Counter
.align
.org
Directives for Generating Data
.ascii and .asciz
.byte, .short, .long, and .quad
.comm
.fill
.lcomm
.single and .double
.space
Directives for Dealing With Symbols
.globl
.indirect_symbol
.reference
.weak_reference
.lazy_reference
.weak_definition
.private_extern
.stabs, .stabn, and .stabd
.desc
.set
.lsym
Directives for Dead-Code Stripping
.subsections_via_symbols
.no_dead_strip
Miscellaneous Directives
.abort
.abs
.dump and .load
.file and .line
.if, .elseif, .else, and .endif
.include
.machine
.macro, .endmacro, .macros_on, and .macros_off
PowerPC-Specific Directives
.flag_reg
.greg
.no_ppc601
.noflag_reg
Additional Processor-Specific Directives
PowerPC Addressing Modes and Assembler Instructions
PowerPC Registers and Addressing Modes
Registers
Operands and Addressing Modes
Extended Instruction Mnemonics & Operands
Branch Mnemonics
Branch Prediction
Trap Mnemonics
PowerPC Assembler Instructions
A
B
C
D
E
F
I
J
L
M
N
O
P
R
S
T
V
X
i386 Addressing Modes and Assembler Instructions
i386 Registers and Addressing Modes
Instruction Mnemonics
Registers
General Registers
Floating-Point Registers
Segment Registers
Other Registers
Operands and Addressing Modes
Register Operands
Immediate Operands
Direct Memory Operands
Indirect Memory Operands
i386 Assembler Instructions
A
B
C
D
E
F
H
I
J
L
M
N
O
P
R
S
T
V
W
X
Appendix A: Mode-Independent Macros
Revision History
Index