On 07/14/16 19:14, Paolo Bonzini wrote:
> 
> 
> On 14/07/2016 19:11, Laszlo Ersek wrote:
>> * I didn't say, but I also tried "mov ax, ds". The SDM writes, "The
>>   upper 56 bits or 48 bits (respectively) of the destination
>>   general-purpose register are not modified by the operation". In this
>>   context, those bits were known to be zero, and I hoped that NASM 2.07
>>   might support a 16->16 MOV.
>>
>> I vaguely recall that I tried "mov eax, ds" too (it may have been my
>> very first try, I don't remember any longer). I think "mov ax, ds" was
>> my second try, and "movzx eax, ds" the third?...
>>
>> However, none of these work, because NASM 2.07 (apparently) lacks the
>> *general* ability to MOV from/to segment registers in 64-bit mode.
> 
> Ugh, this is so wrong. :)  I guess you could also use a macro that
> expands to
> 
>       bits 32
>       mov  src, dst
>       bits 64
> 
> because the encoding is the same in 32-bit and 64-bit.

Nice trick :), but the point of using NASM would be to avoid such hacks,
and to say what we mean, on Windows and Linux build hosts identically.

Thanks!
Laszlo

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to