Browse code

Fix issue in stack balance

neauoire authored on 21/03/2021 21:37:39
Showing 4 changed files
... ...
@@ -31,7 +31,15 @@ Read more in the [Uxambly Guide](https://wiki.xxiivv.com/site/uxambly.html).
31 31
 
32 32
 %RTN { JMP2r }
33 33
 
34
-@RESET 
34
+( devices )
35
+
36
+|0100 ;Console { pad 8 char 1 byte 1 short 2 }
37
+|01F0 .RESET .FRAME .ERROR ( vectors )
38
+|01F8 [ 13fd 1ef3 1bf2 ] ( palette )
39
+
40
+( program )
41
+
42
+|0200 @RESET 
35 43
 	
36 44
 	,text1 ,print-label JSR2
37 45
 	,text2 ,print-label JSR2
... ...
@@ -55,11 +63,6 @@ RTN
55 63
 
56 64
 |c000 @FRAME
57 65
 |d000 @ERROR 
58
-
59
-|FF00 ;Console { pad 8 char 1 byte 1 short 2 }
60
-
61
-|FFF0 .RESET .FRAME .ERROR ( vectors )
62
-|FFF8 [ 13fd 1ef3 1bf2 ] ( palette )
63 66
 ```
64 67
 
65 68
 ## TODOs
... ...
@@ -73,7 +76,6 @@ RTN
73 76
 - Includes
74 77
 - Defines
75 78
 - Jump helpers
76
-- Don't brk when return stack is not zeroed
77 79
 - LDRS should load from the zeropage?
78 80
 - A fast way(2 bytes) to read from the zero page #aa LDR.
79 81
 
... ...
@@ -20,5 +20,5 @@ cc -std=c89 -DDEBUG -Wall -Wno-unknown-pragmas -Wpedantic -Wshadow -Wextra -Werr
20 20
 # cc uxn.c emulator.c -std=c89 -Os -DNDEBUG -g0 -s -Wall -Wno-unknown-pragmas -L/usr/local/lib -lSDL2 -o bin/emulator
21 21
 
22 22
 # run
23
-./bin/assembler projects/software/nasu.usm bin/boot.rom
23
+./bin/assembler projects/software/left.usm bin/boot.rom
24 24
 ./bin/emulator bin/boot.rom
... ...
@@ -695,7 +695,7 @@ RTN
695 695
 	007c 8280 f080 827c 007c 8280 f080 8080
696 696
 ]
697 697
 
698
-|2000 ;canvas { w 2 h 2 x1 2 y1 2 x2 2 y2 2 }
699
-|3000 @data [ ]
698
+@ERROR BRK 
700 699
 
701
-|F000 @ERROR BRK 
702 700
\ No newline at end of file
701
+;canvas { w 2 h 2 x1 2 y1 2 x2 2 y2 2 }
702
+@data [ ]
... ...
@@ -112,12 +112,12 @@ void (*ops[])(Uxn *u) = {
112 112
 Uint8 opr[][4] = { /* wstack-/+ rstack-/+ */
113 113
 	{0,0,0,0}, {0,0,0,0}, {0,0,0,0}, {1,0,0,0}, {1,2,0,0}, {2,2,0,0}, {2,3,0,0}, {3,3,0,0},
114 114
 	{2,1,0,0}, {2,1,0,0}, {2,1,0,0}, {2,1,0,0}, {2,1,0,0}, {2,1,0,0}, {1,0,0,0}, {1,0,0,2},
115
-	{1,1,0,0}, {2,0,0,0}, {2,1,0,0}, {3,0,0,0}, {0,0,0,0}, {0,0,0,0}, {1,2,0,0}, {1,0,0,1},
115
+	{1,1,0,0}, {2,0,0,0}, {2,1,0,0}, {3,0,0,0}, {0,0,0,0}, {0,0,0,0}, {0,1,1,1}, {1,0,0,1},
116 116
 	{2,1,0,0}, {2,1,0,0}, {2,1,0,0}, {2,1,0,0}, {2,1,0,0}, {2,1,0,0}, {2,1,0,0}, {2,1,0,0},
117 117
 	/* 16-bit */
118 118
 	{0,0,0,0}, {2,0,0,0}, {0,0,0,0}, {2,0,0,0}, {2,4,0,0}, {4,4,0,0}, {4,6,0,0}, {6,6,0,0},
119 119
 	{4,1,0,0}, {4,1,0,0}, {4,1,0,0}, {4,1,0,0}, {4,1,0,0}, {4,1,0,0}, {2,0,0,0}, {2,0,0,2},
120
-	{2,1,0,0}, {3,0,0,0}, {2,2,0,0}, {4,0,0,0}, {0,0,0,0}, {0,0,0,0}, {2,4,0,0}, {2,0,0,2},
120
+	{2,1,0,0}, {3,0,0,0}, {2,2,0,0}, {4,0,0,0}, {0,0,0,0}, {0,0,0,0}, {0,2,2,2}, {2,0,0,2},
121 121
 	{4,2,0,0}, {4,2,0,0}, {4,2,0,0}, {4,2,0,0}, {4,2,0,0}, {4,2,0,0}, {4,2,0,0}, {4,2,0,0}
122 122
 };
123 123