flat assembler
Message board for the users of flat assembler.
![]() Goto page 1, 2 Next |
Author |
|
revolution
What should happen here?
Code: mov [esi],-1 |
|||
![]() |
|
ouadji
yes revolution, in this case (-1), there is a ambiguity, i understand ...( byte, word, dword ?) In this case, i'm agree with you. But with operand "0A0D0A0Dh", there is no ambiguity. The question about operand size has no meaning An operand whose size exceeds the word should automatically be considered a double word. There is anyway no alternative. |
|||
![]() |
|
revolution
What should happen here?
Code: mov [esi],valueXYZ-constantABC |
|||
![]() |
|
revolution
What about here?
Code: use64 mov [esi],0x0a0d0a0d |
|||
![]() |
|
ouadji
"valueXYZ-constantABC" yes revolution, but here too there is ambiguity about the size of the result. In my case, there is no ambiguity. When there is no ambiguity, and the size of the operand is explicit and exceeds the word, FASM should consider directly that this is a double word. yes, it's a littel bit a cosmetic problem ![]() but this is illogical and unnecessary. |
|||
![]() |
|
ouadji
yes, with "USE64" there is a ambiguity. In this case, i'm agree with you too. But in my case, there is no ambiguity. |
|||
![]() |
|
revolution
It is not cosmetic, it allows for very sloppy programming. fasm should not have to guess the size. What if I want a word size but accidentally put 0xfffff? I see no error from fasm but my program crashes for unknown reasons!
Last edited by revolution on 04 Mar 2010, 22:35; edited 1 time in total |
|||
![]() |
|
LocoDelAssembly
Code: mov [esi], SOME_CONFIGURABLE_EQUATE ; Keep compiling until someone decides to use a constant with "size ambiguity" |
|||
![]() |
|
zhak
oh, come on, ouadji. what is all about? are you too lazy to put 5 letters "dword" in front of [esi]?
Last edited by zhak on 04 Mar 2010, 22:36; edited 1 time in total |
|||
![]() |
|
ouadji
Code: mov [esi],eax mov [esi],0A0D0A0Dh |
|||
![]() |
|
ouadji
Quote:
with this answer, I understand now. Quote:
Last edited by ouadji on 04 Mar 2010, 23:05; edited 1 time in total |
|||
![]() |
|
ouadji
Quote:
|
|||
![]() |
|
MazeGen
ouadji wrote:
With use64 there is no ambiguity as well, you can't move 64-bit immediate value to memory in any case. EDIT: Not quite true, you can't move values 80000000-FFFFFFFF to 64-bit memory operand. You can move 0-7FFFFFFF. Last edited by MazeGen on 06 Mar 2010, 12:11; edited 1 time in total |
|||
![]() |
|
Tomasz Grysztar
LocoDelAssembly wrote: (Note, the assembler and parser stages can't know where the literal came from so it can't make an special case when the constant is typed straight) But this still doesn't make this idea any good. I don't want people reporting bugs that "mov [esi],65536" assembles fine, but after they decrement value, it suddenly stops assembling. |
|||
![]() |
|
edfed
and please note that fasm is a compiler that generate a flat image of the source.
then, operand size should be specified because there are at least 3 possible sizes. it can be a problem sometimes, but ones you are used to this problem, it is no longer a problem. Code: mov dword[esi+eax*4],0 |
|||
![]() |
|
ouadji
Quote:
|
|||
![]() |
|
LocoDelAssembly
Tomasz Grysztar wrote: Do you mean values defined with EQU here? |
|||
![]() |
|
baldr
This problem looks similar to signed vs. unsigned contradiction:
Code: a = 1 shl 63 - 1; 0x7FFF'FFFF'FFFF'FFFF b = a+1 if b>a display "b>a", 13, 10 else display "b<=a", 13, 10 end if if b-a>0 display "b-a>0", 13, 10 else display "b-a<=0", 13, 10 end if |
|||
![]() |
|
edemko
Never thought how fasm does number comparison.., it is signed.
b-a = 10b - 01b = 01b which is unsigned. All is fine. |
|||
![]() |
|
Goto page 1, 2 Next < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.
Website powered by rwasa.