Quote:
Originally Posted by jump
Very interesting news. I have read everywhere that inline assmbler isnt possible on x64 architecture.
Could you show us correct syntax for inline assembler which will Intel C++ Compiler accept ?
--
Jump
|
It is virtually the same as MSVC:
__asm mov rbx, rax;
or
__asm
{
...
}
emit format is:
__asm __emit 0xCC;
sample function:
Code:
__declspec(naked) int __fastcall strcmpW(const wchar_t *s1, const wchar_t *s2)
{
__asm {
push rdi
push rsi
mov rdi, rdx
mov rsi, rcx
or rcx, -1
xor rax, rax
repne scasw
not rcx
mov rdi, rdx
repe cmpsw
xor rdx, rdx
mov ax, [rsi - 2]
mov dx, [rdi - 2]
sub rax, rdx
pop rsi
pop rdi
ret
}
}