Browse code

Modified examples

neauoire authored on 14/02/2021 03:19:13
Showing 4 changed files
... ...
@@ -83,7 +83,6 @@ BRK
83 83
 
84 84
 ## TODOs
85 85
 
86
-- Li1 short mode
87 86
 - Defines?
88 87
 - LDR/STR helpers
89 88
 - Keyboard example
... ...
@@ -24,5 +24,5 @@ rm -f ./bin/emulator
24 24
 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
25 25
 
26 26
 # run
27
-./bin/assembler examples/pixels.usm bin/boot.rom
27
+./bin/assembler examples/line.usm bin/boot.rom
28 28
 ./bin/emulator bin/boot.rom
... ...
@@ -4,8 +4,8 @@
4 4
 
5 5
 |0100 @RESET 
6 6
 
7
-	#00 ,dev/w STR                        ( set dev/write to console ) 
8
-	,string                               ( add string pointer to stack )
7
+	#00 ,dev/w STR                           ( set dev/write to console ) 
8
+	,string                                  ( add string pointer to stack )
9 9
 	@loop
10 10
 		DUP2 LDR IOW                         ( write pointer value to console )
11 11
 		#0001 ADD2                           ( increment string pointer )
... ...
@@ -13,7 +13,7 @@
13 13
 
14 14
 BRK
15 15
 
16
-@string " Hello World "                ( add string to memory )
16
+@string " Hello World "                      ( add string to memory )
17 17
 
18 18
 |c000 @FRAME BRK
19 19
 |d000 @ERROR BRK 
... ...
@@ -9,26 +9,26 @@
9 9
 |0100 @RESET
10 10
 
11 11
 	( set dev/write to screen ) 
12
-	,01 ,dev/w STR 
12
+	#01 ,dev/w STR 
13 13
 
14 14
 	( positive )
15
-	,01 ,color STR
15
+	#01 ,color STR
16 16
 	+0030 ,x0 STR2 +0040 ,y0 STR2
17 17
 	+0100 ,x1 STR2 +0060 ,y1 STR2
18 18
 	,line JSR
19 19
 
20
-	,02 ,color STR
20
+	#02 ,color STR
21 21
 	+0020 ,x0 STR2 +0010 ,y0 STR2
22 22
 	+0090 ,x1 STR2 +0070 ,y1 STR2
23 23
 	,line JSR
24 24
 
25
-	,03 ,color STR
25
+	#03 ,color STR
26 26
 	+0010 ,x0 STR2 +0040 ,y0 STR2
27 27
 	+0070 ,x1 STR2 +0060 ,y1 STR2
28 28
 	,line JSR
29 29
 
30 30
 	( draw control points )
31
-	,02 ,color STR
31
+	#02 ,color STR
32 32
 	,x0 LDR2 ,y0 LDR2 ,putpixel JSR
33 33
 	,x1 LDR2 ,y1 LDR2 ,putpixel JSR
34 34
 
... ...
@@ -57,17 +57,17 @@ BRK
57 57
 	RTS
58 58
 
59 59
 @redraw
60
-	,0000 IOW2
61
-	,0000 IOW2
62
-	,00 IOW
63
-	,01 IOW
60
+	#0000 IOW2
61
+	#0000 IOW2
62
+	#00 IOW
63
+	#01 IOW
64 64
 	RTS
65 65
 
66 66
 @putpixel 
67 67
 	IOW2 ( y short )
68 68
 	IOW2 ( x short )
69 69
 	,color LDR IOW  ( color byte )
70
-	,00 IOW  ( redraw byte )
70
+	#00 IOW  ( redraw byte )
71 71
 	RTS
72 72
 
73 73
 @diff16