diff --git a/source2/Compiler/Cosmos.Compiler.DebugStub/Old/CmdAsmBreak.cs b/source2/Compiler/Cosmos.Compiler.DebugStub/Old/CmdAsmBreak.cs index de7452b42..ead4c0a87 100644 --- a/source2/Compiler/Cosmos.Compiler.DebugStub/Old/CmdAsmBreak.cs +++ b/source2/Compiler/Cosmos.Compiler.DebugStub/Old/CmdAsmBreak.cs @@ -20,8 +20,8 @@ namespace Cosmos.Debug.DebugStub { public class SetAsmBreak : Inlines { public override void Assemble() { - ReadComPortX32toStack(1); - EDI.Pop(); + Call("DebugStub_ComReadEAX"); + EDI = EAX; // Save the old byte EAX = EDI[0]; AsmOrigByte.Value = EAX; diff --git a/source2/Compiler/Cosmos.Compiler.DebugStub/Old/CmdSend.cs b/source2/Compiler/Cosmos.Compiler.DebugStub/Old/CmdSend.cs index ec1518322..4793ae466 100644 --- a/source2/Compiler/Cosmos.Compiler.DebugStub/Old/CmdSend.cs +++ b/source2/Compiler/Cosmos.Compiler.DebugStub/Old/CmdSend.cs @@ -74,9 +74,9 @@ namespace Cosmos.Debug.DebugStub { // offset relative to ebp // size of data to send - ReadComPortX32toStack(2); - ECX.Pop(); - EAX.Pop(); + Call("DebugStub_ComReadEAX"); + ECX = EAX; + Call("DebugStub_ComReadEAX"); // now ECX contains size of data (count) // EAX contains relative to EBP @@ -100,20 +100,17 @@ namespace Cosmos.Debug.DebugStub { // 2: x32 - size of data to send [XSharp(PreserveStack = true)] public override void Assemble() { - ReadComPortX32toStack(1); - Label = "DebugStub_SendMemory_1"; + Call("DebugStub_ComReadEAX"); + ECX = EAX; AL = (int)DsVsip.MemoryData; Call("DebugStub_ComWriteAL"); - ReadComPortX32toStack(1); - Label = "DebugStub_SendMemory_2"; - ECX.Pop(); - ESI.Pop(); + Call("DebugStub_ComReadEAX"); + ESI = EAX; // now ECX contains size of data (count) // ESI contains address - Label = "DebugStub_SendMemory_3"; Label = "DebugStub_SendMemory_SendByte"; new Compare { DestinationReg = Registers.ECX, SourceValue = 0 }; JumpIf(Flags.Equal, "DebugStub_SendMemory_After_SendByte"); diff --git a/source2/Compiler/Cosmos.Compiler.DebugStub/Old/ComPort.cs b/source2/Compiler/Cosmos.Compiler.DebugStub/Old/ComPort.cs index 1663d0672..0bf5cc0ea 100644 --- a/source2/Compiler/Cosmos.Compiler.DebugStub/Old/ComPort.cs +++ b/source2/Compiler/Cosmos.Compiler.DebugStub/Old/ComPort.cs @@ -11,24 +11,6 @@ namespace Cosmos.Debug.DebugStub { public partial class DebugStub : CodeGroup { public abstract class Inlines : CodeBlock { - // INLINE - // Modifies: Stack, EDI, AL - // TODO: Modify X# to allow inlining better by using dynamic labels otherwise - // repeated use of an inline will fail with conflicting labels. - // TODO: Allow methods to emit a start label and return automatically - // and mark inlines so this does not happen. - //TODO: Allow inlining in X# wtih an attribute - or method like Call<>? - protected void ReadComPortX32toStack(int xCount) { - for (int i = 1; i <= xCount; i++) { - // Make room on the stack for the address - Push(0); - // ReadByteFromComPort writes to EDI, then increments - EDI = ESP; - - // Read address to stack via EDI - Call("DebugStub_ComRead32"); - } - } } } diff --git a/source2/Compiler/Cosmos.Compiler.DebugStub/Old/DebugStub.cs b/source2/Compiler/Cosmos.Compiler.DebugStub/Old/DebugStub.cs index b93891ec7..8101519eb 100644 --- a/source2/Compiler/Cosmos.Compiler.DebugStub/Old/DebugStub.cs +++ b/source2/Compiler/Cosmos.Compiler.DebugStub/Old/DebugStub.cs @@ -37,7 +37,6 @@ namespace Cosmos.Debug.DebugStub { [XSharp(PreserveStack = true)] public override void Assemble() { // BP Address - //ReadComPortX32toStack(1); Call("DebugStub_ComReadEAX"); ECX = EAX;