From 7ed839040509b5cf9efccc988b662f516442c4f8 Mon Sep 17 00:00:00 2001 From: rekado Date: Fri, 19 Sep 2014 23:46:39 +0200 Subject: fix: use 7F, not EF as a register mask --- SHARC/Instruction.hs | 4 ++-- SHARC/Types.hs | 2 +- 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 -- cgit v1.2.3