Author Topic: MASM to NASM , segmentation fault on movdqu  (Read 9316 times)

Offline rouki

  • Jr. Member
  • *
  • Posts: 5
MASM to NASM , segmentation fault on movdqu
« on: July 15, 2014, 03:40:08 PM »
Hey,

The following line leads to a segmentation fault: movdqu  xmm0, [rcx]

This line works fine in MASM but not in NASM. What am I missing? What should I supply nasm in order for that command to work properly?

thanks

Offline encryptor256

  • Full Member
  • **
  • Posts: 250
  • Country: lv
  • Win64 .
    • On Youtube: encryptor256
Re: MASM to NASM , segmentation fault on movdqu
« Reply #1 on: July 15, 2014, 06:41:58 PM »
Hi!

No seg fault for me.

Works without fault's.

Code: [Select]
bits 64
section .data

align 16
message0: db "HeLLO 123!!!",13,10,0

align 16
number: dq 0

section .text

global main

extern printf


align 16

main:
sub rsp,0x28

mov rcx,number
movdqu xmm0,[rcx]

mov rcx,message0
call printf

add rsp,0x28
ret

"nasm.exe -f win64 code.asm -o code.obj"

"gcc code.obj -o code.exe"
Encryptor256's Investigation \ Research Department.