# Path: MC6809/utils/humanize.py
# def cc_value2txt(status):
#     """
#     >>> cc_value2txt(0x50)
#     '.F.I....'
#     >>> cc_value2txt(0x54)
#     '.F.I.Z..'
#     >>> cc_value2txt(0x59)
#     '.F.IN..C'
#     """
#     return "".join(
#         "." if status & x == 0 else char
#         for char, x in zip("EFHINZVC", (128, 64, 32, 16, 8, 4, 2, 1))
#     )


import logging
from MC6809.utils.humanize import cc_value2txt
        self.H = 0  # H - 0x20 - bit 5 - Half-Carry
        self.I = 0  # I - 0x10 - bit 4 - IRQ interrupt masked
        self.N = 0  # N - 0x08 - bit 3 - Negative result (twos complement)
        self.Z = 0  # Z - 0x04 - bit 2 - Zero result
        self.V = 0  # V - 0x02 - bit 1 - Overflow
        self.C = 0  # C - 0x01 - bit 0 - Carry (or borrow)

        self.cc_register = ConditionCodeRegister(self)

    ####

    def get_cc_value(self):
        return self.C | \
            self.V << 1 | \
            self.Z << 2 | \
            self.N << 3 | \
            self.I << 4 | \
            self.H << 5 | \
            self.F << 6 | \
            self.E << 7

    def set_cc(self, status):
        self.E, self.F, self.H, self.I, self.N, self.Z, self.V, self.C = \
            [0 if status & x == 0 else 1 for x in (128, 64, 32, 16, 8, 4, 2, 1)]

    def get_cc_info(self):
        """
        return cc flags as text representation, like: 'E.H....C'
        used in trace mode and unittests
        """

# Path: MC6809/utils/humanize.py
# def cc_value2txt(status):
#     """
#     >>> cc_value2txt(0x50)
#     '.F.I....'
#     >>> cc_value2txt(0x54)
#     '.F.I.Z..'
#     >>> cc_value2txt(0x59)
#     '.F.IN..C'
#     """
#     return "".join(
#         "." if status & x == 0 else char
#         for char, x in zip("EFHINZVC", (128, 64, 32, 16, 8, 4, 2, 1))
#     )


# Path: MC6809/components/mc6809_cc_register.py
import logging
from MC6809.utils.humanize import cc_value2txt

        self.H = 0  # H - 0x20 - bit 5 - Half-Carry
        self.I = 0  # I - 0x10 - bit 4 - IRQ interrupt masked
        self.N = 0  # N - 0x08 - bit 3 - Negative result (twos complement)
        self.Z = 0  # Z - 0x04 - bit 2 - Zero result
        self.V = 0  # V - 0x02 - bit 1 - Overflow
        self.C = 0  # C - 0x01 - bit 0 - Carry (or borrow)

        self.cc_register = ConditionCodeRegister(self)

    ####

    def get_cc_value(self):
        return self.C | \
            self.V << 1 | \
            self.Z << 2 | \
            self.N << 3 | \
            self.I << 4 | \
            self.H << 5 | \
            self.F << 6 | \
            self.E << 7

    def set_cc(self, status):
        self.E, self.F, self.H, self.I, self.N, self.Z, self.V, self.C = \
            [0 if status & x == 0 else 1 for x in (128, 64, 32, 16, 8, 4, 2, 1)]

    def get_cc_info(self):
        """
        return cc flags as text representation, like: 'E.H....C'
        used in trace mode and unittests
        """

        return cc_value2txt(self.get_cc_value())