Package: d52 Version: 3.4.1-1 Severity: normal Tags: patch When the control file contains a T directive which ends at the 32nd character of a line, an extra ' character is written, generating syntax errors in dumps.
Better seen with an example test case. First, create a file named test-T.bin containing this ASCII text (in mine it is terminated with an LF but that's irrelevant): """ 1234567890123456789012345678901234567890123456789012345678901234 """ Now create a file named test-T.ctl containing just this line: """ t 0-3f """ The result (in an unpatched version) is: """ ; ; DZ80 V3.4.1 Z80 Disassembly of test2.bin ; 2013/05/03 23:21 ; org 0 ; db '12345678901234567890123456789012' db '34567890123456789012345678901234'' ; ld a,(bc) ; end ; """ The second db line ends with '' instead of ' which is not correct. If the control file contains instead the following: """ t 0-1f """ then it's the first line the one with the doubled quote. With any other ending addresses up to 3Fh the result is fine; the problem only arises when the last line dumped contains 32 characters. The attached patch fixes it for me. It is common to all disassemblers, so it probably fixes it for them all at once, even if I've seen it only on the dz80 one.
diff -ru d52-3.4.1-orig/common.c d52-3.4.1/common.c --- d52-3.4.1-orig/common.c 2007-09-02 17:33:46.000000000 +0200 +++ d52-3.4.1/common.c 2013-05-03 20:12:03.000000000 +0200 @@ -1747,8 +1747,11 @@ --asc_cnt; } - putc('\'', fp); // terminate line - kcnt++; + if (cnt) + { + putc('\'', fp); // terminate line + kcnt++; + } if (hexflag && cnt) // if comment field requested... {