summary refs log tree commit diff
path: root/instructions/BIT.ts
blob: 2367ba76aa11936919ec0a083148cb3a1bf04e83 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import type The65c02 from "../65c02.ts";

export default function (this: The65c02, mode: string) {
    const location = this.getAddr(mode, [
        'zero-page',
        'absolute'
    ]);
    this.io.address.set(location);
    this.read();
    this.overflow = this.io.data.bit(6)
    this.negative = this.io.data.bit(7)
    const thing = this.regA.num() & this.io.data.num();
    this.zero = thing == 0;
}