IT WORKS HELL YEAH.

This commit is contained in:
2025-06-18 22:53:01 +01:00
parent 1210b19333
commit e281bc2d1d
26 changed files with 715 additions and 188 deletions
+8 -2
View File
@@ -49,11 +49,17 @@ impl Encode for Instruction {
StoreWord, LoadLowerImmediate, LoadUpperImmediate, Jump,
JumpEq, JumpNeq, JumpGt, JumpGe, JumpLt, JumpLe, Compare,
Add, Sub, Increment, Decrement, ShiftLeft, ShiftRight,
And, Or, Not, Xor, Nand, Nor, Xnor
And, Or, Not, Xor, Nand, Nor, Xnor, AddImmediate, SubImmediate
],
no_args: [Nop, IntReturn, Halt],
special: [
Self::Interrupt(_) => todo!()
Self::Interrupt(_) => todo!(),
Self::Data(data) => data,
Self::Segment(segment) => {
let opcode = u32::from(self.opcode());
let segment = segment as u8;
(opcode << 26) | (segment as u32)
}
]
)
}