Modified examples

This commit is contained in:
neauoire 2021-02-13 19:19:13 -08:00
parent 89952e8112
commit 812148c291
4 changed files with 14 additions and 15 deletions

View File

@ -83,7 +83,6 @@ BRK
## TODOs
- Li1 short mode
- Defines?
- LDR/STR helpers
- Keyboard example

View File

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

View File

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

View File

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