diff options
| author | Mirek Kratochvil <exa.exa@gmail.com> | 2023-08-06 00:25:53 +0200 |
|---|---|---|
| committer | Mirek Kratochvil <exa.exa@gmail.com> | 2023-08-06 00:25:53 +0200 |
| commit | 74cad993376dc269e8389fbf150be9ecc36890c7 (patch) | |
| tree | 32a2dbb382836ee0f1853fe5e63036d044fea77d /print_123.s | |
| parent | 46d84e91ebe48ade19bd3f5e18360bf853b53968 (diff) | |
| download | uskel-74cad993376dc269e8389fbf150be9ecc36890c7.tar.gz uskel-74cad993376dc269e8389fbf150be9ecc36890c7.tar.bz2 | |
fibs work
Diffstat (limited to 'print_123.s')
| -rw-r--r-- | print_123.s | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/print_123.s b/print_123.s new file mode 100644 index 0000000..612b4c8 --- /dev/null +++ b/print_123.s @@ -0,0 +1,42 @@ + +.include "include/uskel.s" + +.include "include/data.s" +.include "include/io.s" +.include "include/intops.s" + +# || -> cont +.thunkcode main + # push a new integer + pushq $100 + pushq $INT_code + mov %rsp, %r11 # backup first arg + + # push another new integer + pushq $23 + pushq $INT_code + mov %rsp, %r12 # backup second arg + + # push the plus + push %r12 + push %r11 + pushq $2 + pushq $plus + mov %rsp, %r11 # backup plus + + # push the print + push %r11 + pushq $1 + pushq $print + mov %rsp, %r11 # backup print + + # push a cont thunk for main_exit + push %rsi + pushq $1 + pushq $main_exit + + # evaluate into main_exit + mov %rsp, %rsi + enter %r11 + +.include "include/main_exit.s" |
