tebe6502/Mad-Assembler

.fl 0 broken in MADS 2.1.5

Closed this issue · 0 comments

Latest versions of MADS on Win32 seem to have a bug with the .fl directive when emitting zero: they emit 6 extra bytes to the output, which is not reflected in the PC, corrupting the executable.

Repro case:

    org $2000
    .fl 0

MADS 2.1.0 build 8:

Writing listing file...
Writing object file...
2 lines of source assembled in 2 pass
12 bytes written to the object file

MADS 2.1.5 build 3:

Writing listing file...
Writing object file...
2 lines of source assembled in 2 pass
18 bytes written to the object file

The hex dump of the executable shows 6 extra bytes that should not be there, although the DOS segment header still indicates only 6 bytes ($2000-2005):

00000000: FF FF 00 20 05 20 00 00-00 00 00 00 0E 00 00 00
00000010: 00 00

This only happens with 0 and -0. Non-zero values emit 6 bytes as expected.