From fcc736bd45ba429bf838707c84d706f7419f5ebf Mon Sep 17 00:00:00 2001 From: curt mayer Date: Wed, 26 Feb 2020 15:05:26 -0800 Subject: [PATCH 1/2] fixed expression parser bug : ~(1|2) returned 0xfe --- Tools/unix/uz80as/expr.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Tools/unix/uz80as/expr.c b/Tools/unix/uz80as/expr.c index 1de2c7e5..445e36f0 100644 --- a/Tools/unix/uz80as/expr.c +++ b/Tools/unix/uz80as/expr.c @@ -156,7 +156,7 @@ static int ashr(int r, int n) const char *expr(const char *p, int *v, int linepc, int allowfr, enum expr_ecode *ecode, const char **ep) { - int si, usi; + int si, usi, usl; const char *q; char last; int stack[ESTKSZ2]; @@ -172,6 +172,7 @@ const char *expr(const char *p, int *v, int linepc, int allowfr, si = 0; r = 0; last = 'V'; /* first void */ + usl = 0; loop: p = skipws(p); if (*p == '(') { @@ -184,6 +185,8 @@ loop: } stack[si++] = last; stack[si++] = r; + stack[si++] = usl; + usl = usi; p++; r = 0; last = 'v'; /* void */ @@ -197,6 +200,7 @@ loop: } else { p++; n = r; + usl = stack[--si]; r = stack[--si]; last = (char) stack[--si]; goto oper; @@ -396,7 +400,7 @@ uoper: uopstk[usi++] = *p++; goto loop; oper: - while (usi > 0) { + while (usi > usl) { usi--; switch (uopstk[usi]) { case '~': n = ~n; break; From f8c4ee1183f40e86c553b0cc97be9b9819371bc1 Mon Sep 17 00:00:00 2001 From: curt mayer Date: Wed, 26 Feb 2020 15:42:16 -0800 Subject: [PATCH 2/2] added diff build option --- Source/HBIOS/Build.sh | 15 +++++++++++++-- Source/HBIOS/Makefile | 7 ++++++- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/Source/HBIOS/Build.sh b/Source/HBIOS/Build.sh index 1344a610..0301a274 100755 --- a/Source/HBIOS/Build.sh +++ b/Source/HBIOS/Build.sh @@ -5,6 +5,19 @@ set -e CPMCP=../../Tools/`uname`/cpmcp +timestamp=$(date +%Y-%m-%d) +#timestamp="2020-02-24" + +if [ $1 == '-d' ] ; then + shift + diffdir=$1 + shift + if [ -f $diffdir/build.inc ] ; then + timestamp=$(grep TIMESTAMP $diffdir/build.inc | awk '{print $3}' | tr -d '\015"') + echo diff build using $timestamp + fi +fi + # positional arguments platform=$1 config=$2 @@ -45,8 +58,6 @@ else fi Apps=(assign fdu format mode osldr rtc survey syscopy sysgen talk timer xm inttest) -timestamp=$(date +%Y-%m-%d) -#timestamp="2020-02-24" blankfile=Blank${romsize}KB.dat romdiskfile=RomDisk.tmp diff --git a/Source/HBIOS/Makefile b/Source/HBIOS/Makefile index b598a3b3..2c42c98c 100644 --- a/Source/HBIOS/Makefile +++ b/Source/HBIOS/Makefile @@ -31,6 +31,11 @@ DEST = ../../Binary TOOLS =../../Tools OTHERS = *.img *.rom *.com *.bin *.z80 cpm.sys zsys.sys Build.inc include $(TOOLS)/Makefile.inc + +ifeq ($(DIFFMAKE),1) + DIFFBUILD := -d $(DIFFTO)/Source/HBIOS +endif + DIFFPATH = $(DIFFTO)/Binary @@ -39,7 +44,7 @@ ROMSIZE=512 N8_std.rom: ROMSIZE=512 %.rom: - bash Build.sh $(shell echo $* | tr '_' ' ') $(ROMSIZE) + bash Build.sh $(DIFFBUILD) $(shell echo $* | tr '_' ' ') $(ROMSIZE) #ZETA2_std.rom: # bash Build.sh ZETA2 std 512