flat assembler
Message board for the users of flat assembler.
Index
> Main > x86-64 MOVZX |
Author |
|
revolution 13 Sep 2008, 23:39
Code: mov eax,dword[rsi] Last edited by revolution on 13 Sep 2008, 23:54; edited 1 time in total |
|||
13 Sep 2008, 23:39 |
|
msschlt 13 Sep 2008, 23:43
Ah, ok.. thx
|
|||
13 Sep 2008, 23:43 |
|
vid 14 Sep 2008, 00:56
in case you missed it: "rax" is 64bits = qword, not dword.
|
|||
14 Sep 2008, 00:56 |
|
Xorpd! 14 Sep 2008, 06:14
movzx rax, dword[rsi] is not encodable but there are a couple of variations:
Code: C:\Asm\FASM\EXAMPLES\WIN64\my_example>link /dump /disasm movzx.obj Microsoft (R) COFF/PE Dumper Version 8.00.50727.363 Copyright (C) Microsoft Corporation. All rights reserved. Dump of file movzx.obj File Type: COFF OBJECT _main: 0000000000000000: 63 06 movsxd eax,dword ptr [rsi] 0000000000000002: 8B 06 mov eax,dword ptr [rsi] 0000000000000004: C3 ret Summary 5 CODE fasm doesn't permit the former encoding. It would be an interesting feature to permit all possible encodings, and in this case it can make a difference because the two operations do in fact use different pipelines on some processors, but it has been considered too much work for too little return to implement alternate encodings like this. |
|||
14 Sep 2008, 06:14 |
|
msschlt 14 Sep 2008, 07:47
vid wrote: in case you missed it: "rax" is 64bits = qword, not dword. I want to mov with zero-ext. and zero the high 32bit. Like e.g. movzx eax, word [esi] in 32bit. But it's exactly like revolution says. mov eax, [rsi] ..in 64bit mode, it kills the high 32bit autom. I had thought the high 32bit remain unchanged. Ok, stupid question.. Is there a way to mov without loosing the high 32bit in 64bit mode? |
|||
14 Sep 2008, 07:47 |
|
Xorpd! 14 Sep 2008, 08:05
Quote:
Assuming you want to copy ebx into eax and don't care if you destroy rcx, the sequence Code: mov rcx, rax xor eax, ebx xor rax, rcx should do the trick. Alternative: Code: shrd rax, rbx, 32 ror rax, 32 |
|||
14 Sep 2008, 08:05 |
|
msschlt 14 Sep 2008, 08:09
Xorpd! wrote:
Thank you Xorpd! |
|||
14 Sep 2008, 08:09 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.