# 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/MC6809data/MC6809_op_data.py
# REG_A = "A"
# 
# REG_B = "B"
# 
# REG_CC = "CC"
# 
# REG_DP = "DP"
# 
# REG_PC = "PC"
# 
# REG_U = "U"
# 
# REG_X = "X"
# 
# REG_Y = "Y"


from MC6809.components.cpu_utils.instruction_caller import opcode
from MC6809.components.MC6809data.MC6809_op_data import REG_A, REG_B, REG_CC, REG_DP, REG_PC, REG_U, REG_X, REG_Y
            data = register_obj.value

#             log.debug("\tpush %s with data $%x", register_obj.name, data)

            if register_obj.WIDTH == 8:
                self.push_byte(register, data)
            else:
                assert register_obj.WIDTH == 16
                self.push_word(register, data)

#        log.debug("$%x PSH%s post byte: $%x", self.program_counter, register.name, m)

        # m = postbyte
        if m & 0x80:
            push(REG_PC, register)  # 16 bit program counter register
        if m & 0x40:
            push(REG_U, register)  # 16 bit user-stack pointer
        if m & 0x20:
            push(REG_Y, register)  # 16 bit index register
        if m & 0x10:
            push(REG_X, register)  # 16 bit index register
        if m & 0x08:
            push(REG_DP, register)  # 8 bit direct page register
        if m & 0x04:
            push(REG_B, register)  # 8 bit accumulator
        if m & 0x02:
            push(REG_A, register)  # 8 bit accumulator
        if m & 0x01:
            push(REG_CC, register)  # 8 bit condition code register


# 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/MC6809data/MC6809_op_data.py
# REG_A = "A"
# 
# REG_B = "B"
# 
# REG_CC = "CC"
# 
# REG_DP = "DP"
# 
# REG_PC = "PC"
# 
# REG_U = "U"
# 
# REG_X = "X"
# 
# REG_Y = "Y"


# Path: MC6809/components/mc6809_stack.py
from MC6809.components.cpu_utils.instruction_caller import opcode
from MC6809.components.MC6809data.MC6809_op_data import REG_A, REG_B, REG_CC, REG_DP, REG_PC, REG_U, REG_X, REG_Y

            data = register_obj.value

#             log.debug("\tpush %s with data $%x", register_obj.name, data)

            if register_obj.WIDTH == 8:
                self.push_byte(register, data)
            else:
                assert register_obj.WIDTH == 16
                self.push_word(register, data)

#        log.debug("$%x PSH%s post byte: $%x", self.program_counter, register.name, m)

        # m = postbyte
        if m & 0x80:
            push(REG_PC, register)  # 16 bit program counter register
        if m & 0x40:
            push(REG_U, register)  # 16 bit user-stack pointer
        if m & 0x20:
            push(REG_Y, register)  # 16 bit index register
        if m & 0x10:
            push(REG_X, register)  # 16 bit index register
        if m & 0x08:
            push(REG_DP, register)  # 8 bit direct page register
        if m & 0x04:
            push(REG_B, register)  # 8 bit accumulator
        if m & 0x02:
            push(REG_A, register)  # 8 bit accumulator
        if m & 0x01:
            push(REG_CC, register)  # 8 bit condition code register


    @opcode(  # Pull A, B, CC, DP, D, X, Y, U, or PC from stack