Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

using Assembly language or MASM CSC 221 Project 03 - Fibonacci Again Calculate the numbers in the Mbonacci Sequence up to a given sequence value

using Assembly language or MASM image text in transcribed
CSC 221 Project 03 - Fibonacci Again Calculate the numbers in the Mbonacci Sequence up to a given sequence value Write a program that 1) greets the user (describes task) 2) asks the user for number value 3) store the value of the lower 8 bits of the value given by the user, in a BYTE 2. note this limits the range of values for the sequence numbers to 255 4 using a loop, calculate the Fibonacel sequence up to the given sequence value ce if the user give us 11 we calculate the sequence up to the 11 number in the sequence 5) neatly print out all the sequence values (separated by a space) For this program the sequence is 1st 2nd 3rd 4th 5th Gh 0 1 1 2 3 To read in a value from the user use the ReadDec procedure nov edx, OFFSET prompt mov address of prompt into edx call WriteString call proc to write out what is pointed to by edx call ReadDec ; user vale is put into eax Save only the lower 8 bits of the given number of eax has the user's given value (as a DWORD) mov Nun, al mov lowest 8 bits in to Nun (BYTE) nov ecx, o zero out the whole ecx register nov cl, Num nove lower 8 bits of eax into lower 8 bits of ecx novci, al ; do we really need to store given value in Num? To loop a certain number of times es, write out "hello no" five times where is then 4, then 3. - mov ecx, 5 number of times to go through loop (loop loops at ecx (DWORD)) TOP_OF_LOOP: mov edx, OFFSET hello should reall do this outside of loop call writestring ; write out "hello" mov eax, ecx ; copy loop counter to eax (never change ecx in loop) call writeint write out loop value of loop counter call CRLF ; printout a new line loop TOP_OF_LOOP go to top_of_loop 1f and only if (-ecx) - the loop instruction automatically decrenents ecx Output: Hello +5 Hello + Hello 3 Hello +2 Hello +1 Read up on both loop/ecx and reading in an user value (book and notes) Use http://ec.cudh.edu/mmccullough/asm_help as a reference Make sure: 1) your program builds (assembles and links) before turning it in 2) your program has comments (line and header) and is well formatted 3) asm file is named correctly and is the only thing upload

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Driven Web Sites

Authors: Joline Morrison, Mike Morrison

2nd Edition

? 061906448X, 978-0619064488

More Books

Students also viewed these Databases questions

Question

What is the purpose of a mission statement?

Answered: 1 week ago

Question

What is an interface? What keyword is used to define one?

Answered: 1 week ago

Question

How do Excel Pivot Tables handle data from non OLAP databases?

Answered: 1 week ago