flat assembler
Message board for the users of flat assembler.
Index
> Main > operand size not specified Goto page 1, 2 Next |
Author |
|
revolution 04 Mar 2010, 22:10
What should happen here?
Code: mov [esi],-1 |
|||
04 Mar 2010, 22:10 |
|
ouadji 04 Mar 2010, 22:18
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. |
|||
04 Mar 2010, 22:18 |
|
revolution 04 Mar 2010, 22:22
What should happen here?
Code: mov [esi],valueXYZ-constantABC |
|||
04 Mar 2010, 22:22 |
|
revolution 04 Mar 2010, 22:23
What about here?
Code: use64 mov [esi],0x0a0d0a0d |
|||
04 Mar 2010, 22:23 |
|
ouadji 04 Mar 2010, 22:30
"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. |
|||
04 Mar 2010, 22:30 |
|
ouadji 04 Mar 2010, 22:32
yes, with "USE64" there is a ambiguity. In this case, i'm agree with you too. But in my case, there is no ambiguity. |
|||
04 Mar 2010, 22:32 |
|
revolution 04 Mar 2010, 22:34
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 |
|||
04 Mar 2010, 22:34 |
|
LocoDelAssembly 04 Mar 2010, 22:34
Code: mov [esi], SOME_CONFIGURABLE_EQUATE ; Keep compiling until someone decides to use a constant with "size ambiguity" |
|||
04 Mar 2010, 22:34 |
|
zhak 04 Mar 2010, 22:35
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 |
|||
04 Mar 2010, 22:35 |
|
ouadji 04 Mar 2010, 22:36
Code: mov [esi],eax mov [esi],0A0D0A0Dh |
|||
04 Mar 2010, 22:36 |
|
ouadji 04 Mar 2010, 22:44
Quote:
with this answer, I understand now. Quote:
Last edited by ouadji on 04 Mar 2010, 23:05; edited 1 time in total |
|||
04 Mar 2010, 22:44 |
|
ouadji 04 Mar 2010, 22:51
Quote:
|
|||
04 Mar 2010, 22:51 |
|
MazeGen 05 Mar 2010, 07:17
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 |
|||
05 Mar 2010, 07:17 |
|
Tomasz Grysztar 05 Mar 2010, 09:05
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. |
|||
05 Mar 2010, 09:05 |
|
edfed 05 Mar 2010, 09:29
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 |
|||
05 Mar 2010, 09:29 |
|
ouadji 05 Mar 2010, 09:40
Quote:
|
|||
05 Mar 2010, 09:40 |
|
LocoDelAssembly 05 Mar 2010, 15:20
Tomasz Grysztar wrote: Do you mean values defined with EQU here? |
|||
05 Mar 2010, 15:20 |
|
baldr 05 Mar 2010, 17:47
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 |
|||
05 Mar 2010, 17:47 |
|
edemko 05 Mar 2010, 18:34
Never thought how fasm does number comparison.., it is signed.
b-a = 10b - 01b = 01b which is unsigned. All is fine. |
|||
05 Mar 2010, 18:34 |
|
Goto page 1, 2 Next < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.