The MASM Forum Archive 2004 to 2012

Project Support Forums => 64 Bit Assembler => Topic started by: rags on March 28, 2012, 04:58:46 AM

Title: Annoyances of 64 bit
Post by: rags on March 28, 2012, 04:58:46 AM
Anyone have any idea why Intel or AMD thought it would be a good idea to sign extend an immediate
32 bit operand when using an AND?
For example:

mov rax, 0f1f2f3f4f5f6f7f8h
and rax, 0FF000000h

assembles as:

mov    rax, 0f1f2f3f4f5f6f7f8h
and     rax,0FFFFFFFFFF000000h

When all I want is the 4th byte of the low dword.
I know I can use the eax register to get the value I want, but is there a performance hit when switching
between the 32bit and 64bit registers?
And not being able to use immediate values greater than 32 bits, without first moving them into a register
is a real PITA.