eight_bit_computer.operations.operation_template module

Template for operation module

eight_bit_computer.operations.operation_template.generate_microcode_templates()[source]

Generate microcode for all the OP_TEMPLATE instructions.

Returns:DataTemplates for all the OP_TEMPLATE instructions.
Return type:list(DataTemplate)
eight_bit_computer.operations.operation_template.generate_signatures()[source]

Generate all the argument signatures for the OP_TEMPLATE operation.

Returns:All possible signatures, See get_arg_def_template() for more information on an argument definition dictionary.
Return type:list(list(dict))
eight_bit_computer.operations.operation_template.generate_operation_templates(signature)[source]

Create the DataTemplates to define a OP_TEMPLATE with the given signature.

Parameters:signature (list(dict)) – List of argument definitions that specify which particular OP_TEMPLATE operation to generate templates for.
Returns:DataTemplates that define this OP_TEMPLATE.
Return type:list(DataTemplate)
eight_bit_computer.operations.operation_template.generate_instruction_byte_bitdefs(signature)[source]

Generate bitdefs to specify the instruction byte for this signature.

Parameters:signature (list(dict)) – List of argument definitions that specify which particular OP_TEMPLATE operation to generate the instruction byte bitdefs for.
Returns:Bitdefs that make up the instruction_byte
Return type:list(str)
eight_bit_computer.operations.operation_template.generate_control_steps(signature)[source]

Generate control steps for this signature.

Parameters:signature (list(dict)) – List of argument definitions that specify which particular OP_TEMPLATE operation to generate the control steps for.
Returns:List of list of bitdefs that specify the control steps.
Return type:list(list(str))
eight_bit_computer.operations.operation_template.parse_line(line)[source]

Parse a line of assembly code to create machine code byte templates.

If a line is not identifiably a OP_TEMPLATE assembly line, return an empty list instead.

Parameters:line (str) – Assembly line to be parsed.
Returns:List of machine code byte template dictionaries or an empty list.
Return type:list(dict)