From 74cad993376dc269e8389fbf150be9ecc36890c7 Mon Sep 17 00:00:00 2001 From: Mirek Kratochvil Date: Sun, 6 Aug 2023 00:25:53 +0200 Subject: fibs work --- include/intops.s | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 include/intops.s (limited to 'include/intops.s') diff --git a/include/intops.s b/include/intops.s new file mode 100644 index 0000000..dbadb37 --- /dev/null +++ b/include/intops.s @@ -0,0 +1,25 @@ + +.ifndef _intops_s_file +_intops_s_file: + +.include "include/primops.s" + +.primop2 plus + mov 010(%rsi), %rax # arg 2 + mov 020(%rbp), %rsi # location of arg1 + add 010(%rsi), %rax # arg 1 + primop2_ret_int %rax + +.primop2 mul + mov 010(%rsi), %rax # arg 2 + mov 020(%rbp), %rsi # location of arg1 + mulq 010(%rsi) # arg 1 (goes to %rax and %rdx) + primop2_ret_int %rax + +.primop2 sub + mov 020(%rbp), %rdi # location of arg1 + mov 010(%rdx), %rax # arg 1 + sub 010(%rsi), %rax # arg 2 + primop2_ret_int %rax + +.endif # _intops_s_file -- cgit v1.2.3