Fix issue in stack balance

This commit is contained in:
neauoire 2021-03-21 14:37:39 -07:00
parent 6cea4d8c4a
commit d7f355b0be
4 changed files with 15 additions and 13 deletions

View File

@ -31,7 +31,15 @@ Read more in the [Uxambly Guide](https://wiki.xxiivv.com/site/uxambly.html).
%RTN { JMP2r }
@RESET
( devices )
|0100 ;Console { pad 8 char 1 byte 1 short 2 }
|01F0 .RESET .FRAME .ERROR ( vectors )
|01F8 [ 13fd 1ef3 1bf2 ] ( palette )
( program )
|0200 @RESET
,text1 ,print-label JSR2
,text2 ,print-label JSR2
@ -55,11 +63,6 @@ RTN
|c000 @FRAME
|d000 @ERROR
|FF00 ;Console { pad 8 char 1 byte 1 short 2 }
|FFF0 .RESET .FRAME .ERROR ( vectors )
|FFF8 [ 13fd 1ef3 1bf2 ] ( palette )
```
## TODOs
@ -73,7 +76,6 @@ RTN
- Includes
- Defines
- Jump helpers
- Don't brk when return stack is not zeroed
- LDRS should load from the zeropage?
- A fast way(2 bytes) to read from the zero page #aa LDR.

View File

@ -20,5 +20,5 @@ cc -std=c89 -DDEBUG -Wall -Wno-unknown-pragmas -Wpedantic -Wshadow -Wextra -Werr
# cc uxn.c emulator.c -std=c89 -Os -DNDEBUG -g0 -s -Wall -Wno-unknown-pragmas -L/usr/local/lib -lSDL2 -o bin/emulator
# run
./bin/assembler projects/software/nasu.usm bin/boot.rom
./bin/assembler projects/software/left.usm bin/boot.rom
./bin/emulator bin/boot.rom

View File

@ -695,7 +695,7 @@ RTN
007c 8280 f080 827c 007c 8280 f080 8080
]
|2000 ;canvas { w 2 h 2 x1 2 y1 2 x2 2 y2 2 }
|3000 @data [ ]
@ERROR BRK
|F000 @ERROR BRK
;canvas { w 2 h 2 x1 2 y1 2 x2 2 y2 2 }
@data [ ]

4
uxn.c
View File

@ -112,12 +112,12 @@ void (*ops[])(Uxn *u) = {
Uint8 opr[][4] = { /* wstack-/+ rstack-/+ */
{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},
{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},
{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},
{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},
{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},
/* 16-bit */
{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},
{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},
{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},
{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},
{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}
};