Initial commit

This commit is contained in:
Hazem Krimi
2024-03-08 14:40:23 +01:00
commit 2117f916c9
7 changed files with 160 additions and 0 deletions
+14
View File
@@ -0,0 +1,14 @@
use crate::types::Instruction;
pub fn parse(mut instruction: String) -> Instruction {
if instruction.chars().nth(0).unwrap() == '@' {
instruction.remove(0);
return Instruction::AInstruction { decimal: instruction };
}
Instruction::CInstruction {
dest: "1".to_owned(),
comp: "2".to_owned(),
jump: "3".to_owned(),
}
}