0
0
Fork 0
mirror of https://git.sr.ht/~rabbits/uxn synced 2024-11-27 00:03:00 +00:00

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 } %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 ,text1 ,print-label JSR2
,text2 ,print-label JSR2 ,text2 ,print-label JSR2
@ -55,11 +63,6 @@ RTN
|c000 @FRAME |c000 @FRAME
|d000 @ERROR |d000 @ERROR
|FF00 ;Console { pad 8 char 1 byte 1 short 2 }
|FFF0 .RESET .FRAME .ERROR ( vectors )
|FFF8 [ 13fd 1ef3 1bf2 ] ( palette )
``` ```
## TODOs ## TODOs
@ -73,7 +76,6 @@ RTN
- Includes - Includes
- Defines - Defines
- Jump helpers - Jump helpers
- Don't brk when return stack is not zeroed
- LDRS should load from the zeropage? - LDRS should load from the zeropage?
- A fast way(2 bytes) to read from the zero page #aa LDR. - 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 # cc uxn.c emulator.c -std=c89 -Os -DNDEBUG -g0 -s -Wall -Wno-unknown-pragmas -L/usr/local/lib -lSDL2 -o bin/emulator
# run # run
./bin/assembler projects/software/nasu.usm bin/boot.rom ./bin/assembler projects/software/left.usm bin/boot.rom
./bin/emulator bin/boot.rom ./bin/emulator bin/boot.rom

View file

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