write an assembly language program to calculate the first 10 geometric sequence a+ar+ar^2................and store them sequentially in memory and push them to stack then display them in decimal 1s interval on seven segment display
I wrote a program for sum of Fibonacci series see below and stuck power of two. Thanks for your help.
Moderator edit: added code tags like this: [code] your code [/code]
I wrote a program for sum of Fibonacci series see below and stuck power of two. Thanks for your help.
Code:
start:
mov r0, #0 @ answer
mov r1, #10 @ n = 10
mov r2, #0 @ first value in sequence
mov r3, #1 @ second value in sequence
mov r4, #0 @ i = 0
mov r6,#0 @ Sum
loop:
add r4, r4, #1
cmp r1, r4
ble exit
mov r5, r0
add r0, r2, r3
mov r2, r0
mov r3, r5
add r6, r6,r0
bal loop
exit:
mov r7, #1