aboutsummaryrefslogtreecommitdiffstats
path: root/foci.c
diff options
context:
space:
mode:
authorClyne Sullivan <clyne@bitgloo.com>2025-01-24 10:45:22 -0500
committerClyne Sullivan <clyne@bitgloo.com>2025-01-24 10:45:22 -0500
commitb8446c868707ac1b86b482aac03002a2b585dbb6 (patch)
tree82578c37fa95285d2ca4c6ad46e53655722b5741 /foci.c
parent3776fbcb74435ba11395fe5f1d80f7ede39c7d66 (diff)
branching, if-else-then; test arm compile
Diffstat (limited to 'foci.c')
-rw-r--r--foci.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/foci.c b/foci.c
index 9c73a04..2ca054f 100644
--- a/foci.c
+++ b/foci.c
@@ -101,7 +101,13 @@ W(colon, ":", &w_align) FTH(here), LIT(0), comma, FTH(latest), comma,
poke, comp, END
I(semic, ";", &w_colon) LIT(fexit), comma, LIT(&latest), poke, intr, END
I(literal, "literal", &w_semic) LIT(push), comma, comma, END
-#define LATEST &w_literal
+N(b, "_b", &w_literal) { ++pp; pp = (intptr_t **)*pp; NEXT; }
+N(bz, "_bz", &w_literal) { ++pp; if (!*sp++) { pp = (intptr_t **)*pp; } NEXT; }
+I(fif, "if", &w_b) LIT(bz), comma, FTH(here), LIT(0), comma, END
+I(then, "then", &w_fif) FTH(here), LIT(sizeof(intptr_t)), sub, swap, poke, END
+I(felse, "else", &w_then) LIT(b), comma, FTH(here), LIT(0), comma, swap,
+ FTH(here), LIT(sizeof(intptr_t)), sub, swap, poke, END
+#define LATEST &w_felse
void call(void *ptr)
{