assume cs:code
code segment
start:
mov ax, cs
mov ds, ax
mov si, offset do0 ;ds:si指向源地址
mov ax, 0
mov es, ax
mov di, 200h ;es:di指向目的地址
mov cx, offset do0end - offset do0 ;设置cx为传输长度
cld ;设置传输方向为正
rep movsb
;设置中断向量表
mov ax, 0
mov es, ax
mov word ptr es:[0*4], 200h
mov word ptr es:[0*4+2], 0
mov ax, 4c00h
int 21h
do0: ;显示字符串"Welcome to tangtao"
jmp short do0start
db "I Love You!",0
do0start:
mov ax, 0
mov ds, ax
mov si, 202h ;设置ds:si指向字符串
mov ax, 0b800h
mov es, ax
mov di, 12*160+36*2 ;设置es:di指向显存空间的中间位置
mov ch, 0
;mov cx, 19 ;设置cx为字符串长度
s:
mov al, [si]
mov cl, al
jcxz send
mov es:[di], al ;设置字符
inc si
add di, 1
mov al, 0ah ;设置字符颜色
mov es:[di], al
add di, 1
;loop s
jmp short s
send:
mov ax, 4c00h
int 21h
do0end:
nop
code ends
end start