# Path: skoolkit/components.py
# def get_component(name, *args):
#     """Return a component declared in the ``[skoolkit]`` section of
#     `skoolkit.ini`.
# 
#     :param name: The component name.
#     :param args: Arguments passed to the component's constructor.
#     """
#     obj = get_object(get_value(name))
#     if callable(obj):
#         return obj(*args)
#     return obj
# 
# Path: skoolkit/ctlparser.py
# DEFAULT_BASE = 'n'


from skoolkit.components import get_component
from skoolkit.ctlparser import DEFAULT_BASE
            else:
                value = 65536 - value
        if value > 255 or num_bytes > 1:
            return self.word_formats[base].format(value)
        return self.byte_formats[base].format(value)

class Disassembler:
    """Initialise the disassembler.

    :param snapshot: The snapshot (list of 65536 byte values) to disassemble.
    :param config: Configuration object with the following attributes:

                   * `asm_hex` - if `True`, produce a hexadecimal disassembly
                   * `asm_lower` - if `True`, produce a lower case disassembly
                   * `defb_size` - default maximum number of bytes in a DEFB
                     statement
                   * `defm_size` - default maximum number of characters in a
                     DEFM statement
                   * `defw_size` - default maximum number of words in a DEFW
                     statement
                   * `wrap` - if `True`, disassemble an instruction that wraps
                     around the 64K boundary
    """
    # Component API
    def __init__(self, snapshot, config):
        self.snapshot = snapshot
        self.defb_size = config.defb_size
        self.defm_size = config.defm_size
        self.defw_size = config.defw_size
        self.wrap = config.wrap

# Path: skoolkit/components.py
# def get_component(name, *args):
#     """Return a component declared in the ``[skoolkit]`` section of
#     `skoolkit.ini`.
# 
#     :param name: The component name.
#     :param args: Arguments passed to the component's constructor.
#     """
#     obj = get_object(get_value(name))
#     if callable(obj):
#         return obj(*args)
#     return obj
# 
# Path: skoolkit/ctlparser.py
# DEFAULT_BASE = 'n'


# Path: skoolkit/disassembler.py
from skoolkit.components import get_component
from skoolkit.ctlparser import DEFAULT_BASE

            else:
                value = 65536 - value
        if value > 255 or num_bytes > 1:
            return self.word_formats[base].format(value)
        return self.byte_formats[base].format(value)

class Disassembler:
    """Initialise the disassembler.

    :param snapshot: The snapshot (list of 65536 byte values) to disassemble.
    :param config: Configuration object with the following attributes:

                   * `asm_hex` - if `True`, produce a hexadecimal disassembly
                   * `asm_lower` - if `True`, produce a lower case disassembly
                   * `defb_size` - default maximum number of bytes in a DEFB
                     statement
                   * `defm_size` - default maximum number of characters in a
                     DEFM statement
                   * `defw_size` - default maximum number of words in a DEFW
                     statement
                   * `wrap` - if `True`, disassemble an instruction that wraps
                     around the 64K boundary
    """
    # Component API
    def __init__(self, snapshot, config):
        self.snapshot = snapshot
        self.defb_size = config.defb_size
        self.defm_size = config.defm_size
        self.defw_size = config.defw_size
        self.wrap = config.wrap

        self.op_formatter = get_component('OperandFormatter', config)