def METHOD_NAME(self, state: CpuState):
    state.copyTo(self.tempState)
    self.tempState.ir = self.rom[state.pc][0]
    self.tempState.d = self.rom[state.pc][1]
    instruction = state.ir >> 5
    mod = (state.ir >> 2) & 7
    bus = state.ir & 3
    w = (instruction == 6)
    j = (instruction == 7)
    lo = state.d
    hi = 0
    to = None
    inc_x = False
    if not j:
        if mod == 0:
            to = "AC" if w is False else None
        elif mod == 1:
            to = "AC" if w is False else None
            lo = state.x
        elif mod == 2:
            to = "AC" if w is False else None
            hi = state.y
        elif mod == 3:
            to = "AC" if w is False else None
            lo = state.x
            hi = state.y
        elif mod == 4:
            to = "X"
        elif mod == 5:
            to = "Y"
        elif mod == 6:
            to = "OUT" if w is False else None
        elif mod == 7:
            to = "OUT" if w is False else None
            lo = state.x
            hi = state.y
            inc_x = True
    addr = (hi << 8) | lo
    b = state.undef
    if bus == 0:
        b = state.d
    elif bus == 1:
        if not w:
            b = self.ram[addr & 0x7fff]
    elif bus == 2:
        b = state.ac
    elif bus == 3:
        b = self.IN
    if w:
        self.ram[addr & 0x7fff] = b
    if instruction == 0:    # LD
        ALU = b
    elif instruction == 1:  # ANDA
        ALU = state.ac & b
    elif instruction == 2:  # ORA
        ALU = state.ac | b
    elif instruction == 3:  # XORA
        ALU = state.ac ^ b
    elif instruction == 4:  # ADDA
        ALU = (state.ac + b) & 0xFF
    elif instruction == 5:  # SUBA
        ALU = (state.ac - b) & 0xFF
    elif instruction == 6:  # ST
        ALU = state.ac
    elif instruction == 7:  # Bcc/JMP
        ALU = (-state.ac) & 0xFF
    # Load value into register
    if to == "AC":
        self.tempState.ac = ALU
    elif to == "X":
        self.tempState.x = ALU
    elif to == "Y":
        self.tempState.y = ALU
    elif to == "OUT":
        self.tempState.out = ALU
    if inc_x:
        self.tempState.x = (state.x + 1) & 0xFF
    self.tempState.pc = (state.pc + 1) & 0xFFFF
    if j:
        if mod != 0:
            cond = (state.ac >> 7) + 2 * (state.ac == 0)
            if (mod & (1 << cond)) != 0:    # 74153
                self.tempState.pc = (state.pc & 0xff00) | b
        else:
            self.tempState.pc = (state.y << 8) | b   # Unconditional far jump
    return self.tempState