diff options
| author | krolxon <krolyxon@tutanota.com> | 2026-01-05 19:46:19 +0530 |
|---|---|---|
| committer | krolxon <krolyxon@tutanota.com> | 2026-01-05 19:46:19 +0530 |
| commit | deac6a4448be93c3c70655cea821e84a7a1b116c (patch) | |
| tree | c7113c14e56bc82a26b0ed1a900a81ec888c8306 /src/instructions.rs | |
| parent | 4166b0e5430bd723e31c1198b8d940381aded499 (diff) | |
add add_ri, sub_ri
Diffstat (limited to 'src/instructions.rs')
| -rw-r--r-- | src/instructions.rs | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/instructions.rs b/src/instructions.rs index 77de7f4..bfc4fc6 100644 --- a/src/instructions.rs +++ b/src/instructions.rs @@ -1,9 +1,12 @@ #[repr(u8)] +#[allow(non_camel_case_types)] pub enum Instruction { MOV_RI = 0x01, MOV_RR = 0x08, - ADD = 0x02, - SUB = 0x03, + ADD_RR = 0x02, + ADD_RI = 0x0A, + SUB_RR = 0x03, + SUB_RI = 0x0B, JMP = 0x04, JZ = 0x05, JNZ = 0x06, @@ -16,8 +19,8 @@ impl Instruction { pub fn opcode_name(op: u8) -> &'static str{ match op { 0x01 | 0x08 => "MOV", - 0x02 => "ADD", - 0x03 => "SUB", + 0x02 | 0x0A => "ADD", + 0x03 | 0x0B => "SUB", 0x04 => "JMP", 0x05 => "JZ", 0x06 => "JNZ", |
