Re: [cc65] ca65: Why doesn't this zero-page override work?

From: Agent Friday <64subnet1gmail.com>
Date: 2012-05-24 21:18:36
On Thu, May 24, 2012 at 5:24 AM,  <silverdr@wfmh.org.pl> wrote:
>
> On 2012-05-24, at 13:47, Agent Friday wrote:
>>        LDA  Z:FOO
>>
>> FOO = $12
>
> I think the forward declaration is a problem. I recall discussing
> similar thing with UZ some time ago. Check if you get warning when
> the forced Z: is omitted (this would be result of my discussion) and
> if you get the same if the declaration of FOO is _before_ its first
> use.

Yes, the "warning: didn't use zeropage ..." was what led me to look
for such a solution.  I tried a couple other things...

FOO = $1234
        LDA (FOO),Y

This generated a "range error" rather than "illegal addressing
mode", making me wonder if maybe the general form X: was recognized
as an address size override, but perhaps "Z" itself was just not
implemented.  But a couple other tests ruled this out...

FOO = $12
        LDA  K:FOO      ; SYNTAX ERROR
        LDA  Z:FOO      ; _NO_ ERROR!

So it seems that Z: _is_ in fact recognized as zero-page addressing
override, but instead of being used as the default size for FOO
(when not yet defined), it is still assuming FOO must be 16 bits,
and then complaining that it cannot use a 16-bit address in zero-
page mode.

So I conclude that this is a bug in the implementation of Z:

-- 
// Agent Friday
----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Thu May 24 21:18:45 2012

This archive was generated by hypermail 2.1.8 : 2012-05-24 21:18:48 CEST