汇编语言实验15(王爽 第三版)安装新的int 9中断例程

提示,.按下一个键时产生的扫描码称为通码,松开一个键产生的扫描码称为断码。断码一通码十80h

assume cs:code
stack segment
 db 128 dup (0)
stack ends
code segment
start: mov ax,stack
       mov ss,ax
       mov sp,128
;--------------------set adtess
       push cs
       pop ds
       mov si,offset newint9

       mov ax,0
       mov es,ax
       mov di,204h
;----------------copy newint9 code
       cli
       mov cx,offset newint9end-newint9
       cld 
       rep movsb 
       sti
 ;--------------------set table
       cli
       mov ax,es:[4*9]
       mov es:[200h],ax
       mov ax,es:[4*9+2]
       mov es:[202h],ax
      
       mov word ptr es:[4*9],204h
       mov word ptr es:[4*9+2],0
       sti
       
       cycle:   mov ax,1000
                jmp short cycle
       mov ax,4c00h
       int 21h
 ;-------------------------
 ;--------------------------
newint9: push ax
         push bx
	 push cx
	 push es

         in al,60h

	 pushf
	 call dword ptr cs:[200h]
         
	 cmp al,1h+80h
	 jne int9ret 
	
	 mov ax,0b800h
	 mov es,ax
	 mov bx,0
	 mov cx,2000
      s: mov byte ptr es:[bx],'A'
         add bx,2
	 loop s

int9ret: pop es
         pop cx
	 pop bx
	 pop ax
         iret
newint9end:nop

 code ends
 end start

发布日期:

所属分类: 编程, 编程语言 标签:


没有相关文章!