This commit is contained in:
Matthijs ter Woord 2016-06-17 13:16:01 -04:00
parent ac1f59034d
commit cc44dc021e
11 changed files with 104 additions and 97 deletions

View file

@ -108,7 +108,7 @@ namespace Cosmos.Core.Plugs
var xInterruptsWithParam = new int[] { 8, 10, 11, 12, 13, 14 }; var xInterruptsWithParam = new int[] { 8, 10, 11, 12, 13, 14 };
for (int j = 0; j < 256; j++) for (int j = 0; j < 256; j++)
{ {
new CPUAll.Label("__ISR_Handler_" + j.ToString("X2")); XS.Label("__ISR_Handler_" + j.ToString("X2"));
XS.Call("__INTERRUPT_OCCURRED__"); XS.Call("__INTERRUPT_OCCURRED__");
if (Array.IndexOf(xInterruptsWithParam, j) == -1) if (Array.IndexOf(xInterruptsWithParam, j) == -1)
@ -129,11 +129,9 @@ namespace Cosmos.Core.Plugs
XS.Push(XSRegisters.OldToNewRegister(CPUx86.RegistersEnum.EAX)); // XS.Push(XSRegisters.OldToNewRegister(CPUx86.RegistersEnum.EAX)); //
XS.Push(XSRegisters.OldToNewRegister(CPUx86.RegistersEnum.EAX)); // pass old stack address (pointer to InterruptContext struct) to the interrupt handler XS.Push(XSRegisters.OldToNewRegister(CPUx86.RegistersEnum.EAX)); // pass old stack address (pointer to InterruptContext struct) to the interrupt handler
//new CPUx86.Move("eax",
// "esp"); XS.JumpToSegment(8, "__ISR_Handler_" + j.ToString("X2") + "_SetCS");
//new CPUx86.Push("eax"); XS.Label("__ISR_Handler_" + j.ToString("X2") + "_SetCS");
new CPUx86.JumpToSegment { Segment = 8, DestinationLabel = "__ISR_Handler_" + j.ToString("X2") + "_SetCS" };
new CPUAll.Label("__ISR_Handler_" + j.ToString("X2") + "_SetCS");
MethodBase xHandler = GetInterruptHandler((byte)j); MethodBase xHandler = GetInterruptHandler((byte)j);
if (xHandler == null) if (xHandler == null)
{ {
@ -152,9 +150,9 @@ namespace Cosmos.Core.Plugs
new CPUAll.Label("__ISR_Handler_" + j.ToString("X2") + "_END"); new CPUAll.Label("__ISR_Handler_" + j.ToString("X2") + "_END");
XS.InterruptReturn(); XS.InterruptReturn();
} }
new CPUAll.Label("__INTERRUPT_OCCURRED__"); XS.Label("__INTERRUPT_OCCURRED__");
XS.Return(); XS.Return();
new CPUAll.Label("__AFTER__ALL__ISR__HANDLER__STUBS__"); XS.Label("__AFTER__ALL__ISR__HANDLER__STUBS__");
XS.Noop(); XS.Noop();
XS.Set(XSRegisters.OldToNewRegister(CPUx86.RegistersEnum.EAX), XSRegisters.OldToNewRegister(CPUx86.RegistersEnum.EBP), sourceDisplacement: 8); XS.Set(XSRegisters.OldToNewRegister(CPUx86.RegistersEnum.EAX), XSRegisters.OldToNewRegister(CPUx86.RegistersEnum.EBP), sourceDisplacement: 8);
XS.Compare(XSRegisters.OldToNewRegister(CPUx86.RegistersEnum.EAX), 0); XS.Compare(XSRegisters.OldToNewRegister(CPUx86.RegistersEnum.EAX), 0);
@ -167,7 +165,7 @@ namespace Cosmos.Core.Plugs
// Reenable interrupts // Reenable interrupts
XS.EnableInterrupts(); XS.EnableInterrupts();
new CPUAll.Label(".__AFTER_ENABLE_INTERRUPTS"); XS.Label(".__AFTER_ENABLE_INTERRUPTS");
} }
} }
} }

View file

