use opcode_proc::generate_opcodes; generate_opcodes!( pub enum OpCodes { #[code(0x00)] fn Nop() { }, #[code(0x10)] fn Add(a: u32, b: u32) -> u32 { a + b }, #[code(0x11)] fn Sub(a: u32, b: u32) -> u32 { a - b }, #[code(0x23)] fn Jnz(&mut interpreter, comparison: u32, offset: u32) { if comparison != 0 { interpreter.reg_program += offset; } } } );