Assembly Language (x86): How to create a loop to calculate Fibonacci sequence
I am programming assembly language (x86) in MASM using Visual Studio 2013 Ultimate. I am trying to use an array to calculate a Fibonacci sequence for n elements using an array. In other words, I am trying to go to an array element, obtain the two elements before it, add those up, and store the result in another array. I am having trouble setting up the index registers to make this work. I have my program setup like this: TITLE fibonacci.asm INCLUDE Irvine32.inc .data fibInitial BYTE 0, 1, 2, 3, 4, 5, 6 fibComputed BYTE 5 DUP(0) .code main PROC MOVZX si, fibInitial MOVZX di, fibComputed MOV cl,