Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

avr assembler: #define vs .equ, is it the same?

Is the avr-c command

#define baudrate 9600

the same like the avr-asm command

.equ BAUD  = 9600 

??

like image 256
Tekkzz Avatar asked Jun 06 '26 18:06

Tekkzz


1 Answers

According to official guide (see 4.5.9):

The EQU directive assigns a value to a label. This label can then be used in later expressions. A label assigned to a value by the EQU directive is a constant and can not be changed or redefined.

equ is very similar to C-language #define directive, but there is one difference: equ can't be redefined.

like image 140
mblw Avatar answered Jun 10 '26 15:06

mblw



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!