汇编源码--COMINT
敬业的IT人
互联网
佚名
2008-2-19 14:31:45
;Serial communications port interupt intercepter AHA 8502.27
;
;Functions:
;al=0 then Disable communications interupt vector
;al=1 then Enable communications interupt vector
;Issue and int 44h
;
progseg segment para public 'CODE'
publicsetcom
assumecs:progseg, ds:progseg, es:progseg
org100h
doscall equ21h
;
startup procfar
jmpsetup
;
setcomprocfar
pushds
pushes
pushdx
pushax
movax,cs
movds,ax
moves,ax
popax
cmpal,1;is function 1
jzenable;then enable
;
disable:
movdx,offset interupt ;get new vector address
movax,cs
movds,ax;set segment
movah,25h;set interupt vector address function
moval,14h;communications interupt vector
intdoscall ;set the interupt
jmpexit;exit
enable:
movdx,word ptr vector ;set old segment
movds,vector+2;set old communications vector
movah,25h;set interupt vector address function
moval,14h;communications interupt vector
intdoscall
exit:
popdx
popes
popds
;
interupt proc far
subax,ax;zero return status
iret
interupt endp
setcomendp
;
msgdb'Serial communications intercepter installed',0ah,0dh,'$'
msg1db'Serial communications intercepter is already installed',0ah,0dh,'$'
vectordb8 dup(0);only 4 needed 4 more for safety
;
setup:
movah,35h;get interupt vector address function
moval,44h;communications interupt vector
intdoscall ;go get it
cmpbx,0;check if vector used
jnzlderr;if used then exit
movax,es;check segment
cmpax,0
jnzlderr
;
movdx,offset msg
movah,9
intdoscall
;
movah,35h;get interupt vector address function
moval,14h;communications interupt vector
intdoscall ;go get it
;
movword ptr vector,bx ;save offset
movbx,es;get segment address
movword ptr vector+2,bx ;save segment
;
movdx,offset setcom ;get new vector address
movax,cs
movds,ax;set segment
movah,25h;set interupt vector address function
moval,44h;set to our new interupt vector
intdoscall ;set the interupt
;
movdx,offset setup ;terminate and stay resident
int27h
lderr:
movdx,offset msg1
movah,9
intdoscall
int20h
startup endp
progseg ends
;
endstartup
进入讨论组讨论。
- 最新文章
- 汇编源码--CLR[02-19]
- 汇编源码--CLOCK[02-19]
- 汇编源码--CLEAR[02-19]
- 汇编源码--CLEANF[02-19]
- 汇编源码--CLEAN[02-19]
- HELLO,WORLD进阶汇编程序系列[02-19]
- 相关文章
- 汇编源码--CLR[02-19]
- 汇编源码--CLOCK[02-19]
- 汇编源码--CLEAR[02-19]
- 汇编源码--CLEANF[02-19]
- 汇编源码--CLEAN[02-19]
- HELLO,WORLD进阶汇编程序系列[02-19]
