ideal
model small
stack 1024
dataseg
array1 db 11 dup(?)
codeseg
org 100h
PROC MAIN
CALL GETINPUT
CALL PRINTARRAY
EXIT:
mov ah, 4ch
int 21h
ENDP
PROC PRINTARRAY
lea dx, [array1]
mov ah, 9
int 21h
ret
ENDP
PROC GETINPUT
mov bx, offset array1
GET:
CALL GETCHAR
cmp al, '.'
je ENDGET
mov [array1+bx], al
inc bx
cmp bx, 10
jge ENDGET
CALL PRINTSPACE
jmp GET
ENDGET:
mov [array1+bx], '$'
ret
ENDP
PROC GETCHAR
mov ah, 1
int 21h
ret
ENDP
PROC PRINTSPACE
mov dl, ' '
mov ah, 2
int 21h
ret
ENDP
PROC PRINTCHAR
mov ah, 2
int 21h
ret
ENDP
END MAIN
添加“$”时出现 NTVDM 错误 cs:0423 ip:0125。没有哨兵,我无法打印没有垃圾和其他字符的数组。:( 我不知道是因为我的操作系统、windows 7 32bit 还是汇编程序。请帮助我。:(