检测点6.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]
        ________
        add bx,2
        loop s
        mov ax,4c00h
        int 21h
codesg ends
end start

答案

mov cs:[bx],ax

下面的程序实现依次用内存 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
1
start  mov ax,cs
mov ss,ax
1
mov sp,36
mov ax,0 mov ds,ax mov bx,0 mov cx,8 s: push [bx]
1
pop ss:[bx]
add bx,2 loop s mov ax, 4c00h int codesg ends end start

结题步骤
1.设置栈段(ss)和代码段(cs)
2.设置栈底
3.取出数据