王爽老是的实验9被我写成了函数的形式,爽
assume cs:cseg,ds:data,ss:stackdata 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:
mov ah,0
mov bx,0A0h
mul bx
mov bx,ax
mov al,ss:
mov ah,0
add bx,ax
;mov bx,0EA0h
mov si,0
mov cx,16
s:
mov dl,
mov es:,dl
mov al,ss:
mov es:,al
add bx,2
inc si
loop s
pop bp
ret
cseg ends
end start
页:
[1]