汇编区,好冷清啊,远没有c语言那么热闹,发个程序
输入字符串,按enter键结束,为了区别,我在末尾加了a程序代码:
DATAS SEGMENT str db 50 dup (?) DATAS ENDS CODES SEGMENT ASSUME CS:CODES,DS:DATAS START: MOV AX,DATAS MOV DS,AX mov cx,50 mov bx,0 loops: mov ah,1h int 21h cmp al,13 jz exit mov [str+bx],al inc bx loop loops exit: mov [str+bx],'a' mov [str+bx+1],'$' lea dx,str mov ah,9h int 21h MOV AH,4CH INT 21H CODES ENDS END START