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

首頁(yè) > 編程 > ASM > 正文

匯編語(yǔ)言直接定指標(biāo)的應(yīng)用實(shí)驗(yàn)16代碼

2019-11-10 19:04:19
字體:
來(lái)源:轉(zhuǎn)載
供稿:網(wǎng)友

代碼解釋如下:

;匯編語(yǔ)言王爽  直接定址表  實(shí)驗(yàn)16 assume cs:code,ds:data,ss:stackdata segment	db 128 dup(0)data  endsstack segment	db 128 dup(0)stack endscode segmentstart:				mov ax,stack					mov ss,ax					mov sp,128					call cpy_newInt7ch			;復(fù)制定義的新的int7ch中斷處理程序					call set_newInt7ch			;設(shè)置中斷向量表					mov ah,2					;初始化參數(shù),執(zhí)行哪個(gè)子程序					mov al,10111010B			;al存顏色參數(shù)					int 7ch						;執(zhí)行7ch中斷程序					mov ax,4c00h					int 21h;=========================================================	設(shè)置新的中斷程序new_int7ch:			jmp newInt7chStartTABLE				dw offset clear_screen 	- 	offset new_int7ch +7e00h	;記錄每個(gè)子程序的入口地址,參數(shù)0					dw offset set_PRe_screen - 	offset new_int7ch +7e00h	;參數(shù)1					dw offset set_back_screen - offset new_int7ch +7e00h	;參數(shù)2										dw offset set_up_scroll - 	offset new_int7ch +7e00h	;參數(shù)3newInt7chStart:		push bx					push es					push ax										mov bx,0					mov es,bx					mov bl,ah					add bx,bx					;存儲(chǔ)程序地址的是雙字,所以bx加倍					add bx,offset TABLE - offset new_int7ch + 7e00h					call Word ptr es:[bx]										pop ax					pop es					pop bx					iret										;中斷程序用iret返回					;=========================================================		清屏					clear_screen:		push cx					push bx					push es					push di					mov cx,2000					mov bx,0b800h					mov es,bx					mov di,0clearScreen:		mov es:[di],0700h					add di,2					loop clearScreen										pop di					pop es					pop bx					pop cx					ret;=========================================================		設(shè)置前景色set_pre_screen:		push cx					push bx					push es					push ax					mov cx,2000					mov bx,0b800h					mov es,bx					mov bx,1changePreColor:		and byte ptr es:[bx],11111000B					or byte ptr es:[bx],al					add bx,2					loop changePreColor										pop ax					pop es					pop bx					pop cx					ret;=========================================================		設(shè)置背景色set_back_screen:	push cx					push bx					push es					push ax										mov cx,2000					mov bx,0b800h					mov es,bx					mov bx,1changeBackColor:	and byte ptr es:[bx],10001111B					or byte ptr es:[bx],al					add bx,2					loop changeBackColor										pop ax					pop es					pop bx					pop cx					ret;=========================================================		向上滾動(dòng)一行set_up_scroll:		push bx					push es					push ds					push di					push si					push cx										mov bx,0b800h					mov es,bx					mov ds,bx					mov di,0					mov si,160					mov cx,24*160					rep movsb					mov cx,80setNull:			mov di,160*24								;設(shè)置最后一行為空					mov es:[di],0700h					add di,2					loop setNull										pop cx					pop si					pop di					pop ds					pop es					pop bx					ret;=========================================================					new_int7chEnd:		nop					;========================================================== 	復(fù)制中斷程序cpy_newInt7ch:		push ax					push ds					push si					push es					push di					push cx										mov ax,cs					mov ds,ax					mov si,offset new_int7ch					mov ax,0					mov es,ax					mov di,7e00h					mov cx,offset new_int7chEnd - offset new_int7ch					cld											;每次執(zhí)行后si,di加 1,					rep movsb										pop cx					pop di					pop es					pop si					pop ds					pop ax					ret;==========================================================	設(shè)置中斷向量表set_newInt7ch:		mov ax,0					mov es,ax					cli					mov word ptr es:[7ch*4],7e00h			;設(shè)置ip = 7e00					mov word ptr es:[7ch*4+2],0				;設(shè)置cs = 0000					sti					ret;==========================================================			code endsend start


發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表

圖片精選

主站蜘蛛池模板: 茶陵县| 扶风县| 金塔县| 荃湾区| 内江市| 东兰县| 宝丰县| 井陉县| 巴东县| 平山县| 黄浦区| 长宁区| 清河县| 延川县| 广宗县| 永福县| 临汾市| 壤塘县| 兖州市| 大同县| 东宁县| 株洲县| 宁陵县| 英德市| 剑川县| 白玉县| 达拉特旗| 邻水| 南乐县| 莲花县| 黄浦区| 申扎县| 岚皋县| 黑龙江省| 汽车| 侯马市| 罗山县| 普兰店市| 黄浦区| 平谷区| 威信县|