练习一下实验10-1
assume cs:codedata 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: = 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: = 1st address of line8
mov al, dl
add al, dl
mov ah, 0
add bx, ax ;es: = 1 target address
mov dl, cl
push cx
mov cx, 17
s0: jcxz ok
mov al, ds:
mov byte ptr es:, al
mov byte ptr es:, dl
add bx, 2
inc si
loop s0
ok: pop cx
ret
code ends
end start
页:
[1]