blob: 2f7c7af5957399eb292cf27dbeaa7a0c4a85aded (
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
|
// file : core/arch_inst.h
// project : Salis-VM
// author : Paul Oliver <contact@pauloliver.dev>
#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
|