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 ## TODOs
- Li1 short mode
- Defines? - Defines?
- LDR/STR helpers - LDR/STR helpers
- Keyboard example - 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 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 # run
./bin/assembler examples/pixels.usm bin/boot.rom ./bin/assembler examples/line.usm bin/boot.rom
./bin/emulator bin/boot.rom ./bin/emulator bin/boot.rom

View File

@ -4,8 +4,8 @@
|0100 @RESET |0100 @RESET
#00 ,dev/w STR ( set dev/write to console ) #00 ,dev/w STR ( set dev/write to console )
,string ( add string pointer to stack ) ,string ( add string pointer to stack )
@loop @loop
DUP2 LDR IOW ( write pointer value to console ) DUP2 LDR IOW ( write pointer value to console )
#0001 ADD2 ( increment string pointer ) #0001 ADD2 ( increment string pointer )
@ -13,7 +13,7 @@
BRK BRK
@string " Hello World " ( add string to memory ) @string " Hello World " ( add string to memory )
|c000 @FRAME BRK |c000 @FRAME BRK
|d000 @ERROR BRK |d000 @ERROR BRK

View File

@ -9,26 +9,26 @@
|0100 @RESET |0100 @RESET
( set dev/write to screen ) ( set dev/write to screen )
,01 ,dev/w STR #01 ,dev/w STR
( positive ) ( positive )
,01 ,color STR #01 ,color STR
+0030 ,x0 STR2 +0040 ,y0 STR2 +0030 ,x0 STR2 +0040 ,y0 STR2
+0100 ,x1 STR2 +0060 ,y1 STR2 +0100 ,x1 STR2 +0060 ,y1 STR2
,line JSR ,line JSR
,02 ,color STR #02 ,color STR
+0020 ,x0 STR2 +0010 ,y0 STR2 +0020 ,x0 STR2 +0010 ,y0 STR2
+0090 ,x1 STR2 +0070 ,y1 STR2 +0090 ,x1 STR2 +0070 ,y1 STR2
,line JSR ,line JSR
,03 ,color STR #03 ,color STR
+0010 ,x0 STR2 +0040 ,y0 STR2 +0010 ,x0 STR2 +0040 ,y0 STR2
+0070 ,x1 STR2 +0060 ,y1 STR2 +0070 ,x1 STR2 +0060 ,y1 STR2
,line JSR ,line JSR
( draw control points ) ( draw control points )
,02 ,color STR #02 ,color STR
,x0 LDR2 ,y0 LDR2 ,putpixel JSR ,x0 LDR2 ,y0 LDR2 ,putpixel JSR
,x1 LDR2 ,y1 LDR2 ,putpixel JSR ,x1 LDR2 ,y1 LDR2 ,putpixel JSR
@ -57,17 +57,17 @@ BRK
RTS RTS
@redraw @redraw
,0000 IOW2 #0000 IOW2
,0000 IOW2 #0000 IOW2
,00 IOW #00 IOW
,01 IOW #01 IOW
RTS RTS
@putpixel @putpixel
IOW2 ( y short ) IOW2 ( y short )
IOW2 ( x short ) IOW2 ( x short )
,color LDR IOW ( color byte ) ,color LDR IOW ( color byte )
,00 IOW ( redraw byte ) #00 IOW ( redraw byte )
RTS RTS
@diff16 @diff16