[英]Moving a quadword number to xmm registers
I am trying to move a number in a 64-bit register to an xmm register to do arithmetic. 我试图将64位寄存器中的数字移动到xmm寄存器来进行算术运算。 My thinking was:
我的想法是:
movq xmm1, r14
In my program r14 is holding the counter and I need it to get moved into xmm1 so I can divide it with the sum of numbers i have stored in xmm0. 在我的程序中,r14持有计数器,我需要它移动到xmm1,所以我可以将它除以我存储在xmm0中的数字之和。 And then display it.
然后显示它。
When I execute the code, it stores 0 into xmm1. 当我执行代码时,它将0存储到xmm1中。
Someone please help. 有人请帮忙。
I created test.asm
as: 我创建了
test.asm
:
section .code
global _start
_start:
mov r14,0x123456789abcdef0
movq xmm1, r14
int 3
Compiled and linked with: 编译并链接:
nasm.exe -f win64 -o test.obj test.asm
link.exe test.obj /entry:_start /subsystem:console
And ran it under the 64-bit WinDbg. 并在64位WinDbg下运行它。 When it hit the
int 3
WinDbg showed the registers as: 当它击中
int 3
WinDbg显示寄存器为:
r14 123456789abcdef0
xmm1 0.000000e+000: 0.000000e+000: 5.690457e-028:-7.811515e-023
xmm1/0 9abcdef0
xmm1/1 12345678
xmm1/2 0
xmm1/3 0
xmm1l 1234:5678:9abc:def0
xmm1h 0:0:0:0
...and having typed all of that, is it possible that you are looking at xmm1
as a floating point instead of integer values? ...并且键入了所有这些内容,您是否可能将
xmm1
视为浮点而不是整数值?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.