From 59769a222cbd4a753c09196bb415bda414f34050 Mon Sep 17 00:00:00 2001
From: Matthew Berry <me@mattrb.com>
Date: Tue, 3 Nov 2020 00:04:15 -0800
Subject: [PATCH] thumb software interrupt fix link register offset

---
 src/crab/thumb/software_interrupt.cr | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/crab/thumb/software_interrupt.cr b/src/crab/thumb/software_interrupt.cr
index 4699de7..bc21d1b 100644
--- a/src/crab/thumb/software_interrupt.cr
+++ b/src/crab/thumb/software_interrupt.cr
@@ -1,6 +1,6 @@
 module THUMB
   def thumb_software_interrupt(instr : Word) : Nil
-    lr = @r[15] - 4
+    lr = @r[15] - 2
     switch_mode CPU::Mode::SVC
     set_reg(14, lr)
     @cpsr.irq_disable = true