Mercurial > repos > tabletprog
view samples/fibmacro.tp @ 362:7101ad443081
Add null terminator to string literals in x86 module and fix a bug that interfered with use of function name labels in call instructions
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Sat, 25 Apr 2015 13:05:38 -0700 |
parents | 647f7a2d253b |
children |
line wrap: on
line source
#{ fib <- :n { if: n < 2 { 1 } else: { (fib: n-1) + (fib: n-2) } } fibm <- macro: :n { eval: n :n { fib: n } else: { quote: (fib: n) } } main <- { print: (string: (fibm: 20)) . "\n" } }