From 1961b4b237083f4cfac9ca6b249c1d6cb665d149 Mon Sep 17 00:00:00 2001 From: Paul Oliver Date: Tue, 14 Jul 2026 17:29:02 +0200 Subject: Initial (refactor) --- arch/null/arch_inst.c | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 arch/null/arch_inst.c (limited to 'arch/null/arch_inst.c') diff --git a/arch/null/arch_inst.c b/arch/null/arch_inst.c new file mode 100644 index 0000000..4744382 --- /dev/null +++ b/arch/null/arch_inst.c @@ -0,0 +1,48 @@ +// file : arch/null/arch_inst.c +// project : Salis-VM +// author : Paul Oliver + +#include +#include +#include +#include + +#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; +} -- cgit v1.2.1