(1)下面的程序实现依次用内存0:0-0:15单元中的内容改写程序中的数据,完成程序:
assume cs:codesg
codesg segment
dw 0123h,0456h,0789h,0abch,0defh,0fedh,0cbah,0987h
start: mov ax,0
mov ds,ax
mov bx,0
mov cx,8
s: mov ax,[bx]
mov cs:[bx],ax
add bx,2
loop s
mov ax,4c00h
int 21h
codesg ends
end start
(2)下面的程序实现依次用内存0:0-0:15单元中的内容改写程序中的数据,数据的传送用栈来进行。栈空间设置在程序内。完成程序:
assume cs:codesg
codesg segment
dw 0123h,0456h,0789h,0abch,0defh,0fedh,0cbah,0987h
dw 0,0,0,0,0,0,0,0,0,0
stary: mov ax, cs
mov ss,ax
mov sp, 24h
mov ax,0
mov ds,ax
mov bx,0
mov cx,8
s: push [bx]
pop cs:[bx]
add bx,2
loop s
mov ax,4c00h
int 21h
codesg ends
end start
- [tolearn] 谢谢你哈…… 10/19 07:10
- [huang425618] 呵呵,第二种方法原来就是第七章的内容,我当时还没学到那呢。我其实不是为我自己辩解,只是我想说,我们的 10/03 20:00
- [qq93324030] 不觉得第二种方法好,他怎么就能那么确定abc三个段是连续的呢?万一不连续他的程序就没作用了。。 10/02 04:37
- [qq93324030] 谢谢,和你对比了我就不用贴了 10/02 00:18