我正在使用这个组件http://sourceforge.net/projects/tponguard/ 现在我需要在 64 位中编译。我被困在这个大会上。
是这样的:
push esi
push edi
mov esi, eax //esi = Mem1
mov edi, edx //edi = Mem2
push ecx //save byte count
shr ecx, 2 //convert to dwords
jz @Continue
cld
@Loop1: //xor dwords at a time
mov eax, [edi]
xor [esi], eax
add esi, 4
add edi, 4
dec ecx
jnz @Loop1
@Continue: //handle remaining bytes (3 or less)
pop ecx
and ecx, 3
jz @Done
@Loop2: //xor remaining bytes
mov al, [edi]
xor [esi], al
inc esi
inc edi
dec ecx
jnz @Loop2
@Done:
pop edi
pop esi
我改为:
push rsi
push rdi
mov rsi, rax //esi = Mem1
mov rdi, rdx //edi = Mem2
push rcx //save byte count
shr rcx, 2 //convert to dwords
jz @Continue
cld
@Loop1: //xor dwords at a time
mov rax, [rdi]
xor [rsi], rax
add rsi, 4
add rdi, 4
dec rcx
jnz @Loop1
@Continue: //handle remaining bytes (3 or less)
pop rcx
and rcx, 3
jz @Done
@Loop2: //xor remaining bytes
mov al, [rdi]
xor [rsi], al
inc rsi
inc rdi
dec rcx
jnz @Loop2
@Done:
pop rdi
pop rsi
但是现在我在 xor [rsi], rax 中遇到了访问冲突