summaryrefslogtreecommitdiff
path: root/instructions.h
diff options
context:
space:
mode:
Diffstat (limited to 'instructions.h')
-rw-r--r--instructions.h16
1 files changed, 14 insertions, 2 deletions
diff --git a/instructions.h b/instructions.h
index c94c04b..36a69f8 100644
--- a/instructions.h
+++ b/instructions.h
@@ -190,8 +190,20 @@
#define JNZ
#define JMP
#define LEA
-#define POP
-#define PUSH
+
+// Push immediate byte/dword
+#define PUSHBI(imm) (0x6a), imm
+#define PUSHDI(imm) \
+ (0x68), (imm & 0xff), ((imm >> 8) & 0xff), ((imm >> 16) & 0xff), \
+ ((imm >> 24) & 0xff)
+// Push register word/qword
+#define PUSHW(reg) PREFIX_OVERRIDE_OPSIZE, (0x50 + reg)
+#define PUSHQ(reg) (0x50 + reg)
+
+// Pop register word/qword
+#define POPW(reg) PREFIX_OVERRIDE_OPSIZE, (0x58 + reg)
+#define POPQ(reg) (0x58 + reg)
+
#define RET 0xc3
#define RETN
#define SUB