@ -49,11 +49,11 @@ namespace Cosmos.Core.Plugs {
XS.ShiftRight(XSRegisters.OldToNewRegister(CPUx86.RegistersEnum.ECX), 1); XS.ShiftRight(XSRegisters.OldToNewRegister(CPUx86.RegistersEnum.ECX), 1);
XS.Jump(CPUx86.ConditionalTestEnum.NotBelow, ".step2"); XS.Jump(CPUx86.ConditionalTestEnum.NotBelow, ".step2");
XS.StoreByteInString(); XS.StoreByteInString();
new CPUAll.Label(".step2"); XS.Label(".step2");
XS.ShiftRight(XSRegisters.OldToNewRegister(CPUx86.RegistersEnum.ECX), 1); XS.ShiftRight(XSRegisters.OldToNewRegister(CPUx86.RegistersEnum.ECX), 1);
XS.Jump(CPUx86.ConditionalTestEnum.NotBelow, ".step3"); XS.Jump(CPUx86.ConditionalTestEnum.NotBelow, ".step3");
XS.StoreWordInString(); XS.StoreWordInString();
new CPUAll.Label(".step3"); XS.Label(".step3");
new CPUx86.Stos { Size = 32, Prefixes = CPUx86.InstructionPrefixes.Repeat }; new CPUx86.Stos { Size = 32, Prefixes = CPUx86.InstructionPrefixes.Repeat };
} }
} }

View file

