NASM - The Netwide Assembler
NASM Forum => Programming with NASM => Topic started by: axper on February 04, 2014, 08:26:20 AM
-
Can't understand what I am doing wrong here
global main
SECTION .bss
number:
resq 1
SECTION .text
main:
subsd xmm2, qword [rbx]
; Exit
mov rbx, 0
mov rax, 1
int 0x80
Compiling with
nasm -felf64 file.asm
The manual (http://"http://http://www.intel.com/content/www/us/en/architecture-and-technology/64-ia-32-architectures-software-developer-vol-2b-manual.html") says this about subsd:
Subtracts the low double-precision floating-point value in the source operand (second operand) from the low
double-precision floating-point value in the destination operand (first operand), and stores the double-precision
floating-point result in the destination operand. The source operand can be an XMM register or a 64-bit memory
location. The destination operand is an XMM register. The high quadword of the destination operand remains
unchanged.
My second operand is a 64-bit memory location. What's wrong here?
-
Hi!
You have to specify - only a memory location.
It compiles fine without "qword", like this:
subsd xmm2,[rbx]
-
That worked, thank you!
-
XMM registers are 128 bit, so you have to use oword or nothing.