俺的第一个汇编程序,哈哈

作者在 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

默认分类 | 阅读 676 次
文章评论,共0条
游客请输入验证码
浏览51129次
文章分类