easier68k.core.models package¶
Submodules¶
easier68k.core.models.assembly_parameter module¶
Assembly Parameter
Represents a single parameter in assembly code this is the new ‘EAMode’ class
-
class
easier68k.core.models.assembly_parameter.
AssemblyParameter
(mode: easier68k.core.enum.ea_mode.EAMode, data: int)[source]¶ Constructor
Checks that the mode and the data are considered to be valid, like registers are within the correct bounds and addresses are not out of bounds.
-
get_value
(simulator: easier68k.simulator.m68k.M68K, length: easier68k.core.enum.op_size.OpSize = <OpSize.WORD: 2>) → easier68k.core.models.memory_value.MemoryValue[source]¶ Gets the value for this EAMode from the simulator :param simulator: reference to the 68k simulator :param length: the length in bytes associated with this operation, must be 1 2 or 4 :return: the value associated with this assembly parameter
-
set_value
(simulator: easier68k.simulator.m68k.M68K, value: easier68k.core.models.memory_value.MemoryValue)[source]¶ Sets the value of a destination mode :param simulator: the reference to the simulator :param value: the value to set for this assembly parameter :param length: the number of bits associated for this instruction, must be 1 2 or 4 :return:
-
easier68k.core.models.list_file module¶
-
class
easier68k.core.models.list_file.
ListFile
[source]¶ Represents assembled instructions and their locations in memory
Constructor
-
clear_location
(location: int)[source]¶ Clears the data at the given location :param location: :return:
-
define_symbol
(name: str, location: int)[source]¶ Defines a label and it’s associated location :param name: :param location: :return:
-
get_starting_data
(location: int) → int[source]¶ Gets the data starting at the given location :param location: :return:
-
get_symbol_data
(name: str) → str[source]¶ Get the data for the given label Only works for the start of data This is not for reading in the middle of a set of data :param name: :return:
-
get_symbol_location
(name: str) → int[source]¶ Gets the associated location for a label :param name: :return: the location associated to the label, if it exists
-
insert_data
(location: int, data: str)[source]¶ Inserts the data at the given location into the list file This data should be a string of hexadecimal data :param location: :param data: :return:
-
insert_data_at_symbol
(name: str, data: str)[source]¶ Inserts the data at the location for the given symbol :param name: :param data: :return:
-
load_from_json
(json_str: str)[source]¶ Populates this object from a json str :param json_str: :return:
-
read_s_record_filename
(filepath: str)[source]¶ Read the S record at the given file path, builds the content of this list file from it :param filepath: {str} Path to an S record :return: None
-
easier68k.core.models.memory_value module¶
Memory Value
Representation of some value in memory with a length of a Byte, Word or Long Word, which can either be an array of bytes, an integer number, a single character or an array of characters.
Supports operations like adding, subtracting, shift left, shift right, bitwise OR AND XOR, equals
Supports getting the most significant bit, determining the signed or unsigned integer values, the value as a array of bytes, the value as a hex string.
This was done to keep the interal handling of memory values consistent, instead of conversions back and forth between integers, hex strings and byte arrays.
-
class
easier68k.core.models.memory_value.
MemoryValue
(len: easier68k.core.enum.op_size.OpSize = <OpSize.WORD: 2>, *, signed_int: int = None, unsigned_int: int = None, bytes: bytearray = None)[source]¶ Representation of some value in memory
Constructor
Sets the initial value to zero with a length of OpSize.Wordprint :param len the length in bytes of this memory value :param signed_int the value to set as a signed int :param unsigned_int the value to set as an unsigned int :param bytes the value to set as a bytearray
-
get_msb
(size: easier68k.core.enum.op_size.OpSize = None)[source]¶ Get the most significant bit indicating that the value is negative :return:
-
get_size
() → easier68k.core.enum.op_size.OpSize[source]¶ Gets the length of this memory value as an OpSize :return: the length in bytes of this value as defined by an OpSize
-
lsl
(other)[source]¶ logical shift left, allows for the msb to be set when shifted left :param other: :return:
-
set_size
(size: easier68k.core.enum.op_size.OpSize)[source]¶ Sets the length of this memory value :param size: the length in bytes of this value, defined by OpSize :return: None
-
set_value_bytes
(bytes_value: bytes)[source]¶ Sets the value of this MemoryValue from an array of bytes :param bytes_value: :return:
-
easier68k.core.models.trap_vector module¶
Trap Vector
Represents the data type used by the TRAP opcode in ASM looks just like an immediate value