easier68k.core.enum package

Submodules

easier68k.core.enum.condition module

Represents all of the different conditions and their corresponding bit values

class easier68k.core.enum.condition.Condition[source]
CC = 4
CS = 5
EQ = 7
F = 1
GE = 12
GT = 14
HI = 2
LE = 15
LS = 3
LT = 13
MI = 11
NE = 6
PL = 10
T = 0
VC = 8
VS = 9

easier68k.core.enum.condition_status_code module

Represents the different condition codes that are stored in the condition code register

class easier68k.core.enum.condition_status_code.ConditionStatusCode[source]

X - Extend - Set to the value of the C-bit for arithmetic operations; otherwise not affected or set to a specified result.

N - Negative - Set if the most significant bit of the result is set; otherwise clear.

Z - Zero - Set if the result equals zero; otherwise clear.

V - Overflow - Set if an arithmetic operation occurs implying that the result cannot be represented in the operand size; otherwise clear;

C - Carry - Set if a carry out of the most significant bit of the operand occurs for an addition, or if a borrow occurs in a subtraction; otherwise clear.

C = 1
Carry = 1
Extend = 16
N = 8
Negative = 8
Overflow = 2
V = 2
X = 16
Z = 4
Zero = 4

easier68k.core.enum.ea_mode module

Represents an effective addressing mode and methods associated with it

class easier68k.core.enum.ea_mode.EAMode[source]

An enumeration.

ALA = 6
ARD = 1
ARI = 2
ARIPD = 4
ARIPI = 3
AWA = 7
AbsoluteLongAddress = 6
AbsoluteWordAddress = 7
AddressRegisterDirect = 1
AddressRegisterIndirect = 2
AddressRegisterIndirectPostIncrement = 3
AddressRegisterIndirectPreDecrement = 4
DRD = 0
DataRegisterDirect = 0
IMM = 5
Immediate = 5

easier68k.core.enum.ea_mode_bin module

EA Mode Binary Enum Represents binary translations for various EA modes

class easier68k.core.enum.ea_mode_bin.EAModeBinary[source]

An enumeration.

MODE_ALA = 7
MODE_ARD = 1
MODE_ARI = 2
MODE_ARIPD = 4
MODE_ARIPI = 3
MODE_AWA = 7
MODE_DRD = 0
MODE_IMM = 7
REGISTER_ALA = 1
REGISTER_AWA = 0
REGISTER_IMM = 4
easier68k.core.enum.ea_mode_bin.get_mode_and_register_values(mode: easier68k.core.enum.ea_mode.EAMode) -> (<class 'int'>, <class 'int'>)[source]

Gets the integer value representing the mode and register values for a given EAMode for use in the assembly process :param mode: EAMode to produce binary from :return:(the integer value of the assembled mode bits, the integer value of the assembled register bits)

easier68k.core.enum.ea_mode_bin.parse_ea_from_binary(mode: int, register: int, size: easier68k.core.enum.op_size.OpSize, is_source: bool, data: bytearray) -> (<enum 'EAMode'>, <class 'int'>)[source]

Takes in the paramaters and returns a newly constructed EAMode and the amount of words of data that it used. If the paramaters were illegal in any way then (None, 0) is returned

Test that it handles source and destination behaviors properly >>> parse_ea_from_binary(EAModeBinary.MODE_IMM, EAModeBinary.REGISTER_IMM, OpSize.BYTE, False, bytearray.fromhex(‘A0’)) (None, 0)

>>> m = parse_ea_from_binary(EAModeBinary.MODE_IMM, EAModeBinary.REGISTER_IMM, OpSize.BYTE, True, bytearray.fromhex('A0'))
>>> str(m[0])
'EA Mode: EAMode.IMM, Data: 160'
>>> m[1]
1
>>> m = parse_ea_from_binary(EAModeBinary.MODE_DRD, 0b010, OpSize.WORD, True, bytearray())
>>> str(m[0])
'EA Mode: EAMode.DRD, Data: 2'
>>> m[1]
0
>>> m = parse_ea_from_binary(EAModeBinary.MODE_ARI, 0b110, OpSize.LONG, True, bytearray())
>>> str(m[0])
'EA Mode: EAMode.ARI, Data: 6'
>>> m[1]
0
>>> m = parse_ea_from_binary(EAModeBinary.MODE_ALA, EAModeBinary.REGISTER_ALA, OpSize.LONG, False, bytearray.fromhex('00011000'))
>>> str(m[0])
'EA Mode: EAMode.ALA, Data: 69632'
>>> m[1]
2
Parameters:
  • mode – the binary mode bits retrieved from the instruction
  • register – the binary register bits retrieved from the instruction
  • size – the alphabetical size (i.e. one of ‘BLW’)
  • is_source – is this the source or destination ea?
  • data – extra data that follows after the command that might be needed
Returns:

an EAMode constructed from the given parameters and how many words were used from data

easier68k.core.enum.ea_mode_bin.parse_from_ea_mode_modefirst(mode: easier68k.core.enum.ea_mode.EAMode) → int[source]

Parses binary EA mode text from an EAMode class, returning the mode data first. :param mode: The EAMode to produce binary from :return: The parsed binary

easier68k.core.enum.ea_mode_bin.parse_from_ea_mode_regfirst(mode: easier68k.core.enum.ea_mode.EAMode) → int[source]

