[cc65] start adress

From: carlos <carlosofcascade1gmx.net>
Date: 2004-04-29 10:05:38
Hello,

as i'm porting some old code, which was written with turbo assembler on the c64, i don't want always to use the linker config file.
there is the command line option for ld65 -S xxxx, with which you can pass a start adress. it works only with cpu type none, which is correct. if you use ld65 --start-addr xxxx it won't work. if you use cl65 --start-addr it won't be passed to the linker. 
this is ok for now, because you can work around with using seperate calls to ca65 and ld65. 

then i have problems with the c style macros of ca65. in c you can define macros which take parameters this way:

#define a(b) f(b), where f(b) is any mathematical expression using b. 

this doesn't conflict with using brackes as part of the macro, like this:

#define a (y*40+x), so you don't get conflicts with precedence when using the macro.

but in ca65, the second version, where there is a space between the macro name and the first bracket will be interpreted like the first one of the #define macros. so the assembler complains about not closed brackets and so on.
if often use the defines likethis:

.define scrw 40
.define scrn $400
.define x ??
.define y ??; any numbers ok
.define adr y*scrw+x+scrn

ldx #<(adr)
ldy #>(adr)
jsr ....;some routine which takes x and y as parameters

but is would prefer using this:
ldx #<adr
ldy #>adr, so the brackets should be included in the macro definition, which is not possible at the moment.

Greetings Carlos





----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Thu Apr 29 10:06:32 2004

This archive was generated by hypermail 2.1.8 : 2004-04-29 10:06:38 CEST