From 1961b4b237083f4cfac9ca6b249c1d6cb665d149 Mon Sep 17 00:00:00 2001 From: Paul Oliver Date: Tue, 14 Jul 2026 17:29:02 +0200 Subject: Initial (refactor) --- core/arch_inst.h | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 core/arch_inst.h (limited to 'core/arch_inst.h') diff --git a/core/arch_inst.h b/core/arch_inst.h new file mode 100644 index 0000000..2f7c7af --- /dev/null +++ b/core/arch_inst.h @@ -0,0 +1,24 @@ +// file : core/arch_inst.h +// project : Salis-VM +// author : Paul Oliver + +#pragma once + +#define ARCH_INST_COUNT (1 << ARCH_SPEC_INST_BITS) +#define ARCH_INST_IPCM_FLAG 0x80 +#define ARCH_INST_MALL_FLAG 0x80 +#define ARCH_INST_MASK (ARCH_INST_COUNT - 1) +#define ARCH_INST_UNUSED_BITS (~(ARCH_INST_MALL_FLAG | ARCH_INST_MASK)) + +int arch_inst_count(void); +wchar_t arch_inst_symbol(uint8_t inst); +const char *arch_inst_mnemonic(uint8_t inst); + +// ARCH_EXPORT_INST_COUNT must be defined in arch_inst.c source files. +// This allows Python to read back the number of instructions for the selected +// VM architecture. +#if defined(ARCH_EXPORT_INST_COUNT) +int arch_inst_count(void) { + return ARCH_INST_COUNT; +} +#endif -- cgit v1.2.1