diff --git a/henceforth/src/compiler/instruction.rs b/henceforth/src/compiler/instruction.rs index b6f3aa5..59f8ca1 100644 --- a/henceforth/src/compiler/instruction.rs +++ b/henceforth/src/compiler/instruction.rs @@ -66,6 +66,9 @@ pub enum Instruction { Mod, AsmQuote(String), + True, + False, + Multiple { instruction: Box, count: usize, @@ -535,6 +538,14 @@ impl compiler::Compilable for Inst name: "std_set".to_string(), args: vec![hence::arg::Arg::Variable("MEM_ALLOC_PTR".to_string())], }, + hence::parser::ast::Node::Call { + name: "tsr".to_string(), + arg: Some(hence::arg::Arg::Variable("CORE_REG_A".to_string())), + }, + hence::parser::ast::Node::Call { + name: "tls".to_string(), + arg: None, + }, ]), Instruction::Dot => Ok(vec![ hence::parser::ast::Node::MacroCall { @@ -1263,6 +1274,15 @@ impl compiler::Compilable for Inst None => bail!("Condition by index not found: {}", x), }, + Instruction::True => Ok(vec![hence::parser::ast::Node::Call { + name: "push".to_string(), + arg: Some(hence::arg::Arg::Variable("TRUE".to_string())), + }]), + Instruction::False => Ok(vec![hence::parser::ast::Node::Call { + name: "push".to_string(), + arg: Some(hence::arg::Arg::Variable("FALSE".to_string())), + }]), + Instruction::Multiple { instruction, count } => { if *count == 0 { Ok(vec![]) @@ -1536,6 +1556,8 @@ impl Instruction { "*" => Some(Instruction::Times), "/" => Some(Instruction::Divide), "mod" => Some(Instruction::Mod), + "true" => Some(Instruction::True), + "false" => Some(Instruction::False), _ => None, } }