On Thu, Mar 23, 2017 at 1:55 AM, Willard Goosey <goo...@sdc.org> wrote:

> Grrrr!!!!!!!
>
> Ok, so. My m100.def has, for SmallC purposes,  3 classes of equates. ROM
> function that don't require arguments or return values, ROM functions that
> do require args or return values, and system variables.
>
> Because I use sed to translate the ASM/ZMAC original equates into ASX
> syntax global equates, these all end up as global labels that are stored,
> name and value, in the .rel object files. This means that the first class
> of functions can be called with no further code from Small C. The second
> type of function requires wrapper functions. And that's. All good.
>
> And I really really hoped that the system variables would be as easily
> used. Unfortunately it's not to be. A reference to extern char *CRSX
> (x=CRSX) generates "lhld CRSX \n mov a,m" when what I need is "lxi h,
> CRSX\n mov a,m" . I am very sad.
>
> I've looked through the code generator already and there's no hope. It
> looks like the best I can do is have the system variable names as #defines.
> Anything else would result in a huge tabke of pointers in the .co file that
> might not even be used!
>
>
It's not clear to me how you're expecting it to work. You want it to
derefence the pointer without you telling it to?

I'd think if you want to access the char referred to by the pointer at the
address, you need to dereference the pointer.

extern char *CSRX;
char x;

x = *CSRX;
*CSRX = 0x65;

or are you talking about the address of a pointer

extern char **CSRX;

-- John.

Reply via email to