题目:检测点6.1
(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
上面的意思。是把0-0-0-15的数据盖到 当前程序中, 执行过程没有错,我思考了一个问题。可不可不可以把程序的数据转移到0-0-0-15内,如果可以转移过去。那个是不是要把CS 和DS 执行位置调换? 现实中没等我移动过去就被系统踢了出来。我找了空地址,一样把我踢出来,我是这样执行的:
assume cs:abc
abc segment
;dw 0123h,0456h,0789h,0abch,0defh,0fedh,0987h
start : mov ax,1400H
mov bx,0
mov cs,ax
mov cx,8
s: mov ax,[bx]
mov ds:[bx],ax
add bx,2
loop s
mov ax,4c00h
int 21h
abc ends
end start
------解决思路----------------------
mov cs, ax 这样的指令非法吧