easier68k.core.enum package¶
Submodules¶
easier68k.core.enum.condition module¶
Represents all of the different conditions and their corresponding bit values
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.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¶
-
-
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¶
-
-
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¶
-
easier68k.core.enum.register module¶
Register Enum Represents the different types of registers
easier68k.core.enum.srecordtype module¶
Type used by the S record files
easier68k.core.enum.system_status_code module¶
Represents the upper byte of the Status Register See Fig 1-8
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¶
-