题目:
编写汇编程序,求出首地址为BUF 10有符号字的内容之和,并存入字变量SUM单元
data segment
;编写汇编程序,求出首地址为BUF 5个有符号字的内容之和,并存入字变量SUM单元
buf dw 20,-30,40,5,-3,33,50,-16,16,43
sum dw 0
data ends
code segment
assume cs:code ,ds:data
start:
mov ax,data
mov ds,ax
mov dx,buf
mov ax,0
mov cx,3
a: mov ax,[bx]
add sum,ax
add bx,2
loop a
mov ah,4ch
int 21h
code ends
end start
2021-9-1