mirror of
https://github.com/odin-lang/Odin.git
synced 2026-06-19 16:42:33 +00:00
Minimize mos6502 Instruction and Operand
This commit is contained in:
@@ -14,14 +14,14 @@ Instruction_Flags :: bit_field u8 {
|
||||
}
|
||||
|
||||
Instruction :: struct #packed {
|
||||
ops: [3]Operand `fmt:"v,operand_count"`, // 48 bytes
|
||||
ops: [3]Operand `fmt:"v,operand_count"`, // 30 bytes
|
||||
mnemonic: Mnemonic, // 2
|
||||
operand_count: u8, // 1
|
||||
flags: Instruction_Flags, // 1
|
||||
length: u8, // 1 (filled by decoder; 1..7)
|
||||
_: [3]u8, // 3
|
||||
_: [1]u8, // 1
|
||||
}
|
||||
#assert(size_of(Instruction) == 56)
|
||||
#assert(size_of(Instruction) == 36)
|
||||
|
||||
// =============================================================================
|
||||
// Builders (mirror the contract: shape spelled out, comma-separated)
|
||||
|
||||
@@ -83,9 +83,8 @@ Operand :: struct #packed {
|
||||
},
|
||||
kind: Operand_Kind, // 1
|
||||
size: u8, // 1
|
||||
_: [6]u8, // 6
|
||||
}
|
||||
#assert(size_of(Operand) == 16)
|
||||
#assert(size_of(Operand) == 10)
|
||||
|
||||
// Generic constructors -------------------------------------------------------
|
||||
|
||||
|
||||
Reference in New Issue
Block a user