eight_bit_computer.operations.jump_if_flag_base module¶
-
eight_bit_computer.operations.jump_if_flag_base.
generate_microcode_templates
(src_dest, true_flag_bitdef, false_flag_bitdef)[source]¶ Generate microcode for all the JUMP_IF_XXX_FLAG instructions.
Parameters: - src_dest (str) – Name of the module used for both the source and destination.
- true_flag_bitdef (str) – Bitdef that represents the state of the flags if the condition is true, i.e. the operation should jump.
- false_flag_bitdef (str) – Bitdef that represents the state of the flags if the condition is false, i.e. the operation should not jump and just execute the next instruction instead.
Returns: DataTemplates for all the JUMP_IF_XXX_FLAG instructions.
Return type: list(DataTemplate)
-
eight_bit_computer.operations.jump_if_flag_base.
generate_instruction_byte_bitdefs
(src_dest)[source]¶ Generate bitdefs to specify the instruction byte
Parameters: src_dest (str) – Name of the module used for both the source and destination. Returns: Bitdefs that make up the instruction_byte Return type: list(str)
-
eight_bit_computer.operations.jump_if_flag_base.
generate_true_control_steps
()[source]¶ Generate control steps to carry out the jump.
Returns: List of list of bitdefs that specify the control steps. Return type: list(list(str))
-
eight_bit_computer.operations.jump_if_flag_base.
parse_line
(line, src_dest, name)[source]¶ Parse a line of assembly code to create machine code byte templates.
If a line is not identifiably a JUMP_IF_XXX_FLAG assembly line, return an empty list instead.
Parameters: - line (str) – Assembly line to be parsed.
- src_dest (str) – Name of the module used for both the source and destination.
- name (str) – Name of the Operation.
Returns: List of machine code byte template dictionaries or an empty list.
Return type: list(dict)
-
eight_bit_computer.operations.jump_if_flag_base.
generate_signatures
()[source]¶ Generate all the argument signatures for the JUMP_IF_XXX_FLAG operation.
Returns: All possible signatures, See get_arg_def_template()
for more information on an argument definition dictionary.Return type: list(list(dict))