diff options
| author | Mirek Kratochvil <exa.exa@gmail.com> | 2023-08-12 15:12:03 +0200 |
|---|---|---|
| committer | Mirek Kratochvil <exa.exa@gmail.com> | 2023-08-12 15:12:03 +0200 |
| commit | 6be5a28bb90b391a5842a8ce3dfc7c154100ab68 (patch) | |
| tree | 22e04a263e68d983c6bf5d1fdebd662e66915e96 /print_123.s | |
| parent | 5184299c7dfddeba4d2d2ba95d390040368f9736 (diff) | |
| download | uskel-6be5a28bb90b391a5842a8ce3dfc7c154100ab68.tar.gz uskel-6be5a28bb90b391a5842a8ce3dfc7c154100ab68.tar.bz2 | |
make a macro for pushing out thunks
Diffstat (limited to 'print_123.s')
| -rw-r--r-- | print_123.s | 26 |
1 files changed, 6 insertions, 20 deletions
diff --git a/print_123.s b/print_123.s index 612b4c8..b87309b 100644 --- a/print_123.s +++ b/print_123.s @@ -8,35 +8,21 @@ # || -> cont .thunkcode main # push a new integer - pushq $100 - pushq $INT_code - mov %rsp, %r11 # backup first arg + thunkto %r11, $INT_code, $100 # push another new integer - pushq $23 - pushq $INT_code - mov %rsp, %r12 # backup second arg + thunkto %r12, $INT_code, $23 # push the plus - push %r12 - push %r11 - pushq $2 - pushq $plus - mov %rsp, %r11 # backup plus + thunkto %r11, $plus, $2, %r11, %r12 # push the print - push %r11 - pushq $1 - pushq $print - mov %rsp, %r11 # backup print + thunkto %r11, $print, $1, %r11 - # push a cont thunk for main_exit - push %rsi - pushq $1 - pushq $main_exit + # push a cont thunk for main_exit and set continuation for main_exit + thunkto %rsi, $main_exit, $1, %rsi # evaluate into main_exit - mov %rsp, %rsi enter %r11 .include "include/main_exit.s" |
