【过程】
- 编写 7ch 中断例程
- 将中断例程代码送入到 0000:0200处
- 设置中断向量,将中断例程的入口地址 0000:0200 写入中断向量表中的7ch号表项中
- 测试数据响应中断
源程序
assume cs:code
data segment
db 'conversation',0
data ends
code segment
start:
call set_ds_es
call cpy_interrupt
call install_interrupt
call test_data
;==========设置ds,es==============
set_ds_es:
mov ax,cs
mov ds,ax
mov si,offset interrupt
mov ax,0
mov es,ax
mov di,200h
ret
cpy_interrupt:
mov cx,offset interrupt_end - offset interrupt
cld
movsb
ret
;==========编写中断例程==============
interrupt:
push bp
mov bp,sp
add [bp+2],bx
pop bp
iret
interrupt_end:
nop
;==========安装中断例程======&#