This commit is contained in:
zanostro 2025-12-07 11:27:01 +01:00
parent 18a14d204c
commit 717568b6d0
30 changed files with 4093 additions and 209 deletions

View file

@ -1,6 +1,8 @@
#ifndef OPCODE_H
#define OPCODE_H
#include "utils.h"
// ==============================
// Opcode definitions (SIC/XE)
// ==============================
@ -64,13 +66,26 @@
#define TIXR 0xB8
#define WD 0xDC
// SW register condition codes
constexpr int CC_LT = 0x0; // 00
constexpr int CC_EQ = 0x1; // 01
constexpr int CC_GT = 0x2; // 10
constexpr int CC_MASK = 0x3; // mask for 2 bits
// ==============================
// Extended opcodes (SIC/XE/XE)
// ==============================
#define NOP 0xF1
#define HALT 0xF2
#define XEXE 0xEE // Enable extended mode
#define VADD 0x18
#define VADDR 0x90
#define VSUB 0x1C
#define VSUBR 0x94
#define VMUL 0x20
#define VMULR 0x98
#define VDIV 0x24
#define VDIVR 0x9C
#define STVA 0x0C
#define STVS 0x7C
#define STVT 0x84
#define LDVA 0x00
#define LDVS 0x68
#define LDVT 0x04
@ -93,6 +108,7 @@ struct InstructionInfo {
};
extern InstructionInfo instructions[];
extern InstructionInfo instructionsEXEX[];
// Initialize the instruction table
void loadInstructionSet();