|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
assume cs:code
code segment
start:
mov ax,cs
mov ds,ax
mov ax,0
mov es,ax
mov si,offset int7c ;将新的int 7ch中断程序传入0:200处
mov di,200h
mov cx,offset int7cend-offset int7c
cld
rep movsb
;在中断向量表中设置新的int 7ch中断例程的入口地址
cli
mov word ptr es:[7c*4+2],0
mov word ptr es:[7c*4],200h
sti
mov ax,4c00h
int 21h
;新的int 7c中断例程?
org 200h ;有些网友说要加上org,但是加了还是不行啊
int7c:
jmp short s
data dw sub1-s+200h,sub2-s+200h,sub3-s+200h,sub4-s+200h
s: push bx
cmp ah,3
ja ok ;判断ah中的功能号是否大于3
mov bl,ah
mov bh,0
add bx,bx ;计算对应子程序在data表中的偏移
call word ptr data[bx] ;调用对应的功能子程序
ok: pop bx
iret
;功能:清屏
sub1: push ax
push es
push di
push cx
mov ax,0b800h
mov es,ax
mov cx,2000
mov di,0
s5: mov byte ptr es:[di],' '
add di,2
loop s5
pop cx
pop di
pop es
pop ax
ret
;设置前景色,al传送颜色值,(al)∈{0,1,2,3,4,5,6,7}
sub2: push ax
push es
push bx
push di
mov bl,al
mov ax,0b800h
mov es,ax
mov di,1
mov cx,2000
s0: and byte ptr es:[di],11111000b
or es:[di],bl
add di,2
loop s0
pop di
pop bx
pop es
pop ax
ret
;设置背景色,al传送颜色值,(al)∈{0,1,2,3,4,5,6,7}
sub3: push ax
push es
push bx
push di
mov cl,4
shl al,cl
mov bl,al
mov ax,0b800h
mov es,ax
mov di,1
mov cx,2000
s1: and byte ptr es:[di],10001111b
or es:[di],bl
add di,2
loop s1
pop di
pop bx
pop es
pop ax
ret
;向上滚动一行
sub4: push ax
push di
push bx
push si
push ds
mov ax,0b800h
mov es,ax
mov ds,ax
mov si,160
mov di,0
cld
mov cx,24
s2: push cx
mov cx,160
rep movsb
pop cx
loop s2
mov cx,80
s3: mov byte ptr es:[160*24+si],' '
add di,2
loop s3
pop ds
pop si
pop bx
pop di
pop ax
ret
int7cend:nop
code ends
end start
我这个程序哪里错了啊,编译过了,但是测试的时候,总是跳不到int 7ch中断显示
希望大家帮帮忙啊
|
|