Ro5bert / avra

Assembler for the Atmel AVR microcontroller family
GNU General Public License v2.0
153 stars 39 forks source link

Expressions should be evaluated as 64-bit integer #53

Open srtlg opened 1 year ago

srtlg commented 1 year ago

For compatibility with AVRASM2 all expressions should be 64 bit internally, so that the following is equal

.device atmega168
.equ F_CPU = 16000000
.macro delay1
        .set cycles = @0 * (F_CPU / 1000000)
        .dw cycles
.endmacro
.macro delay2
        .set cycles = (@0 * F_CPU) / 1000000
        .dw cycles
.endmacro
delay1 1000
delay2 1000
srtlg commented 1 year ago

here is the relevant section of the manual 2022-09-03-114446