Add Bx and Bxj for A32

This commit is contained in:
arthurchan35 2018-11-12 08:10:31 +08:00
parent a22b30c294
commit 540b8501af
2 changed files with 17 additions and 0 deletions

View file

@ -37,6 +37,21 @@ namespace ChocolArm64.Instructions32
}
}
public static void Bx(CpuThreadState state, MemoryManager memory, OpCode64 opCode)
{
A32OpCodeBReg op = (A32OpCodeBReg)opCode;
if (IsConditionTrue(state, op.Cond))
{
uint pc = GetPc(state);
BXWritePC(state, GetReg(state, op.Rm));
}
}
public static void Bxj(CpuThreadState state, MemoryManager memory, OpCode64 opCode)
{
Bx(state, memory, opCode);
}
private static void Blx_Imm(CpuThreadState state, MemoryManager memory, OpCode64 opCode, bool x)
{
A32OpCodeBImmAl op = (A32OpCodeBImmAl)opCode;

View file

@ -18,6 +18,8 @@ namespace ChocolArm64
SetA32("<<<<1011xxxxxxxxxxxxxxxxxxxxxxxx", A32InstInterpret.Bl, typeof(A32OpCodeBImmAl));
SetA32("1111101xxxxxxxxxxxxxxxxxxxxxxxxx", A32InstInterpret.Blx, typeof(A32OpCodeBImmAl));
SetA32("<<<<000100101111111111110011xxxx", A32InstInterpret.Blx, typeof(A32OpCodeBReg));
SetA32("<<<<000100101111111111110001xxxx", A32InstInterpret.Bx, typeof(A32OpCodeBReg));
SetA32("<<<<000100101111111111110010xxxx", A32InstInterpret.Bxj, typeof(A32OpCodeBReg));
#endregion
#region "OpCode Table (AArch64)"