_memcpy_r SEGMENT
memcpy_r PROC
mov r10, rdi
mov r11, rsi
mov rdi, rcx
mov rsi, rdx
mov rcx, r8
shr rcx, 3
rep movsq
mov rcx, r8
and rcx, 7
rep movsb
mov rsi, r11
mov rdi, r10
ret
memcpy_r ENDP
_memcpy_r ENDS
END
I have the above code in a .asm file which I'm using in a Visual Studio 2010 project. It's set to compile using the Microsoft Macro Assembler (ml64.exe). The program crashes with an access violation exception on the first line of the procedure (mov r10, rdi). Does anyone know why?
EDIT: I should clarify. If I remove the first line, the exception still occurs on the next. If I remove that, it occurs on the next (mov rdi, rcx).