diff --git a/README.md b/README.md index 755b81f..be21d7f 100644 --- a/README.md +++ b/README.md @@ -83,7 +83,6 @@ BRK ## TODOs -- Li1 short mode - Defines? - LDR/STR helpers - Keyboard example diff --git a/build.sh b/build.sh index 3763040..eba54f1 100755 --- a/build.sh +++ b/build.sh @@ -24,5 +24,5 @@ rm -f ./bin/emulator 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 emulator.c -L/usr/local/lib -lSDL2 -o bin/emulator # run -./bin/assembler examples/pixels.usm bin/boot.rom +./bin/assembler examples/line.usm bin/boot.rom ./bin/emulator bin/boot.rom diff --git a/examples/hello.usm b/examples/hello.usm index 0a29d82..73b8d4d 100644 --- a/examples/hello.usm +++ b/examples/hello.usm @@ -4,8 +4,8 @@ |0100 @RESET - #00 ,dev/w STR ( set dev/write to console ) - ,string ( add string pointer to stack ) + #00 ,dev/w STR ( set dev/write to console ) + ,string ( add string pointer to stack ) @loop DUP2 LDR IOW ( write pointer value to console ) #0001 ADD2 ( increment string pointer ) @@ -13,7 +13,7 @@ BRK -@string " Hello World " ( add string to memory ) +@string " Hello World " ( add string to memory ) |c000 @FRAME BRK |d000 @ERROR BRK diff --git a/examples/line.usm b/examples/line.usm index 84c9150..fc69f2b 100644 --- a/examples/line.usm +++ b/examples/line.usm @@ -9,26 +9,26 @@ |0100 @RESET ( set dev/write to screen ) - ,01 ,dev/w STR + #01 ,dev/w STR ( positive ) - ,01 ,color STR + #01 ,color STR +0030 ,x0 STR2 +0040 ,y0 STR2 +0100 ,x1 STR2 +0060 ,y1 STR2 ,line JSR - ,02 ,color STR + #02 ,color STR +0020 ,x0 STR2 +0010 ,y0 STR2 +0090 ,x1 STR2 +0070 ,y1 STR2 ,line JSR - ,03 ,color STR + #03 ,color STR +0010 ,x0 STR2 +0040 ,y0 STR2 +0070 ,x1 STR2 +0060 ,y1 STR2 ,line JSR ( draw control points ) - ,02 ,color STR + #02 ,color STR ,x0 LDR2 ,y0 LDR2 ,putpixel JSR ,x1 LDR2 ,y1 LDR2 ,putpixel JSR @@ -57,17 +57,17 @@ BRK RTS @redraw - ,0000 IOW2 - ,0000 IOW2 - ,00 IOW - ,01 IOW + #0000 IOW2 + #0000 IOW2 + #00 IOW + #01 IOW RTS @putpixel IOW2 ( y short ) IOW2 ( x short ) ,color LDR IOW ( color byte ) - ,00 IOW ( redraw byte ) + #00 IOW ( redraw byte ) RTS @diff16