<commit_before>package machine6502;

import machine6502.instructions.*;

class InstructionTable {
    private Instruction[] insts;
    
    public InstructionTable() {
        insts = new Instruction[256];
        
        // NOP (no operation)
        insts[0xEA] = new Instruction() {
            @Override
            public int operate(CPUState regdata, Memory mem) {
                regdata.pc += 1;
                return 2;
            }
        };
        
        // BIT
        // zp
        insts[0x24] = new Instruction() {
            @Override
            public int operate(CPUState regdata, Memory mem) {
                int m = mem.readByte(regdata.pc+1);
                
                regdata.setFlag(CPUFlags.Z, (m & regdata.a) == 0);
                regdata.setFlag(CPUFlags.V, (m & 0x40) != 0);
                regdata.setFlag(CPUFlags.N, (m & 0x80) != 0);
                
                regdata.pc += 2;
                return 3;
            }
        };
        // abs
        insts[0x2C] = new Instruction() {
            @Override
            public int operate(CPUState regdata, Memory mem) {
                int m = MemUtils.readShort(mem, regdata.pc+1);
                
                regdata.setFlag(CPUFlags.Z, (m & regdata.a) == 0);
                regdata.setFlag(CPUFlags.V, (m & 0x40) != 0);
                regdata.setFlag(CPUFlags.N, (m & 0x80) != 0);
                
                regdata.pc += 3;
                return 4;<commit_msg>passes test 08<commit_after>package machine6502;

import machine6502.instructions.*;

class InstructionTable {
    private Instruction[] insts;
    
    public InstructionTable() {
        insts = new Instruction[256];
        
        // NOP (no operation)
        insts[0xEA] = new Instruction() {
            @Override
            public int operate(CPUState regdata, Memory mem) {
                regdata.pc += 1;
                return 2;
            }
        };
        
        // BIT
        // zp
        insts[0x24] = new Instruction() {
            @Override
            public int operate(CPUState regdata, Memory mem) {
                int m = mem.readByte(regdata.pc+1);
                int value = mem.readByte(m);
                
                regdata.setFlag(CPUFlags.Z, (value & regdata.a) == 0);
                regdata.setFlag(CPUFlags.V, (value & 0x40) != 0);
                regdata.setFlag(CPUFlags.N, (value & 0x80) != 0);
                
                regdata.pc += 2;
                return 3;
            }
        };
        // abs
        insts[0x2C] = new Instruction() {
            @Override
            public int operate(CPUState regdata, Memory mem) {
                int m = MemUtils.readShort(mem, regdata.pc+1);
                int value = mem.readByte(m);
                
                regdata.setFlag(CPUFlags.Z, (value & regdata.a) == 0);
                regdata.setFlag(CPUFlags.V, (value & 0x40) != 0);
                regdata.setFlag(CPUFlags.N, (value & 0x80) != 0);
                
                regdata.pc += 3;
                return 4;
{'fraction_non_alphanumeric': 0.11107502435855797, 'fraction_numerical': 0.028580708022085094, 'mean_word_length': 1.2531089978054133, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7304629', 'n_tokens_mistral': 970, 'n_tokens_neox': 868, 'n_words': 193}