mirror of
https://github.com/danbulant/Cosmos
synced 2026-05-22 05:48:37 +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 override void Assemble() {
|
||||
ReadComPortX32toStack(1);
|
||||
EDI.Pop();
|
||||
Call("DebugStub_ComReadEAX");
|
||||
EDI = EAX;
|
||||
// Save the old byte
|
||||
EAX = EDI[0];
|
||||
AsmOrigByte.Value = EAX;
|
||||
|
|
|
|||
|
|
@ -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");
|
||||
|
|
|
|||
|
|
@ -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");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,7 +37,6 @@ namespace Cosmos.Debug.DebugStub {
|
|||
[XSharp(PreserveStack = true)]
|
||||
public override void Assemble() {
|
||||
// BP Address
|
||||
//ReadComPortX32toStack(1);
|
||||
Call("DebugStub_ComReadEAX");
|
||||
ECX = EAX;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue