Ex6502.CPU.Executor.BIT (ex6502 v0.1.0) View Source

Perform and AND between the location and the accumulator

Does not affect the accumulator -- only sets specific flags (outlined below) based on the AND operation.

Operation

A ^ M, M7 -> N, M6 -> V

Table

BIT Test Bits in Memory with Accumulator

bits 7 and 6 of operand are transfered to bit 7 and 6 of SR (N,V); the zeroflag is set to the result of operand AND accumulator.

A AND M, M7 -> N, M6 -> V N Z C I D V

                               M7 + - - - M6

addressing assembler opc bytes cyles


immediate BIT #oper 89 2 3 absolute BIT oper 2C 3 4 absolute,X BIT oper,X 3C 3 4 zeropage BIT oper 24 2 3 zeropage,X BIT oper 34 2 3

Flags

  • oVerflow: 1 if bit 6 is set; 0 otherwise
  • Zero: 1 if result is zero; 0 otherwise
  • Negative: 1 if bit 7 of result is 1; 0 otherwise

Link to this section Summary

Link to this section Functions