[cc65] Passing variables from asm to c and vice versa

From: Stefan <stefan-physik1gmx.net>
Date: 2008-08-05 10:56:45
Thank you, i had figured out to pass asm constants to c a while ago.
Anyway i repeatedly stumbled across the problem to tell the compiler
thinks, that these are variables but instead they are actually constants.
I have again included an example program.
I define a colortable in the assembler program and want to access it from
the c code. I also have to know the length of the colortable in the c 
program.
The external pointer to the colortable is recognized as a constants as you
see when i assign them to a copy.
But if i calculate the difference of two constant pointers they are for some
reason not recognized as constants (A difference of constants is again 
constant, or?).
The same i get, when i define a label _colortable_size in the assembler 
program.
This is again not recognized as contant in the c code even with the 
ampersand before.

Monte
 


----------------------------------------------------------------------
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 Aug 5 10:56:48 2008

This archive was generated by hypermail 2.1.8 : 2008-08-05 10:56:50 CEST