新手学王爽汇编 实验10(1)请教下
本帖最后由 s0512 于 2013-5-29 09:47 编辑下面是我写的实验10 不知道哪里错了
assume cs:code
data segment
db 'Welcome to masm!',0
data ends
code segment
start: mov dh,8
mov dl,3
mov cl,2
mov ax,data
mov ds,ax
mov si,0
call show_str
mov ax,4c00h
int 21h
show_str: mov ax,0b800h
mov es,ax
mov al,0a0h
dec dh
mul dh
mov dh,0
add ax,dx
mov bx,ax
show_obj: push cx
mov ch,0
mov cl,ds:
jcxz ok
mov al,
mov es:,al
pop cx
mov al,cl
mov es:,al
add bx,2
inc si
jmp short show_obj
ok: pop cx
ret
code ends
end start
assume cs:code
data segment
db 'Welcome to masm!',0
data ends
code segment
start: mov dh,8 ;8行 8*160
mov dl,3 ;3列 3 * 2
mov cl,2 ;颜色
mov ax,data
mov ds,ax
mov si,0
call show_str ;显示字符
mov ax,4c00h
int 21h
show_str: mov ax,0b800h
mov es,ax
mov ah,0 ;先清0试下
mov al,0a0h ;B800H+160 也就是一行
dec dh ;前面加了一行,这里-1,对的~嘿嘿
mul dh ;在这之前,要保存一下AX才行
mov bx,ax
mov dh,0
add dl,dl
add bx,dx
;mov bx,ax
show_obj: push cx ;保存CX
mov ch,0
mov cl,ds:
jcxz ok
mov al,
mov es:,al
pop cx
mov al,cl
mov es:,al
add bx,2
inc si
jmp short show_obj
ok: pop cx
ret
code ends
end start同学,你贴发重复了! {:9_227:} {:9_227:}
页:
[1]