assume cs:codesg
stacksg segment
dw 10 dup (0)
stacksg ends
datasg segment
db 'welcome to nasm!'
datasg ends
codesg segment
start: mov ax,0b800h
mov ds,ax
mov ax,stacksg
mov ss,ax
mov sp,0ah
mov bx,0
mov cx,25
s: push cx
mov cx,80
mov di,0
s0: mov byte ptr [bx+di],0h
mov byte ptr [bx+1],07h
add di,2
loop s0
add bx,0a0h
pop cx
loop s
mov cx,7
mov bx,64
mov ax,datasg
mov es,ax
mov di,0
s1: mov al,es:[di]
mov byte ptr [780h+bx],al
mov byte ptr [780h+bx+1],02h
add bx,2
inc di
loop s1
add bx,2
inc di
mov cx,2
s2: mov al,es:[di]
mov byte ptr [780h+bx],al
mov byte ptr [780h+bx+1],24h
add bx,2
inc di
loop s2
add bx,2
inc di
mov cx,5
s3: mov al,es:[di]
mov byte ptr [780h+bx],al
mov byte ptr [780h+bx+1],71h
add bx,2
inc di
loop s3
mov ax,4c00h
int 21h
codesg ends
end start