flat assembler
Message board for the users of flat assembler.
Index
> Compiler Internals > Absolute memory offset in 64 bit code (bug maybe?) |
Author |
|
vid 24 Apr 2006, 12:42
revolution: shouldn't you use 1 shl 64 instead of 32? If i understand right what you wanted
|
|||
24 Apr 2006, 12:42 |
|
revolution 24 Apr 2006, 13:12
Quote: shouldn't you use 1 shl 64 instead of 32? |
|||
24 Apr 2006, 13:12 |
|
revolution 24 Apr 2006, 13:16
I just saw another thread concerning the same thing.
http://board.flatassembler.net/topic.php?t=5154 I will reply there. |
|||
24 Apr 2006, 13:16 |
|
vid 24 Apr 2006, 13:27
sorry then
|
|||
24 Apr 2006, 13:27 |
|
Tomasz Grysztar 24 Apr 2006, 14:21
fasm's manual, section 2.1.19 wrote: The long mode uses also the instruction pointer based addresses, you can specify it manually with the special RIP register symbol, but such addressing is also automatically generated by flat assembler, since there is no 64-bit absolute addressing in long mode. You can still force the assembler to use the 32-bit absolute addressing by putting the dword size override for address inside the square brackets. There is also one exception, where the 64-bit absolute addressing is possible, it's the mov instruction with one of the operand being accumulator register, and second being the memory operand. To force the assembler to use the 64-bit absolute addressing there, use the qword size operator for address inside the square brackets. When no size operator is applied to address, assembler generates the optimal form automatically. So the correct way is: Code: use64 org 0 mov [0],eax ; Generates: mov [RIP-6],eax mov [dword 0],eax ; Generates: mov [0],eax mov [dword 1 shl 32],eax org 1 shl 32 mov [dword 0],eax mov [dword 1 shl 32],eax |
|||
24 Apr 2006, 14:21 |
|
revolution 24 Apr 2006, 15:10
Code: mov [dword 1 shl 32],eax |
|||
24 Apr 2006, 15:10 |
|
Tomasz Grysztar 24 Apr 2006, 15:58
what a mess! Right, I thought it was 31 here (and that you wanted absolute dword addressing, not absolute qword). There's some slip in error checking, I'll find it out.
|
|||
24 Apr 2006, 15:58 |
|
Tomasz Grysztar 25 Apr 2006, 20:13
It's fixed in 1.65.20.
|
|||
25 Apr 2006, 20:13 |
|
revolution 26 Apr 2006, 00:31
Yep, it it working great.
|
|||
26 Apr 2006, 00:31 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.