commit c2d075958834acb9654f2fd873e62209e87828e0
parent 6ce6915752655b2b58121bdfaefa39037cc0eb5e
Author: neauoire <aliceffekt@gmail.com>
Date: Sun, 7 Feb 2021 21:07:34 -0800
*
Diffstat:
4 files changed, 20 insertions(+), 14 deletions(-)
diff --git a/build.sh b/build.sh
@@ -14,5 +14,5 @@ cc -std=c89 -DDEBUG -Wall -Wno-unknown-pragmas -Wpedantic -Wshadow -Wextra -Werr
cc -std=c89 -DDEBUG -Wall -Wno-unknown-pragmas -Wpedantic -Wshadow -Wextra -Werror=implicit-int -Werror=incompatible-pointer-types -Werror=int-conversion -Wvla -g -Og -fsanitize=address -fsanitize=undefined uxn.c -o uxn
# run
-./uxnasm examples/hello.usm boot.rom
+./uxnasm examples/condjump.usm boot.rom
./uxn boot.rom
diff --git a/examples/benchmark.usm b/examples/benchmark.usm
@@ -26,6 +26,8 @@
,1234 ,1233 GTH^ #0e STR
,1234 ,1235 LTH^ #0f STR
+,ef ,ee EQU ,12 ,01 ROT ADD?
+
|c000 @FRAME BRK
|d000 @ERROR BRK
|FFFA .RESET .FRAME .ERROR
diff --git a/examples/conditionals.usm b/examples/conditionals.usm
@@ -1,13 +0,0 @@
-< conditionals >
-
-.there ( 0a 05 GTH ) JMC
-
-:here
- < when not equal >
- ee
- BRK
-
-:there
- < when is equal >
- ff
- BRK
diff --git a/examples/condjump.usm b/examples/condjump.usm
@@ -0,0 +1,17 @@
+( conditional jump )
+
+|0100 @RESET
+
+,06 ,05 GTH ,there ROT JMP? POP^
+
+@here ( when lesser or equal )
+ ,ee
+ BRK
+
+@there ( when greater )
+ ,ff
+ BRK
+
+|c000 @FRAME BRK
+|d000 @ERROR BRK
+|FFFA .RESET .FRAME .ERROR