#93 asz80 bug with borland compiler

z80 port (188)

This bug occurs in the z80 assembler when
it is compiled with the borland compiler.
(latest from CVS)

The definition of ctype (in asm.h and asdata.c)
should be unsigned char to prevent it from
sign-extending in expressions. As it does
in aslex.c:167:
} while (ctype[c=get()] & ~(SPACE|ILL));
Somehow the borland compiler wants to evaluate
this as an integer expression. Since
ctype[0]=-128 this does not evaluate to 0.
And the assembler goes into an endless loop.

Could someone fix this please?


  • Johan Knol

    Johan Knol - 2001-08-02
    • assigned_to: nobody --> michaelh
  • Michael Hope

    Michael Hope - 2001-08-02

    Logged In: YES

    The assembler and linker assume unsigned characters
    throughout. Try turning on whatever flag the Borland
    compiler uses to use unsigned instead of signed
    characters. On gcc it is -funsigned-char.

    I'm afraid that I don't have a Windows or x86 machine to
    test this on.

  • Michael Hope

    Michael Hope - 2001-08-02
    • status: open --> closed-accepted

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks