Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .intel_syntax noprefix
- .global remove_spaces_asm16
- .section .mydata, "a"
- maps:
- .incbin "map.bin"
- shifts = maps + 0x10000*16
- spaces16:
- .fill 16, 1, 0x20
- .text
- remove_spaces_asm16:
- // char* remove_spaces_asm16(char *in, char *out, unsigned int count);
- // rdi, rsi, rdx
- vmovdqu xmm2, [spaces16]
- 1:
- vmovdqu xmm0, [rdi]
- vpcmpeqb xmm1, xmm2, xmm0
- vpmovmskb rax, xmm1
- movzx ecx, byte ptr [shifts + rax]
- shl eax, 4
- vpshufb xmm0, xmm0, [maps + rax]
- vmovdqu [rsi], xmm0
- add rdi, 16
- add rsi, rcx
- sub rdx, 16
- jne 1b
- mov rax, rsi
- ret
Advertisement
Add Comment
Please, Sign In to add comment