马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
实验五 6小题:
我做得解答:assume cs:code
a segment
db 1,2,3,4,5,6,7,8
a ends
b segment
db 1,2,3,4,5,6,7,8
b ends
c segment
db 0,0,0,0,0,0,0,0
c ends
code segment
start:
mov ax,a
mov es,ax
mov ax,c
mov ds,ax
mov bx,0
mov cx,8
s0:
mov al,es:[bx]
mov [bx],al
inc bx
loop s0
mov ax,b
mov es,ax
mov ax,c
mov ds,ax
mov bx,0
mov cx,8
s1:
mov al,es:[bx]
add [bx],al
inc bx
loop s1
mov ax,4c00h
int 21h
code ends
end start
网上的答案:assume cs:code
a segment
db 1,2,3,4,5,6,7,8
a ends
b segment
db 1,2,3,4,5,6,7,8
b ends
c segment
db 0,0,0,0,0,0,0,0
c ends
code segment
start:mov ax,a
mov es,ax
mov ax,c
mov ds,ax
mov bx,0
mov cx,8
s1:mov ax,es:[bx]
add [bx],ax
add bx,2
loop s1
mov ax,b
mov es,ax
mov ds,ax
mov bx,0
mov cx,8
s2:mov ax,es:[bx]
add [bx],ax
add bx,2
loop s2
mov ax,4c00h
int 21h
code ends
end start
都能正确运行,为什么
s2:mov ax,es:[bx]
add [bx],ax
add bx,2
能正确运行
如果偏移了两个单元,后续的第二个单元怎么会正确取出数据 |