eight_bit_computer.operations.jump_if_eq_acc_op module¶
The JUMP_IF_EQ_ACC operation.
Sets PC (jumps) to a constant if the module or constant passed as an argument is equal to the value in ACC.
This operation will generate and store (clobber) ALU flags.
-
eight_bit_computer.operations.jump_if_eq_acc_op.
generate_microcode_templates
()[source]¶ Generate microcode for all the JUMP_IF_EQ_ACC operations.
Returns: DataTemplates for all the JUMP_IF_EQ_ACC microcode. Return type: list(DataTemplate)
-
eight_bit_computer.operations.jump_if_eq_acc_op.
generate_signatures
()[source]¶ Generate the definitions of all possible arguments passable.
Returns: All possible arguments. See get_arg_def_template()
for more information.Return type: list(list(dict))
-
eight_bit_computer.operations.jump_if_eq_acc_op.
generate_operation_templates
(signature)[source]¶ Create the DataTemplates to define a JUMP_IF_EQ_ACC with the given args.
Parameters: signature (list(dict)) – List of argument definitions that specify which particular not operation to generate templates for. Returns: Datatemplates that define this JUMP_IF_EQ_ACC. Return type: list(DataTemplate)
-
eight_bit_computer.operations.jump_if_eq_acc_op.
generate_false_datatemplates
(signature)[source]¶ Create DataTemplates to define a conditional jump if condition is false.
This is the case where no jump happens.
Parameters: signature (list(dict)) – List of argument definitions that specify which particular not operation to generate templates for. Returns: Datatemplates that define the “false half” of the operation. Return type: list(DataTemplate)
-
eight_bit_computer.operations.jump_if_eq_acc_op.
generate_nonconditional_steps
(signature)[source]¶ Generate the nonconditional control steps.
These steps generate the flags which then govern whether the jump happens or not.
Parameters: signature (list(dict)) – List of argument definitions that specify which particular operation to generate steps for. Returns: List of list of bitdefs that represent the steps, and the control signals at each step. Return type: list(list(str))
-
eight_bit_computer.operations.jump_if_eq_acc_op.
generate_instruction_byte_bitdefs
(signature)[source]¶ Generate bitdefs to specify the instruction byte for these args.
Parameters: signature (list(dict)) – List of argument definitions that specify which particular operation to generate the instruction byte bitdefs for. Returns: Bitdefs that make up the instruction_byte Return type: list(str)
-
eight_bit_computer.operations.jump_if_eq_acc_op.
generate_true_datatemplates
(signature)[source]¶ Create DataTemplates to define a conditional jump if condition is true.
This is the case where no jump happens
Parameters: signature (list(dict)) – List of argument definitions that specify which particular operation to generate templates for. Returns: Datatemplates that define the “true half” of a JUMP_IF_***_ACC operation. Return type: list(DataTemplate)
-
eight_bit_computer.operations.jump_if_eq_acc_op.
parse_line
(line)[source]¶ Parse a line of assembly code to create machine code byte templates.
If a line is not identifiably an JUMP_IF_EQ_ACC assembly line, return an empty list instead.
Parameters: line (str) – Assembly line to be parsed. Returns: List of instruction byte template dictionaries or an empty list. Return type: list(dict)