diff options
Diffstat (limited to 'src/Machine.hs')
-rw-r--r-- | src/Machine.hs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/Machine.hs b/src/Machine.hs index 6a09be9..23b7872 100644 --- a/src/Machine.hs +++ b/src/Machine.hs @@ -166,6 +166,19 @@ writeA _ _ = return $ error "Incorrect Address register write" ------------------------------------------------------------------------------- +-- PC Register Access +readPC = with pc $ \pc -> do + return pc + +writePC r = with pc $ \pc -> do + writeIORef pc r + +incPC = with pc $ \pc -> do + pcval <- readIORef pc + writeIORef pc (pcval + 2) + + +------------------------------------------------------------------------------- -- Status Register Access isTracing :: Emulator Bool |