A
6502 instruction that performs a bitwise AND between A and a number but discards the result except to set the Z flag. It also sets S and V to bits 7 and 6 of the number.
- Function: !(A & N) => Z; N >> 7 => S; N >> 6 => V
- Updates flags: S V . . . . Z .
- Opcode numbers:
dp $24
abs $2C
Super Mario Brothers's code often uses BIT to skip an instruction by fooling the processor into treating an instruction as an address, using code similar to this:
close1:
ldx #$10
.dcb $2c ;skip next two-byte instruction
close2:
ldx #$20
closex:
lda #12
sta iccom,x
See also: 6502 instructions | 6502 addressing modes