diff options
Diffstat (limited to 'sources/meta')
-rw-r--r-- | sources/meta/disasm.c | 41 | ||||
-rw-r--r-- | sources/meta/undef.c | 36 |
2 files changed, 77 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" + diff --git a/sources/meta/undef.c b/sources/meta/undef.c new file mode 100644 index 0000000..1863e9b --- /dev/null +++ b/sources/meta/undef.c @@ -0,0 +1,36 @@ +#undef X_C8_ILL +#undef X_C8_CLS +#undef X_C8_RET +#undef X_C8_SYS +#undef X_C8_JP +#undef X_C8_CALL +#undef X_C8_LDI +#undef X_C8_JPV +#undef X_C8_SEB +#undef X_C8_SNEB +#undef X_C8_LD +#undef X_C8_ADDB +#undef X_C8_RND +#undef X_C8_SKP +#undef X_C8_SKNP +#undef X_C8_MVDT +#undef X_C8_LDK +#undef X_C8_LDDT +#undef X_C8_LDST +#undef X_C8_ADDI +#undef X_C8_HEX +#undef X_C8_BCD +#undef X_C8_SAVE +#undef X_C8_RESTORE +#undef X_C8_SE +#undef X_C8_MOVE +#undef X_C8_OR +#undef X_C8_AND +#undef X_C8_XOR +#undef X_C8_ADD +#undef X_C8_SUB +#undef X_C8_SHR +#undef X_C8_SUBN +#undef X_C8_SHL +#undef X_C8_SNE +#undef X_C8_DRW |