TSK3000A Generic Instruction - LA
Frozen Content
Instruction: Load Address
Assembler Format | Example | Translates to... |
---|---|---|
la rC, target | la $3, Shifter | see note 1 |
la rC, target(rA) | la $3, Shifter($2) | see note 2 |
Notes
- If the address is an absolute expression, then this format becomes identical to the LI macro instruction and will translate as such. If the address is a relocatable expression, then this format translates to:
lui $at, @HI(target)
addiu rC, $at, @LO(target)
- If the address is an absolute expression, then this format translates into single ADDIU machine instruction, or in a LI plus an ADDIU. In this case the second format for this macro can better be described as 'la rC, offset(rA)' – i.e. load an offset added to an address defined in GPR rA.
If the address is a relocatable expression, then this format translates to:
lui $at, @HI(target)
addiu $at, $at, @LO(target)
addu rC, $at, rA
unless the source register is the GP register ($28) and the assembler runs with the -gp-relative option enabled, in which case the second format translates into the following single machine instruction:
addiu rC, rA, @GPREL(target)