Skip to content

Commit

Permalink
Fix: repair build.
Browse files Browse the repository at this point in the history
  • Loading branch information
uxmal committed Aug 12, 2024
1 parent 6c6b905 commit 24882e5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
8 changes: 2 additions & 6 deletions src/Arch/i8051/i8051Disassembler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,14 @@
*/
#endregion

using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Reko.Core;
using Reko.Core.Expressions;
using Reko.Core.Machine;
using Reko.Core.Memory;
using Reko.Core.Services;
using Reko.Core.Types;
using System;
using System.Collections.Generic;

namespace Reko.Arch.i8051
{
Expand Down
12 changes: 8 additions & 4 deletions src/Arch/i8051/i8051Rewriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;

namespace Reko.Arch.i8051
{
Expand Down Expand Up @@ -459,7 +460,10 @@ private Expression OpSrc(MachineOperand op, RegisterStorage? dataMemory)
case AddressOperand addr:
return addr.Address;
case MemoryOperand mem:
var ea = EffectiveAddress(mem);
var (ea, alias) = EffectiveAddress(mem);
if (alias is not null)
return alias;
Debug.Assert(ea is not null);
if (dataMemory != null)
{
return m.SegMem(mem.Width, binder.EnsureRegister(dataMemory), ea);
Expand Down Expand Up @@ -487,7 +491,7 @@ private Expression OpSrc(MachineOperand op, RegisterStorage? dataMemory)
}
}

private Expression EffectiveAddress(MemoryOperand mem)
private (Expression?, Expression?) EffectiveAddress(MemoryOperand mem)
{
Expression ea;
if (mem.DirectAddress != null)
Expand All @@ -500,7 +504,7 @@ private Expression EffectiveAddress(MemoryOperand mem)
{
var alias = AliasedSpecialFunctionRegister(c.ToUInt16());
if (alias != null)
return alias;
return (null, alias);
ea = c;
}
else
Expand Down Expand Up @@ -537,7 +541,7 @@ private Expression EffectiveAddress(MemoryOperand mem)
{
ea = m.Convert(ea, PrimitiveType.Byte, PrimitiveType.Word16);
}
return ea;
return (ea, null);
}

/// <summary>
Expand Down

0 comments on commit 24882e5

Please sign in to comment.