实验13(1)
assume cs:codecode 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
;dh 行号
;dl 列号
;cl 颜色
;ds:si 指向字符串首地址 结束标志‘0’
do0:
add dl,dl ;列号最大为80,不会溢出
mov al,160
mul dh ;8位mul,al放乘数1,AX放结果
mov di,ax
mov dh,0
add di,dx ;显存索引 = 行*160+列x2
mov ax,0b800H
mov es,ax
mov ah,cl; ;字体颜色
s: cmp byte ptr ,0
je ok ;(ds:)=0时则跳转
mov al,
mov es:,ax ;写显存
inc si
add di,2
jmp s
ok: iret
do0end: nop
code ends
end start
页:
[1]