blob: 47443827546cbbe6032637c8561e7196d3a327de (
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
|
// file : arch/null/arch_inst.c
// project : Salis-VM
// author : Paul Oliver <contact@pauloliver.dev>
#include <assert.h>
#include <stdbool.h>
#include <stdint.h>
#include <wchar.h>
#define ARCH_EXPORT_INST_COUNT
#include "arch_spec.h"
#include "arch_inst.h"
wchar_t arch_inst_symbol(uint8_t inst) {
assert(inst < ARCH_INST_COUNT);
switch (inst) {
case 0:
return L'⢀';
case 1:
return L'⢁';
case 2:
return L'⢂';
case 3:
return L'⢃';
}
assert(false);
return L'\0';
}
const char *arch_inst_mnemonic(uint8_t inst) {
assert(inst < ARCH_INST_COUNT);
switch (inst) {
case 0:
return "null 0";
case 1:
return "null 1";
case 2:
return "null 2";
case 3:
return "null 3";
}
assert(false);
return NULL;
}
|