Write an ASM language for fibonacci series of 10 numbers?

All QuestionsCategory: Embedded SystemWrite an ASM language for fibonacci series of 10 numbers?
Chetan Shidling Staff asked 5 years ago

I need code.

1 Answers
Chetan Shidling Staff answered 5 years ago

Code:

AREA FIBONACCI, CODE
ENTRY
MOV R10, #10
LDR R3,= 0X40000000
MOV R0, #0
SUB R1, R0, #1
MOV R2, #1
ADD R6, R2, R1
STR R6, [R3], #4
FIB ADD R6, R2, R0
STR R6, [R3], #4
MOV R2, R0
MOV R0, R6
SUBS R10, R10, #1
BNE FIB
STOP B STOP
END