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

From: thefox xofeht <thefox1aspekt.fi>
Date: 2012-05-24 17:05:35
On Thu, May 24, 2012 at 2:47 PM, Agent Friday <64subnet@gmail.com> wrote:
> I'm having a hard time seeing which the following (forcing zero-page
> addressing on a symbol of yet-unknown size) does not:
>
>         LDA  Z:FOO
>
> FOO = $12
>
> This generates an Error: illegal addressing mode.  It seems clear
> that the Z: prefix is recognized as an addressing mode specifier,
> but... doesn't seem to do what you'd think?

I'm not sure about the exact internal reason why this happens, but if
you need a workaround (i.e. your message was not just a "bug" report),
using "<" will accomplish what you want:

   LDA <FOO

FOO = $12

However, this will naturally not check if FOO actually ends up being a
zero page address. You could use .assert for that.

-thefox
----------------------------------------------------------------------
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 17:05:53 2012

This archive was generated by hypermail 2.1.8 : 2012-05-24 17:05:57 CEST