my microproccessor lab work asks me
Write a code that prints the first twenty “Fibonacci Numbers” to any register. (You don’t have to print these numbers to screen and you must use loop structure)
And I wrote this simple code in emu8086 emulator:
name "fibo-series"
org 100h
mov ax, 1
mov bx, 1
mov cx, 9
fibo: add ax, bx
add bx, ax
loop fibo
ret
And it works well, I mean it prints all I want. But when I looked at other examples of fibonacci series on internet the code samples are much bigger than mine. Did I do something wrong? I mean is this enough for my situation? I want your opinions. Thanks.