作者在 2010-04-25 22:09:08 发布以下内容
;程序功能:从键盘读入一行数据并显示
DAT SEGMENT
STRING DB 100,0,100 DUP(?)
ENT DB 0AH,0DH,'$'
PRINTF DB 'INPUT A STING TO TEST!','$'
STAR DB '------------------'
DB 'THIS IS A DEVIDE LINE'
DB '------------------','$'
MESS DB '**'
DB 'THIS IS A PROGRAMME BY SPYGG'
DB '**','$'
DAT ENDS
COD SEGMENT
ASSUME CS: COD,DS: DAT
START:
MOV AX,DAT
MOV DS,AX
LEA DX,MESS
MOV AH,09H
INT 21H
LEA DX,ENT
MOV AH,09H
INT 21H
;Print a line to remind user
LEA DX,PRINTF
MOV AH,09H
INT 21H
LEA DX,ENT
MOV AH,09H
INT 21H
;
TITLE INPUT & DISPLAY
LEA DX,STRING
MOV AH,0AH
INT 21H
XOR CL,CL
MOV CL,STRING+1
XOR CH,CH
ADD DX,CX
MOV BX,DX
MOV BYTE PTR[BX+2],'$'
; ENTER NEXT LINE
LEA DX,ENT
MOV AH,09H
INT 21H
LEA DX,STAR
MOV AH,09H
INT 21H
LEA DX,ENT
MOV AH,09H
INT 21H
; PRINT THE LINE THAT USER TYPED
LEA DX,STRING+2
MOV AH,09H
INT 21H
MOV AH,4CH
INT 21H
COD ENDS
END START