Beispiel #1
0
 public Instructions()
 {
     instructions["ST"]   = new ST();
     instructions["LD"]   = new LD();
     instructions["ADD"]  = new ADD();
     instructions["SUB"]  = new SUB();
     instructions["JMP"]  = new JMP();
     instructions["JN"]   = new JN();
     instructions["JP"]   = new JP();
     instructions["JZ"]   = new JZ();
     instructions["JNZ"]  = new JNZ();
     instructions["HALT"] = new HALT();
     //Second architecture functions.
     instructions["LD2"] = new LD2();
     instructions["LD3"] = new LD3();
     instructions["ST2"] = new ST2();
     instructions["ST3"] = new ST3();
     instructions["POS"] = new POS();
     instructions["PXL"] = new PXL();
     instructions["RND"] = new RND();
     instructions["CLR"] = new CLR();
     instructions["COS"] = new COS();
     instructions["SIN"] = new SIN();
     instructions["IN"]  = new IN();
 }
Beispiel #2
0
 /// <summary>
 /// Creates a string containing all non-vpu register/flag states"/>
 /// </summary>
 public string GetCPUDebugString()
 {
     return(CreateTable(new int[] { 26, 10, 0 }, new string[][]
     {
         new string[] { $"RAX: {RAX:x16}", $"CF: {(CF ? 1 : 0)}", $"RFLAGS: {RFLAGS:x16}" },
         new string[] { $"RBX: {RBX:x16}", $"PF: {(PF ? 1 : 0)}", $"RIP:    {RIP:x16}" },
         new string[] { $"RCX: {RCX:x16}", $"AF: {(AF ? 1 : 0)}" },
         new string[] { $"RDX: {RDX:x16}", $"ZF: {(ZF ? 1 : 0)}", $"ST0: {(ST_Tag(0) != FPU_Tag_empty ? ST0.ToString() : "Empty")}" },
         new string[] { $"RSI: {RSI:x16}", $"SF: {(SF ? 1 : 0)}", $"ST1: {(ST_Tag(1) != FPU_Tag_empty ? ST1.ToString() : "Empty")}" },
         new string[] { $"RDI: {RDI:x16}", $"OF: {(OF ? 1 : 0)}", $"ST2: {(ST_Tag(2) != FPU_Tag_empty ? ST2.ToString() : "Empty")}" },
         new string[] { $"RBP: {RBP:x16}", null, $"ST3: {(ST_Tag(3) != FPU_Tag_empty ? ST3.ToString() : "Empty")}" },
         new string[] { $"RSP: {RSP:x16}", $"b:  {(cc_b ? 1 : 0)}", $"ST4: {(ST_Tag(4) != FPU_Tag_empty ? ST4.ToString() : "Empty")}" },
         new string[] { $"R8:  {R8:x16}", $"be: {(cc_be ? 1 : 0)}", $"ST5: {(ST_Tag(5) != FPU_Tag_empty ? ST5.ToString() : "Empty")}" },
         new string[] { $"R9:  {R9:x16}", $"a:  {(cc_a ? 1 : 0)}", $"ST6: {(ST_Tag(6) != FPU_Tag_empty ? ST6.ToString() : "Empty")}" },
         new string[] { $"R10: {R10:x16}", $"ae: {(cc_ae ? 1 : 0)}", $"ST7: {(ST_Tag(7) != FPU_Tag_empty ? ST7.ToString() : "Empty")}" },
         new string[] { $"R11: {R11:x16}" },
         new string[] { $"R12: {R12:x16}", $"l:  {(cc_l ? 1 : 0)}", $"C0: {(FPU_C0 ? 1 : 0)}" },
         new string[] { $"R13: {R13:x16}", $"le: {(cc_le ? 1 : 0)}", $"C1: {(FPU_C1 ? 1 : 0)}" },
         new string[] { $"R14: {R14:x16}", $"g:  {(cc_g ? 1 : 0)}", $"C2: {(FPU_C2 ? 1 : 0)}" },
         new string[] { $"R15: {R15:x16}", $"ge: {(cc_ge ? 1 : 0)}", $"C3: {(FPU_C3 ? 1 : 0)}" },
     }));
 }