Skip to content

Commit

Permalink
Debugger: WS - Fixed effective address calculation for LES/LDS
Browse files Browse the repository at this point in the history
Show first word's address instead of the second's
  • Loading branch information
SourMesen committed Nov 13, 2024
1 parent 54b8973 commit 2e6a2e5
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions Core/WS/Debugger/WsDisUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -399,9 +399,14 @@ EffectiveAddressInfo WsDisUtils::GetEffectiveAddress(DisassemblyInfo& info, WsCo
result.ShowAddress = true;

if(dummyCpu.IsWordAccess(i)) {
result.Address = opInfo.Address;
result.Type = opInfo.MemType;
result.ValueSize = 2;
if(dummyCpu.IsWordAccess(i - 1) && prevOpInfo.Type == opInfo.Type && prevOpInfo.Address == opInfo.Address - 2) {
result.Address = prevOpInfo.Address;
result.Type = prevOpInfo.MemType;
} else {
result.Address = opInfo.Address;
result.Type = opInfo.MemType;
}
} else {
if(prevOpInfo.Type == opInfo.Type && prevOpInfo.Address == opInfo.Address - 1) {
//For 16-bit read/writes that were split into 2 8-bit accesses, return the first address
Expand Down

0 comments on commit 2e6a2e5

Please sign in to comment.