|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
小的自己写的代码如下
assume cs:codesg,ds:datasg
datasg segment
db 'welcome to masm!',0
datasg ends
codesg segment
start: mov dh,8
mov dl,2
mov cl,2;RGB red green bule 4 2 1
mov ax,datasg
mov ds,ax
mov si,0
call show_str
mov ax,4c00h
int 21h
show_str: push dx; 给定参数 dh=行号 dl=列号 cl=颜色 ds:si指向字符串首地址 返回:无 作用:在指定位置显示字符串,以0结尾
push si
push cx
mov ch,0
mov ax,0b800h
mov es,ax
mov al,160
dec dh
mul dh
mov bx,ax
dec dl
mov al,2
mul dl
sub ax,2
add bx,ax
mov bh,0
mov bl,dl
mov al,cl
mov di,0
mov ch,0
s: mov cl,ds:[si]
jcxz ok
mov es:[bx+di],al
mov es:[bx+di+1],cl
inc si
add di,2
jmp short s
ok:pop cx
pop si
pop dx
ret
codesg ends
end start
|
|