# 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/utils/bits.py
# def get_bit(value, bit):
#     """
#     return 1 or 0 from the bit at the given offset >bit<, e.g.:
# 
#     >>> get_bit(0x01, bit=0) # 00000001
#     1
#     >>> get_bit(0xfd, bit=1) # 11111101
#     0
#     >>> get_bit(int('10000000', 2), bit=7)
#     1
#     >>> get_bit(int('01111111', 2), bit=7)
#     0
#     >>> get_bit(int('1111000011110000', 2), bit=11)
#     0
#     >>> get_bit(int('1111000011110000', 2), bit=12)
#     1
#     """
#     return 0 if value & 2 ** bit == 0 else 1


from MC6809.components.cpu_utils.instruction_caller import opcode
from MC6809.utils.bits import get_bit
#!/usr/bin/env python

"""
    MC6809 - 6809 CPU emulator in Python
    =======================================

    6809 is Big-Endian

    Links:
        http://dragondata.worldofdragon.org/Publications/inside-dragon.htm
        http://www.burgins.com/m6809.html
        http://koti.mbnet.fi/~atjs/mc6809/

    :copyleft: 2013-2015 by the MC6809 team, see AUTHORS for more details.
    :license: GNU GPL v3 or above, see LICENSE for more details.

    Based on:
        * ApplyPy by James Tauber (MIT license)
        * XRoar emulator by Ciaran Anscomb (GPL license)
    more info, see README
"""




class OpsLogicalMixin:
    # ---- Logical Operations ----


# 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/utils/bits.py
# def get_bit(value, bit):
#     """
#     return 1 or 0 from the bit at the given offset >bit<, e.g.:
# 
#     >>> get_bit(0x01, bit=0) # 00000001
#     1
#     >>> get_bit(0xfd, bit=1) # 11111101
#     0
#     >>> get_bit(int('10000000', 2), bit=7)
#     1
#     >>> get_bit(int('01111111', 2), bit=7)
#     0
#     >>> get_bit(int('1111000011110000', 2), bit=11)
#     0
#     >>> get_bit(int('1111000011110000', 2), bit=12)
#     1
#     """
#     return 0 if value & 2 ** bit == 0 else 1


# Path: MC6809/components/mc6809_ops_logic.py
from MC6809.components.cpu_utils.instruction_caller import opcode
from MC6809.utils.bits import get_bit

#!/usr/bin/env python

"""
    MC6809 - 6809 CPU emulator in Python
    =======================================

    6809 is Big-Endian

    Links:
        http://dragondata.worldofdragon.org/Publications/inside-dragon.htm
        http://www.burgins.com/m6809.html
        http://koti.mbnet.fi/~atjs/mc6809/

    :copyleft: 2013-2015 by the MC6809 team, see AUTHORS for more details.
    :license: GNU GPL v3 or above, see LICENSE for more details.

    Based on:
        * ApplyPy by James Tauber (MIT license)
        * XRoar emulator by Ciaran Anscomb (GPL license)
    more info, see README
"""




class OpsLogicalMixin:
    # ---- Logical Operations ----


    @opcode(  # AND memory with accumulator