Re: [cc65] Romable configuration / run-time library?

From: thefox xofeht <thefox1aspekt.fi>
Date: 2013-01-18 22:55:32
On Fri, Jan 18, 2013 at 10:55 PM, Oliver Schmidt <ol.sc@web.de> wrote:

> Hi Darryl,
>
> > ; Copy DATA_LOAD to DATA_RUN
> >         ldy     __DATA_SIZE__
> > L0:     lda     __DATA_LOAD__,y
> >         sta     __DATA_RUN__,y
> >         iny
> >         cpy     #<__DATA_SIZE__
> >         bne     L0
>
> The code above copies up to 255 bytes. Maybe you want to check your
> map file if the DATA segment is already larger than 255 bytes...
>

Not only that, but the code is also broken. "ldy __DATA_SIZE__" loads Y
from the *memory address* __DATA_SIZE__, which may contain a 0 (if you're
lucky) and the code may appear to work for that reason. I really don't
understand how that load ended up in there. :)

BTW, you can use .assert to make sure that the linker will warn you if
__DATA_SIZE__ grows bigger than 256 bytes one day.

-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 Fri Jan 18 22:55:43 2013

This archive was generated by hypermail 2.1.8 : 2013-01-18 22:55:47 CET