检测点13.1(2)
安装7ch中断例程assume cs:code
code segment
start:
mov ax,cs
mov ds,ax
mov si,offset do0
mov ax,0
mov es,ax
mov di,200h ;将do0写到0:200处
mov cx,offset do0end-offset do0
cld
rep movsb
;设置中断向量表
mov ax,0
mov es,ax ;将es指向中断向量表
mov word ptr es:,200h ;发生7ch中断时跳转到0:200处执行
mov word ptr es:,0
mov ax,4c00h
int 21h
;中断例程,跳转到s处
;S的地址相对于进入中断时程序执行的偏移地址的偏移量存储在bx中
;进入中断时程序执行的偏移地址存放在ss:处
do0:
push bp
mov bp,sp
add ss:,bx
pop bp
iret
do0end: nop
code ends
end start
应用调起7CH中断(题目给的程序,改了字体颜色,测试的时候按题目中不给字体颜色不显示字符,感觉奇怪...)
assume cs:code
data segment
db 'conversation',0
data ends
code segment
start:
mov ax,data
mov ds,ax
mov ax,0b800h
mov es,ax ;指向显存
mov di,160*12
s: cmp byte ptr ,0
je ok ;(ds:)=0时则跳转
mov al,
mov ah,02; ;绿色字体
mov es:,ax ;写显存
inc si
add di,2
mov bx,offset s-offset ok; bx保存ok到s的程序长度
int 7ch
ok: mov ax,4c00h
int 21h
mov ax,4c00h
int 21h
code ends
end start
页:
[1]