From 77b2540293dea4b6c348b3154e62c095de780142 Mon Sep 17 00:00:00 2001 From: Aleksey Veresov Date: Mon, 22 Mar 2021 16:45:26 +0300 Subject: . --- src/Commands.hs | 7 ++++++- src/Machine.hs | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'src') 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 -- cgit v1.2.3