summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoakim Sindholt <opensource@zhasha.com>2012-04-30 19:13:44 +0200
committerJoakim Sindholt <opensource@zhasha.com>2012-04-30 19:13:44 +0200
commitf461143a6bcdc4c87906354a28c99ecf65978840 (patch)
tree9a93c45554315133ea9e9aba44cee657b600f9dc
parentec4f577a0fd43cedd89a128e75334b464d8c51ff (diff)
assembler: fix sign extender on large branchesHEADmaster
-rw-r--r--Assembler.hs2
1 files changed, 1 insertions, 1 deletions
diff --git a/Assembler.hs b/Assembler.hs
index 71fbb1b..6b5ae3e 100644
--- a/Assembler.hs
+++ b/Assembler.hs
@@ -152,7 +152,7 @@ mkWord inst dr sa sb = ((inst .&. 0x7F) `shift` 9)
-- Helper for bit mangling instructions using the sign extender
mkWordSE :: Word16 -> Word16 -> Word16 -> Word16
mkWordSE inst dr sa = ((inst .&. 0x7F) `shift` 9)
- .|. ((dr .&. 0x38) `shift` 6)
+ .|. ((dr .&. 0x38) `shift` 3)
.|. ((sa .&. 0x7) `shift` 3)
.|. (dr .&. 0x7)