@ -36,7 +36,7 @@ namespace Cosmos.Core.Plugs.System.Assemblers
*/ */
XS.ClearInterruptFlag(); XS.ClearInterruptFlag();
XS.Label(".DEBUG"); XS.Label(".DEBUG");
//new CPU.Label("____DEBUG_FOR_MULTICAST___"); //XS.Label("____DEBUG_FOR_MULTICAST___");
XS.Comment("move address of delegate to eax"); XS.Comment("move address of delegate to eax");
XS.Set(XSRegisters.OldToNewRegister(CPUx86.RegistersEnum.EAX), XSRegisters.OldToNewRegister(CPUx86.RegistersEnum.EBP), sourceDisplacement: Ldarg.GetArgumentDisplacement(xMethodInfo, 0)); XS.Set(XSRegisters.OldToNewRegister(CPUx86.RegistersEnum.EAX), XSRegisters.OldToNewRegister(CPUx86.RegistersEnum.EBP), sourceDisplacement: Ldarg.GetArgumentDisplacement(xMethodInfo, 0));
@ -130,7 +130,7 @@ namespace Cosmos.Core.Plugs.System.Assemblers
XS.Exchange(XSRegisters.EBP, XSRegisters.EDX, destinationIsIndirect: true); XS.Exchange(XSRegisters.EBP, XSRegisters.EDX, destinationIsIndirect: true);
XS.Push(XSRegisters.OldToNewRegister(CPUx86.RegistersEnum.EDX));//ebp XS.Push(XSRegisters.OldToNewRegister(CPUx86.RegistersEnum.EDX));//ebp
XS.Set(XSRegisters.ESP, XSRegisters.EDI, destinationDisplacement: 12); XS.Set(XSRegisters.ESP, XSRegisters.EDI, destinationDisplacement: 12);
new Assembler.Label(".noReturn"); XS.Label(".noReturn");
XS.EnableInterrupts(); XS.EnableInterrupts();
} }
@ -167,7 +167,7 @@ namespace Cosmos.Core.Plugs.System.Assemblers
// * EBX contains the number of items in the array // * EBX contains the number of items in the array
// * ECX contains the argument size // * ECX contains the argument size
// */ // */
// //new CPU.Label("____DEBUG_FOR_MULTICAST___"); // //XS.Label("____DEBUG_FOR_MULTICAST___");
// // new CPUx86.Cli();//DEBUG ONLY // // new CPUx86.Cli();//DEBUG ONLY
// new CPU.Comment("push address of delgate to stack"); // new CPU.Comment("push address of delgate to stack");
// Ldarg.DoExecute(xAssembler, xMethodInfo, 0); // Ldarg.DoExecute(xAssembler, xMethodInfo, 0);
@ -195,13 +195,13 @@ namespace Cosmos.Core.Plugs.System.Assemblers
// new CPU.Comment("ecx points to the size of the delegated methods arguments"); // new CPU.Comment("ecx points to the size of the delegated methods arguments");
// XS.Xor(XSRegisters.EDX, XSRegisters.CPUx86.Registers.EDX); // XS.Xor(XSRegisters.EDX, XSRegisters.CPUx86.Registers.EDX);
// ;//make sure edx is 0 // ;//make sure edx is 0
// new CPU.Label(".BEGIN_OF_LOOP"); // XS.Label(".BEGIN_OF_LOOP");
// XS.Compare(XSRegisters.EDX, XSRegisters.CPUx86.Registers.EBX);//are we at the end of this list // XS.Compare(XSRegisters.EDX, XSRegisters.CPUx86.Registers.EBX);//are we at the end of this list
// XS.Jump(ConditionalTestEnum.Equal, ".END_OF_INVOKE_");//then we better stop // XS.Jump(ConditionalTestEnum.Equal, ".END_OF_INVOKE_");//then we better stop
// //new CPUx86.Compare("edx", 0); // //new CPUx86.Compare("edx", 0);
// //new CPUx86.JumpIfLessOrEqual(".noreturnYet"); // //new CPUx86.JumpIfLessOrEqual(".noreturnYet");
// //new CPUx86.Add("esp", 4); // //new CPUx86.Add("esp", 4);
// //new CPU.Label(".noreturnYet"); // //XS.Label(".noreturnYet");
// //new CPU.Comment("space for the return value"); // //new CPU.Comment("space for the return value");
// //new CPUx86.Pushd("0"); // //new CPUx86.Pushd("0");
// XS.Pushad(); // XS.Pushad();
@ -217,7 +217,7 @@ namespace Cosmos.Core.Plugs.System.Assemblers
// XS.Jump(ConditionalTestEnum.Zero, ".NO_THIS"); // XS.Jump(ConditionalTestEnum.Zero, ".NO_THIS");
// XS.Push(XSRegisters.EDI); // XS.Push(XSRegisters.EDI);
// new CPU.Label(".NO_THIS"); // XS.Label(".NO_THIS");
// new CPU.Comment("make space for us to copy the arguments too"); // new CPU.Comment("make space for us to copy the arguments too");
// XS.Sub(XSRegisters.ESP, XSRegisters.CPUx86.Registers.EBX); // XS.Sub(XSRegisters.ESP, XSRegisters.CPUx86.Registers.EBX);
@ -245,7 +245,7 @@ namespace Cosmos.Core.Plugs.System.Assemblers
// //new CPUx86.JumpIfEqual(".getReturn"); // //new CPUx86.JumpIfEqual(".getReturn");
// //new CPUx86.Move(Registers_Old.EAX, "[esp]"); // //new CPUx86.Move(Registers_Old.EAX, "[esp]");
// //new CPUx86.Move("[esp+0x20]", Registers_Old.EAX); // //new CPUx86.Move("[esp+0x20]", Registers_Old.EAX);
// //new CPU.Label(".getReturn"); // //XS.Label(".getReturn");
// Ldarg.DoExecute(xAssembler, xMethodInfo, 0); // Ldarg.DoExecute(xAssembler, xMethodInfo, 0);
// Ldfld.DoExecute(xAssembler, xMethodInfo.MethodBase.DeclaringType, "System.Object System.Delegate._target"); // Ldfld.DoExecute(xAssembler, xMethodInfo.MethodBase.DeclaringType, "System.Object System.Delegate._target");
// // edi contains $this now // // edi contains $this now
@ -262,15 +262,15 @@ namespace Cosmos.Core.Plugs.System.Assemblers
// //new CPUx86.Move("ecx", "[ecx + " + (MethodInfo.Arguments[0].TypeInfo.Fields["$$ArgSize$$"].Offset + 12) + "]");//the size of the arguments to the method? + 12??? -- 12 is the size of the current call stack.. i think // //new CPUx86.Move("ecx", "[ecx + " + (MethodInfo.Arguments[0].TypeInfo.Fields["$$ArgSize$$"].Offset + 12) + "]");//the size of the arguments to the method? + 12??? -- 12 is the size of the current call stack.. i think
// //new CPUx86.Compare("ecx", "0"); // //new CPUx86.Compare("ecx", "0");
// //new CPUx86.JumpIfLessOrEqual(".noTHIStoPop"); // //new CPUx86.JumpIfLessOrEqual(".noTHIStoPop");
// //new CPU.Label(".needToPopThis"); // //XS.Label(".needToPopThis");
// //new CPUx86.Pop("edi"); // //new CPUx86.Pop("edi");
// //new CPUx86.Move("[esp]", "edi"); // //new CPUx86.Move("[esp]", "edi");
// new CPU.Label(".noTHIStoPop"); // XS.Label(".noTHIStoPop");
// XS.Popad(); // XS.Popad();
// XS.INC(XSRegisters.EDX); // XS.INC(XSRegisters.EDX);
// XS.Add(XSRegisters.EAX, 4); // XS.Add(XSRegisters.EAX, 4);
// XS.Jump(".BEGIN_OF_LOOP"); // XS.Jump(".BEGIN_OF_LOOP");
// new CPU.Label(".END_OF_INVOKE_"); // XS.Label(".END_OF_INVOKE_");
// new CPU.Comment("get the return value"); // new CPU.Comment("get the return value");
// // TEMP!!! // // TEMP!!!
// // XS.Add(XSRegisters.ESP, 4); // // XS.Add(XSRegisters.ESP, 4);
@ -288,7 +288,7 @@ namespace Cosmos.Core.Plugs.System.Assemblers
// //XS.Xchg(XSRegisters.EBP, XSRegisters.EDX, destinationIsIndirect: true); // //XS.Xchg(XSRegisters.EBP, XSRegisters.EDX, destinationIsIndirect: true);
// //XS.Push(XSRegisters.EDX);//ebp // //XS.Push(XSRegisters.EDX);//ebp
// //XS.Mov(XSRegisters.ESP, XSRegisters.EDI, destinationDisplacement: 12); // //XS.Mov(XSRegisters.ESP, XSRegisters.EDI, destinationDisplacement: 12);
// new CPU.Label(".noReturn"); // XS.Label(".noReturn");
// // XS.Sti(); // // XS.Sti();
// //#warning remove this ^ sti call when issue is fixed!!! // //#warning remove this ^ sti call when issue is fixed!!!
// //MethodInfo.Arguments[0]. // //MethodInfo.Arguments[0].

