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

51 lines
986 B
C
Raw Normal View History

2019-05-29 16:57:22 +02:00
// The OS/K Team licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
2019-06-14 12:46:09 +02:00
// Register types
enum
{
2019-07-11 18:34:21 +02:00
GPR = 0, // Non-reserved
RES = 1 << 0, // Reserved for insternal use
SYS = 1 << 1, // Reserved for supervisor mode
2019-06-14 12:46:09 +02:00
};
// FLG register
enum
{
2019-07-11 18:34:21 +02:00
ZF = 1 << 0, // Zero flag
SF = 1 << 1, // Sign flag
2019-06-14 12:46:09 +02:00
2019-07-11 18:34:21 +02:00
CF = 1 << 4, // Carry flag
OF = 1 << 5, // Overflow flag
2019-06-14 12:46:09 +02:00
2019-07-11 18:34:21 +02:00
PF = 1 << 8, // Parity flag
DF = 1 << 9, // Direction flag
2019-06-14 12:46:09 +02:00
};
// CR0 register
enum
{
2019-06-19 21:41:22 +02:00
IF = 1 << 0, // Interrupts-enable flag
UF = 1 << 1, // User-mode flag
2019-06-14 12:46:09 +02:00
};
struct reg_t
{
char *name;
ulong flags;
};
2019-05-29 16:57:22 +02:00
enum
{
2019-07-22 13:18:13 +02:00
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,
2019-07-01 00:45:08 +02:00
NREGS
};
2019-07-24 16:52:26 +02:00
#define _fc0 ctx->ninstrs
#define _rpc ctx->cur_pc
2019-05-29 16:57:22 +02:00