summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrekado <rekado@elephly.net>2014-09-19 23:46:39 +0200
committerrekado <rekado@elephly.net>2014-09-19 23:46:39 +0200
commit7ed839040509b5cf9efccc988b662f516442c4f8 (patch)
treea784810a514a69c71c123ea9b4af92eb7c7c91e8
parent79eb0890140cf212245195b2b4c6768cdedbd372 (diff)
fix: use 7F, not EF as a register mask
-rw-r--r--SHARC/Instruction.hs4
-rw-r--r--SHARC/Types.hs2
2 files changed, 3 insertions, 3 deletions
diff --git a/SHARC/Instruction.hs b/SHARC/Instruction.hs
index 4073248..6278492 100644
--- a/SHARC/Instruction.hs
+++ b/SHARC/Instruction.hs
@@ -403,7 +403,7 @@ parseType14 w = Type14 rw mem wa ureg addr
rw = if w64 `testBit` 40 then Write else Read
mem = if w64 `testBit` 41 then Prog else Data
wa = if w64 `testBit` 39 then LW else NW
- ureg = mkUreg $ w64 `cutMask` 0x00EF00000000
+ ureg = mkUreg $ w64 `cutMask` 0x007F00000000
addr = Address32 $ w64 `cutMask` 0x0000FFFFFFFF
-- TODO
@@ -414,7 +414,7 @@ parseType17 w = Type17 ureg dat
where
w64 = word48ToWord64 w
dat = w64 `cutMask` 0x0000FFFFFFFF
- ureg = mkUreg $ w64 `cutMask` 0x00EF00000000
+ ureg = mkUreg $ w64 `cutMask` 0x007F00000000
parseType18 w = Type18 bop sreg dat
where
diff --git a/SHARC/Types.hs b/SHARC/Types.hs
index 22f91a1..a0a0973 100644
--- a/SHARC/Types.hs
+++ b/SHARC/Types.hs
@@ -113,7 +113,7 @@ instance Show Mreg where
-- 7 bit universal register
data Ureg = Ureg Word8
mkUreg :: Word8 -> Ureg
-mkUreg n = Ureg $ n .&. 0xEF
+mkUreg n = Ureg $ n .&. 0x7F
instance Show Ureg where
show (Ureg n) = case prefix of
0x00 -> format0000 stripped