Altera Corporation 101
3232323232-Bit Instruction Set
2
32-Bit Instruction
Set
SWAP

Swap Register Half-Words

Operation: RAh0RA : h1RA
Assembler Syntax: SWAP %rA
Example: SWAP %g3 ; Exchange two half-words in %g3
Description: Swaps (exchanges positions) of the two 16-bit half-word values in RA. Writes
result back into RA.
Condition Codes: Flags: Unaffected
Instruction Format: Rw
Instruction Fields: A = Register index of operand RA
1514131211109876543210
01111101000 A
NVZC
−−−−