安装新的int 9中断例程(按'A'键后显示满屏幕的'A')
int 9 是外中断,同样,程序编写还是和其他中断例程类似,安装(复制),调用;
不同点是在于,他要从端口读取数据60h,
Source Code :
assume cs:codestack segmentdb 128 dup(0) stack endscode segmentstart:mov ax,stackmov ss,axmov sp,128push cspop dsmov si,offset int9startmov ax,0mov es,axmov di,204hmov cx,offset int9end - offset int9startcldrep movsbpush es:[9*4]pop es:[200h]push es:[9*4+2]pop es:[202h]climov word ptr es:[9*4],204hmov word ptr es:[9*4+2],0hstimov ax,4c00hint 21hint9start:push axpush cxpush espush dipushfcall dword ptr cs:[200h]in al,60hcmp al,1eh+80hjne okmov cx,2000mov ax,0b800hmov es,axmov di,0s:mov byte ptr es:[di],'A'mov byte ptr es:[di+1],2add di,2loop sok:pop dipop espop cxpop axiretint9end:nopcode ends end start
实验效果: