Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expressions should be evaluated as 64-bit integer #53

Open
srtlg opened this issue Sep 3, 2022 · 1 comment
Open

Expressions should be evaluated as 64-bit integer #53

srtlg opened this issue Sep 3, 2022 · 1 comment

Comments

@srtlg
Copy link

srtlg commented Sep 3, 2022

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
Copy link
Author

srtlg commented Sep 3, 2022

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

srtlg added a commit to srtlg/avra that referenced this issue Sep 3, 2022
srtlg added a commit to srtlg/avra that referenced this issue Sep 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant