汇编剔除字符串中的空格

来源:互联网 发布:电话网络诈骗怎么办 编辑:程序博客网 时间:2024/05/02 04:55
include io32.inc.datastring byte 'Let us hava a try ! ',0dh,0ah,0.codestart:mov eax, offset stringcall dispmsg;call dispcrlfmov ecx, lengthof string     ; 从字符串末尾向前遍历mov esi, offset stringadd esi, ecxoutlp:cmp byte ptr [esi], ' 'jnz nextmov edi, esiinlp:mov al, [edi+1]mov [edi],alinc edicmp byte ptr [edi],0jnz inlpnext:dec esicmp esi, offset stringjz doneloop outlpdone:mov eax, offset stringcall dispmsgexit 0end start

原创粉丝点击