汇编语言实验九
在屏幕中间显示‘welcome to masm!’
assume cs:code,ds:datasg
datasg segment
db 'welcome to masm!'
datasg ends
stack segment
dw 0,0,0,0,0,0,0,0
stack ends
code segment ;代码段
start:
nop
mov cx,16
mov si,0
mov bx,0
s: mov ax,datasg
mov ds,ax
mov dh,02
mov dl, ds:[bx] ; data to dx
mov ax,0b800h
mov ds,ax
mov ds:[si+720h],dl
mov ds:[si+720h+1],dh ; dx to b800h
inc bx
add si,2
loop s
mov cx,16
mov si,0
mov bx,0
s1: mov ax,datasg
mov ds,ax
mov dh,24h
mov dl, ds:[bx] ; data to dx
mov ax,0b800h
mov ds,ax
mov ds:[si+7c0h],dl
mov ds:[si+7c0h+1],dh ; dx to b800h
inc bx
add si,2
loop s1
mov cx,16
mov si,0
mov bx,0
s2: mov ax,datasg
mov ds,ax
mov dh,71h
mov dl, ds:[bx] ; data to dx
mov ax,0b800h
mov ds,ax
mov ds:[si+860h],dl
mov ds:[si+860h+1],dh ; dx to b800h
inc bx
add si,2
loop s2
mov ax,4c00h ;程序返回
int 21h
code ends
end start ;start标号处作为程序入口
在这里插入代码片