summaryrefslogtreecommitdiffhomepage
path: root/include/CompilerKit/Detail
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal@nekernel.org>2026-01-16 22:54:33 +0100
committerAmlal El Mahrouss <amlal@nekernel.org>2026-01-16 22:54:33 +0100
commit112b49ab7d2af6edea6bad97f2eea98e96ed5428 (patch)
tree80e7590c4851efafa6813f6f6adf483b1d5180de /include/CompilerKit/Detail
parentd4d91d5ffe7b02478a5ed14adcdad931dec95fd1 (diff)
feat: implement Mach-O linker and massive improvements on Assembler and Linkers.
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
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