uxn

Varvara Ordinator, written in ANSI C(SDL2)
git clone https://git.eamoncaddigan.net/uxn.git
Log | Files | Refs | README | LICENSE

commit 550aceee231ed3b9f55af90ca1142b507747dd4c
parent 8b84813c6ea4beb094c2a4c2a09da3e92a7eeb14
Author: Andrew Alderwick <andrew@alderwick.co.uk>
Date:   Sat, 19 Feb 2022 00:28:03 +0000

(uxnasm) Allow writing the 0xffff byte of RAM.

Diffstat:
Msrc/uxnasm.c | 7++++++-
1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/uxnasm.c b/src/uxnasm.c @@ -35,7 +35,8 @@ typedef struct { typedef struct { Uint8 data[LENGTH]; - Uint16 ptr, length, llen, mlen, rlen; + unsigned int ptr, length; + Uint16 llen, mlen, rlen; Label labels[512]; Macro macros[256]; Reference refs[2048]; @@ -193,6 +194,10 @@ writebyte(Uint8 b) fprintf(stderr, "-- Writing in zero-page: %02x\n", b); return 0; } + else if(p.ptr > 0xffff) { + fprintf(stderr, "-- Writing after the end of RAM: %02x\n", b); + return 0; + } else if(p.ptr < p.length) { fprintf(stderr, "-- Memory overwrite: %04x -> %04x\n", p.length, p.ptr); return 0;