mirror of
https://github.com/danbulant/Cosmos
synced 2026-05-24 12:35:31 +00:00
This commit is contained in:
parent
72774ac092
commit
02c0e0221f
4 changed files with 9 additions and 31 deletions
|
|
@ -20,8 +20,8 @@ namespace Cosmos.Debug.DebugStub {
|
||||||
|
|
||||||
public class SetAsmBreak : Inlines {
|
public class SetAsmBreak : Inlines {
|
||||||
public override void Assemble() {
|
public override void Assemble() {
|
||||||
ReadComPortX32toStack(1);
|
Call("DebugStub_ComReadEAX");
|
||||||
EDI.Pop();
|
EDI = EAX;
|
||||||
// Save the old byte
|
// Save the old byte
|
||||||
EAX = EDI[0];
|
EAX = EDI[0];
|
||||||
AsmOrigByte.Value = EAX;
|
AsmOrigByte.Value = EAX;
|
||||||
|
|
|
||||||
|
|
@ -74,9 +74,9 @@ namespace Cosmos.Debug.DebugStub {
|
||||||
|
|
||||||
// offset relative to ebp
|
// offset relative to ebp
|
||||||
// size of data to send
|
// size of data to send
|
||||||
ReadComPortX32toStack(2);
|
Call("DebugStub_ComReadEAX");
|
||||||
ECX.Pop();
|
ECX = EAX;
|
||||||
EAX.Pop();
|
Call("DebugStub_ComReadEAX");
|
||||||
|
|
||||||
// now ECX contains size of data (count)
|
// now ECX contains size of data (count)
|
||||||
// EAX contains relative to EBP
|
// EAX contains relative to EBP
|
||||||
|
|
@ -100,20 +100,17 @@ namespace Cosmos.Debug.DebugStub {
|
||||||
// 2: x32 - size of data to send
|
// 2: x32 - size of data to send
|
||||||
[XSharp(PreserveStack = true)]
|
[XSharp(PreserveStack = true)]
|
||||||
public override void Assemble() {
|
public override void Assemble() {
|
||||||
ReadComPortX32toStack(1);
|
Call("DebugStub_ComReadEAX");
|
||||||
Label = "DebugStub_SendMemory_1";
|
ECX = EAX;
|
||||||
AL = (int)DsVsip.MemoryData;
|
AL = (int)DsVsip.MemoryData;
|
||||||
Call("DebugStub_ComWriteAL");
|
Call("DebugStub_ComWriteAL");
|
||||||
|
|
||||||
ReadComPortX32toStack(1);
|
Call("DebugStub_ComReadEAX");
|
||||||
Label = "DebugStub_SendMemory_2";
|
ESI = EAX;
|
||||||
ECX.Pop();
|
|
||||||
ESI.Pop();
|
|
||||||
|
|
||||||
// now ECX contains size of data (count)
|
// now ECX contains size of data (count)
|
||||||
// ESI contains address
|
// ESI contains address
|
||||||
|
|
||||||
Label = "DebugStub_SendMemory_3";
|
|
||||||
Label = "DebugStub_SendMemory_SendByte";
|
Label = "DebugStub_SendMemory_SendByte";
|
||||||
new Compare { DestinationReg = Registers.ECX, SourceValue = 0 };
|
new Compare { DestinationReg = Registers.ECX, SourceValue = 0 };
|
||||||
JumpIf(Flags.Equal, "DebugStub_SendMemory_After_SendByte");
|
JumpIf(Flags.Equal, "DebugStub_SendMemory_After_SendByte");
|
||||||
|
|
|
||||||
|
|
@ -11,24 +11,6 @@ namespace Cosmos.Debug.DebugStub {
|
||||||
public partial class DebugStub : CodeGroup {
|
public partial class DebugStub : CodeGroup {
|
||||||
|
|
||||||
public abstract class Inlines : CodeBlock {
|
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");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,6 @@ namespace Cosmos.Debug.DebugStub {
|
||||||
[XSharp(PreserveStack = true)]
|
[XSharp(PreserveStack = true)]
|
||||||
public override void Assemble() {
|
public override void Assemble() {
|
||||||
// BP Address
|
// BP Address
|
||||||
//ReadComPortX32toStack(1);
|
|
||||||
Call("DebugStub_ComReadEAX");
|
Call("DebugStub_ComReadEAX");
|
||||||
ECX = EAX;
|
ECX = EAX;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue