This commit is contained in:
neauoire 2021-02-07 21:07:34 -08:00
parent 6ce6915752
commit c2d0759588
4 changed files with 20 additions and 14 deletions

View File

@ -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

View File

@ -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

View File

@ -1,13 +0,0 @@
< conditionals >
.there ( 0a 05 GTH ) JMC
:here
< when not equal >
ee
BRK
:there
< when is equal >
ff
BRK

17
examples/condjump.usm Normal file
View File

@ -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