assume cs:cseg,ds:data,ss:stack
data segment
db 'welcome to masm!'
data ends
stack segment
db 30h dup('0')
stack ends
cseg segment
start:
mov ax,data
mov ds,ax
mov ax,stack
mov ss,ax
mov sp,30h
mov ax,0B800H
mov es,ax
mov dh,22 ;行
mov dl,30h ;列
push dx
mov dl,02h ;//颜色
mov dh,0h
push dx
call sub1
add sp,4
mov dh,23 ;行
mov dl,30h ;列
push dx
mov dl,100b ;//颜色
mov dh,0h
push dx
call sub1
add sp,4
mov dh,24 ;行
mov dl,30h ;列
push dx
mov dl,1b ;//颜色
mov dh,0h
push dx
call sub1
add sp,4
;add bx,160
;call sub1
;系统调用
mov ax,4c00H
INT 21H
sub1:
push bp
mov bp,sp
mov al,ss:[bp+7]
mov ah,0
mov bx,0A0h
mul bx
mov bx,ax
mov al,ss:[bp+6]
mov ah,0
add bx,ax
;mov bx,0EA0h
mov si,0
mov cx,16
s:
mov dl,[si]
mov es:[bx],dl
mov al,ss:[bp+4]
mov es:[bx+1],al
add bx,2
inc si
loop s
pop bp
ret
cseg ends
end start