summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--instructions.h17
1 files changed, 12 insertions, 5 deletions
diff --git a/instructions.h b/instructions.h
index d6c512b..c94c04b 100644
--- a/instructions.h
+++ b/instructions.h
@@ -153,8 +153,7 @@
(0x81), MODRM(3, 0, reg), (imm & 0xff), ((imm >> 8) & 0xff), \
((imm >> 16) & 0xff), ((imm >> 24) & 0xff)
// The immediate value will get truncated to 32bit anyways.
-#define ADDQI(reg, imm) \
- REX(REX_W), ADDDI(reg, imm)
+#define ADDQI(reg, imm) REX(REX_W), ADDDI(reg, imm)
// Add register
#define ADDB(src, dst) (0x00), MODRM(3, src, dst)
@@ -168,15 +167,23 @@
#define ADDDC(src, dst) (0x11), MODRM(3, src, dst)
#define ADDQC(src, dst) REX(REX_W), ADDDC(src, dst)
-#define ADD
#define CALL
#define CMP
-#define DEC
#define DIV
#define HLT
#define IDIV
#define IMUL
-#define INC
+
+#define INCB(reg) (0xFE), MODRM(3, 0x0, reg)
+#define INCW(reg) PREFIX_OVERRIDE_OPSIZE, (0xFF), MODRM(3, 0x0, reg)
+#define INCD(reg) (0xFF), MODRM(3, 0x0, reg)
+#define INCQ(reg) REX(REX_W), (0xFF), MODRM(3, 0x0, reg)
+
+#define DECB(reg) (0xFE), MODRM(3, 0x1, reg)
+#define DECW(reg) PREFIX_OVERRIDE_OPSIZE, (0xFF), MODRM(3, 0x1, reg)
+#define DECD(reg) (0xFF), MODRM(3, 0x1, reg)
+#define DECQ(reg) REX(REX_W), (0xFF), MODRM(3, 0x1, reg)
+
#define INT
#define INTO
#define IRET