use custom runtime

This commit is contained in:
Mylloon 2024-01-01 10:48:42 +01:00
parent 26c68379d0
commit 1ee322b064
Signed by: Anri
GPG key ID: A82D63DFF8D1317F
2 changed files with 16 additions and 1 deletions

View file

@ -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

View 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;
}