RE: [cc65] statics in zero page

Date view Thread view Subject view

From: Keates, Mark (Mark.Keates_at_dendrite.com)
Date: 2002-05-21 14:00:54


Hi Christian,

> Now, where I managed to build a little test project for the
> Lynx under cc65, I like to ask if there is a feature
> which allows to place static variables into zero page
> for quicker access?
> 
> The special (old) Lynx-Adaption of cc65 has the keyword 'zstatic'
> for this feature. Is there something like that to achieve the
> same behaviour under cc65 2.8?

After a little experiment I think there maybe a bug here
but that'll need to be confirmed as I'm not sure how
this should work. I tried my test.c file:

#pragma rodataseg ("zp")
char *msg = "Hello.";
#pragma rodataseg ("RODATA")

main(int c,char**v) {
exit(printf("%s\n",msg));
}

Compiled using "cl65 -S test.c" gave this in the asm produced:

<snip>
.segment        "DATA"

_msg:
        .addr   L0001+0

.segment        "RODATA"

.segment        "zp"
.segment        "RODATA"
L0001:
        .byte   $C8,$45,$4C,$4C,$4F,$2E,$00,$25,$53,$0D,$00
</snip>

Shouldn't the last bit be this:

.segment        "zp"
L0001:
        .byte   $C8,$45,$4C,$4C,$4F,$2E,$00

.segment        "RODATA"
L0002:
        .byte   $25,$53,$0D,$00
 
Thoughts?

Mark
----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo_at_musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.


Date view Thread view Subject view

This archive was generated by hypermail 2.1.3 : 2002-05-21 14:01:03 CEST