aboutsummaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorKimplul <kimi.h.kuparinen@gmail.com>2023-08-02 20:54:08 +0300
committerKimplul <kimi.h.kuparinen@gmail.com>2023-08-02 20:54:08 +0300
commit9251fddfdfb11b9e1b2dff643aa20ec82e9f7036 (patch)
treefa6045ac60ab66cfd04b820d50b9f92f86f2bfc7 /src/main.c
parent6c12792402503705bf921d56ea3b309408bb417a (diff)
downloadcopyjit-9251fddfdfb11b9e1b2dff643aa20ec82e9f7036.tar.gz
copyjit-9251fddfdfb11b9e1b2dff643aa20ec82e9f7036.zip
add return values to main loop
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/main.c b/src/main.c
index 78f9f9e..de287f6 100644
--- a/src/main.c
+++ b/src/main.c
@@ -1,6 +1,7 @@
/* SPDX-License-Identifier: copyleft-next-0.3.1 */
#include <stdint.h>
+#include <stdio.h>
#include <stddef.h>
#include "copyjit.h"
@@ -10,12 +11,12 @@ int main()
ctx_t ctx;
compile_start(&ctx);
- compile_fast_lia(&ctx, 0); // total in a
+ compile_fast_lix(&ctx, 0); // total in x
- compile_fast_liy(&ctx, 0);
+ compile_fast_liy(&ctx, 0); // iter in y
- void *top = compile_movxa(&ctx); // iter + total in a
- compile_add(&ctx);
+ void *top = compile_add(&ctx); // iter + total in a
+ compile_movxa(&ctx); // move total to x
compile_incy(&ctx); // increment iter
compile_fast_lio(&ctx, 1000000000); // limit in o
@@ -30,5 +31,5 @@ int main()
compile_finish(&ctx);
- run(&ctx);
+ printf("%lu\n", run(&ctx));
}