|
|
IRIX 6.5 » Books » Developer »
MIPSpro Assembly Language Programmer's Guide
(document number: 007-2418-006 / published: 2003-08-15)
table of contents | additional info | download find in page
This chapter
describes the formats that you can use to specify addresses. SGI CPUs use
a byte addressing scheme. Access to halfwords requires alignment on even byte
boundaries, and access to words requires alignment on byte boundaries that
are divisible by four. Access to doublewords (for 64-bit systems) requires
alignment on byte boundaries that are divisible by eight. Any attempt to
address a data item that does not have the proper alignment causes an alignment
exception.
Instructions to Load and Store Unaligned Data
The unaligned assembler load and store instructions may generate multiple
machine language instructions. They do not raise alignment exceptions.
These instructions load and store unaligned data:
Load doubleword left (LDL)
Load word left (LWL)
Load doubleword right (LDR)
Load word right (LWR)
Store doubleword left (SDL)
Store word left (SWL)
Store doubleword right (SDR)
Store word right (SWR)
Unaligned load doubleword (ULD)
Unaligned load word (ULW)
Unaligned load halfword (ULH)
Unaligned load halfword unsigned (ULHU)
Unaligned store doubleword (USD)
Unaligned store word (USW)
Unaligned store halfword (USH)
The following instructions load and store aligned data:
The
assembler accepts the following formats for addresses: Table 2-2
explains these formats in more detail.
Table 2-1. Address Formats
Format
| Address
|
|---|
(base-register)
| Base address (zero offset assumed)
| expression
| Absolute address
| expression (base-register
)
| Based address
| index-register (base-register
)
| Based address
| relocatable-symbol
| Relocatable address
| relocatable-symbol ±
expression
| Relocatable address
| relocatable-symbol ±
expression (index register)
| Indexed relocatable address
|
The assembler accepts any combination of the constants and operations
described in this chapter for expressions in address descriptions.
Table 2-2. Assembler Addresses
Expression
| Address
Description
|
|---|
( base-register)
| Specifies an indexed address, which assumes a zero offset. The
base-register contents specify the address.
| expression
| Specifies an absolute address. The assembler generates the most
locally efficient code for referencing a value at the specified address.
| expression (base-register
)
| Specifies a based address. To get the address, the CPU adds
the value of the expression to the contents of the base-register.
| index-register (base-register)
| Same as expression(base-register
), except that the index register is used as the offset.
| relocatable-symbol
| Specifies a relocatable address. The assembler generates the
necessary instruction(s) to address the item and generates relocatable information
for the link editor.
| relocatable-symbol ±
expression
| Specifies a relocatable address. To get the address, the assembler
adds or subtracts the value of the expression, which has an absolute value,
from the relocatable symbol. The assembler generates the necessary instruction(s)
to address the item and generates relocatable information for the link editor.
If the symbol name does not appear as a label anywhere in the assembly,
the assembler assumes that the symbol is external.
| relocatable-symbol (
index register)
| Specifies an indexed relocatable address. To get the address,
the CPU adds the index registerto the relocatable symbol's address. The
assembler generates the necessary instruction(s) to address the item and
generates relocatable information for the link editor. If the symbol name
does not appear as a label anywhere in the assembly, the assembler assumes
that the symbol is external.
| relocatable ±
expression
| Specifies an indexed relocatable address. To get the address,
the assembler adds or subtracts the relocatable symbol, the expression,
and the contents of the index register. The assembler generates the necessary
instruction(s) to address the item and generates relocation information for
the link editor. If the symbol does not appear as a label anywhere in the
assembly, the assembler assumes that the symbol is external.
|
MIPSpro Assembly Language Programmer's Guide
(document number: 007-2418-006 / published: 2003-08-15)
table of contents | additional info | download
Front Matter
New Features in This Manual
About This Guide
Chapter 1. Registers
Chapter 2. Addressing
Chapter 3. Exceptions
Chapter 4. Lexical Conventions
Chapter 5. The Instruction Set
Chapter 6. Coprocessor Instruction Set
Chapter 7. Writing Assembly Language Code
Chapter 8. Pseudo Op-Codes (Directives)
Index
home/search |
what's new |
help
|
|
|