实验10.1
本帖最后由 风不会停息 于 2018-5-28 17:04 编辑实验10.1
以下两种代码在对行和列的处理上哪里不同了?
assume cs:code, ds:data
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: push cx
mov di, 0
mov bx, 0B800H
mov al, 16
mov ah, 0
mul dh
add bx, ax
mov es, bx ;设定行
mov ax, 0
mov al, 2
mul dl
mov di, ax ;设定列
show: mov ch, 0
mov cl,
jcxz ok
mov al,
mov es:, al
pop cx
mov es:, cl
push cx
inc si
add di, 2
jmp short show
ok: pop cx
ret
code ends
end start
assume cs:code, ds:data
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: push cx
mov di, 0
mov ax, 0B800H
mov es, ax
mov al, 160
mov ah, 0
mul dh
mov di, ax ;设定行
mov ax, 0
mov al, 2
mul dl
add di, ax ;设定列
show: mov ch, 0
mov cl,
jcxz ok
mov al,
mov es:, al
pop cx
mov es:, cl
push cx
inc si
add di, 2
jmp short show
ok: pop cx
ret
code ends
end start
自己已经解决了,在设置段地址时,我直接把160右移了一位和dh相乘,应该先把160转化为16进制0A0H再右移一位和dh相乘 风不会停息 发表于 2018-5-28 17:18
自己已经解决了,在设置段地址时,我直接把160右移了一位和dh相乘,应该先把160转化为16进制0A0H再右移一位 ...
页:
[1]