Add over word

This commit is contained in:
Dominic Grimm 2022-09-09 14:17:04 +02:00
parent cf1af6b412
commit c96368c494
No known key found for this signature in database
GPG key ID: A6C051C716D2CE65
3 changed files with 34 additions and 44 deletions

View file

@ -207,7 +207,40 @@ impl compiler::Compilable<compiler::Data, hence::parser::ast::Body> for Instruct
arg: None,
},
]),
Instruction::Over => Ok(vec![]),
Instruction::Over => Ok(vec![
hence::parser::ast::Node::MacroCall {
name: "std_ld".to_string(),
args: vec![],
},
hence::parser::ast::Node::Call {
name: "tlr".to_string(),
arg: Some(hence::arg::Arg::Variable("CORE_REG_A".to_string())),
},
hence::parser::ast::Node::Call {
name: "tss".to_string(),
arg: None,
},
hence::parser::ast::Node::Call {
name: "tlr".to_string(),
arg: Some(hence::arg::Arg::Variable("CORE_REG_B".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,
},
hence::parser::ast::Node::Call {
name: "tsr".to_string(),
arg: Some(hence::arg::Arg::Variable("CORE_REG_B".to_string())),
},
hence::parser::ast::Node::Call {
name: "tls".to_string(),
arg: None,
},
]),
Instruction::Rot => Ok(vec![]),
Instruction::Nip => Ok(vec![]),
Instruction::I => Ok(vec![]),