Parses binary EA mode text from an EAMode class, returning the Xn data first. :param mode: The EAMode to produce binary from :return: The parsed binary

easier68k.core.enum.op_size module

Op Size Enum Holds the values for various binary translations of size codes

>>> MoveSize.BYTE
<MoveSize.BYTE: 1>
>>> MoveSize.LONG
<MoveSize.LONG: 2>
>>> MoveSize.WORD
<MoveSize.WORD: 3>
>>> MoveSize(0b01)
<MoveSize.BYTE: 1>
>>> MoveSize(0b11)
<MoveSize.WORD: 3>
>>> MoveSize(0b10)
<MoveSize.LONG: 2>
>>> MoveSize.parse('B')
<MoveSize.BYTE: 1>
>>> MoveSize.parse('w')
<MoveSize.WORD: 3>
>>> MoveSize.parse('L')
<MoveSize.LONG: 2>
>>> Size(0)
<Size.BYTE: 0>
>>> Size(1)
<Size.WORD: 1>
>>> Size(2)
<Size.LONG: 2>
>>> Size.BYTE
<Size.BYTE: 0>
>>> Size.WORD
<Size.WORD: 1>
>>> Size.LONG
<Size.LONG: 2>
>>> Size.parse('B')
<Size.BYTE: 0>
>>> Size.parse('w')
<Size.WORD: 1>
>>> Size.parse('l')
<Size.LONG: 2>
>>> SingleBitSize.WORD
<SingleBitSize.WORD: 0>
>>> SingleBitSize.LONG
<SingleBitSize.LONG: 1>
>>> SingleBitSize.parse('l')
<SingleBitSize.LONG: 1>
>>> SingleBitSize.parse('w')
<SingleBitSize.WORD: 0>
>>> SingleBitSize.parse('b')
class easier68k.core.enum.op_size.MoveSize[source]

Represents the “Big S” sizes (dark purple on this chart: http://goldencrystal.free.fr/M68kOpcodes-v2.3.pdf)

BYTE = 1
LONG = 2
WORD = 3
from_op_size = <function MoveSize.from_op_size>[source]
parse = <function MoveSize.parse>[source]
to_op_size() → easier68k.core.enum.op_size.OpSize[source]

converts back to the op size :return:

class easier68k.core.enum.op_size.OpSize[source]

Represents the 3 lengths associated with operations, either Byte Word or Long word

For example: the OpSize for MOVE.B xxx, yyy is Byte

BYTE = 1
LONG = 4
WORD = 2
get_number_of_bytes() → int[source]

Gets the number of bytes associated with an opsize :param: size - the OpSize object to get the number of bytes for :return:

parse = <function OpSize.parse>[source]
class easier68k.core.enum.op_size.SingleBitSize[source]

Represents the single bit sizes (medium purple on this chart: http://goldencrystal.free.fr/M68kOpcodes-v2.3.pdf)

LONG = 1
WORD = 0
parse = <function SingleBitSize.parse>[source]
class easier68k.core.enum.op_size.Size[source]

Represents the “Small S” sizes (light purple on this chart: http://goldencrystal.free.fr/M68kOpcodes-v2.3.pdf)

BYTE = 0
LONG = 2
WORD = 1
parse = <function Size.parse>[source]

easier68k.core.enum.register module

Register Enum Represents the different types of registers

class easier68k.core.enum.register.Register[source]

An enumeration.

A0 = 8
A1 = 9
A2 = 10
A3 = 11
A4 = 12
A5 = 13
A6 = 14
A7 = 15
CCR = 17
ConditionCodeRegister = 17
D0 = 0
D1 = 1
D2 = 2
D3 = 3
D4 = 4
D5 = 5
D6 = 6
D7 = 7
PC = 16
ProgramCounter = 16

easier68k.core.enum.srecordtype module

Type used by the S record files

class easier68k.core.enum.srecordtype.SRecordType[source]

An enumeration.

S0 = 0
S1 = 1
S2 = 2
S3 = 3
S4 = 4
S5 = 5
S6 = 6
S7 = 7
S8 = 8
S9 = 9
parse = <function SRecordType.parse>[source]

easier68k.core.enum.system_status_code module

Represents the upper byte of the Status Register See Fig 1-8

class easier68k.core.enum.system_status_code.SystemStatusCode[source]
I0 = 256
I1 = 512
I2 = 1024
INTERRUPT_PRIORITY_MASK = 1792
INTERRUPT_STATE = 4096
M = 4096
MASTER_STATE = 4096
S = 8192
SUPERVISOR_STATE = 8192
T0 = 16384
T1 = 32768
TRACE_ENABLE = 49152
USER_STATE = 8192

easier68k.core.enum.trap_task module

TrapTask Represents the different types of tasks that are done with the TRAP opcode

Not all functions of TRAP are supported

class easier68k.core.enum.trap_task.TrapTask[source]

An enumeration.

DisplayNullTermString = 14
DisplayNullTermStringAndReadNumberFromKeyboard = 18
DisplayNullTermStringWithCRLF = 13
DisplaySignedNumber = 3
DisplaySingleCharacter = 6
ReadNullTermString = 2
ReadNumberFromKeyboard = 4
ReadSingleCharacterFromKeyboard = 5
Terminate = 9

easier68k.core.enum.trap_vector module

class easier68k.core.enum.trap_vector.TrapVectors[source]

An enumeration.

IO = 15
parse = <function TrapVectors.parse>[source]