- [starrynight] 注:我只注意到了结果为90H,此时最高位为1,但是忘了结果是整个ax寄存器,而不仅仅是al。所以最后 04/24 22:31
- [游客] Dei ho <a href='http://无效链接' >nelle inmobiliarias 02/26 08:34
- [游客] Questi http://无效链接/friuli-venezia-giulia-incontro 02/26 05:44
- [游客] Abbiamo http://无效链接 centro tre <a href='http://无效链 02/26 00:56
- [游客] Da http://无效链接 stesso altri <a href='http://无效链接' 02/25 08:32
- [游客] Sarebbe meno <a href='http://无效链接' >pop rock degli 02/21 01:18
- [游客] 学习了,比较写得好! 01/13 10:42
- [mouse] 博主没有自己debug看吧,结果不对 01/12 08:49
- [lijangwei] 我也是这样想的 12/12 20:28
- [游客] 在 Bochs x86 Emulator 2.1.1 环境事了一下 看起来挺精致,要是设置时间 11/20 17:16
[2007-11-13 09:55] 实验15 安装新的int9中断
代码如下:
;Install new int9 interuppt
assume cs:code,ss:stack
stack segment
db 64 dup (0)
stack ends
code segment
start:
mov ax,stack
mov ss,ax
mov sp,64
mov ax,0
mov es,ax
mov di,204h
mov ax,cs
mov ds,ax
mov si,offset int9
mov cx,offset int9end - offset int9
cld
rep movsb ;Copy new int9 interrupt program to 0:204h
push es:[9*4]
pop es:[200h]
push es:[9*4+2]
pop es:[202h] ;Store old int9 interrupt address at 0:200h
cli
mov word ptr es:[9*4],204h
mov word ptr es:[9*4+2],0 ;Install new int9 interrupte address
sti
mov ax,4c00h
int 21h
int9:
push ax
push cx
push es
push si
in al,60h ;Read the keyboad input
pushf
call dword ptr cs:[200h] ;Call old int9 interrupt handling
cmp al,9eh ;Compare al with 'A' loose key number '9EH'
jne int9ret ;If not,just simply return
mov cx,0b800h
mov es,cx
mov cx,2000 ;Otherwise display 'A' all monitor
mov ah,'A'
mov si,0
s:
mov es:[si],ah
add si,2
loop s
int9ret:
pop si
pop es
pop cx
pop ax
iret
int9end:
nop
code ends
end start
;Install new int9 interuppt
assume cs:code,ss:stack
stack segment
db 64 dup (0)
stack ends
code segment
start:
mov ax,stack
mov ss,ax
mov sp,64
mov ax,0
mov es,ax
mov di,204h
mov ax,cs
mov ds,ax
mov si,offset int9
mov cx,offset int9end - offset int9
cld
rep movsb ;Copy new int9 interrupt program to 0:204h
push es:[9*4]
pop es:[200h]
push es:[9*4+2]
pop es:[202h] ;Store old int9 interrupt address at 0:200h
cli
mov word ptr es:[9*4],204h
mov word ptr es:[9*4+2],0 ;Install new int9 interrupte address
sti
mov ax,4c00h
int 21h
int9:
push ax
push cx
push es
push si
in al,60h ;Read the keyboad input
pushf
call dword ptr cs:[200h] ;Call old int9 interrupt handling
cmp al,9eh ;Compare al with 'A' loose key number '9EH'
jne int9ret ;If not,just simply return
mov cx,0b800h
mov es,cx
mov cx,2000 ;Otherwise display 'A' all monitor
mov ah,'A'
mov si,0
s:
mov es:[si],ah
add si,2
loop s
int9ret:
pop si
pop es
pop cx
pop ax
iret
int9end:
nop
code ends
end start
评论次数(1) |
浏览次数(587) |
类型(汇编作业) |
收藏此文 |