Page 1 of 1

nesasm c-style defines?

Posted: Thu Jun 02, 2011 7:25 pm
by djcouchycouch
Totally simple thing I'm sure I've missed, but is there a way to do c-style #defines for declaring constant values with nesasm?

Thanks!
djcc

Posted: Thu Jun 02, 2011 8:14 pm
by Dwedit
Have you tried .equ or = ?
It varies from assembler to assembler, but in many, you can use .equ or = to declare a label, such as

MyVariable .equ $0123

or

MyVariable = $0123

Posted: Fri Jun 03, 2011 5:45 am
by djcouchycouch
I'll try that, thanks!

Posted: Fri Jun 03, 2011 7:28 am
by 3gengames
RandomValue:
.dw $0000
RandomVales:
.dw $0000,$0000
RandomBytes:
.db $00,$00

I am pretty sure that's how to do it.

Posted: Fri Jun 03, 2011 3:32 pm
by mic_
NAME = value works fine with nesasm, and so does NAME EQU value (note: no dot in front of EQU).

Posted: Fri Jun 03, 2011 6:26 pm
by djcouchycouch
Yep, it works! Thanks!