Added notes

This commit is contained in:
neauoire 2021-02-03 17:43:13 -08:00
parent 1422c5dc6e
commit 69d255bfff
6 changed files with 18 additions and 24 deletions

View File

@ -56,6 +56,10 @@ cc uxn.c -std=c89 -Os -DNDEBUG -g0 -s -Wall -Wno-unknown-pragmas -o uxn
- Implement addressing
- Implement 16 bits operations
## Notes
- Forth logic operators pop 2 items and add a bool to the stack, is that viable in uxn?
## Refs
https://code.9front.org/hg/plan9front/file/a7f9946e238f/sys/src/games/nes/cpu.c

View File

@ -14,5 +14,5 @@ cc -std=c89 -DDEBUG -Wall -Wno-unknown-pragmas -Wpedantic -Wshadow -Wextra -Werr
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 -o uxn
# run
./uxnasm examples/arithmetic.usm boot.rom
./uxnasm examples/core.usm boot.rom
./uxn boot.rom

View File

@ -1,4 +1,6 @@
< core >
0102
34 34 EQU .label JSZ ff BRK
:label ee RTS

2
examples/subcond.usm Normal file
View File

@ -0,0 +1,2 @@
< subcond >

View File

@ -1,25 +1,9 @@
< subroutines >
:begin
.addall JSI ADD ADD
06 EQU .isequal JSI
BRK
.part1 JSI 44 BRK
:add1
01 RTS
:part1 11 .part2 JSI RTS
:add2
02 RTS
:part2 22 .part3 JSI RTS
:add3
03 RTS
:addall
.add1 JSI
.add2 JSI
.add3 JSI
RTS
:isequal
.addall JSI ff
RTS
:part3 33 RTS

6
uxn.c
View File

@ -123,12 +123,14 @@ reset(void)
int i;
cpu.status = 0x00;
cpu.counter = 0x00;
cpu.literal = 0x00;
cpu.rom.ptr = 0x00;
cpu.wst.ptr = 0x00;
cpu.literal = 0x00;
cpu.rst.ptr = 0x00;
for(i = 0; i < 256; i++)
for(i = 0; i < 256; i++) {
cpu.wst.dat[i] = 0x00;
cpu.rst.dat[i] = 0x00;
}
}
int