aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikita Orlov <nikitf-97@mail.ru>2021-04-03 23:24:20 +0300
committerNikita Orlov <nikitf-97@mail.ru>2021-04-03 23:24:20 +0300
commitbb999d34dac7be7f79a1b2c847c0022576847718 (patch)
tree150c87e0b9af1e0ce61cd0a2c26fb13fa4a44196
parent717a132ea55eb634eda375d59d73df826712cd8b (diff)
downloadsuem-bb999d34dac7be7f79a1b2c847c0022576847718.tar
suem-bb999d34dac7be7f79a1b2c847c0022576847718.tar.xz
suem-bb999d34dac7be7f79a1b2c847c0022576847718.zip
MOVEA added
-rw-r--r--src/Instructions.hs9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/Instructions.hs b/src/Instructions.hs
index 98e4337..3d9ad1a 100644
--- a/src/Instructions.hs
+++ b/src/Instructions.hs
@@ -59,7 +59,13 @@ doBSET :: Int -> Int -> Int -> Int -> Emulator ()
doBSET _ _ _ _ = error "BSET"
doMOVEA :: Int -> Int -> Int -> Int -> Emulator ()
-doMOVEA _ _ _ _ = error "MOVEA"
+doMOVEA size dst_reg src_mode src_reg = do
+ incPC
+ (src_get, src_set) <- getOp src_mode src_reg (getMoveSize size)
+ (dst_get, dst_set) <- getOp 1 dst_reg 4
+ src_val <- src_get
+ let val = signExtend src_val (getMoveSize size)
+ dst_set val
doMOVE :: Int -> Int -> Int -> Int -> Int -> Emulator ()
doMOVE size dst_reg dst_mode src_mode src_reg = do
@@ -68,7 +74,6 @@ doMOVE size dst_reg dst_mode src_mode src_reg = do
(dst_get, dst_set) <- getOp dst_mode dst_reg (getMoveSize size)
src_val <- src_get
dst_set src_val
- sv <- isSupervisor
setNegative (checkNegative src_val (getMoveSize size))
setZero (checkZero src_val)
setOverflow False