From 3f1970aa9bbd08d1178ba7321c7a42a044771d1b Mon Sep 17 00:00:00 2001 From: Ross Wilson Date: Wed, 10 Jun 2015 16:55:56 +0700 Subject: [PATCH] Fixed error in LWC instruction --- pymlac/MainCPU.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pymlac/MainCPU.py b/pymlac/MainCPU.py index 6e797e5..bb628c5 100644 --- a/pymlac/MainCPU.py +++ b/pymlac/MainCPU.py @@ -63,7 +63,7 @@ def init(): 015: i_ADD, 016: i_SUB, 017: i_SAM} - + # page_00 dispatch dictionary for decoding opcodes # HLT may be handled specially page_00_decode = {001003: i_DLA, @@ -161,6 +161,7 @@ def EFFADDR(address): def execute_one_instruction(): """Execute one MAIN instruction, return # cycles used""" + global main_decode global PC, BlockBase if not running: @@ -199,7 +200,7 @@ def i_LAW_LWC(indirect, address, instruction): global AC if indirect: - AC = ((~address) + 1) & WORDMASK + AC = ~address & WORDMASK Trace.itrace('LWC', False, address) else: AC = address