From 59c42922247bcf4011710901294e9ef855d49d3b Mon Sep 17 00:00:00 2001 From: gingerBill Date: Mon, 15 Jun 2026 14:30:23 +0100 Subject: [PATCH] Minimize mos6502 Instruction and Operand --- core/rexcode/mos6502/instructions.odin | 6 +++--- core/rexcode/mos6502/operands.odin | 3 +-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/core/rexcode/mos6502/instructions.odin b/core/rexcode/mos6502/instructions.odin index 10cf8704f..74e6d7f7a 100644 --- a/core/rexcode/mos6502/instructions.odin +++ b/core/rexcode/mos6502/instructions.odin @@ -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) diff --git a/core/rexcode/mos6502/operands.odin b/core/rexcode/mos6502/operands.odin index e3b3ec383..a6326f55e 100644 --- a/core/rexcode/mos6502/operands.odin +++ b/core/rexcode/mos6502/operands.odin @@ -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 -------------------------------------------------------