编写code段中的代码,将a段和b段中的数据依次相加,将结果存到c段中

assume cs:code,ds:a,ss:c
a segment
  dw 1,2,3,4,5,6,7,8
a ends
b segment
  dw 1,2,3,4,5,6,7,8
b ends
c segment
  dw 0,0,0,0,0,0,0,0
c ends
code segment
start: mov ax,c
      mov ss,ax
      mov sp,0

      mov ax,b
      mov ds,ax

      mov ax,a
      mov es,ax
      mov ax,0

      mov bx,0
      mov cx,8
      s:add ax,[bx]
        add ax,es:[bx]
        push ax
        mov ax,0
        add bx,2
      loop s
code ends
end start

 

posted @ 2020-11-17 22:19  phpwyl  阅读(660)  评论(0编辑  收藏  举报