diff --git a/henceforth/examples/test.asm b/henceforth/examples/test.asm deleted file mode 100644 index 8325d62..0000000 --- a/henceforth/examples/test.asm +++ /dev/null @@ -1,43 +0,0 @@ -.include "$lib/core.asm" -.include "$lib/std.asm" -.include "$lib/main.asm" -.define MEM_CALL_STACK, CORE_MEM_MEM -.macro stack_transfer_alu -.std_ld -tlr CORE_REG_B -.std_ld -tlr CORE_REG_A -.endmacro -.macro call_word, call_word_arg_0_label -ts (OFFSET + 14) -tlr CORE_REG_A -ts MEM_CALL_STACK -set -ts call_word_arg_0_label -tlr CORE_REG_PC -.endmacro -.macro return_word -.std_get MEM_CALL_STACK -tlr CORE_REG_PC -.endmacro -.jump_main -data: -data_strings: -words: -main: -.main main -push 10 -tss -tls -tss -tls -.std_ld -tlr CORE_REG_A -.std_set CORE_MEM_CHR -.std_ld -tlr CORE_REG_A -.std_set CORE_MEM_CHR -.std_ld -tlr CORE_REG_A -.std_set CORE_MEM_CHR -.std_stop \ No newline at end of file diff --git a/henceforth/examples/test.bin b/henceforth/examples/test.bin deleted file mode 100644 index 3a9fe76..0000000 Binary files a/henceforth/examples/test.bin and /dev/null differ diff --git a/henceforth/src/lib/compiler/instruction.rs b/henceforth/src/lib/compiler/instruction.rs index 60e34aa..5f011b5 100644 --- a/henceforth/src/lib/compiler/instruction.rs +++ b/henceforth/src/lib/compiler/instruction.rs @@ -207,7 +207,40 @@ impl compiler::Compilable 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![]),