From cdb206b7a5989d35c915e5ddc0ad04d6f20b9ab9 Mon Sep 17 00:00:00 2001 From: Virgil Dupras Date: Tue, 23 Jul 2019 13:58:18 -0400 Subject: [PATCH] zasm: fix nasty (iy+d) misparsing bug *sob*... --- apps/zasm/instr.asm | 1 + tools/emul/zasm/zasm.bin | Bin 4647 -> 4650 bytes tools/tests/zasm/test6.asm | 6 ++++++ tools/tests/zasm/test6.asm.expected | 1 + 4 files changed, 8 insertions(+) create mode 100644 tools/tests/zasm/test6.asm create mode 100644 tools/tests/zasm/test6.asm.expected diff --git a/apps/zasm/instr.asm b/apps/zasm/instr.asm index af27bdf..52dff9c 100644 --- a/apps/zasm/instr.asm +++ b/apps/zasm/instr.asm @@ -180,6 +180,7 @@ parseArg: ; note: the "-" part isn't supported yet. inc hl ; (HL) now points to X or Y ld a, (hl) + call upcase inc hl ; advance HL to the number part inc hl ; this is the number cp 'Y' diff --git a/tools/emul/zasm/zasm.bin b/tools/emul/zasm/zasm.bin index 7c5a6faa8ac6fa35f61ed6bc1b987e8db747825e..98c83b5eead04916dc61f05951dbe8b14ace1153 100644 GIT binary patch delta 1182 zcmYjQO>7%Q6yDkOZrs{g|5frP!DSXZWaB_%+!9(tS3y-(xw@wteyq$UP z`@Z+>o0+d;OEIp-7|R?&XpZpcBr2|`sEN?pN{s74fo1^kUf~>k|Dy^JSc`7jezvuajf~~;1=3|6&k|6vjvBJl6NUN$3_bB0T_?ta~Y6Ida^$A3BMUc)8 z>-)Hbo_bzSzTh7ktAg4G4hjI-|0yo-OQz!Fp3t|D(A6#I2Br?osw2=8 z1RYrr??@gLA+s}kP#3xXXnPiR&N;=7Cn)aavany?8Fktq3#Qgwa|ZX2n^C+A_KeG( z=4o%b7R}jZ7hnRzdPqcenZJt#0KKPh!I0M(?`%ftc4j-9!9y@+IGjN}T5j28?y>Lu zHVvgaXt(_x4;Cc&I%*OFQ~=VS#}$okj4MHq0JgJN=>~b!CAy1-@>1QoU|U_rnL#}X z)vIH;Hvp`74y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Su%c*fchYoMjNDip4C_d+NFO-tt>vAOq1`LVx>j_1p-%cn!AOURGS6!c# z9*G07ro;o(G?dXb_qP1eWjs8nry*@7kNZTRCrda-SMoUMMjj9Wfk;L?`UL-xMXwhW zzskE;=})ys!ZcsJsO&u~4=a6qS@dA&?$Dozs?<;d6mJ-62Ag^F??9mo}F z7kN2+03<#R4*}zwa9=MlxXR_5l}`SJ3g&1J0|Mfcgca}I_jg$?8#J0%QTpH)~uCj1v>&)YP_*mUCYp~Tc( MnK`#B66%Tl10qM4!vFvP diff --git a/tools/tests/zasm/test6.asm b/tools/tests/zasm/test6.asm new file mode 100644 index 0000000..d91189e --- /dev/null +++ b/tools/tests/zasm/test6.asm @@ -0,0 +1,6 @@ +; There was a very nasty bug (cost me a couple of hours of mis-debugging) where +; ld r, (iy+d) would use the 0xdd byte code instead of the correct 0xfd one. +; genallinstrs didn't catch it because it outputs uppercase. Oh sweet mother, +; how much time did I lose over this... + +ld h, (iy+1) diff --git a/tools/tests/zasm/test6.asm.expected b/tools/tests/zasm/test6.asm.expected new file mode 100644 index 0000000..ca54089 --- /dev/null +++ b/tools/tests/zasm/test6.asm.expected @@ -0,0 +1 @@ +ýf \ No newline at end of file