assume cs:code,ds:data,ss:stack
data segment
db 'welcome to masm!'
db 02h,24h,71h
data ends
stack segment
dd 8 dup(0)
stack ends
code segment
start:
mov ax,data
mov ds,ax
mov ax,stack
mov ss,ax
mov sp,010h
mov ax,0b870h ;在第十二行显示
mov es,ax
mov bx,0
mov si,0
mov di,0
mov cx,03h
l:
mov ah,ds:[16+di];设置显示属性
push cx
mov cx,10h
s:
mov al,ds:[bx];拷贝字符
mov es:[si],ax;将字符与显示属性送到显示缓冲区
inc bx
add si,2
loop s
inc di
add si,0
mov bx,0
pop cx
loop l
mov ax,4c00h
int 21h
code ends
end start |