Excalibur electronic A-MNL-NIOSPROG-01.1 DJ Equipment User Manual


 
Altera Corporation 11
GettingOverview
Overview
1
The following example shows an ADDI instruction being used both with
and without a PFX.
Code Example 3: The ADDI Instruction Used with/without a PFX
Besides arithmetic and logical instructions, several other instructions use
immediate-mode constants of various widths, and the constant is not
modified by the K register. See the description of each instruction in the
32-Bit Instruction Set for a precise explanation of its operation. Table 10
shows instructions using 5/16-bit immediate values.
* AND, ANDN, OR, and XOR can only use PFXd 16-bit immediate
values. These instructions act on two register operands if not preceded by
a PFX instruction.
; Assume %g3 contains the value 0x0041
ADDI %g3,5 ; Add 5 to %g3
; so %g3 now contains 0x0046
PFX %hi(0x1234) ; Load K with upper 11 bits of 0x1234
ADDI %g3,%lo(0x1234) ; Add low 5 bits of 0x1234 to %g3
; so the K register contained 0x0091
; and the immediate operand of the ADDI
; instruction contained 0x0011, which
; concatenated together make 0x1234
Table 10. Instructions Using 5/16-bit Immediate Values
ADDI AND* ANDN* ASRI
CMPI LSLI LSRI MOVI
MOVHI OR* SUBI XOR*