View file

@ -1,4 +1,4 @@
namespace Cosmos.Debug.GDB { namespace Cosmos.Debug.GDB {
partial class BreakpointUC { partial class BreakpointUC {
/// <summary> /// <summary>
/// Required designer variable. /// Required designer variable.
@ -23,10 +23,10 @@
/// the contents of this method with the code editor. /// the contents of this method with the code editor.
/// </summary> /// </summary>
private void InitializeComponent() { private void InitializeComponent() {
this.lablNum = new System.Windows.Forms.Label(); this.lablNum = XS.Label();
this.cboxEnabled = new System.Windows.Forms.CheckBox(); this.cboxEnabled = new System.Windows.Forms.CheckBox();
this.lablName = new System.Windows.Forms.Label(); this.lablName = XS.Label();
this.lablDelete = new System.Windows.Forms.Label(); this.lablDelete = XS.Label();
this.SuspendLayout(); this.SuspendLayout();
// //
// lablNum // lablNum

View file

@ -1,4 +1,4 @@
namespace Cosmos.Debug.GDB { namespace Cosmos.Debug.GDB {
partial class FormLog { partial class FormLog {
/// <summary> /// <summary>
/// Required designer variable. /// Required designer variable.
@ -30,7 +30,7 @@
this.panel2 = new System.Windows.Forms.Panel(); this.panel2 = new System.Windows.Forms.Panel();
this.butnSendCmd = new System.Windows.Forms.Button(); this.butnSendCmd = new System.Windows.Forms.Button();
this.textSendCmd = new System.Windows.Forms.TextBox(); this.textSendCmd = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label(); this.label1 = XS.Label();
this.panel1 = new System.Windows.Forms.Panel(); this.panel1 = new System.Windows.Forms.Panel();
this.lboxDebug = new System.Windows.Forms.ListBox(); this.lboxDebug = new System.Windows.Forms.ListBox();
this.lboxCmd = new System.Windows.Forms.ListBox(); this.lboxCmd = new System.Windows.Forms.ListBox();

View file

@ -1,4 +1,4 @@
namespace Cosmos.Debug.GDB { namespace Cosmos.Debug.GDB {
partial class FormMain { partial class FormMain {
/// <summary> /// <summary>
/// Required designer variable. /// Required designer variable.
@ -27,8 +27,8 @@
this.panel1 = new System.Windows.Forms.Panel(); this.panel1 = new System.Windows.Forms.Panel();
this.butnBreak = new System.Windows.Forms.Button(); this.butnBreak = new System.Windows.Forms.Button();
this.butnBreakpoints = new System.Windows.Forms.Button(); this.butnBreakpoints = new System.Windows.Forms.Button();
this.lablRunning = new System.Windows.Forms.Label(); this.lablRunning = XS.Label();
this.lablConnected = new System.Windows.Forms.Label(); this.lablConnected = XS.Label();
this.butnContinue = new System.Windows.Forms.Button(); this.butnContinue = new System.Windows.Forms.Button();
this.butnConnect = new System.Windows.Forms.Button(); this.butnConnect = new System.Windows.Forms.Button();
this.menuMain = new System.Windows.Forms.MenuStrip(); this.menuMain = new System.Windows.Forms.MenuStrip();
@ -54,7 +54,7 @@
this.mitmWindowsToForeground = new System.Windows.Forms.ToolStripMenuItem(); this.mitmWindowsToForeground = new System.Windows.Forms.ToolStripMenuItem();
this.panel4 = new System.Windows.Forms.Panel(); this.panel4 = new System.Windows.Forms.Panel();
this.textCurrentFunction = new System.Windows.Forms.TextBox(); this.textCurrentFunction = new System.Windows.Forms.TextBox();
this.label5 = new System.Windows.Forms.Label(); this.label5 = XS.Label();
this.lboxDisassemble = new Cosmos.Debug.GDB.ToolTipListBox(); this.lboxDisassemble = new Cosmos.Debug.GDB.ToolTipListBox();
this.menuDisassembly = new System.Windows.Forms.ContextMenuStrip(this.components); this.menuDisassembly = new System.Windows.Forms.ContextMenuStrip(this.components);
this.mitemDisassemblyAddBreakpoint = new System.Windows.Forms.ToolStripMenuItem(); this.mitemDisassemblyAddBreakpoint = new System.Windows.Forms.ToolStripMenuItem();

View file

@ -1,4 +1,4 @@
namespace Cosmos.Debug.GDB { namespace Cosmos.Debug.GDB {
partial class FormRegisters { partial class FormRegisters {
/// <summary> /// <summary>
/// Required designer variable. /// Required designer variable.
@ -24,65 +24,65 @@
/// </summary> /// </summary>
private void InitializeComponent() { private void InitializeComponent() {
this.panel5 = new System.Windows.Forms.Panel(); this.panel5 = new System.Windows.Forms.Panel();
this.label2 = new System.Windows.Forms.Label(); this.label2 = XS.Label();
this.lablFlagsText = new System.Windows.Forms.Label(); this.lablFlagsText = XS.Label();
this.label3 = new System.Windows.Forms.Label(); this.label3 = XS.Label();
this.lablFlags = new System.Windows.Forms.Label(); this.lablFlags = XS.Label();
this.label4 = new System.Windows.Forms.Label(); this.label4 = XS.Label();
this.label11 = new System.Windows.Forms.Label(); this.label11 = XS.Label();
this.lablALText = new System.Windows.Forms.Label(); this.lablALText = XS.Label();
this.lablGS = new System.Windows.Forms.Label(); this.lablGS = XS.Label();
this.lablEAX = new System.Windows.Forms.Label(); this.lablEAX = XS.Label();
this.label32 = new System.Windows.Forms.Label(); this.label32 = XS.Label();
this.lablAX = new System.Windows.Forms.Label(); this.lablAX = XS.Label();
this.lablFS = new System.Windows.Forms.Label(); this.lablFS = XS.Label();
this.lablAH = new System.Windows.Forms.Label(); this.lablAH = XS.Label();
this.label29 = new System.Windows.Forms.Label(); this.label29 = XS.Label();
this.lablEBXLabel = new System.Windows.Forms.Label(); this.lablEBXLabel = XS.Label();
this.lablES = new System.Windows.Forms.Label(); this.lablES = XS.Label();
this.lablBXLabel = new System.Windows.Forms.Label(); this.lablBXLabel = XS.Label();
this.label17 = new System.Windows.Forms.Label(); this.label17 = XS.Label();
this.label8 = new System.Windows.Forms.Label(); this.label8 = XS.Label();
this.lablDS = new System.Windows.Forms.Label(); this.lablDS = XS.Label();
this.lablEBX = new System.Windows.Forms.Label(); this.lablEBX = XS.Label();
this.label19 = new System.Windows.Forms.Label(); this.label19 = XS.Label();
this.lablBX = new System.Windows.Forms.Label(); this.lablBX = XS.Label();
this.lablCS = new System.Windows.Forms.Label(); this.lablCS = XS.Label();
this.lablBH = new System.Windows.Forms.Label(); this.lablBH = XS.Label();
this.label22 = new System.Windows.Forms.Label(); this.label22 = XS.Label();
this.lablECXLabel = new System.Windows.Forms.Label(); this.lablECXLabel = XS.Label();
this.lablSS = new System.Windows.Forms.Label(); this.lablSS = XS.Label();
this.lablCXLabel = new System.Windows.Forms.Label(); this.lablCXLabel = XS.Label();
this.label25 = new System.Windows.Forms.Label(); this.label25 = XS.Label();
this.label14 = new System.Windows.Forms.Label(); this.label14 = XS.Label();
this.lablEDI = new System.Windows.Forms.Label(); this.lablEDI = XS.Label();
this.lablECX = new System.Windows.Forms.Label(); this.lablECX = XS.Label();
this.label7 = new System.Windows.Forms.Label(); this.label7 = XS.Label();
this.lablCX = new System.Windows.Forms.Label(); this.lablCX = XS.Label();
this.lablESI = new System.Windows.Forms.Label(); this.lablESI = XS.Label();
this.lablCH = new System.Windows.Forms.Label(); this.lablCH = XS.Label();
this.label10 = new System.Windows.Forms.Label(); this.label10 = XS.Label();
this.lablEDXLabel = new System.Windows.Forms.Label(); this.lablEDXLabel = XS.Label();
this.lablEBP = new System.Windows.Forms.Label(); this.lablEBP = XS.Label();
this.lablDXLabel = new System.Windows.Forms.Label(); this.lablDXLabel = XS.Label();
this.label12 = new System.Windows.Forms.Label(); this.label12 = XS.Label();
this.label20 = new System.Windows.Forms.Label(); this.label20 = XS.Label();
this.lablESP = new System.Windows.Forms.Label(); this.lablESP = XS.Label();
this.lablEDX = new System.Windows.Forms.Label(); this.lablEDX = XS.Label();
this.label15 = new System.Windows.Forms.Label(); this.label15 = XS.Label();
this.lablDX = new System.Windows.Forms.Label(); this.lablDX = XS.Label();
this.lablEIPText = new System.Windows.Forms.Label(); this.lablEIPText = XS.Label();
this.lablDH = new System.Windows.Forms.Label(); this.lablDH = XS.Label();
this.lablEIP = new System.Windows.Forms.Label(); this.lablEIP = XS.Label();
this.label30 = new System.Windows.Forms.Label(); this.label30 = XS.Label();
this.label6 = new System.Windows.Forms.Label(); this.label6 = XS.Label();
this.lablAL = new System.Windows.Forms.Label(); this.lablAL = XS.Label();
this.lablDL = new System.Windows.Forms.Label(); this.lablDL = XS.Label();
this.label28 = new System.Windows.Forms.Label(); this.label28 = XS.Label();
this.label24 = new System.Windows.Forms.Label(); this.label24 = XS.Label();
this.lablBL = new System.Windows.Forms.Label(); this.lablBL = XS.Label();
this.lablCL = new System.Windows.Forms.Label(); this.lablCL = XS.Label();
this.label26 = new System.Windows.Forms.Label(); this.label26 = XS.Label();
this.panel5.SuspendLayout(); this.panel5.SuspendLayout();
this.SuspendLayout(); this.SuspendLayout();
// //

View file

@ -1,4 +1,4 @@
namespace Cosmos.Debug.GDB { namespace Cosmos.Debug.GDB {
partial class WatchUC { partial class WatchUC {
/// <summary> /// <summary>
/// Required designer variable. /// Required designer variable.
@ -23,10 +23,10 @@
/// the contents of this method with the code editor. /// the contents of this method with the code editor.
/// </summary> /// </summary>
private void InitializeComponent() { private void InitializeComponent() {
this.lablAddress = new System.Windows.Forms.Label(); this.lablAddress = XS.Label();
this.cboxEnabled = new System.Windows.Forms.CheckBox(); this.cboxEnabled = new System.Windows.Forms.CheckBox();
this.lablValue = new System.Windows.Forms.TextBox(); this.lablValue = new System.Windows.Forms.TextBox();
this.lablDelete = new System.Windows.Forms.Label(); this.lablDelete = XS.Label();
this.SuspendLayout(); this.SuspendLayout();
// //
// lablAddress // lablAddress

View file

@ -1508,7 +1508,7 @@ namespace Cosmos.IL2CPU
new Mov { DestinationRef = ElementReference.New("DebugStub_CallerEIP"), DestinationIsIndirect = true, SourceReg = RegistersEnum.EAX }; new Mov { DestinationRef = ElementReference.New("DebugStub_CallerEIP"), DestinationIsIndirect = true, SourceReg = RegistersEnum.EAX };
XS.Call("DebugStub_SendStackCorruptionOccurred"); XS.Call("DebugStub_SendStackCorruptionOccurred");
XS.Halt(); XS.Halt();
new Assembler.Label(xLabel + ".StackCorruptionCheck_End"); XS.Label(xLabel + ".StackCorruptionCheck_End");
} }
} }

View file

@ -434,7 +434,7 @@ namespace Cosmos.IL2CPU {
XS.ClearInterruptFlag(); XS.ClearInterruptFlag();
// don't remove the call. It seems pointless, but we need it to retrieve the EIP value // don't remove the call. It seems pointless, but we need it to retrieve the EIP value
XS.Call(".NullCheck_GetCurrAddress"); XS.Call(".NullCheck_GetCurrAddress");
new Assembler.Label(".NullCheck_GetCurrAddress"); XS.Label(".NullCheck_GetCurrAddress");
XS.Pop(XSRegisters.OldToNewRegister(CPU.RegistersEnum.EAX)); XS.Pop(XSRegisters.OldToNewRegister(CPU.RegistersEnum.EAX));
new CPU.Mov {DestinationRef = ElementReference.New("DebugStub_CallerEIP"), DestinationIsIndirect = true, SourceReg = CPU.RegistersEnum.EAX}; new CPU.Mov {DestinationRef = ElementReference.New("DebugStub_CallerEIP"), DestinationIsIndirect = true, SourceReg = CPU.RegistersEnum.EAX};
XS.Call("DebugStub_SendNullReferenceOccurred"); XS.Call("DebugStub_SendNullReferenceOccurred");

View file

@ -1214,5 +1214,14 @@ namespace XSharp.Compiler
ArgumentReg = argumentReg ArgumentReg = argumentReg
}; };
} }
public static void JumpToSegment(ushort segment, string targetLabel)
{
new JumpToSegment
{
Segment = segment,
DestinationLabel = targetLabel
};
}
} }
} }