From ac93861c63fb639c260e046373135aea113d7a9c Mon Sep 17 00:00:00 2001 From: Mylloon Date: Sun, 31 Dec 2023 16:14:05 +0100 Subject: [PATCH] =?UTF-8?q?etape=201=20termin=C3=A9e?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- flap/questions/retrolixToX86_64/07.retrolix | 1 - flap/questions/retrolixToX86_64/08.retrolix | 23 +++++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/flap/questions/retrolixToX86_64/07.retrolix b/flap/questions/retrolixToX86_64/07.retrolix index b653317..0e0516e 100644 --- a/flap/questions/retrolixToX86_64/07.retrolix +++ b/flap/questions/retrolixToX86_64/07.retrolix @@ -1,4 +1,3 @@ - def fact () local x: jumpif lte %rdi, 1 -> fini, rec; diff --git a/flap/questions/retrolixToX86_64/08.retrolix b/flap/questions/retrolixToX86_64/08.retrolix index e69de29..ea0c8d3 100644 --- a/flap/questions/retrolixToX86_64/08.retrolix +++ b/flap/questions/retrolixToX86_64/08.retrolix @@ -0,0 +1,23 @@ +def my_add_eight_int (i7, i8) + %rax <- add %rdi, %rsi; + %rax <- add %rax, %rdx; + %rax <- add %rax, %rcx; + %rax <- add %rax, %r8; + %rax <- add %rax, %r9; + %rax <- add %rax, i7; + %rax <- add %rax, i8; + ret; +end + +globals () + %rdi <- copy 1; + %rsi <- copy 2; + %rdx <- copy 3; + %rcx <- copy 4; + %r8 <- copy 5; + %r9 <- copy 6; + my_add_eight_int(7, 8); + + %rdi <- copy %rax; + observe_int(); +end