public U2i union U2 { I1i i1[2]; U1i u1[2]; }; public I2i union I2 { I1i i1[2]; U1i u1[2]; }; public U4i union U4 { I1i i1[4]; U1i u1[4]; I2i i2[2]; U2i u2[2]; }; public I4i union I4 { I1i i1[4]; U1i u1[4]; I2i i2[2]; U2i u2[2]; }; public U8i union U8 { I1i i1[8]; U1i u1[8]; I2i i2[4]; U2i u2[4]; I4i i4[2]; U4i u4[2]; }; public I8i union I8 { I1i i1[8]; U1i u1[8]; I2i i2[4]; U2i u2[4]; I4i i4[2]; U4i u4[2]; }; public class P2I4 //two dimensional point { I4 x,y; }; public class P3I4 //three dimensional point { I4 x,y,z; }; public class P2I8 //two dimensional point { I8 x,y; }; public class P3I8 //three dimensional point { I8 x,y,z; }; public class P2d //two dimensional point { double x,y; }; public class P3d //three dimensional point { double x,y,z; }; #define NULL 0 #define TRUE 1 #define FALSE 0 #define ON 1 #define OFF 0 #define BoolU1 U1 #define BoolU2 U2 #define BoolU4 U4 #define BoolU8 U8 #define MAX_U1 0xFF #define MIN_U1 0 #define MAX_I1 0x7F #define MIN_I1 0x80 #define MAX_U2 0xFFFF #define MIN_U2 0 #define MAX_I2 0x7FFF #define MIN_I2 0x8000 #define MAX_U4 0xFFFFFFFF #define MIN_U4 0 #define MAX_I4 0x7FFFFFFF #define MIN_I4 0x80000000 #define MAX_U8 0xFFFFFFFFFFFFFFFF #define MIN_U8 0 #define MAX_I8 0x7FFFFFFFFFFFFFFF #define MIN_I8 0x8000000000000000 #define MAX_double 1.79e308 //TODO:make exact #define MIN_double -1.79e308 #define PTR_SIZE sizeof(U4i) #define INVALID_PTR 0x7FFFFFFF #define INVALID_CLUSTER -1 #define ALL_MASK -1 public class Ode { Ode *next,*last; I8 n; double base_t; double t; double h; double tolerance_start; double tolerance; double *state; double *DstateDt; double *state_scale; double *initial_state; double *temp0,*temp1,*temp2,*temp3, *temp4,*temp5,*temp6,*temp7; void derivative(Ode *o,double t,double *state,double *DstateDt); }; public class Order2D3 { double x,y,z,DxDt,DyDt,DzDt; }; class BinFileHeaderStruct { U4 jmp; U4 header_offset; U4 file_size; U4 xsum; }; #define MAXGDT 512 #define MAXIDT 96 #define SYS_DEFAULT_FLAGS 0x40200 #define SYS_DEFAULT_CR3 0 class GdtTabStruct { U4 lo,hi; }; class OsMainStruct $LK,"/LT/OSMain/OSMAIN.ASZ","FI:/LT/OSMain/OSMAIN.ASZ"$ { BinFileHeaderStruct h; U4 jmp; U4 boot_base; U4 header_base; U4 os_32start; GdtTabStruct gdttab[MAXGDT]; U4 boot_code; U4 sys_memblks; }; #define JIFFY_FREQ 10000 // Hz #define LTDATE_FREQ 49710 // Hz #define SYS_TIMER_FREQ (18333*65536/1000) //Hz #define SYS_TIMER0_PERIOD (65536*182/10/JIFFY_FREQ) //SYSFLAGS definitions #define SYSf_PREEMPTIVE 0 #define SYSf_CLEAR_SCREEN_TEXT 1 #define SYSf_DEBUG 2 #define SYSf_RAW_CRT_OUT 3 #define SYSf_CTRL_ALT_DEL 4 #define SYSf_CTRL_ALT_C 5 #define SYSf_CTRL_ALT_ESC 6 #define SYSf_CTRL_ALT_X 7 #define SYSf_CTRL_ALT_TAB 8 #define SYSf_TASK_LINKS_ALTERED 9 #define SYSf_RECORD_MACRO 10 #define SYSf_NO_SOUND 11 #define SYSf_NO_IO_SOUND 12 //Extern calls #define EXT_IRQ01 1 // Keyboard #define EXT_IRQ03 3 // Comm #define EXT_IRQ04 4 // Comm #define EXT_IRQ06 6 // FDC0 #define EXT_IRQ07 7 // LPT1 #define EXT_IRQ0C 12 // Mouse #define EXT_IRQ0E 14 // IDE0 #define EXT_IRQ0F 15 // IDE1 #define EXT_IRQ00 32 // Timer #define EXT_LTF_PUT_I1 33 #define EXT_LTF_PUTS 34 #define EXT_LTF_READ 35 #define EXT_LTF_WRITE 36 #define EXT_LTF_NEW 37 #define EXT_LTF_RESET 38 #define EXT_LTF_DEL 39 #define EXT_LTF_RECALC 40 #define EXT_SPRINTF_JOIN 41 #define EXT_GETF_JOIN 42 #define EXT_DEBUG 43 #define EXT_EXECUTE_FILE 44 #define EXT_EXECUTE_STRING 45 #define EXT_WINDOW_TO_TOP 46 #define EXT_CMP_EXE_BLK 47 #define EXT_RMT_GETMSG 48 #define EXT_RMT_PUTCHAR 49 #define EXT_RMT_PUTS 50 #define EXT_RMT_LTFPUTCHAR 51 #define EXT_TABLE_SIZE 256 //Software Interrupts #define I_PUT_SYSTEXT 0x30 #define I_PUT_I1 0x31 #define I_GET_CHAR 0x32 #define I_COUT 0x33 #define I_PEEK_MSG 0x34 #define I_GET_MSG_NO_WAIT 0x35 #define I_FLUSH_MSGS 0x36 #define I_GET_MSG 0x37 #define I_PUT_STRING 0x38 #define I_COUTLN 0x39 #define I_DEBUG 0x3A #define FLT_UNDEF_EXTERN 0x100 //Hash table types #define HTT_INVALID 0 #define HTT_ALL -1 #define HTT_STRING_CONSTANT 0x001 #define HTT_SYS_SYMBOL 0x002 #define HTT_KEYWORD 0x004 #define HTT_LOCAL_VAR 0x008 #define HTT_GLBL_VAR 0x010 #define HTT_CLASS 0x020 #define HTT_INTERNAL_TYPE 0x040 #define HTT_FUNCTION 0x080 #define HTT_WORD 0x100 #define HTT_OPCODE 0x200 #define HTT_R8 0x400 #define HTT_R16 0x800 #define HTT_R32 0x1000 #define HTT_SEG 0x2000 #define HTT_SYSTEXT 0x4000 #define HTT_FILE 0x8000 #define HTT_MODULE 0x10000 #define HTT_PRIVATE 0x02000000 #define HTT_PUBLIC 0x04000000 #define HTT_EXPORT 0x08000000 #define HTT_IMPORT 0x10000000 #define HTT_LITERAL 0x20000000 #define HTT_UNRESOLVED_LOCAL 0x40000000 #define HTT_UNRESOLVED_GLBL 0x80000000 class DbgInfo { U4 min_line,max_line; U4 body[1]; }; public class SysHashEntry //Don't forget to change WsHashEntry and asm stuff { SysHashEntry *next; I1 *string; U4 type,use_cnt; I1 *source_link; DbgInfo *debug; U4 user0,user1,user2; }; public class SysHashTable { SysHashTable *next; U4 mask; SysHashEntry *body[1]; //SysHashTable is var size }; public class StringConstantStruct { SysHashEntry *next; I1 *string; U4 type,use_cnt; I1 *source_link; I1 *data; }; #define LTFLT_BLINK 0x10000000 #define LTFLT_INVERTED 0x20000000 #define LTFLT_SELECTED 0x40000000 #define LTFLT_UNDERLINED 0x80000000 #define MLF_DEFAULT_AVAILABLE 1 #define MLF_FUNCTION 2 #define MLF_DOT_DOT_DOT 4 public class MemberListStruct { MemberListStruct *next; I1 *string; U4 *member_class; U4 use_cnt; I1 *fmtstr; I1 *fmtdata; U2 flags; U2 parameter_cnt; U4 cnt; //for arrays I4 offset; U8 default_value; void output_fun(I1 *buf,U1 *d); void input_fun(I1 *buf,U1 *d); }; #define Cf_INTERNAL 0 // Internal function #define Cf_EXTERN 1 public class ClassStruct //used for classes, functions and internal_data_types { SysHashEntry *next; I1 *string; U4 type,use_cnt; I1 *source_link; DbgInfo *debug; U2 member_cnt; U2 parameter_cnt; I4 size; MemberListStruct *member_list; MemberListStruct *last_in_member_list; U4 *executable_address; ClassStruct *return_class; U1 pointer_cnt; U1 sub_type,flags[2]; I1 *import_name; }; //Internal type definitions #define IT_I0 0 #define IT_U0 1 #define IT_I1 2 #define IT_U1 3 #define IT_I2 4 #define IT_U2 5 #define IT_I4 6 #define IT_U4 7 #define IT_I8 8 #define IT_U8 9 #define IT_DOUBLE 10 #define IT_UDOUBLE 11 // fictitious placeholder #define IT_NUM_IT 12 #define GVAF_FUNCTION 1 #define GVAF_IMPORT 2 #define GVAF_EXTERN 4 public class GlblVarStruct { SysHashEntry *next; I1 *string; U4 type,use_cnt; I1 *source_link; DbgInfo *debug; U2 flags; U2 parameter_cnt; U4 size; //must be in same spot as in class ClassStruct *var_class; U4 cnt; I1 *import_name; U4 data_address; U4 data; }; #define SACTf_ADAM3_LOADED 0 public class SysAccntStruct { SysAccntStruct *next,*last; I1 name[32]; U4 flags; }; #define TSSCf_WAKE_MASTER 0 #define TSSCf_FOCUS_MASTER 1 #define TSSCf_NOT_INPUT 2 #define TSSCf_EXIT_ON_COMPLETE 3 #define TSSCf_TEXT 4 #define TSSCf_DONT_FILTER 5 class TssCmdStruct { TssCmdStruct *next,*last; U4 code; U8 p1,p2; U8 flags; I1 *data; U8 result; U4 master_tss; }; #define SBPTf_DISABLE 0 #define SBPTF_BPT 2 #define SBPTF_STEP 4 class SysBpt { SysBpt *next; U4 flags; U4 address; U1 b; }; class MemBlk { MemBlk *next,*last; U4 pages; }; class UnusedAllocatedMem { UnusedAllocatedMem *next; U4 size; }; //LtfEntry.type codes (Low 8 bits) #define LTFT_TEXT 0 #define LTFT_CR 1 #define LTFT_SOFT_CR 2 #define LTFT_CURSOR 3 #define LTFT_TAB 4 #define LTFT_CLEAR 5 #define LTFT_PAGE_BREAK 6 #define LTFT_DATA 7 #define LTFT_PAGE_LENGTH 8 #define LTFT_LEFT_MARGIN 9 #define LTFT_RIGHT_MARGIN 10 #define LTFT_HEADER 11 #define LTFT_FOOTER 12 #define LTFT_INDENT 13 #define LTFT_FOREGROUND_COLOR 14 #define LTFT_BACKGROUND_COLOR 15 #define LTFT_DEFAULT_FOREGROUND_COLOR 16 #define LTFT_DEFAULT_BACKGROUND_COLOR 17 #define LTFT_LINK_FOREGROUND 18 #define LTFT_LINK_BACKGROUND 19 #define LTFT_MACRO_FOREGROUND 20 #define LTFT_MACRO_BACKGROUND 21 #define LTFT_ANCHOR_FOREGROUND 22 #define LTFT_ANCHOR_BACKGROUND 23 #define LTFT_HIDDEN_FOREGROUND 24 #define LTFT_HIDDEN_BACKGROUND 25 #define LTFT_TREE_FOREGROUND 26 #define LTFT_TREE_BACKGROUND 27 #define LTFT_USER_FOREGROUND 28 #define LTFT_USER_BACKGROUND 29 #define LTFT_WORD_WRAP 30 #define LTFT_UNDERLINED 31 #define LTFT_INVERTED 32 #define LTFT_BLINK 33 #define LTFT_SHIFTED_X 34 #define LTFT_SHIFTED_Y 35 #define LTFT_CURSOR_MOVEMENT 36 #define LTFT_ANCHOR 37 #define LTFT_LINK 38 #define LTFT_BUTTON 39 #define LTFT_CHECK_BOX 40 #define LTFT_MACRO 41 #define LTFT_MENU_VALUE 42 #define LTFT_HEX_EDIT 43 #define LTFT_HIDE_START 44 #define LTFT_HIDE_END 45 #define LTFT_TREE 46 #define LTFT_PICTURE 47 #define LTFT_INSERT_BINARY 48 #define LTFT_INSERT_BINARY_TYPE 49 #define LTFT_INSERT_BINARY_SIZE 50 #define LTFT_BPT 51 #define LTFT_SONG 52 #define LTFT_ERROR 53 //LtfEntry.flag flags #define LTFLF_AUX_STRING 1 #define LTFLF_LEFT_CB 2 #define LTFLF_LEFT_EXP 4 #define LTFLF_LEFT_MACRO 8 #define LTFLF_LEFT_AUTO 0x10 #define LTFLF_RIGHT_CB 0x20 #define LTFLF_RIGHT_EXP 0x40 #define LTFLF_RIGHT_MACRO 0x80 #define LTFLF_RIGHT_AUTO 0x100 #define LTFLF_DISPLAY_CB 0x200 #define LTFLF_HAS_BIN 0x400 #define LTFLF_ESC 0x800 #define LTFLF_QUIT 0x1000 #define LTFLF_LEFT_X 0x2000 #define LTFLF_CENTER_X 0x4000 #define LTFLF_RIGHT_X 0x8000 #define LTFLF_TOP_Y 0x10000 #define LTFLF_CENTER_Y 0x20000 #define LTFLF_BOTTOM_Y 0x40000 #define LTFLF_SHIFTED_X 0x80000 #define LTFLF_SHIFTED_Y 0x100000 #define LTFLF_SCROLLING_X 0x200000 #define LTFLF_SCROLLING_Y 0x400000 #define LTFLF_HAS_BORDER 0x100000000 #define LTFLF_SOLID_BORDER 0x200000000 #define LTFLF_BORDER_PLOT 0x400000000 #define LTFLF_COLLAPSED 0x800000000 #define LTFLF_CHECKED 0x1000000000 #define LTFLF_REFRESH_DATA 0x2000000000 #define LTFLF_DATA_IS_PTR 0x4000000000 #define LTFLF_HAS_TERMINATOR 0x8000000000 #define LTFLF_ZERO_BASED 0x10000000000 #define LTFLF_PASSWORD 0x20000000000 #define LTFLF_WORD_WRAP 0x40000000000 #define LTFLF_UNDERLINED 0x80000000000 #define LTFLF_INVERTED 0x100000000000 #define LTFLF_BLINK 0x200000000000 #define LTFLF_SELECTED 0x400000000000 #define LTFLF_HOLD 0x800000000000 #define LTFLF_TREE 0x1000000000000 #define LTFLF_SKIP 0x2000000000000 #define LTFLF_ALIAS 0x4000000000000 #define LTFLF_POPUP 0x8000000000000 #define LTFLF_PAGE_REL_Y 0x10000000000000 #define LTFLF_MARGIN_REL_X 0x20000000000000 #define LTFLf_AUX_STRING 0 #define LTFLf_LEFT_CB 1 #define LTFLf_LEFT_EXP 2 #define LTFLf_LEFT_MACRO 3 #define LTFLf_LEFT_AUTO 4 #define LTFLf_RIGHT_CB 5 #define LTFLf_RIGHT_EXP 6 #define LTFLf_RIGHT_MACRO 7 #define LTFLf_RIGHT_AUTO 8 #define LTFLf_DISPLAY_CB 9 #define LTFLf_HAS_BIN 10 #define LTFLf_ESC 11 #define LTFLf_QUIT 12 #define LTFLf_LEFT_X 13 #define LTFLf_CENTER_X 14 #define LTFLf_RIGHT_X 15 #define LTFLf_TOP_Y 16 #define LTFLf_CENTER_Y 17 #define LTFLf_BOTTOM_Y 18 #define LTFLf_SHIFTED_X 19 #define LTFLf_SHIFTED_Y 20 #define LTFLf_SCROLLING_X 21 #define LTFLf_SCROLLING_Y 22 #define LTFLf_HAS_BORDER 32 #define LTFLf_SOLID_BORDER 33 #define LTFLf_BORDER_PLOT 34 #define LTFLf_COLLAPSED 35 #define LTFLf_CHECKED 36 #define LTFLf_REFRESH_DATA 37 #define LTFLf_DATA_IS_PTR 38 #define LTFLf_HAS_TERMINATOR 39 #define LTFLf_ZERO_BASED 40 #define LTFLf_PASSWORD 41 #define LTFLf_WORD_WRAP 42 #define LTFLf_UNDERLINED 43 #define LTFLf_INVERTED 44 #define LTFLf_BLINK 45 #define LTFLf_SELECTED 46 #define LTFLf_HOLD 47 #define LTFLf_TREE 48 #define LTFLf_SKIP 49 #define LTFLf_ALIAS 50 #define LTFLf_POPUP 51 #define LTFLf_PAGE_REL_Y 52 #define LTFLf_MARGIN_REL_X 53 #define LTFBT_GENERIC_DATA 1 #define LTFBT_ELEMENT_GRAPH 2 public class LtfBinEntry { LtfBinEntry *next,*last; U0 start; U4 type,num,flags,size,use_cnt; U1 *data; }; #define LTF_DEFAULT (-0x7FFFFFFF) public class LtfEntryBase { LtfEntryBase *next,*last; union { U4 type; U1 btype; }; U8 flags; I4 x,y; U4 min_col,max_col; //These are here to allow recalculating the Ltf //from a point other than the beginning. Without //these, you do not know the current state. //Margins will change to allow multiple columns //of text on the same page. (cursor move back up the page.) I4 indent,page_line_num; I4 left_margin,right_margin; U1 *user_data; }; public class LtfEntry { LtfEntry *next,*last; union { U4 type; U1 btype; }; U8 flags; I4 x,y; U4 min_col,max_col; I4 indent,page_line_num; I4 left_margin,right_margin; U1 *user_data; U1 *display; U1 *plain_text; union { I4 attr; I4 cursor_x_offset; I4 left_cb(U4 *l,U1 *user,LtfEntry *ll); I4 left_exp; }; union { I1 *left_macro; I1 *song; } union { I4 cursor_y_offset; I4 right_cb(U4 *l,U1 *user,LtfEntry *ll); I4 right_exp; }; I1 *right_macro; I1 *display_cb(U4 *l,U1 *user,LtfEntry *ll, TssStruct *mem_tss); I1 *aux_string; U1 *my_format_data; U4 scroll_len; U4 len; U4 bin_num; LtfBinEntry *bin_data; U1 *data; }; class EditFindTextStruct { I1 find_text[132] fmtstr "$$DA -P 131 \"FIND :%s\"$$\r\n"; I1 replace_text[132] fmtstr "$$DA -P 131 \"REPLACE:%s\"$$\r\n"; U4 replace fmtstr "$$CB \"REPLACE\"$$\r\n"; U4 scan_forward fmtstr "$$CB \"FORWARD\"$$\r\n"; U4 scan_selected_text fmtstr "$$CB \"SELECTION\"$$\r\n"; U4 match_case fmtstr "$$CB \"CASE\"$$\r\n"; U4 whole_labels fmtstr "$$CB \"WHOLE LABELS\"$$\r\n"; }; class EditFileNameStruct { I1 name[256] fmtstr "$$DA -P 255 \"File Name:%s\"$$"; }; // LTF header flags #define LTFF_OVERSTRIKE 1 #define LTFF_PLAIN_TEXT 2 #define LTFF_PLAIN_TEXT_WITH_TABS 4 #define LTFF_MIN_SIZE 8 #define LTFF_NO_CURSOR 0x10 // Makes LtfInsertStr remove #define LTFF_IN_DOLLAR 0x20 #define LTFF_STATEMENT_WAS_RUN 0x40 #define LTFF_WORD_WRAP 0x80 #define LTFF_UNDERLINED 0x100 #define LTFF_INVERTED 0x200 #define LTFF_BLINK 0x400 #define LTFF_FORM 0x800 #define LTFF_ATTR_BY_PARTITION 0x1000 #define LTFF_ATTR_BY_FILENAME 0x2000 #define LTFF_INHIBIT_LEFT_CLICK 0x4000 #define LTFF_DOUBLE_DOLLARS 0x8000 public class Ltf //Linked Text File header { LtfEntryBase dummy; LtfBinEntry bin_root; U4 flags; I4 shifted_x,shifted_y; LtfEntry *cur_entry; I4 cur_data_col, line_start_col,cur_top_line_num; I4 x,y,min_x,max_x,min_y,max_y; I4 old_window_top,old_window_bottom, old_window_left,old_window_right; I8 line,col; I4 indent,page_line_num,page_length; I4 left_margin,right_margin; I4 header,footer; U4 cmd_I1; U4 dollar_buf_size,dollar_buf_ptr; U1 *dollar_buf; U4 max_entries,ww_lines_back,cur_bin_num; LtfEntry *recalc_start; EditFindTextStruct *find_replace; LtfEntry *base_select,*limit_select; Ltf *menu_ltf; U4 cur_GrElem,cur_sub_GrElem; U4 *tss,*mem_tss; U1 text_attribute,link_attribute, macro_attribute,anchor_attribute, hidden_attribute,tree_attribute,user_attribute,pad1; EditFileNameStruct filename; U8 file_attr; BoolU4 EditPlugIns(Ltf *l,I8 ch,U8 sc); U1 *user_data; }; class InstructionEntry { U1 ins_entry_num; //This entry num in opcode hash entry U1 opcode_cnt; U1 opcode[4],operand_size16,operand_size32,dont_switch_modes; U1 plus_opcode,slash_value,opcode_modifier,default; U1 arg1,arg2; }; class OpcodeHashEntry { SysHashEntry *next; I1 *string; U4 type,use_cnt; //AHT_OPCODE I1 *source_link; DbgInfo *debug; U1 instruction_entry_cnt; U1 reserved[3]; InstructionEntry ins[1]; }; #define OM_NO 0 #define OM_R 1 // Not used #define OM_CB 2 #define OM_CW 3 #define OM_CD 4 #define OM_CP 5 #define OM_IB 6 #define OM_IW 7 #define OM_ID 8 #define OM_RB 9 #define OM_RW 10 #define OM_RD 11 #define ARGT_NO 0 #define ARGT_REL8 1 #define ARGT_REL16 2 #define ARGT_REL32 3 #define ARGT_UIMM8 4 #define ARGT_UIMM16 5 #define ARGT_UIMM32 6 #define ARGT_R8 7 #define ARGT_R16 8 #define ARGT_R32 9 #define ARGT_IMM8 10 #define ARGT_IMM16 11 #define ARGT_IMM32 12 #define ARGT_RM8 13 #define ARGT_RM16 14 #define ARGT_RM32 15 #define ARGT_M8 16 // Not used, needed for LEA, etc #define ARGT_M16 17 // Not used #define ARGT_M32 18 // Not used #define ARGT_M1616 19 // Not used #define ARGT_M1632 20 // Not used #define ARGT_M16N32 21 // Not used #define ARGT_M16N16 22 // Not used #define ARGT_M32N32 23 // Not used #define ARGT_MOFFS8 24 #define ARGT_MOFFS16 25 #define ARGT_MOFFS32 26 #define ARGT_CL 27 #define ARGT_AL 28 #define ARGT_AX 29 #define ARGT_EAX 30 #define ARGT_DX 31 #define ARGT_SS 32 #define ARGT_DS 33 #define ARGT_ES 34 #define ARGT_FS 35 #define ARGT_GS 36 #define ARGT_SREG 37 #define ARGT_CS 38 #define ASM_CODE_BLK_BITS 15 #define ASM_CODE_BLK_SIZE (1<answers[0]) #define ans0 (Fs->answers[0]) #define ans1 (Fs->answers[1]) #define ans2 (Fs->answers[2]) #define ans3 (Fs->answers[3]) #define ans4 (Fs->answers[4]) #define ans5 (Fs->answers[5]) #define ans6 (Fs->answers[6]) #define ans7 (Fs->answers[7]) #define ansd (Fs->double_answers[0]) #define ansd0 (Fs->double_answers[0]) #define ansd1 (Fs->double_answers[1]) #define ansd2 (Fs->double_answers[2]) #define ansd3 (Fs->double_answers[3]) #define ansd4 (Fs->double_answers[4]) #define ansd5 (Fs->double_answers[5]) #define ansd6 (Fs->double_answers[6]) #define ansd7 (Fs->double_answers[7]) public class MachineRegsStruct { U4 cr0 fmtstr "CR0 :%08X", cr2 fmtstr "CR2 :%08X", cr3 fmtstr "CR3 :%08X", cr4 fmtstr "CR4 :%08X", dbg0 fmtstr "DBG0:%08X", dbg1 fmtstr "DBG1:%08X", dbg2 fmtstr "DBG2:%08X", dbg3 fmtstr "DBG3:%08X", dbg6 fmtstr "DBG6:%08X", dbg7 fmtstr "DBG7:%08X"; }; #define KEYB_PORT 0x60 #define KEYB_CTRL 0x64 //SYS_CUR_SCAN_CODE FLAGS #define SCf_E0_PREFIX 7 #define SCf_KEY_UP 8 #define SCf_SHIFT 9 #define SCf_CTRL 10 #define SCf_ALT 11 #define SCf_CAPS 12 #define SCf_NUM 13 #define SCf_SCROLL 14 #define SCf_NEW_KEY 16 #define SCf_PRIOR_E0 17 #define SCF_E0_PREFIX (1<