commit d7a24243607b8d161eada6cd9b5c15f9996abb02 parent 0ea08191f789a98c6012288715855cf285cf2f8d Author: Henry Wilson <m3henry@googlemail.com> Date: Sun, 11 Jun 2017 01:38:06 +0100 more macros Diffstat:
M | main.s | | | 31 | +++++++++++++++++++------------ |
1 file changed, 19 insertions(+), 12 deletions(-)
diff --git a/main.s b/main.s @@ -1,16 +1,30 @@ +.macro forthword + .quad enter +.endm + +.macro endword + .quad exit +.endm + .macro const val .quad docon .quad \val .endm + +.macro vari label + .quad dovar + .quad \label +.endm + .data -cold: .quad enter +cold: forthword _cold: .quad abort -abort: .quad enter +abort: forthword .quad quit -quit: .quad enter +quit: forthword const 4 linelp: const 10 starlp: .quad star @@ -26,17 +40,10 @@ linelp: const 10 .quad . - linelp .quad halt -dict: .quad star - .quad star - .quad cr - .quad star - .quad star - .quad halt - -star: .quad enter +star: forthword const 42 .quad emit - .quad exit + endword buff: .quad