mirror of
https://github.com/hazemKrimi/hack-assembler.git
synced 2026-05-01 18:20:28 +00:00
Initial commit
This commit is contained in:
@@ -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(),
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user