# 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
        0x1022,  # LBHI (relative)
    )
    def instruction_BHI(self, opcode, ea):
        """
        Causes a branch if the previous operation caused neither a carry nor a
        zero result. When used after a subtract or compare operation on unsigned
        binary values, this instruction will branch if the register was higher
        than the memory register.

        Generally not useful after INC/DEC, LD/TST, and TST/CLR/COM
        instructions.

        source code forms: BHI dd; LBHI DDDD

        CC bits "HNZVC": -----
        """
        if self.C == 0 and self.Z == 0:
            #            log.info("$%x BHI branch to $%x, because C==0 and Z==0 \t| %s" % (
            #                self.program_counter, ea, self.cfg.mem_info.get_shortest(ea)
            #            ))
            self.program_counter.set(ea)
#         else:
#            log.debug("$%x BHI: don't branch to $%x, because C and Z not 0 \t| %s" % (
#                self.program_counter, ea, self.cfg.mem_info.get_shortest(ea)
#            ))

    @opcode(  # Branch if less than or equal (signed)
        0x2f,  # BLE (relative)
        0x102f,  # LBLE (relative)
    )

# 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_branches.py
from MC6809.components.cpu_utils.instruction_caller import opcode

        0x1022,  # LBHI (relative)
    )
    def instruction_BHI(self, opcode, ea):
        """
        Causes a branch if the previous operation caused neither a carry nor a
        zero result. When used after a subtract or compare operation on unsigned
        binary values, this instruction will branch if the register was higher
        than the memory register.

        Generally not useful after INC/DEC, LD/TST, and TST/CLR/COM
        instructions.

        source code forms: BHI dd; LBHI DDDD

        CC bits "HNZVC": -----
        """
        if self.C == 0 and self.Z == 0:
            #            log.info("$%x BHI branch to $%x, because C==0 and Z==0 \t| %s" % (
            #                self.program_counter, ea, self.cfg.mem_info.get_shortest(ea)
            #            ))
            self.program_counter.set(ea)
#         else:
#            log.debug("$%x BHI: don't branch to $%x, because C and Z not 0 \t| %s" % (
#                self.program_counter, ea, self.cfg.mem_info.get_shortest(ea)
#            ))

    @opcode(  # Branch if less than or equal (signed)
        0x2f,  # BLE (relative)
        0x102f,  # LBLE (relative)
    )

    def instruction_BLE(self, opcode, ea):