Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between %assign and %define [duplicate]

What is the difference between %assign and %define in NASM assembly x86? Because for me it looks like they are the same thing, well, not really. Is %assign just a %define for which you can change later in the code?

like image 966
C. Cristi Avatar asked May 31 '26 15:05

C. Cristi


1 Answers

They are not part of x86 assembly, they’re specific to nasm. They’re similar but not quite: %assign defines a numeric constant and it can be redefined. It cannot take arguments.%define defines a numeric or string valued macro, it can take arguments, and can also be redefined.

More information in the documentation

like image 123
Sami Kuhmonen Avatar answered Jun 02 '26 08:06

Sami Kuhmonen



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!