键盘中断调用的举例,以及显示器中断调用的例子

源代码在线查看: a11.asm

软件大小: 3 K
上传用户: budyang
关键词: 中断 键盘 举例 显示器
下载地址: 免注册下载 普通下载 VIP

相关代码

				;键盘及显示器中断调用举例,书P110/4.6
				WWidth=40
				WLeftTopLine=10
				WLeftTopRow=20
				WRightBottomLine=20
				WRightBottomRow=WLeftTopRow+WWidth-1
				Collor=70H
				CR=0DH
				LF=0AH
				STACKSG SEGMENT STACK 'S'
				        DW 64 DUP('ST')
				STACKSG ENDS
				DATA SEGMENT
				STRING DB 'This is a example to call interrupt 10H.'
				CT EQU $-STRING
				DATA ENDS
				CODE SEGMENT
				     ASSUME CS:CODE,DS:DATA,ES:DATA,SS:STACKSG
				MAIN PROC FAR
				     MOV AX,DATA
				     MOV DS,AX
				     MOV ES,AX
				     MOV AH,0
				     MOV AL,3
				     INT 10H
				     MOV AH,6
				     MOV AL,0
				     MOV BH,1FH
				     MOV CX,0
				     MOV DX,184FH
				     INT 10H
				     MOV AH,6
				     MOV AL,0
				     MOV BH,Collor
				     MOV CH,WLeftTopLine
				     MOV CL,WLeftTopRow
				     MOV DH,WRightBottomLine
				     MOV DL,WRightBottomRow
				     INT 10H
				     MOV AH,2
				     MOV BH,0
				     MOV DH,WRightBottomLine
				     MOV DL,WLeftTopRow
				     INT 10H
				     MOV AH,9
				     MOV AL,'*'
				     MOV BH,0
				     MOV BL,0EH
				     MOV CX,1
				     INT 10H
				     MOV AH,0EH
				     MOV AL,CR
				     INT 10H
				     MOV AH,0EH
				     MOV AL,LF
				     INT 10H
				     MOV AH,3
				     MOV BH,0
				     INT 10H
				     CMP DH,WRightBottomLine+1
				     JNE L1
				     MOV AH,6
				     MOV AL,1
				     MOV BH,Collor
				     MOV CH,WLeftTopLine
				     MOV CL,WLeftTopRow
				     MOV DH,WRightBottomLine
				     MOV DL,WRightBottomRow
				     INT 10H
				     MOV AH,2
				     MOV BH,0
				     MOV DH,WRightBottomLine
				     MOV DL,WLeftTopRow
				     INT 10H
				L1:  MOV AH,9
				     MOV AL,STRING
				     MOV BH,0
				     MOV BL,4FH
				     MOV CX,1
				     INT 10H
				     MOV AH,0
				     INT 16H
				     MOV AH,13H
				     MOV AL,1
				     MOV BH,0
				     MOV BL,Collor
				     MOV CX,CT
				     MOV DH,WRightBottomLine
				     MOV DL,WLeftTopRow+1
				     LEA BP,STRING+1
				     INT 10H
				     MOV AH,0
				     INT 16H
				     MOV AH,4CH
				     INT 21H
				MAIN ENDP
				CODE ENDS
				     END MAIN
							

相关资源