eight_bit_computer.assembly_validity module¶
Validity checks on the processed assembly lines
-
eight_bit_computer.assembly_validity.
check_structure_validity
(asm_line_infos)[source]¶ Check the processed assembly lines for consistency/correctness.
Parameters: asm_line_infos (list(dict)) – List of dictionaries (conforming to get_assembly_line_template()
) with information about all the lines in the assembly file.
-
eight_bit_computer.assembly_validity.
check_multiple_label_defs
(asm_line_infos)[source]¶ Check if the same label been defined more than once.
Parameters: asm_line_infos (list(dict)) – List of dictionaries (conforming to get_assembly_line_template()
) with information about all the lines in the assembly file.Raises: AssemblyError
– If the same label been defined more than once.
-
eight_bit_computer.assembly_validity.
check_multiple_label_assignment
(asm_line_infos)[source]¶ Check if a single line been assigned more than one label.
Parameters: asm_line_infos (list(dict)) – List of dictionaries (conforming to get_assembly_line_template()
) with information about all the lines in the assembly file.Raises: AssemblyError
– If a single line been assigned more than one label.
-
eight_bit_computer.assembly_validity.
check_undefined_label_ref
(asm_line_infos)[source]¶ Check if an operation is using a label that hasn’t been defined.
Parameters: asm_line_infos (list(dict)) – List of dictionaries (conforming to get_assembly_line_template()
) with information about all the lines in the assembly file.Raises: AssemblyError
– If an operation is using a label that hasn’t been defined.
-
eight_bit_computer.assembly_validity.
check_multiple_variable_def
(asm_line_infos)[source]¶ Has the same variable been defined multiple times.
Parameters: asm_line_infos (list(dict)) – List of dictionaries (conforming to get_assembly_line_template()
) with information about all the lines in the assembly file.Raises: AssemblyError
– If a variable has been defined more than once.
-
eight_bit_computer.assembly_validity.
check_undefined_variable_ref
(asm_line_infos)[source]¶ Check instructions don’t reference undefined variables
Parameters: asm_line_infos (list(dict)) – List of dictionaries (conforming to get_assembly_line_template()
) with information about all the lines in the assembly file.Raises: AssemblyError
– If a variable is referenced but not defined.
-
eight_bit_computer.assembly_validity.
check_overlapping_variables
(asm_line_infos)[source]¶ Check none of the defined variables overlap with each other.
Parameters: asm_line_infos (list(dict)) – List of dictionaries (conforming to get_assembly_line_template()
) with information about all the lines in the assembly file.Raises: AssemblyError
– If two variables overlap in position with each other.
-
eight_bit_computer.assembly_validity.
check_num_instruction_bytes
(assembly_lines)[source]¶ Check there aren’t too many instruction_bytes.
Parameters: asm_line_infos (list(dict)) – List of dictionaries (conforming to get_assembly_line_template()
) with information about all the lines in the assembly file.Raises: AssemblyError
– If there are more instruction bytes than will fit in program memory.