From 1e7e5ee85963aee23b71fa59cd622a06f27e1a6e Mon Sep 17 00:00:00 2001 From: moon Date: Fri, 22 Aug 2025 19:09:46 +0330 Subject: if statements are now supported! --- pu2/code.i2 | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'pu2/code.i2') diff --git a/pu2/code.i2 b/pu2/code.i2 index c42cdd5..06d1c54 100644 --- a/pu2/code.i2 +++ b/pu2/code.i2 @@ -1,3 +1,11 @@ +/* + + testing grounds for the ir2 assembler + i still don't know whether it's a compiler, an IR emitter, or an assembler + hmmm... + +*/ + macro puts(2) { @1 = 0; // write @2 = /1/; // ptr @@ -13,13 +21,12 @@ macro putchar(1) { system(); } -@10 = 1; +@10 = 0; -jz(@10, continue); // conditional jump! - -puts(["hi"], [2]); - -continue: +// if statement!! +if (@10) { + puts(["hi"], [2]); +} putchar([10]); puts([" hello world"], [15]); -- cgit v1.2.3