Re: [cc65] range error

From: Ullrich von Bassewitz <>
Date: 2012-01-18 21:06:00
On Mon, Jan 16, 2012 at 10:45:05PM +0100, Björn Spruck wrote:
> > Ok. Which values would you then consider legal? Do you want anything truncated
> > to 8 bits? Or just -128..255? How about
> >
> >         .byte   $FFFFFF80
> >
> > where the argument has the same internal representation as -128, should that
> > trigger an error?
> >
> If the size is clear, just silently truncate it to 8bit, if the size is
> not clear throw an error.

So be it. There's now

        .FEATURE        force_range

(or --feature force_range on the command line) which causes the assembler to
truncate anything in storage operators like .BYTE and .WORD plus any
expression used in an immediate op to the required size.

> Maybe I do not oversee all the consequences, but I consider this a coder
> friendly solution.

I have to admit that I absolutely dislike the feature, because it will almost
completely disable range error diagnostics. In my eyes "switch off error
messages" is not equivalent to "coder friendly". But as said before, I'm not
the holder of the one and only truth, so everybody with a different opinion
can now add "--feature force_range" to the command line to get rid of these
annoying range errors. And may enjoy hours of additional debugging instead:-)



Ullrich von Bassewitz                        
To unsubscribe from the list send mail to with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Wed Jan 18 21:06:08 2012

This archive was generated by hypermail 2.1.8 : 2012-01-18 21:06:11 CET