flat assembler
Message board for the users of flat assembler.
Index
> Compiler Internals > Bug: operator precedence |
Author |
|
LocoDelAssembly 21 Jan 2012, 15:27
I think the documentation is wrong, those + and - must be referring to the unary operators which of course must be executed with the maximum priority, but the binary forms are not listed.
|
|||
21 Jan 2012, 15:27 |
|
JohnFound 21 Jan 2012, 15:52
In my opinion it is not a bug. The precedence of mod should be the same as the precedence of division. For example, the expression 2+2/2 = 3 but (2+2)/2 = 2
|
|||
21 Jan 2012, 15:52 |
|
shutdownall 21 Jan 2012, 17:45
JohnFound wrote: In my opinion it is not a bug. The precedence of mod should be the same as the precedence of division. For example, the expression 2+2/2 = 3 but (2+2)/2 = 2 Maybe you are right. Is difficult to understand. Can read the table in the document as 1. priority, 2.priority - or - higher priority and lower priority. Maybe I understood this wrong. I just found some source code for Z80 maybe written for other compiler which has other "priorities". |
|||
21 Jan 2012, 17:45 |
|
LocoDelAssembly 21 Jan 2012, 19:26
Oh, haven't understood the following part right the first time:
Quote: The operations with higher priority value will be calculated first, you can of course change this behavior by putting some parts of expression into parenthesis. |
|||
21 Jan 2012, 19:26 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.