Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added: Op_Or_32(), Op_And_32() and tests #364

Merged
merged 4 commits into from
Jan 4, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions MBBSEmu/CPU/CPUCore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1212,6 +1212,7 @@ private void Op_Or()
{
1 => Op_Or_8(),
2 => Op_Or_16(),
4 => Op_Or_32(),
_ => throw new Exception("Unsupported Operation Size")
};

Expand Down Expand Up @@ -1242,6 +1243,16 @@ private ushort Op_Or_16()
return destination;
}

[MethodImpl(CompilerOptimizations)]
private uint Op_Or_32()
{
var destination = GetOperandValueUInt32(_currentInstruction.Op0Kind, EnumOperandType.Destination);
var source = GetOperandValueUInt32(_currentInstruction.Op1Kind, EnumOperandType.Source);
destination |= source;
Flags_EvaluateSignZero(destination);
return destination;
}

[MethodImpl(CompilerOptimizations)]
private void Op_Rcr()
{
Expand Down Expand Up @@ -1783,6 +1794,7 @@ private void Op_And()
{
1 => Op_And_8(),
2 => Op_And_16(),
4 => Op_And_32(),
_ => throw new Exception("Unsupported Operation Size")
};

Expand Down Expand Up @@ -1815,6 +1827,16 @@ private ushort Op_And_16()
return destination;
}

private uint Op_And_32()
{
var destination = GetOperandValueUInt32(_currentInstruction.Op0Kind, EnumOperandType.Destination);
var source = GetOperandValueUInt32(_currentInstruction.Op1Kind, EnumOperandType.Source);

destination &= source;
Flags_EvaluateSignZero(destination);
return destination;
}

[MethodImpl(CompilerOptimizations)]
private void Op_Xor()
{
Expand Down
1 change: 0 additions & 1 deletion MBBSEmu/HostProcess/ExportedModules/Majorbbs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection.Metadata;
using System.Text;

namespace MBBSEmu.HostProcess.ExportedModules
Expand Down