From adeb05911b5d407d6760fb2a68d8535eb486fbcd Mon Sep 17 00:00:00 2001 From: Matthew Berry Date: Thu, 29 Oct 2020 00:10:20 -0700 Subject: [PATCH] thumb high reg bx ops only set flags on cmp --- src/crab/thumb/hi_reg_branch_exchange.cr | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/crab/thumb/hi_reg_branch_exchange.cr b/src/crab/thumb/hi_reg_branch_exchange.cr index 0c40249..2a5ece0 100644 --- a/src/crab/thumb/hi_reg_branch_exchange.cr +++ b/src/crab/thumb/hi_reg_branch_exchange.cr @@ -9,8 +9,9 @@ module THUMB rd += 8 if h1 rs += 8 if h2 + # In this group only CMP (Op = 01) sets the CPSR condition codes. case op - when 0b00 then set_reg(rd, add(@r[rd], @r[rs], true)) + when 0b00 then set_reg(rd, add(@r[rd], @r[rs], false)) when 0b01 then sub(@r[rd], @r[rs], true) when 0b10 then set_reg(rd, @r[rs]) when 0b11