马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
assume cs:code
data segment
db 'Welcome to masm!',0
data ends
code segment
start: mov dh,8
mov dl,3
mov cl,2
mov ax,data
mov ds,ax
mov si,0
call show_str
mov ax,4c00h
int 21h
show_str: mov ax,0b800h
mov es,ax
mov ax,0
mov al,dh
mov bx,0
mov bl,160
mul bl
mov bx,0
add bx,ax
mov ax,0
mov al,dl
mul cl
add bx,ax ;bx为首字偏移值
mov al,cl ;颜色放al中保存
mov di,0
s0: mov cl,[si]
mov ch,0
jcxz s1 ;cx为零时 跳到s1
mov es:[bx+di],cl
mov es:[bx+di+1],al
inc si
add di,2
jmp short s0
s1: ret
code ends
end start
|