Re: [cc65] How to define a zeropage indirect pointer in C?

From: Ullrich von Bassewitz <uz1musoftware.de>
Date: 2004-10-05 08:36:46
On Tue, Oct 05, 2004 at 09:09:28AM +0300, Karri Kaksonen wrote:
> I define a storage for my score pointer in test.s like:
> 	.export _abc_score_ptr0
>         .zeropage
> _abc_score_ptr0:  .res 2

Because the assembler knows that the zeropage segment is reached via direct
(short) addressing, _abc_score_ptr0 is exported as a zeropage symbol.

> Then I want to monitor things in my myprog.c like:
> extern char *abc_score_ptr0[];
[...]

This imports _abc_score_ptr0 as an absolute symbol. Adding a 

        #pragma zpsym ("abc_score_ptr0")

should fix the problem. You can also ignore the warning, because nothing bad
will happen in your case (it's just a warning).

The development (and upcoming major) version will be more verbose about the
problem:

    ld65: Warning: Address size mismatch for `_abc_score_ptr0': Exported from
    t.o, t.s(1) as `zeropage', import in test.o, test.s(13) as `absolute'

Regards


        Uz


-- 
Ullrich von Bassewitz                                  uz@musoftware.de
----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Tue Oct 5 08:36:49 2004

This archive was generated by hypermail 2.1.8 : 2004-10-05 08:36:58 CEST