Merge branch 'jalon6' of gaufre.informatique.univ-paris-diderot.fr:Anri/compilation-m1-2023 into jalon6
This commit is contained in:
commit
4e22648cd4
3 changed files with 19 additions and 3 deletions
|
@ -18,7 +18,9 @@ interpret: build
|
||||||
compilo: build
|
compilo: build
|
||||||
@for f in $(wildcard *.$(TARGET)); do \
|
@for f in $(wildcard *.$(TARGET)); do \
|
||||||
printf "%s: " $$f; \
|
printf "%s: " $$f; \
|
||||||
./$(FLAP) -t elf $$f && \
|
./$(FLAP) -t x86-64 $$f && \
|
||||||
|
gcc -no-pie -o $${f%.*}.elf $${f%.*}.s runtime.c && \
|
||||||
./$${f%.*}.elf; \
|
./$${f%.*}.elf; \
|
||||||
|
rm $${f%.*}.s; \
|
||||||
printf "\n"; \
|
printf "\n"; \
|
||||||
done
|
done
|
||||||
|
|
13
flap/questions/retrolixToX86_64/runtime.c
Normal file
13
flap/questions/retrolixToX86_64/runtime.c
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
#include <stdint.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
int64_t add_eight_int(int64_t i1, int64_t i2, int64_t i3, int64_t i4,
|
||||||
|
int64_t i5, int64_t i6, int64_t i7, int64_t i8) {
|
||||||
|
return i1 + i2 + i3 + i4 + i5 + i6 + i7 + i8;
|
||||||
|
}
|
||||||
|
|
||||||
|
int64_t observe_int(int64_t n) {
|
||||||
|
printf("%ld", n);
|
||||||
|
|
||||||
|
return n;
|
||||||
|
}
|
|
@ -36,6 +36,7 @@ int64_t write_block(intptr_t *block, int64_t n, intptr_t v) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void add_eight_int(int64_t x1,int64_t x2,int64_t x3,int64_t x4,int64_t x5, int64_t x6,int64_t x7,int64_t x8) {
|
void add_eight_int(int64_t x1, int64_t x2, int64_t x3, int64_t x4, int64_t x5,
|
||||||
return observe_int(x1+x2+x3+x4+x5+x6+x7+x8);
|
int64_t x6, int64_t x7, int64_t x8) {
|
||||||
|
return observe_int(x1 + x2 + x3 + x4 + x5 + x6 + x7 + x8);
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue