aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Commands.hs7
-rw-r--r--src/Machine.hs1
2 files changed, 7 insertions, 1 deletions
diff --git a/src/Commands.hs b/src/Commands.hs
index 32fc17f..e12cfdf 100644
--- a/src/Commands.hs
+++ b/src/Commands.hs
@@ -110,7 +110,12 @@ doTRAP :: Int -> Emulator ()
doTRAP _ = return ()
doLINK :: Int -> Emulator ()
-doLINK _ = return ()
+doLINK a = do
+ incPC
+ addr <- readA a
+ sp <- readA 7
+ writeA 7 (sp-4)
+ setLong (sp-4) addr
doUNLK :: Int -> Emulator ()
doUNLK a = do
diff --git a/src/Machine.hs b/src/Machine.hs
index 23b7872..947d43a 100644
--- a/src/Machine.hs
+++ b/src/Machine.hs
@@ -167,6 +167,7 @@ writeA _ _ = return $ error "Incorrect Address register write"
-------------------------------------------------------------------------------
-- PC Register Access
+
readPC = with pc $ \pc -> do
return pc