图中有个错误 f2 db 1这样才是fabonaci 数组 其实还有一个要求是 只要求前10项就可以了,并把总和放在sum里 真心谢谢你 。但是 我这样遍老是出错,求指点迷津
data segment
f1 db 1
f2 db 1
fnext db 8 dup(?)
sum db ?
table dw 4 dup(?)
data ends
code segment
assume cs:code,ds:data
main proc far
push ds
sub ax,ax
push ax
mov ax,data
mov ds,ax
mov table,offset f1
mov table+2,offset f2
mov table+4,offset fnext
mov table+6,offset sum
mov bx,offset table
call ab
ret
main endp
ab proc near
mov si,[bx]
mov cx,8
xor ax,ax
求解答啊 搞了半天了 其中 f2 db 1 这样才是fabonaci数列 求前10项和 就行了
data segment
f1 db 1
f2 db 1
fnext db 8 dup(?)
sum db ?
table dw 4 dup(?)
data ends
code segment
assume cs:code,ds:data
main proc far
push ds
sub ax,ax
push ax
mov ax,data
mov ds,ax
mov table,offset f1
mov table+2,offset f2
mov table+4,offset fnext
mov table+6,offset sum
mov bx,offset table
call ab
ret
main endp
ab proc near
mov si,[bx]
mov cx,8
xor ax,ax