马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
assume cs:code
data segment
db 'welcome to masm!',0
data ends
code segment
start:mov dh,10;行号
mov dl,10;列号
mov cl,6;颜色
mov ax,data
mov ds,ax
mov si,0
int 7ch
mov ax,4c00h
int 21h
code ends
end start
assume cs:code
code segment
start:mov ax,cs
mov ds,ax
mov si,offset s
mov ax,0
mov es,ax
mov di,200h
mov cx,offset ok-offset s
cld
rep movsb
mov ax,0
mov es,ax
mov word ptr es:[7ch*4],200h
mov word ptr es:[7ch*4+2],0
mov ax,4c00h
int 21h
s:push ax
mov ax,0b800h
mov es,ax
mov ax,160
dec dh
mul dh
mov di,ax;第(bh)行
mov ax,2
dec dl
mul dl
mov bx,ax;第(dl)列
mov ah,cl;颜色
mov si,0
j: cmp byte ptr [si],0
je ok
mov al,[si]
mov word ptr es:[bx+di],ax
add di,2
inc si
jmp j
pop ax
iret;相当于pop ip
;pop cs
;popf
mov ax,4c00h
int 21h
ok:nop
code ends
end start
|