When I try to define a constant as simple number what I get is either an error or a memory address, no matter what I try. What am I doing wrong?
According to this page doing this: "two = 2" would define "two" as a numeric constant, but when I do that what I get is the address $2, not the number #2. If I try "two = #2" I get "trailing garbage characters" error.
ca65 is v2.16
edit: apparently this feature is only for cc65? Is that correct? Is there a way to do it on ca65?
How to define a numeric constant in ca65?
Moderator: Moderators
How to define a numeric constant in ca65?
https://twitter.com/bitinkstudios <- Follow me on twitter! Thanks!
https://www.patreon.com/bitinkstudios <- Support me on Patreon!
https://www.patreon.com/bitinkstudios <- Support me on Patreon!
Re: How to define a numeric constant in ca65?
This is probably what you want:
This is possible, but NOT recommended:
Code: Select all
two = 2
lda #two
Code: Select all
.define two #2
lda two
Download STREEMERZ for NES from fauxgame.com! — Some other stuff I've done: fo.aspekt.fi
Re: How to define a numeric constant in ca65?
Precisely, thanks! That works fine.
https://twitter.com/bitinkstudios <- Follow me on twitter! Thanks!
https://www.patreon.com/bitinkstudios <- Support me on Patreon!
https://www.patreon.com/bitinkstudios <- Support me on Patreon!