mirror of
https://gitlab.os-k.eu/os-k-team/kvisc.git
synced 2023-08-25 14:05:46 +02:00
108 lines
1.9 KiB
C
108 lines
1.9 KiB
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.
|
|
|
|
enum
|
|
{
|
|
INV,
|
|
#define inv R(INV)
|
|
|
|
RIP, FLG, RBP, RSP,
|
|
#define rip R(RIP)
|
|
#define flg R(FLG)
|
|
#define rbp R(RBP)
|
|
#define rsp R(RSP)
|
|
|
|
RAX, RBX, RCX, RDX,
|
|
RSX, RBI, RDI, RSI,
|
|
#define rax R(RAX)
|
|
#define rbx R(RBX)
|
|
#define rcx R(RCX)
|
|
#define rdx R(RDX)
|
|
#define rsx R(RSX)
|
|
#define rbi R(RBI)
|
|
#define rdi R(RDI)
|
|
#define rsi R(RSI)
|
|
|
|
NX0, NX1, NX2, NX3,
|
|
NX4, NX5, NX6, NX7,
|
|
#define nx0 R(NX0)
|
|
#define nx1 R(NX1)
|
|
#define nx2 R(NX2)
|
|
#define nx3 R(NX3)
|
|
#define nx4 R(NX4)
|
|
#define nx5 R(NX5)
|
|
#define nx6 R(NX6)
|
|
#define nx7 R(NX7)
|
|
|
|
AX0, AX1, AX2, AX3,
|
|
AX4, AX5, AX6, AX7,
|
|
#define ax0 R(AX0)
|
|
#define ax1 R(AX1)
|
|
#define ax2 R(AX2)
|
|
#define ax3 R(AX3)
|
|
#define ax4 R(AX4)
|
|
#define ax5 R(AX5)
|
|
#define ax6 R(AX6)
|
|
#define ax7 R(AX7)
|
|
|
|
|
|
CR0, CR1, CR2, CR3,
|
|
CR4, CR5, CR6, CR7,
|
|
#define cr0 R(CR0)
|
|
#define cr1 R(CR1)
|
|
#define cr2 R(CR2)
|
|
#define cr3 R(CR3)
|
|
#define cr4 R(CR4)
|
|
#define cr5 R(CR5)
|
|
#define cr6 R(CR6)
|
|
#define cr7 R(CR7)
|
|
|
|
SA0, SA1, SA2, SA3,
|
|
SA4, SA5, SA6, SA7,
|
|
#define sa0 R(SA0)
|
|
#define sa1 R(SA1)
|
|
#define sa2 R(SA2)
|
|
#define sa3 R(SA3)
|
|
#define sa4 R(SA4)
|
|
#define sa5 R(SA5)
|
|
#define sa6 R(SA6)
|
|
#define sa7 R(SA7)
|
|
|
|
NREGS
|
|
};
|
|
|
|
enum
|
|
{
|
|
GPR = 1 << 0, // General
|
|
CTL = 1 << 1, // Control
|
|
SEG = 1 << 2, // Segment
|
|
RES = 1 << 8, // Reserved for insternal use
|
|
SYS = 1 << 9, // Reserved for supervisor mode
|
|
};
|
|
|
|
// FLG register
|
|
enum
|
|
{
|
|
CF = 1 << 0, // Carry flag
|
|
OF = 1 << 1, // Overflow flag
|
|
|
|
ZF = 1 << 2, // Zero flag
|
|
SF = 1 << 3, // Sign flag
|
|
|
|
PF = 1 << 4, // Parity flag
|
|
DF = 1 << 5, // Direction flag
|
|
|
|
UF = 1 << 16, // User-mode flag
|
|
IF = 1 << 17, // Interrupts enable flag
|
|
};
|
|
|
|
struct reg_t
|
|
{
|
|
char *name;
|
|
char *desc;
|
|
char *conv;
|
|
ulong val;
|
|
ulong flags;
|
|
};
|
|
|