程序集8086数组在循环中索引

时间:2017-11-23 09:22:17

标签: assembly emu8086

我是装配的新手,并试图创建一个程序,它准备了前10个斐波那契数字。

IDEAL
MODEL small
STACK 100h
DATASEG
fibo db 10 dup (0)
indx db 2
indxm db 1
CODESEG
start:
     mov ax, @data
     mov ds, ax
     mov [fibo+1], 1
     mov bx, 0
     mov cx, 8
next:
     mov ax, [fibo+indxm] ;here is the problem
     add [fibo+indx], ax ;also here
     inc indx
     inc indxm
     loop next 
exit:
     mov ax, 4c00h
     int 21h
END start

它不起作用。我怎么能解决它?

0 个答案:

没有答案