Debian Codegraph @

test/string_conversion.asm

raw
1 ; Bug in string conversion.
2 ; Reported 2007/08/25 by Eduardo Casino Almao <[email protected]>
3
4 ; I've found a bug in the string conversion feature ([exp]d) I'm using
5 ; version 2.20.10b
6 ;
7 ; Basically, if exp is a not-yet-resolved label, the assembler aborts with
8 ; "program.a: (XX): error Label mismatch...
9
10 processor 6502
11
12 org $0801
13
14 word endprg ; pointer to next line
15 word 1968 ; line number
16 byte $9e ; SYS token
17 byte [start]d ; ASCII of SYS address
18 byte " TESTPROG BY TESTSOFT" ; Show copyright
19 endprg byte 0,0,0 ; End of BASIC program
20
21 start rts
22
23 ; The assembler outputs:
24 ;
25 ; DASM V2.20.10, Macro Assembler (C)1988-2004
26 ; testcase.a (13): error: Label mismatch...
27 ; --> endprg 081c
28 ; testcase.a (16): error: Label mismatch...
29 ; --> start 081f
30 ; Unrecoverable error(s) in pass, aborting assembly!
31 ; Complete.
32 ;
33 ; The offending code is in symbols.c, lines 203 to 210. I think that there
34 ; should be an extra condition, so if in the previous pass it has been a
35 ; string conversion, just go for another pass.
36 ;
37 ; -----CUT-----
38 ; /*
39 ; * If we had an unevaluated IF expression in the
40 ; * previous pass, don't complain about phase errors
41 ; * too loudly.
42 ; */
43 ; 203 if (F_verbose >= 1 || !(Redo_if & (REASON_OBSCURE)))
44 ; {
45 ; char sBuffer[ MAX_SYM_LEN * 2 ];
46 ; sprintf( sBuffer, "%s %s", sym->name, sftos( sym->value, 0 ) );
47 ; /*, sftos(sym->value,
48 ; sym->flags) ); , sftos(pc, cflags & 7));*/
49 ; asmerr( ERROR_LABEL_MISMATCH, false, sBuffer );
50 ; 210 }
51 ; ++Redo;
52 ; Redo_why |= REASON_PHASE_ERROR;
53 ; -----CUT-----