Correct implementation of thumb16_SVC and arm_SVC

This commit is contained in:
MerryMage 2016-08-07 22:19:39 +01:00
parent a32063fa60
commit edb236ab07
2 changed files with 4 additions and 1 deletions

View file

@ -17,8 +17,10 @@ bool ArmTranslatorVisitor::arm_SVC(Cond cond, Imm24 imm24) {
u32 imm32 = imm24;
// SVC<c> #<imm24>
if (ConditionPassed(cond)) {
ir.BranchWritePC(ir.Imm32(ir.current_location.PC() + 4));
ir.CallSupervisor(ir.Imm32(imm32));
return LinkToNextInstruction();
ir.SetTerm(IR::Term::ReturnToDispatch{});
return false;
}
return true;
}

View file

@ -769,6 +769,7 @@ struct ThumbTranslatorVisitor final {
bool thumb16_SVC(Imm8 imm8) {
u32 imm32 = imm8;
// SVC #<imm8>
ir.BranchWritePC(ir.Imm32(ir.current_location.PC() + 2));
ir.CallSupervisor(ir.Imm32(imm32));
ir.SetTerm(IR::Term::ReturnToDispatch{});
return false;