Add emit word
This commit is contained in:
parent
20dfd1244d
commit
cf1af6b412
4 changed files with 58 additions and 10 deletions
43
henceforth/examples/test.asm
Normal file
43
henceforth/examples/test.asm
Normal file
|
@ -0,0 +1,43 @@
|
|||
.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
|
BIN
henceforth/examples/test.bin
Normal file
BIN
henceforth/examples/test.bin
Normal file
Binary file not shown.
|
@ -1 +1 @@
|
|||
." t;;;;;;;;;;;;;;;;;;;;;;est\n"
|
||||
0x0a dup dup emit emit emit
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue