# Path: MC6809/components/cpu_utils/instruction_caller.py
# def opcode(*opcodes):
#     """A decorator for opcodes"""
#     def decorator(func):
#         setattr(func, "_is_opcode", True)
#         setattr(func, "_opcodes", opcodes)
#         return func
#     return decorator


from MC6809.components.cpu_utils.instruction_caller import opcode
        """
#        log.debug("$%x LD16 set %s to $%x \t| %s" % (
#            self.program_counter,
#            register.name, m,
#            self.cfg.mem_info.get_shortest(m)
#        ))
        register.set(m)
        self.clear_NZV()
        self.update_NZ_16(m)

    @opcode(  # Load accumulator from memory
        0x86, 0x96, 0xa6, 0xb6,  # LDA (immediate, direct, indexed, extended)
        0xc6, 0xd6, 0xe6, 0xf6,  # LDB (immediate, direct, indexed, extended)
    )
    def instruction_LD8(self, opcode, m, register):
        """
        Loads the contents of memory location M into the designated register.

        source code forms: LDA P; LDB P

        CC bits "HNZVC": -aa0-
        """
#        log.debug("$%x LD8 %s = $%x" % (
#            self.program_counter,
#            register.name, m,
#        ))
        register.set(m)
        self.clear_NZV()
        self.update_NZ_8(m)


# Path: MC6809/components/cpu_utils/instruction_caller.py
# def opcode(*opcodes):
#     """A decorator for opcodes"""
#     def decorator(func):
#         setattr(func, "_is_opcode", True)
#         setattr(func, "_opcodes", opcodes)
#         return func
#     return decorator


# Path: MC6809/components/mc6809_ops_load_store.py
from MC6809.components.cpu_utils.instruction_caller import opcode

        """
#        log.debug("$%x LD16 set %s to $%x \t| %s" % (
#            self.program_counter,
#            register.name, m,
#            self.cfg.mem_info.get_shortest(m)
#        ))
        register.set(m)
        self.clear_NZV()
        self.update_NZ_16(m)

    @opcode(  # Load accumulator from memory
        0x86, 0x96, 0xa6, 0xb6,  # LDA (immediate, direct, indexed, extended)
        0xc6, 0xd6, 0xe6, 0xf6,  # LDB (immediate, direct, indexed, extended)
    )
    def instruction_LD8(self, opcode, m, register):
        """
        Loads the contents of memory location M into the designated register.

        source code forms: LDA P; LDB P

        CC bits "HNZVC": -aa0-
        """
#        log.debug("$%x LD8 %s = $%x" % (
#            self.program_counter,
#            register.name, m,
#        ))
        register.set(m)
        self.clear_NZV()
        self.update_NZ_8(m)


    @opcode(  # Store register to memory