mirror of
https://github.com/jtauber/applepy.git
synced 2024-11-23 10:31:02 +00:00
little BIT of simplication
This commit is contained in:
parent
c6a6071b2c
commit
3a20c009d9
@ -607,12 +607,9 @@ class CPU:
|
|||||||
|
|
||||||
def BIT(self, operand_address):
|
def BIT(self, operand_address):
|
||||||
value = self.memory.read_byte(operand_address)
|
value = self.memory.read_byte(operand_address)
|
||||||
if value > 0x7F:
|
self.sign_flag = ((value >> 7) % 2) # bit 7
|
||||||
self.sign_flag = 1
|
|
||||||
else:
|
|
||||||
self.sign_flag = 0
|
|
||||||
self.overflow_flag = ((value >> 6) % 2) # bit 6
|
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
|
# COMPARISON
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user