70 lines
824 B
C
70 lines
824 B
C
#pragma once
|
|
|
|
typedef enum {
|
|
R0 = 0,
|
|
R1 = 1,
|
|
R2 = 2,
|
|
R3 = 3,
|
|
R4 = 4,
|
|
Rbp = 5,
|
|
Rsp = 6,
|
|
Rfl = 7,
|
|
Rcs = 8,
|
|
Rip = 9,
|
|
} Reg;
|
|
|
|
typedef enum {
|
|
Fl_Zero,
|
|
Fl_Eq,
|
|
Fl_Be,
|
|
Fl_Lt,
|
|
Fl_Err,
|
|
Fl_Int,
|
|
Fl_Vcd,
|
|
} Flag;
|
|
|
|
typedef enum {
|
|
Op_Nop,
|
|
Op_Hlt,
|
|
Op_Jmp,
|
|
Op_Jnz,
|
|
Op_Test,
|
|
Op_Cmp,
|
|
Op_Mov8,
|
|
Op_Mov16,
|
|
Op_In,
|
|
Op_Out,
|
|
Op_Call,
|
|
Op_Ret,
|
|
Op_Lit,
|
|
Op_Int,
|
|
Op_Or,
|
|
Op_Xor,
|
|
Op_And,
|
|
Op_Shl,
|
|
Op_RShl,
|
|
Op_Shr,
|
|
Op_RShr,
|
|
Op_Add,
|
|
Op_Sub,
|
|
Op_RSub,
|
|
Op_Mul,
|
|
Op_IMul,
|
|
Op_Div,
|
|
Op_IDiv,
|
|
Op_RDiv,
|
|
Op_RIDiv,
|
|
Op_Mod,
|
|
Op_RMod,
|
|
} Op;
|
|
|
|
typedef enum {
|
|
Int_DiskRead = 0,
|
|
Int_DiskWrite = 1,
|
|
Int_Key = 32,
|
|
} VM_Int;
|
|
|
|
typedef enum {
|
|
Device_Keyboard,
|
|
} VM_Device;
|