汇编试验十五:安装新的int 9中断例程
安装新的int 9中断例程(按'A'键后显示满屏幕的'A')
int 9 是外中断,同样,程序编写还是和其他中断例程类似,安装(复制),调用;
不同点是在于,他要从端口读取数据60h,
Source Code :
![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
assume cs:code stack segment db 128 dup(0) stack ends code segment start: mov ax,stack mov ss,ax mov sp,128 push cs pop ds mov si,offset int9start mov ax,0 mov es,ax mov di,204h mov cx,offset int9end - offset int9start cld rep movsb push es:[9*4] pop es:[200h] push es:[9*4+2] pop es:[202h] cli mov word ptr es:[9*4],204h mov word ptr es:[9*4+2],0h sti mov ax,4c00h int 21h int9start: push ax push cx push es push di pushf call dword ptr cs:[200h] in al,60h cmp al,1eh+80h jne ok mov cx,2000 mov ax,0b800h mov es,ax mov di,0 s: mov byte ptr es:[di],'A' mov byte ptr es:[di+1],2 add di,2 loop s ok: pop di pop es pop cx pop ax iret int9end: nop code ends end start
实验效果: