|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
assume cs:code
data segment
db 'Welcome to masm!',0
data ends
code segment
start: mov dh, 7 ;line number
mov dl, 3 ;column number
mov cl, 2 ;color
mov ax, data
mov ds, ax
mov si, 0 ;ds:[si] = 1st address of str
call show_str
s: mov ax, 0
jmp short s
mov ax, 4c00h
int 21h
show_str:
mov bx, 0
mov ax, 0B800h
mov es, ax ;es 显存地址
mov al, 160 ;bytes per line
mul dh
mov bx, ax ;es:[bx] = 1st address of line8
mov al, dl
add al, dl
mov ah, 0
add bx, ax ;es:[bx] = 1 target address
mov dl, cl
push cx
mov cx, 17
s0: jcxz ok
mov al, ds:[si]
mov byte ptr es:[bx], al
mov byte ptr es:[bx+1], dl
add bx, 2
inc si
loop s0
ok: pop cx
ret
code ends
end start |
|