equi

A self-descriptive stack-based PC platform
git clone git://git.luxferre.top/equi.git
Log | Files | Refs | README | LICENSE

commit aaf98b5dbb8651dac906bfb0271f1912f08d73f3
parent 0be72ee3fd670b8e8f935fe998167414e26d10f9
Author: Luxferre <lux@ferre>
Date:   Tue,  9 Aug 2022 21:34:33 +0300

Got rid of POSIX warnings and re-enabled strip in the makefile for now

Diffstat:
MMakefile | 2+-
Mequi.c | 9+++++----
2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/Makefile b/Makefile @@ -7,7 +7,7 @@ DFLAGS= desktopcc: cc -std=c89 -Os -o $(PROJNAME) $(CFILES) $(DFLAGS) - #strip $(PROJNAME) + strip $(PROJNAME) tcc: tcc -std=c89 -o $(PROJNAME) $(CFILES) $(DFLAGS) diff --git a/equi.c b/equi.c @@ -129,7 +129,7 @@ enum EquiErrors { /* Error reporting method */ void trapout(errcode) { if(errcode > 0) { - fprintf(stderr, "Error %d at 0x%x (instruction %c): ", errcode, ram.pc, ram.cmdbuf[ram.pc]); + fprintf(stderr, "\nError %d at 0x%x (instruction %c): ", errcode, ram.pc, ram.cmdbuf[ram.pc]); switch(errcode) { case STACK_OVERFLOW: cerr("Stack overflow\n"); @@ -299,7 +299,7 @@ ushort crc16(const uchar* data_p, uchar length) { /* persistent operation handler */ ushort persistOp(maddr, dataLen, adl, adh, isWrite) { - + return 0; } /* Main interpreter loop */ @@ -357,6 +357,7 @@ void equi_main_loop() { break; case CR: case LF: + case '\t': case ' ': /* all nops in interpretation mode */ break; case INS_QUIT: /* gracefully quit the interpretation mode */ @@ -545,8 +546,8 @@ int main(int argc, char* argv[]) { ram.pc = ram.ibp = 65535U; printf("Welcome to Equi v" EQUI_VER " by Luxferre, 2022\n\nCLT: 0x%X (%d bytes)\nGPD: 0x%X (%d bytes)\nCommand buffer: 0x%X (%d bytes)\nEqui ready\n\n", - (uchar *)&ram.clt - (uchar *)&ram.main_stack, - (uchar *)&ram.gpd - (uchar *)&ram.clt, + (unsigned int) ((uchar *)&ram.clt - (uchar *)&ram.main_stack), + (unsigned int) ((uchar *)&ram.gpd - (uchar *)&ram.clt), ram.gpd_start, ram.cmd_start - ram.gpd_start, ram.cmd_start, ram.cmd_size);