From 3a20c009d9c552272f27f4cdac1f5b73e94c85e6 Mon Sep 17 00:00:00 2001 From: James Tauber Date: Sat, 6 Aug 2011 22:05:15 -0400 Subject: [PATCH] little BIT of simplication --- applepy.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/applepy.py b/applepy.py index c5bb03e..b7e37d4 100644 --- a/applepy.py +++ b/applepy.py @@ -607,12 +607,9 @@ class CPU: def BIT(self, operand_address): value = self.memory.read_byte(operand_address) - if value > 0x7F: - self.sign_flag = 1 - else: - self.sign_flag = 0 + self.sign_flag = ((value >> 7) % 2) # bit 7 self.overflow_flag = ((value >> 6) % 2) # bit 6 - self.zero_flag = ((self.accumulator & value) == 0) # @@@ is this right? + self.zero_flag = ((self.accumulator & value) == 0) # COMPARISON