编程,删除一个字符串中的所有空格,并送回原存储单元
DATA SEGMENT
STRING DB 'a b c$'
DATA ENDS
CODE SEGMENT
ASSUME CS:CODE,DS:DATA
START: MOV AX,DATA
MOV DS,AX
MOV SI,OFFSET STRING
MOV DI,SI
CALL DELSPACE
MOV DX,OFFSET STRING
MOV AH,09H
INT 21H
MOV AH,4CH
INT 21H
DELSPACE PROC
PUSH AX
NEXT: MOV AL,[SI]
INC SI
CMP AL,24H
JZ EXIT
CMP AL,20H
JZ NEXT
MOV [DI],AL
INC DI
JMP NEXT
EXIT: POP AX
RET
DELSPACE ENDP
CODE ENDS
END START
结果应该输出abc,但却输出abcc??