Write an ASM language for fibonacci series of 10 numbers?

All QuestionsCategory: ARMWrite an ASM language for fibonacci series of 10 numbers?
Chetu Staff asked 2 months ago

I need code.

1 Answers
Chetu Staff answered 2 months 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

Your Answer