diff options
author | dweller <dweller@cabin.digital> | 2025-03-26 17:31:51 +0200 |
---|---|---|
committer | dweller <dweller@cabin.digital> | 2025-03-26 17:31:51 +0200 |
commit | 76d89eb9973671726dc7fffaf22b06a7a77be550 (patch) | |
tree | c0c3c6fb20d905b8f9b3bde2c1546d481b66e280 /sources/meta/disasm.c | |
parent | 5bf658d3a940e536e232d8fcd6e2ae431e5afdd7 (diff) |
build ''system''; decode metaprog; disasm
Diffstat (limited to 'sources/meta/disasm.c')
-rw-r--r-- | sources/meta/disasm.c | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/sources/meta/disasm.c b/sources/meta/disasm.c new file mode 100644 index 0000000..2a33aed --- /dev/null +++ b/sources/meta/disasm.c @@ -0,0 +1,41 @@ +#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) + +c8_decode_generate(disasm) + +#include "undef.c" + |