Simple Number Sequence Write a program that generates a sequence of numbers in w
ID: 3805558 • Letter: S
Question
Simple Number Sequence Write a program that generates a sequence of numbers in which each number is equal to double the previous number. The range is 1-1000h, shown here in hexadecimal 12 4 8 10 20 40 80 100 200 400 800 1000 Use a debugger to dump the area of memory containing the numbers. 4. Fibonacci Numbers The well-known Fibonacci number series, reputedly discovered Leornardo of Pisa around the year 1200, has been valued for centuries for its universal qualities by artists, mathematicians, and composers. Each number in the series after the number 1 is the sum of the two previous numbers: 1, 1, 2, 3, 5, 8, 13, 21, 34, 55. Write a program that generates and displays the first 24 numbers in the Fibonacci series, beginning with 1 and ending with 46, 368Explanation / Answer
Hexadecimal equivalent for decimal 24 is 18H,since we need to generate first 24 numbers in fabanoccii series .
Assembly code to generate fabanoccii series:
MVI D,18H//initializing count to 24
MVI B,00H//initially b=0
MVI C,01H//C=1
Label1: MOV A,B//Move value of register B to A
ADD C// add contents of A and C
MOV B,C//push value of register C to B
MOV C,A//move value of register A to C
DCR D// decrement count by 1
JNZ Label1// jump to label1 if count is not 0
END
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.