新手入门
为什么输入字符后会出现一堆乱码
源代码
DATA SEGMENT
STR DB 'PRESS ANY KEY TO CONTINUE', '$'
DATA ENDS
CODE SEGMENT
ASSUME CS:CODE,DS:DATA
MAIN:
MOV AH,01H
INT 21H
MOV DL,AL
MOV AH,02H
INT 21H
MOV DX,OFFSET STR
MOV AH,09H
INT 21H
MOV AH,01H
INT 21H
MOV AH,4CH
INT 21H
CODE ENDS
END MAIN
------解决方案--------------------
stack segment stack//
dw 32 dup(?)//
stack ends//
DATA SEGMENT
STR DB 'PRESS ANY KEY TO CONTINUE $'
DATA ENDS
CODE SEGMENT
ASSUME CS:CODE,DS:DATA,ss:stack
MAIN proc far//
push ds//
sub ax,ax//
mov ax,data//
mov ds,ax//
MOV AH,01H
INT 21H
MOV DL,AL
MOV AH,02H
INT 21H
MOV DX,OFFSET STR
MOV AH,09H
INT 21H
MOV AH,01H
INT 21H
MOV AH,4CH
INT 21H
main endp//
code ends//
end main//
改成这样就可以了,注释处是要改。