summaryrefslogtreecommitdiff
path: root/sources/meta/disasm.c
blob: 841a455c3cd99c37aa7c812886e2aceb4e29c2f8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/*
 * Copyright (C) 2025 dwlr <dweller@cabin.digital>
 *
 * BSD 3-Clause License (BSD-3-Clause)
 * See LICENSE for details
 */

#define X_C8_PRELUDE
#define X_C8_EPILOGUE

#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)

#include "undef.c"