Website Summary Files Commits Branches @commit @diff @stats
path: root / assembler / src / parser
diff options
context:
space:
mode:
1 files changed, 3 insertions, 0 deletions
-rw-r--r--assembler/src/parser/instruction.rs3
diff --git a/assembler/src/parser/instruction.rs b/assembler/src/parser/instruction.rs
index f78c9a6..c44c1de 100644
--- a/assembler/src/parser/instruction.rs
+++ b/assembler/src/parser/instruction.rs
@@ -2,6 +2,9 @@ use super::{ Instruction, Address };
impl Instruction {
fn new_subleq(a: &Address, b: &Address, c: &Address) -> Instruction {
+ if let Address::Constants(_) = c {
+ panic!("Constants cannot be the third subleq argument!");
+ }
Instruction {
name: "subleq".to_string(),
args: vec![a.clone(), b.clone(), c.clone()],