马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
本帖最后由 陌路狂奔 于 2011-5-11 22:26 编辑
这两种代码按理说效果应该是一样的吧,但结果为什么会不一样呢assume cs:code,ds:data,ss:stack
data segment
db 'welcome to masm!'
db 02h,24h,71h
data ends
stack segment
dw 8 dup(0)
stack ends
code segment
start:
mov ax,data
mov ds,ax
mov ax,stack
mov ss,ax
mov sp,16
mov si,0
mov di,16
mov bx,0b870h
mov es,bx
mov bx,20h
mov cx,3
s0:push cx
push si
mov cx,16
s:mov al,[si]
mov es:[bx],al
add bx,1
mov ah,[di]
mov es:[bx],ah
inc si
inc bx
loop s
add bx,80h
pop cx
pop si
inc di
loop s0
mov ax,4c00h
int 21h
code ends
end start
assume cs:code,ds:data,ss:stack
data segment
db 'welcome to masm!'
db 02h,24h,71h
data ends
stack segment
dw 8 dup(0)
stack ends
code segment
start:
mov ax,data
mov ds,ax
mov ax,stack
mov ss,ax
mov sp,16
mov si,0
mov di,16
mov bx,0b870h
mov es,bx
mov bx,20h
mov cx,3
s0:push cx
mov si,0
mov cx,16
s:mov al,[si]
mov es:[bx],al
add bx,1
mov ah,[di]
mov es:[bx],ah
inc si
inc bx
loop s
add bx,80h
pop cx
inc di
loop s0
mov ax,4c00h
int 21h
code ends
end start
|