2个回答
展开全部
8086的汇编:
data segment
buf db 56h,0ah,23h,7ch,31h,19h,0d1h,44h,0e7h,38h
sum dw ?
data ends
code segment
assume cs:code,ds:data
start: mov ax,data
mov ds,ax
lea bx,buf
mov ah,0
mov al,[bx]
add al,[bx+1]
adc ah,0
add al,[bx+2]
adc ah,0
add al,[bx+3]
adc ah,0
add al,[bx+4]
adc ah,0
add al,[bx+5]
adc ah,0
add al,[bx+6]
adc ah,0
add al,[bx+7]
adc ah,0
add al,[bx+8]
adc ah,0
add al,[bx+9]
adc ah,0
mov sum,ax
mov ah,4ch
int 21h
code ends
end start
data segment
buf db 56h,0ah,23h,7ch,31h,19h,0d1h,44h,0e7h,38h
sum dw ?
data ends
code segment
assume cs:code,ds:data
start: mov ax,data
mov ds,ax
lea bx,buf
mov ah,0
mov al,[bx]
add al,[bx+1]
adc ah,0
add al,[bx+2]
adc ah,0
add al,[bx+3]
adc ah,0
add al,[bx+4]
adc ah,0
add al,[bx+5]
adc ah,0
add al,[bx+6]
adc ah,0
add al,[bx+7]
adc ah,0
add al,[bx+8]
adc ah,0
add al,[bx+9]
adc ah,0
mov sum,ax
mov ah,4ch
int 21h
code ends
end start
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询