Minimize mos6502 Instruction and Operand

This commit is contained in:
gingerBill
2026-06-15 14:30:23 +01:00
parent 406dfbe86d
commit 59c4292224
2 changed files with 4 additions and 5 deletions

View File

@@ -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)

View File

@@ -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 -------------------------------------------------------