diff options
author | Nikita Orlov <nikitf-97@mail.ru> | 2021-04-02 22:37:27 +0300 |
---|---|---|
committer | Nikita Orlov <nikitf-97@mail.ru> | 2021-04-02 22:37:27 +0300 |
commit | fd5b0ee5334977256ae1ef0f1802ac67a7248897 (patch) | |
tree | b2479b059fae556c0ab0c4c835469af9f2d59fcb /src | |
parent | 9dcc3abc60d591805f17b758dc579d4f8683f1fb (diff) | |
download | suem-fd5b0ee5334977256ae1ef0f1802ac67a7248897.tar suem-fd5b0ee5334977256ae1ef0f1802ac67a7248897.tar.xz suem-fd5b0ee5334977256ae1ef0f1802ac67a7248897.zip |
MOVE in progress
Diffstat (limited to 'src')
-rw-r--r-- | src/Instructions.hs | 7 | ||||
-rw-r--r-- | src/Machine.hs | 2 |
2 files changed, 7 insertions, 2 deletions
diff --git a/src/Instructions.hs b/src/Instructions.hs index 3ffbfc2..c3e9763 100644 --- a/src/Instructions.hs +++ b/src/Instructions.hs @@ -62,7 +62,12 @@ doMOVEA :: Int -> Int -> Int -> Int -> Emulator () doMOVEA _ _ _ _ = error "MOVEA" doMOVE :: Int -> Int -> Int -> Int -> Int -> Emulator () -doMOVE _ _ _ _ _ = error "MOVE" +doMOVE 1 dst_reg dst_mode src_mode src_reg = do + incPC + src <- getOp src_mode src_reg 1 + src_value <- fst src + dst <- getOp dst_mode dst_reg 1 + (snd dst) src_value doSRMOVE :: Int -> Int -> Emulator () doSRMOVE _ _ = error "SRMOVE" diff --git a/src/Machine.hs b/src/Machine.hs index 4dd40d3..55c5294 100644 --- a/src/Machine.hs +++ b/src/Machine.hs @@ -412,7 +412,7 @@ getOp 7 1 s = do skipOp 4 addr <- getLong pc return (getMemory addr s, setMemory addr s) -getOp 7 6 s = do +getOp 7 4 s = do addr <- readPC skipOp s let addr = addr + if s == 1 then 1 else 0 |