1
0
mirror of https://gitlab.os-k.eu/os-k-team/kvisc.git synced 2023-08-25 14:05:46 +02:00
kvisc/vm/pc/regs.h
2019-07-24 16:52:26 +02:00

51 lines
986 B
C

// The OS/K Team licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
// Register types
enum
{
GPR = 0, // Non-reserved
RES = 1 << 0, // Reserved for insternal use
SYS = 1 << 1, // Reserved for supervisor mode
};
// FLG register
enum
{
ZF = 1 << 0, // Zero flag
SF = 1 << 1, // Sign flag
CF = 1 << 4, // Carry flag
OF = 1 << 5, // Overflow flag
PF = 1 << 8, // Parity flag
DF = 1 << 9, // Direction flag
};
// CR0 register
enum
{
IF = 1 << 0, // Interrupts-enable flag
UF = 1 << 1, // User-mode flag
};
struct reg_t
{
char *name;
ulong flags;
};
enum
{
RZX, CR0, CR1, CR2, RFX, RIP, RBP, RSP,
RAX, RBX, RCX, RDX, RSI, RDI, AX0, AX1,
AX2, AX3, AX4, AX5, R12, R13, R14, R15,
R16, R17, R18, R19, R20, GRP, TRP, SRP,
NREGS
};
#define _fc0 ctx->ninstrs
#define _rpc ctx->cur_pc