include io32.inc
.data
string byte 'Let us hava a try ! ',0dh,0ah,0
.code
start:
mov eax, offset string
call dispmsg
;call dispcrlf
mov ecx, lengthof string ; 从字符串末尾向前遍历
mov esi, offset string
add esi, ecx
outlp: cmp byte ptr [esi], ' '
jnz next
mov edi, esi
inlp:
mov al, [edi+1]
mov [edi],al
inc edi
cmp byte ptr [edi],0
jnz inlp
next: dec esi
cmp esi, offset string
jz done
loop outlp
done: mov eax, offset string
call dispmsg
exit 0
end start
汇编剔除字符串中的空格
最新推荐文章于 2022-05-31 11:58:47 发布