|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
assume cs:code
code segment
start: mov ax,0
mov es,ax
mov di,200h
mov ax,cs
mov ds,ax
mov si,offset int7ch
mov cx,offset int7chend - offset int7ch
cld
rep movsb
mov word ptr es:[7ch*4],200h
mov word ptr es:[7ch*4+2],0
mov ax,4c00h
int 21h
int7ch:
jmp istart
table dw do1,do2,do3,do4
istart: push ax
push bx
push dx
mov bl,ah
mov bh,0
cmp bl,3
ja bye ;提取BH中的功能号,并进行比对是否大于3,大于则跳出
mov ah,0
push ax
pop dx
add bx,bx
call word ptr table[bx] ;跳转到相应功能对应的偏移地址
bye: pop dx
pop bx
pop ax
iret
do1: push ax
push cx
push es
push di
mov ax,0b800h
mov es,ax
mov di,0
mov cx,2000
do1s: mov byte ptr es:[di],' '
add di,2
loop do1s ;清屏
pop di
pop es
pop cx
pop ax
ret
do2: push ax
push cx
push es
push di
mov ax,0b800h
mov es,ax
mov di,1
mov cx,2000
do2s: and byte ptr es:[di],11111000b ;先将前景色置0,再修改前景色
or es:[di],dl
add di,2
loop do2s ;修改前景色
pop di
pop es
pop cx
pop ax
ret
do3: push ax
push cx
push es
push di
push dx
mov ax,0b800h
mov es,ax
mov di,1
mov cx,4
shl dl,cl
mov cx,2000
do3s: and byte ptr es:[di],10001111b
or es:[di],dl
add di,2
loop do3s ;设置背景色
pop dx
pop di
pop es
pop cx
pop ax
ret
do4: push ax
push cx
push es
push di
push ds
push si
mov ax,0b800h
mov es,ax
mov ds,ax
mov si,160
mov di,0
cld
mov cx,24
s0: push cx
mov cx,160
rep movsb
pop cx
loop s0
mov cx,80
s1: mov byte ptr [si],' '
add si,2
loop s1
pop si
pop ds
pop di
pop es
pop cx
pop ax ;向上滚动一行
int7chend:
nop
code ends
end start
在新的INT7ch中断中,call会call到别的地址,求解为什么会出现这样的结果? |
|