Documentation
¶
Index ¶
Constants ¶
View Source
const ( // RegLabel is a placeholder register value indicating a label to be resolved. RegLabel = 0xFE // RegStatus is a placeholder register value indicating a status register (SR/CCR/USP). RegStatus = 0xFFFF )
Variables ¶
View Source
var ( // SizeBits is for dual-operand instructions (ADD, SUB, OR, AND, etc.) SizeBits = commonSizeBits // SizeBitsSingleOp is for single-operand instructions (CLR, NEG, NOT, etc.) SizeBitsSingleOp = commonSizeBits // SizeBitsTst is for the TST instruction (same pattern as dual-operand instructions). SizeBitsTst = commonSizeBits // SizeBitsAddr is for ADDA, SUBA, CMPA (address arithmetic) SizeBitsAddr = map[cpu.Size]uint16{ cpu.SizeWord: 0x00C0, cpu.SizeLong: 0x01C0, } )
View Source
var BitwiseSize = map[cpu.Size]uint16{ cpu.SizeByte: 0x0000, cpu.SizeWord: 0x0040, cpu.SizeLong: 0x0080, }
BitwiseSize contains size bits for shift/rotate register forms.
View Source
var ShiftRotateType = map[string]uint16{
"asr": 0x0000, "asl": 0x0100,
"lsr": 0x0008, "lsl": 0x0108,
"ror": 0x0018, "rol": 0x0118,
"roxr": 0x0010, "roxl": 0x0110,
}
ShiftRotateType contains shift/rotate opcode type bits (added to base opcode).
Functions ¶
This section is empty.
Types ¶
type Assembler ¶
type Assembler struct {
// contains filtered or unexported fields
}
Assembler holds the state for the assembly process.
type Mnemonic ¶
Mnemonic represents a parsed instruction mnemonic.
func ParseMnemonic ¶
ParseMnemonic splits an instruction like "MOVE.W" → ("move", SizeWord).
type Node ¶
type Node struct {
Type NodeType
Label string
Mnemonic Mnemonic
Operands []Operand
Parts []string
Size uint32 // Still used to track size between passes
}
Node represents one parsed element from the assembly source.
Click to show internal directories.
Click to hide internal directories.