summaryrefslogtreecommitdiff
path: root/sources/meta/disasm.c
diff options
context:
space:
mode:
authordweller <dweller@cabin.digital>2025-03-26 18:25:34 +0200
committerdweller <dweller@cabin.digital>2025-03-26 18:25:34 +0200
commit42e9b31e0d7324106a65ad9ff42ea2377a80fa51 (patch)
treeceee87f9e0067b6d5c71f5e728fe0b3fd0fd8b72 /sources/meta/disasm.c
parent76d89eb9973671726dc7fffaf22b06a7a77be550 (diff)
fix disasm not showing instruction hex; implement a few instructions exec; add report logger
Diffstat (limited to 'sources/meta/disasm.c')
-rw-r--r--sources/meta/disasm.c72
1 files changed, 36 insertions, 36 deletions
diff --git a/sources/meta/disasm.c b/sources/meta/disasm.c
index 2a33aed..66c1478 100644
--- a/sources/meta/disasm.c
+++ b/sources/meta/disasm.c
@@ -1,39 +1,39 @@
-#define X_C8_ILL sprintf(usrdat, "ILL unknown")
-#define X_C8_CLS sprintf(usrdat, "CLS")
-#define X_C8_RET sprintf(usrdat, "RET")
-#define X_C8_SYS sprintf(usrdat, "SYS 0x%03X", nnn)
-#define X_C8_JP sprintf(usrdat, "JP 0x%03X", nnn)
-#define X_C8_CALL sprintf(usrdat, "CALL 0x%03X", nnn)
-#define X_C8_LDI sprintf(usrdat, "LD I, 0x%03X", nnn)
-#define X_C8_JPV sprintf(usrdat, "JP V0, 0x%03X", nnn)
-#define X_C8_SEB sprintf(usrdat, "SE V%x, %d", x, kk)
-#define X_C8_SNEB sprintf(usrdat, "SNE V%x, %d", x, kk)
-#define X_C8_LD sprintf(usrdat, "LD V%x, %d", x, kk)
-#define X_C8_ADDB sprintf(usrdat, "ADD V%x, %d", x, kk)
-#define X_C8_RND sprintf(usrdat, "RND V%x, %d", x, kk)
-#define X_C8_SKP sprintf(usrdat, "SKP V%x", x)
-#define X_C8_SKNP sprintf(usrdat, "SKNP V%x", x)
-#define X_C8_MVDT sprintf(usrdat, "LD V%x, DT", x)
-#define X_C8_LDK sprintf(usrdat, "LD V%x, K", x)
-#define X_C8_LDDT sprintf(usrdat, "LD DT, V%x", x)
-#define X_C8_LDST sprintf(usrdat, "LD ST, V%x", x)
-#define X_C8_ADDI sprintf(usrdat, "ADD I, V%x", x)
-#define X_C8_HEX sprintf(usrdat, "LD F, V%x", x)
-#define X_C8_BCD sprintf(usrdat, "LD B, V%x", x)
-#define X_C8_SAVE sprintf(usrdat, "LD [I], V%x", x)
-#define X_C8_RESTORE sprintf(usrdat, "LD V%x, [I]", x)
-#define X_C8_SE sprintf(usrdat, "SE V%x, V%x", x, y)
-#define X_C8_MOVE sprintf(usrdat, "LD V%x, V%x", x, y)
-#define X_C8_OR sprintf(usrdat, "OR V%x, V%x", x, y)
-#define X_C8_AND sprintf(usrdat, "AND V%x, V%x", x, y)
-#define X_C8_XOR sprintf(usrdat, "XOR V%x, V%x", x, y)
-#define X_C8_ADD sprintf(usrdat, "ADD V%x, V%x", x, y)
-#define X_C8_SUB sprintf(usrdat, "SUB V%x, V%x", x, y)
-#define X_C8_SHR sprintf(usrdat, "SHR V%x, V%x", x, y)
-#define X_C8_SUBN sprintf(usrdat, "SUBN V%x, V%x", x, y)
-#define X_C8_SHL sprintf(usrdat, "SHL V%x, V%x", x, y)
-#define X_C8_SNE sprintf(usrdat, "SNE V%x, V%x", x, y)
-#define X_C8_DRW sprintf(usrdat, "DRW V%x, V%x, %d", x, y, n)
+#define X_C8_ILL sprintf(usrdat, "%04X ILL unknown", instr)
+#define X_C8_CLS sprintf(usrdat, "%04X CLS", instr)
+#define X_C8_RET sprintf(usrdat, "%04X RET", instr)
+#define X_C8_SYS sprintf(usrdat, "%04X SYS 0x%03X", instr, nnn)
+#define X_C8_JP sprintf(usrdat, "%04X JP 0x%03X", instr, nnn)
+#define X_C8_CALL sprintf(usrdat, "%04X CALL 0x%03X", instr, nnn)
+#define X_C8_LDI sprintf(usrdat, "%04X LD I, 0x%03X", instr, nnn)
+#define X_C8_JPV sprintf(usrdat, "%04X JP V0, 0x%03X", instr, nnn)
+#define X_C8_SEB sprintf(usrdat, "%04X SE V%x, %d", instr, x, kk)
+#define X_C8_SNEB sprintf(usrdat, "%04X SNE V%x, %d", instr, x, kk)
+#define X_C8_LD sprintf(usrdat, "%04X LD V%x, %d", instr, x, kk)
+#define X_C8_ADDB sprintf(usrdat, "%04X ADD V%x, %d", instr, x, kk)
+#define X_C8_RND sprintf(usrdat, "%04X RND V%x, %d", instr, x, kk)
+#define X_C8_SKP sprintf(usrdat, "%04X SKP V%x", instr, x)
+#define X_C8_SKNP sprintf(usrdat, "%04X SKNP V%x", instr, x)
+#define X_C8_MVDT sprintf(usrdat, "%04X LD V%x, DT", instr, x)
+#define X_C8_LDK sprintf(usrdat, "%04X LD V%x, K", instr, x)
+#define X_C8_LDDT sprintf(usrdat, "%04X LD DT, V%x", instr, x)
+#define X_C8_LDST sprintf(usrdat, "%04X LD ST, V%x", instr, x)
+#define X_C8_ADDI sprintf(usrdat, "%04X ADD I, V%x", instr, x)
+#define X_C8_HEX sprintf(usrdat, "%04X LD F, V%x", instr, x)
+#define X_C8_BCD sprintf(usrdat, "%04X LD B, V%x", instr, x)
+#define X_C8_SAVE sprintf(usrdat, "%04X LD [I], V%x", instr, x)
+#define X_C8_RESTORE sprintf(usrdat, "%04X LD V%x, [I]", instr, x)
+#define X_C8_SE sprintf(usrdat, "%04X SE V%x, V%x", instr, x, y)
+#define X_C8_MOVE sprintf(usrdat, "%04X LD V%x, V%x", instr, x, y)
+#define X_C8_OR sprintf(usrdat, "%04X OR V%x, V%x", instr, x, y)
+#define X_C8_AND sprintf(usrdat, "%04X AND V%x, V%x", instr, x, y)
+#define X_C8_XOR sprintf(usrdat, "%04X XOR V%x, V%x", instr, x, y)
+#define X_C8_ADD sprintf(usrdat, "%04X ADD V%x, V%x", instr, x, y)
+#define X_C8_SUB sprintf(usrdat, "%04X SUB V%x, V%x", instr, x, y)
+#define X_C8_SHR sprintf(usrdat, "%04X SHR V%x, V%x", instr, x, y)
+#define X_C8_SUBN sprintf(usrdat, "%04X SUBN V%x, V%x", instr, x, y)
+#define X_C8_SHL sprintf(usrdat, "%04X SHL V%x, V%x", instr, x, y)
+#define X_C8_SNE sprintf(usrdat, "%04X SNE V%x, V%x", instr, x, y)
+#define X_C8_DRW sprintf(usrdat, "%04X DRW V%x, V%x, %d", instr, x, y, n)
c8_decode_generate(disasm)