From 2c7c580b9fa5dfbd2fe8612db8848475af0ad4e5 Mon Sep 17 00:00:00 2001 From: Matthijs ter Woord Date: Tue, 3 Feb 2015 18:44:46 +0100 Subject: [PATCH] small fixes in debugstub. --- source/Cosmos.Debug.DebugStub/SerialHelpers.asm | 4 +++- source/Cosmos.Debug.DebugStub/SerialHelpers.xs | 8 +++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/source/Cosmos.Debug.DebugStub/SerialHelpers.asm b/source/Cosmos.Debug.DebugStub/SerialHelpers.asm index c775233c4..110166590 100644 --- a/source/Cosmos.Debug.DebugStub/SerialHelpers.asm +++ b/source/Cosmos.Debug.DebugStub/SerialHelpers.asm @@ -1,4 +1,4 @@ -; Generated at 1-1-2015 12:56:21 +; Generated at 3-2-2015 18:02:14 @@ -40,10 +40,12 @@ mov dword [static_field__Cosmos_Core_INTs_mLastKnownAddress], DebugStub_ComRead3 Ret DebugStub_ComWriteAL: +Push ESI Push EAX Mov ESI, ESP Call DebugStub_ComWrite8 Pop EAX +Pop ESI DebugStub_ComWriteAL_Exit: mov dword [static_field__Cosmos_Core_INTs_mLastKnownAddress], DebugStub_ComWriteAL_Exit Ret diff --git a/source/Cosmos.Debug.DebugStub/SerialHelpers.xs b/source/Cosmos.Debug.DebugStub/SerialHelpers.xs index 3d7151023..1394cf3b1 100644 --- a/source/Cosmos.Debug.DebugStub/SerialHelpers.xs +++ b/source/Cosmos.Debug.DebugStub/SerialHelpers.xs @@ -32,14 +32,16 @@ function ComRead32 { // Input: AL // Output: None -// Modifies: EDX, ESI +// Modifies: EDX function ComWriteAL { - +EAX - ESI = ESP + +ESI + +EAX + ESI = ESP ComWrite8() // Is a local var, cant use Return(4). X// issues the return. // This also allows the function to preserve EAX. -EAX + -ESI } function ComWriteAX { // Input: AX