Data Movement
Data movement instructions transfer values between registers, immediates, and memory locations.
MOV
Moves an immediate value or register into a register.
| Instruction | Operand 1 | Operand 2 | Operation |
|---|---|---|---|
MOV | Reg | Reg/Imm | OP1 = OP2 |
block->mov(X86_REG_RAX, 1337);MOVSX
Moves an immediate value or register with sign extension into a register.
| Instruction | Operand 1 | Operand 2 | Operation |
|---|---|---|---|
MOVSX | Reg | Reg/Imm | OP1 = SX(OP2) |
// Move -1 into EAX then sign-extend to RAX
block->mov(X86_REG_EAX, -1);
block->movsx(X86_REG_RAX, X86_REG_EAX);STR
Stores a register or immediate value at the dereferenced value of a register with offset.
| Instruction | Operand 1 | Operand 2 | Operand 3 | Operation |
|---|---|---|---|---|
STR | Reg | Imm | Reg/Imm | [OP1+OP2] = OP3 |
block->str(REG_SP, 0, 1337);LDD
Dereferences a register and loads the value into a register. The source register supports offsets.
| Instruction | Operand 1 | Operand 2 | Operand 3 | Operation |
|---|---|---|---|---|
LDD | Reg | Reg | Imm | OP1 = [OP2+OP3] |
auto value = block->tmp(8);
block->ldd(value, REG_SP, 0);