求助:(汇编语言)程序运行后,清屏,提示输入字符串
盼望好心的高人帮忙编写:(用汇编语言)题目:程序运行后,清屏,提示输入字符串(字符串字数大于5),按回车键后,以一定的速率逐个字符从上往下掉。
CODE SEGMENT ASSUME CS:CODE,DS:CODE START: PUSH CS POP DS MOV AX,0600H MOV BH,07 XOR CX,CX MOV DH,24 MOV DL,79 INT 10H MOV AH,2 MOV DX,0020H INT 10H MOV AH,09H MOV BH,0 MOV CX,1 MOV BL,07H DROP: MOV AL,'A' INT 10H CALL DELAY MOV AL,' ' INT 10H INC DH CALL SETCUR CMP DH,20 JB DROP MOV AL,'A' INT 10H MOV AH,0 INT 16H MOV AH,4CH INT 21H DELAY PROC NEAR PUSH CX MOV CX,6400H DELAY1: PUSH CX MOV CX,7800H DELAY2: LOOP DELAY2 POP CX LOOP DELAY1 POP CX RET DELAY ENDP SETCUR PROC NEAR PUSH AX MOV AH,2 INT 10H POP AX RET SETCUR ENDP CODE ENDS END START 一个字符的下落,自己扩展下就行了
PUSHAL MACRO PUSH AX PUSH BX PUSH CX PUSH DX ENDM POPAL MACRO POP DX POP CX POP BX POP AX ENDM DATA SEGMENT MSG DB 'PLEASE INPUT A STRING: ','$' BUF DB 50 DB ? DB 50 DUP(0) DATA ENDS CODE SEGMENT ASSUME CS :CODE,DS:DATA START: MOV AX,DATA MOV DS,AX MOV DX,OFFSET MSG MOV AH,9 INT 21H MOV AH,0AH MOV DX,OFFSET BUF INT 21H XOR CH,CH MOV CL,BUF+1 CALL CLRSCR MOV BH,0 MOV DH,0 MOV DL,30 MOV AH,2 INT 10H MOV SI,OFFSET BUF+2 PRINT: LODSB MOV AH,2 MOV DH,0 INT 10H DROP: CALL PUTCH CALL DELAY CALL ERASE INC DH CALL SETCUR CMP DH,20 JB DROP CALL PUTCH INC DL LOOP PRINT MOV AH,0 INT 16H MOV AH,4CH INT 21H CLRSCR PROC NEAR PUSHAL MOV BH,0 MOV AX,0600H MOV BL,7 MOV CX,0 MOV DH,24 MOV DL,79 INT 10H POPAL RET CLRSCR ENDP PUTCH PROC NEAR PUSHAL MOV AH,9 MOV BH,0 MOV BL,7 MOV CX,1 INT 10H POPAL RET PUTCH ENDP DELAY PROC NEAR PUSHAL MOV CX,04000H DELAY1: PUSH CX MOV CX,03000H DELAY2: LOOP DELAY2 POP CX LOOP DELAY1 POPAL RET DELAY ENDP ERASE PROC NEAR PUSHAL MOV AH,9 MOV AL,' ' MOV BH,0 MOV BL,7 MOV CX,1 INT 10H POPAL RET ERASE ENDP SETCUR PROC NEAR PUSHAL MOV AH,2 INT 10H POPAL RET SETCUR ENDP CODE ENDS END START