Move Signed Constant Into Register and Sign Extend−Used with MVKH MVKL
3-187 Instruction SetSPRU733
Move Signed Constant Into Register and Sign Extend
MVKL
Syntax MVKL (.unit) cst, dst
.unit = .S1 or .S2
Compatibility C62x, C64x, C67x, and C67x+ CPU
Opcode
31 29 28 27 23 22 76543210
creg z dst cst16 0 1 0 1 0 s p
3 1 5 16 1 1
Opcode map field used... For operand type... Unit
cst16
dst
scst16
sint
.S1, .S2
Description The MVKL pseudo-operation sign extends the 16-bit constant, cst16, and
places it in dst.
The MVKL instruction is equivalent to the MVK instruction (page 3-183),
except that the MVKL instruction disables the constant range checking
normally performed by the assembler/linker. This allows the MVKL instruction
to be paired with the MVKH instruction (page 3-185) to generate 32-bit
constants.
To load 32-bit constants, such as 1234 ABCDh, use the following pair of
instructions:
MVKL .S1 0x0ABCD, A4
MVKLH .S1 0x1234, A4
This could also be used:
MVKL .S1 0x1234ABCD, A4
MVKH .S1 0x1234ABCD, A4
Use this to load the address of a label:
MVKL .S2 label, B5
MVKH .S2 label, B5
Execution if (cond) scst → dst
else nop