国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > ASM > 正文

匯編語言自定義int9中斷程序

2019-11-10 19:36:48
字體:
供稿:網(wǎng)友
代碼解釋如下:
;改變int9中斷例程改變它的中斷處理程序assume cs:codestack segment	db 128 dup(0)stack endscode segment	start:			mov ax,stack				mov ss,ax				mov sp,128				call cpy_new_int9							;復(fù)制自定義的int9程序				call save_int9								;保存原有的int9程序的入口地址:cs:ip				call set_new_int9							;設(shè)置中斷向量表loopInput:		mov ax,100h				jmp loopInput				call set_old_int9							;原來的int9的中斷程序入口地址恢復(fù)				mov ax,4c00h				int 21h;========================================================	;恢復(fù)int9本來的中斷向量表set_old_int9:	mov ax,0				mov es,ax				cli				mov Word ptr es:[9*4],[200h]				mov word ptr es:[9*4+2],[202h]				sti				ret;========================================================   ;設(shè)置新的中斷向量表set_new_int9:	push ax				push es								mov ax,0				mov es,ax				cli											;屏蔽外中斷				mov word ptr es:[9*4],7E00h				mov word ptr es:[9*4+2],0				sti				pop es				pop ax				ret;========================================================	;保存原來的int9中斷程序的地址,ip與cs到0000:0200處save_int9:		push ax				push es				mov ax,0				mov es,ax				cli				push es:[9*4]				pop es:[200h]				push es:[9*4+2]				pop es:[202h]				sti				pop es				pop ax				ret;========================================================	;新的int9中斷處理程序new_int9:		push ax				in al,60h									;讀取60h號端口接受到的一個掃描碼				pushf				call dword ptr cs:[200h]					;因為這段代碼是要復(fù)制到0000:0200h,所以cs = 0000,將原來的int9的中斷處理程序的地址保存到棧中				cmp al,3Bh									;按下的是否是F1鍵				jne new_int9Ret				call change_colornew_int9Ret:	pop ax				iret										;pop ip,pop cs,popf ,執(zhí)行完這句,cs:ip = 0000:0200h,程序其實就去執(zhí)行int9的中斷處理程序去了		;========================================================change_color:	push ax				push es				push cx				push bx								mov ax,0B800h				mov es,ax				mov cx,2000				mov bx,1changeColor:	inc byte ptr es:[bx]				add bx,2				loop changeColor								pop bx				pop cx				pop es				pop ax				retnew_int9End:	nop						;========================================================	;復(fù)制int9程序,將ds:si處的程序復(fù)制到es:di處,cpy_new_int9:	mov ax,cs				mov ds,ax				mov si,offset new_int9				mov di,7E00h				mov ax,0				mov es,ax				mov cx, offset new_int9End - offset new_int9	;復(fù)制的次數(shù)				cld											;cf  = 0 ,每次操作后si、di遞增				rep movsb				ret;========================================================			code endsend start
發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表

圖片精選

主站蜘蛛池模板: 松潘县| 政和县| 徐州市| 自贡市| 罗定市| 德清县| 新野县| 揭阳市| 康保县| 道孚县| 华安县| 仙居县| 固原市| 隆尧县| 松阳县| 安泽县| 丹巴县| 荔波县| 凤山市| 仪陇县| 荥经县| 林芝县| 长泰县| 电白县| 凤山市| 南城县| 如皋市| 建始县| 齐齐哈尔市| 肃南| 和平区| 西乌| 合肥市| 莆田市| 林周县| 四子王旗| 宣化县| 白河县| 永善县| 唐海县| 锡林浩特市|