avra icon indicating copy to clipboard operation
avra copied to clipboard

Expressions should be evaluated as 64-bit integer

Open srtlg opened this issue 2 years ago • 1 comments

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 avatar Sep 03 '22 09:09 srtlg

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

srtlg avatar Sep 03 '22 09:09 srtlg