diff options
Diffstat (limited to 'executor/x86_64/asm.h')
-rw-r--r-- | executor/x86_64/asm.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/executor/x86_64/asm.h b/executor/x86_64/asm.h index ace1ecf..ac519e9 100644 --- a/executor/x86_64/asm.h +++ b/executor/x86_64/asm.h @@ -89,6 +89,30 @@ CHECK_RESULT int asm_callr(Asm *self, Reg64 reg); CHECK_RESULT int asm_call_rel32(Asm *self, i32 relative); void asm_override_call_rel32(Asm *self, u32 asm_index, i32 new_relative); +CHECK_RESULT int asm_cmp_rm(Asm *self, Reg64 reg1, AsmPtr *reg2); +/* + Sets the 8 bit memory operand to 1 if the last cmp was equals, otherwise set it to 0. + Note: this instruction doesn't work with AH (RSP), CH (RBP), DH (RSI) and BH (RDI). + TODO: When ST, MM AND XMM registers are implemented, also check for them as they are also invalid +*/ +CHECK_RESULT int asm_sete_m(Asm *self, AsmPtr *dst); +CHECK_RESULT int asm_sete_r(Asm *self, Reg64 dst); +/* + In x86 assembly, the @relative position starts from the next instruction. + This offset shouldn't be calculated by the caller and is instead managed + by this asm library itself. +*/ +CHECK_RESULT int asm_jz(Asm *self, i32 relative); +/* Override conditional jump target */ +void asm_override_jcc_rel32(Asm *self, u32 asm_index, i32 new_relative); +/* + In x86 assembly, the @relative position starts from the next instruction. + This offset shouldn't be calculated by the caller and is instead managed + by this asm library itself. +*/ +CHECK_RESULT int asm_jmp(Asm *self, i32 relative); +void asm_override_jmp_rel32(Asm *self, u32 asm_index, i32 new_relative); + |