用汇编语言编写一个程序,实现一下功能:如果用户输入abc,则显示abc,如果用户输入0,则退出程序。。。求解啊!要完整的代码噢
------解决方案--------------------------------------------------------
- Assembly code
.386STACK SEGMENT USE16 STACK DB 200 DUP(0)STACK ENDS;DATA SEGMENT USE16BUF DB 100 DB ? DB 100 DUP(0)CRLF DB 0AH,0DH,'$'DATA ENDS;CODE SEGMENT USE16 ASSUME CS:CODE, DS:DATA, SS:STACKBEGIN: MOV AX, DATA MOV DS, AX LEA DX, BUF MOV AH, 10 INT 21H CMP BUF+1, 1 JA CON CMP [BUF+2],'0' JNE CON JMP EXITCON: LEA DX, CRLF MOV AH, 9 INT 21H MOV BL, BUF+1 MOV BH, 0 MOV BYTE PTR BUF[BX+2],'$' LEA DX, BUF+2 MOV AH, 9 INT 21H JMP BEGINEXIT: MOV AH, 4CH INT 21HCODE ENDS END BEGIN