easier68k.simulator package

Submodules

easier68k.simulator.clock module

Used by m68k to handle stepping through actions

class easier68k.simulator.clock.Clock[source]

Bases: object

Constructor

easier68k.simulator.m68k module

Motorola 68k chip definition

class easier68k.simulator.m68k.M68K[source]

Constructor

clear_cycles()[source]

Resets the count of clock cycles :return:

get_condition_status_code(code: easier68k.core.enum.condition_status_code.ConditionStatusCode) → bool[source]

Gets the status of a code from the Condition Code Register :param code: :return:

get_cycles()[source]

Returns how many clock cycles have been performed :return:

get_program_counter_value() → int[source]

Gets the 32-bit unsigned integer value for the program counter value :return:

get_register(register: easier68k.core.enum.register.Register) → easier68k.core.models.memory_value.MemoryValue[source]

Gets the entire value of a register :param register: :return:

halt()[source]

Halts the auto simulation execution :return:

increment_program_counter(inc: int)[source]

Increments the program counter by the given value :param inc: :return:

load_list_file(list_file: easier68k.core.models.list_file.ListFile)[source]

Load List File

load the contents of a list file into memory using the locations specified inside of the list file :param list_file: :return:

load_memory(file: BinaryIO)[source]

saves the raw memory into the designated file NOTE: file must be opened as binary or this won’t work

reload_execution()[source]

restarts execution of the program up to the current program counter location :return:

run()[source]

Starts the automatic execution :return:

save_memory(file: BinaryIO)[source]

Loads the raw memory from the designated file This includes programs NOTE: file must be opened as binary or this won’t work

set_address_register_value(reg: easier68k.core.enum.register.Register, new_value: easier68k.core.models.memory_value.MemoryValue)[source]

Sets the value of an address register, so the PC or A0-A7 :param reg: :param new_value: :return:

set_ccr_reg(extend, negative, zero, overflow, carry)[source]

Accepts Boolean values for X,N,Z,V, and C, respectively and sets the CCR accordingly. Passing None in for any argument will cause it to ignore that bit. Returns nothing. :param extend: :param negative: :param zero: :param overflow: :param carry: :return:

set_condition_status_code(code: easier68k.core.enum.condition_status_code.ConditionStatusCode, value: bool)[source]

Sets the status of a code from the Condition Code Register to value :param code: :return:

set_program_counter_value(new_value: int)[source]

Sets the value of the program counter Must be a non negative integer that is less than the maximum location size :param new_value: :return:

set_register(register: easier68k.core.enum.register.Register, val: easier68k.core.models.memory_value.MemoryValue)[source]

Sets the value of a register using a 32-bit int :param register: :param val: :return:

step_instruction()[source]

Increments the clock until the program counter increments :return:

easier68k.simulator.memory module

Represents all of the memory for the 68k This should be able to be serialized/deserialized and accessed completely

exception easier68k.simulator.memory.AssignWrongMemorySizeError[source]
class easier68k.simulator.memory.Memory[source]

Constructor

get(size: easier68k.core.enum.op_size.OpSize, location: int) → easier68k.core.models.memory_value.MemoryValue[source]

gets the memory at the given location index of size

load_list_file(list_file: easier68k.core.models.list_file.ListFile)[source]

Load List File

load the contents of a list file into memory using the locations specified inside of the list file starting location, registers, etc… (anything which is not data) is ignored :param list_file: :return:

load_memory(file: BinaryIO)[source]

Loads the raw memory from the designated file This includes programs NOTE: file must be opened as binary or this won’t work

save_memory(file: BinaryIO)[source]

saves the raw memory into the designated file NOTE: file must be opened as binary or this won’t work

set(size: easier68k.core.enum.op_size.OpSize, location: int, value: easier68k.core.models.memory_value.MemoryValue)[source]

sets the memory at the given location index of size

exception easier68k.simulator.memory.OutOfBoundsMemoryError[source]
exception easier68k.simulator.memory.UnalignedMemoryAccessError[source]