From c74aea420c662039072f606b2d5ef1c73426e481 Mon Sep 17 00:00:00 2001 From: Nakidai Date: Sat, 24 Aug 2024 14:29:55 +0300 Subject: Add more code Add some funcitons to work with variables, add more instructions and add ability to stop the code from `ccl_instruction` --- src/3cl.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/3cl.c') diff --git a/src/3cl.c b/src/3cl.c index c8016a9..bcadf4d 100644 --- a/src/3cl.c +++ b/src/3cl.c @@ -1,6 +1,7 @@ #include "3cl.h" #include +#include #include #include @@ -12,6 +13,7 @@ int ccl_init(struct CCL *ccl, const char *code, int (*in)(), void (*out)(int)) *ccl = (struct CCL) { .code = code, + .stopped = false, .in = in, .out = out, .rootframe = (struct CCLFrame) @@ -69,6 +71,10 @@ void ccl_exec(struct CCL *ccl) { struct CCLFrame *curframe = &ccl->rootframe; - for (;;++curframe->ep) + for (;;) + { curframe = ccl_instruction(ccl, curframe); + if (ccl->stopped) + break; + } } -- cgit 1.4.1