汇编语言第3版实验13

assume cs:code

code segment
start:
	mov ax,cs
	mov ds,ax
	mov si,offset intFunction
	mov ax,0
	mov es,ax
	mov di,200h	;intFunction安装到0:200处
	mov cx,offset intFunctionEnd-offset intFunction ;求出例程的大小
	cld 
	rep movsb ;正向传送例程到指定地址

	;设置新的中断向量表
	mov ax,0
	mov es,ax
	mov word ptr es:[7ch*4],200h  ;默认为修改0号例程 改为运行200h处的新例程
	mov word ptr es:[7ch*4+2],0
	
	mov ax,4c00h
	int 21h
  
intFunction:
	push ax
	push bx
	mov ax,0b800h
	mov es,ax

	mov bh,dh
	mov al,0A0h  
	mul bh		;行*160

	mov dh,0
	add ax,dx	;加列
	mov di,ax

	;保存颜色
	mov ch,0
	mov bx,cx

	
s:	mov al,ds:[si]
	mov ah,0
	mov cx,ax
	jcxz exit
	mov ah,bl
	mov es:[di],ax
	inc si
	add di,2
	
	loop s
exit:
	
	pop bx
	pop ax
	iret

intFunctionEnd:
	nop
code ends
end start	







猜你喜欢

转载自blog.csdn.net/duling2/article/details/84311772