summaryrefslogtreecommitdiffhomepage
path: root/include/CompilerKit/Detail
diff options
context:
space:
mode:
Diffstat (limited to 'include/CompilerKit/Detail')
-rw-r--r--include/CompilerKit/Detail/AMD64.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/include/CompilerKit/Detail/AMD64.h b/include/CompilerKit/Detail/AMD64.h
index 8f16968..f1c0671 100644
--- a/include/CompilerKit/Detail/AMD64.h
+++ b/include/CompilerKit/Detail/AMD64.h
@@ -39,13 +39,18 @@ struct CpuOpcodeAMD64 {
#define kJumpLimitStandard 0xE3
#define kJumpLimitStandardLimit 0xEB
+/// @brief Base opcodes for push/pop instructions
+#define kAsmPushOpcode 0x50
+#define kAsmPopOpcode 0x58
+
inline std::vector<CpuOpcodeAMD64> kOpcodesAMD64 = {
CK_ASM_OPCODE("int", 0xCD) CK_ASM_OPCODE("into", 0xCE) CK_ASM_OPCODE("intd", 0xF1)
CK_ASM_OPCODE("int3", 0xC3) CK_ASM_OPCODE("iret", 0xCF) CK_ASM_OPCODE("retf", 0xCB)
CK_ASM_OPCODE("retn", 0xC3) CK_ASM_OPCODE("ret", 0xC3) CK_ASM_OPCODE("sti", 0xfb)
CK_ASM_OPCODE("cli", 0xfa) CK_ASM_OPCODE("hlt", 0xf4) CK_ASM_OPCODE("nop", 0x90)
CK_ASM_OPCODE("mov", 0x48) CK_ASM_OPCODE("call", 0xFF)
- CK_ASM_OPCODE("syscall", 0x0F) CK_ASM_OPCODE("xor", 0x48)};
+ CK_ASM_OPCODE("syscall", 0x0F) CK_ASM_OPCODE("xor", 0x48) CK_ASM_OPCODE(
+ "push", kAsmPushOpcode) CK_ASM_OPCODE("pop", kAsmPopOpcode)};
#define kAsmRegisterLimit 16