added instruction functionality
This commit is contained in:
parent
483a16c194
commit
d4754a048d
9 changed files with 754 additions and 170 deletions
38
simulator_SIC_XE/include/constants.h
Normal file
38
simulator_SIC_XE/include/constants.h
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
#ifndef CONSTANTS_H
|
||||
#define CONSTANTS_H
|
||||
|
||||
// ==============================
|
||||
// SIC/XE Architecture Constants
|
||||
// ==============================
|
||||
|
||||
// Memory and system constants
|
||||
constexpr int MEMORY_SIZE = 65536;
|
||||
constexpr int NUM_DEVICES = 256;
|
||||
constexpr int WORD_SIZE = 24;
|
||||
constexpr int WORD_MASK = 0xFFFFFF;
|
||||
|
||||
// SIC/XE floating point constants
|
||||
constexpr int SICF_BITS = 48;
|
||||
constexpr int SICF_FRAC_BITS = 40;
|
||||
constexpr int SICF_EXP_BITS = 7;
|
||||
constexpr int SICF_EXP_BIAS = 64;
|
||||
constexpr unsigned long long SICF_FRAC_MASK = (1ULL << SICF_FRAC_BITS) - 1;
|
||||
|
||||
// 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
|
||||
|
||||
// Instruction format bit masks
|
||||
constexpr int TYPE3_4_SIC_MASK = 0xFC;
|
||||
constexpr int NI_MASK = 0x03; // mask for n and i bits
|
||||
constexpr int NI_SIC = 0x0;
|
||||
|
||||
constexpr int BP_BASE_REL_MASK = 0b10;
|
||||
constexpr int BP_PC_REL_MASK = 0b01;
|
||||
constexpr int BP_DIRECT_MASK = 0b00;
|
||||
|
||||
constexpr int BIT_E_MASK = 0x10; // mask for e bit in F4 and F3 instructions
|
||||
|
||||
#endif // CONSTANTS_H
|
||||
Loading…
Add table
Add a link
Reference in a new issue