From e1e6d52fea8d410b3e27b55488fcd28b2ed3cddd Mon Sep 17 00:00:00 2001 From: Virgil Dupras Date: Mon, 27 May 2019 11:58:12 -0400 Subject: [PATCH] zasm: add ERR_BAD_FMT --- apps/zasm/const.asm | 2 ++ apps/zasm/instr.asm | 4 +++- tools/emul/zasm/zasm.bin | Bin 4049 -> 4051 bytes tools/tests/zasm/errtests.sh | 2 ++ 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/apps/zasm/const.asm b/apps/zasm/const.asm index 3972478..17a6e4d 100644 --- a/apps/zasm/const.asm +++ b/apps/zasm/const.asm @@ -6,3 +6,5 @@ ; contains references to undefined symbols. .equ ERR_BAD_ARG 0x02 +; Code is badly formatted (comma without a following arg, unclosed quote, etc.) +.equ ERR_BAD_FMT 0x03 diff --git a/apps/zasm/instr.asm b/apps/zasm/instr.asm index cefff68..e13ece3 100644 --- a/apps/zasm/instr.asm +++ b/apps/zasm/instr.asm @@ -791,7 +791,7 @@ parseInstruction: call readComma jr nz, .nomorearg call readWord - jr nz, .error + jr nz, .badfmt ld de, curArg2 call processArg jr nz, .error ; A is set to error @@ -824,6 +824,8 @@ parseInstruction: djnz .loopWrite cp a ; ensure Z jr .end +.badfmt: + ld a, ERR_BAD_FMT .error: ; A is set to error already call unsetZ diff --git a/tools/emul/zasm/zasm.bin b/tools/emul/zasm/zasm.bin index dcd66d3f7cf1a57c4defc54e47808e3d470b5402..b7b0c7692021f0d4832a881fa776dd4babbb1d58 100644 GIT binary patch delta 848 zcmY*WOK1~O6rDFSndbkgpP8n%oiw%`QYmR@D^wgsq$ag(>f+7lMyl3@6hT3x5oxJaJh^Xs|3$;igZp5TyVW;(hLE=K3MHT@ixDaWe3kUBcT5&OO?>Xn5d*;4U*T*il z_;s1BBYAlzio$Ch=psT}YfG$%#1|UPX|lUaD_YsCl=4O~tXFA_yyPCC2PDalpig9x zPogl{;QQLHPxox!7DXyBKWZh!GmWT7-G6+<;8 zR{fQ5;ZYu2jOc^WljR1s2f@30zz?QT;?0EHoY z6YTS1*sx0iQopv#`#Iy#KZ?hqC^o`3a{>!CfTf|gr_ zkk-gM|B<~rSVf86EFIPhbU3xzD9QdnB7M~iAG!u+iG1yzH57eS$ZgVhkMxlJ7e6o%|g zu+K|iLz4ugcC*QgPUFZwiX)OF)x$S(0t+^PWuUj?xaoq>#k)z!O_zmkfhTZ8MBfYe zw1;4ixz0lp?0|E|5Mli(d7Pa{$!%~`xUAi)cF*CFxVhz=ljDAdb@^1uez;!ug%lzR z$a2Z({t%2`%0!1*=U6mgBgaC(0CFgF`@HaImW`!luPVTUw*FYb61zYCN*2$?++>c0 zlJVBv9A16r)?L1%L?gGz5?Lm%=|Es=&$PC(Q7jwa$kxy0%}Tk@O`ir1`+bBxPZT$d zQZ^K)p95FXHXRXV|C%N%l@jYnWSBx{#KDe!ZL?h~Sj4PUN>#J3E87>&vQ$EDW!uyc zhxh&@DpC$+*>OG3P9|6CCB?zmm9(Cpu`KxY9TwK3F7`&p)ttem#%3(Ec}=&t&Fi}5 zl-n%pt%?dk$86zFW|n;-IU^RHgb_K&`ZYOX-z&(T=(yc(>oz{Po?b1pY5F)A!R?yC UEW!qoeR8(zz@(i(>CNVh-xGf>;{X5v diff --git a/tools/tests/zasm/errtests.sh b/tools/tests/zasm/errtests.sh index 7bf15b2..c70d8a3 100755 --- a/tools/tests/zasm/errtests.sh +++ b/tools/tests/zasm/errtests.sh @@ -18,3 +18,5 @@ chkerr() { chkerr "foo" 1 chkerr "ld a, foo" 2 +chkerr "ld a," 3 +chkerr "ld a, 'A" 3