Part a write a program to evaluate the first 20 numbers of

Assignment Help Application Programming
Reference no: EM13347724

Part A

Write a program to evaluate the first 20 numbers of Fibonacci series. Use the stack (memory) to store the calculated series. Your debugger output should look like the following screenshot.

Part  B

Modify the program matrixmul.s to add two matrices and store it in a third matrix. Your output could show all three matrices in memory.

Note : Make sure you DO NOT Copy & Paste the above snapshot. You have to make the snapshot of your own program. Please send this with assembly code and a snapshot of debugger session with all important output.

Part -C

Modify the subroutine to add two complex numbers (Slide -1) to multiply two complex numbers. Your debugger output should be in the format shown in Slide -2.The product of two complex numbers a + ib and c + id is given by (ac - bd) + i(bc + ad)

Slide -1

/**

struct complex complex_add(struct complex* c1, struct complex* c2) {

       struct complex c;

       c.re = c1->re + c2->re;

       c.im = c1->im + c2->im;

       return c;

}

**/

.global complex_add

complex_add:

save %sp, -96, %sp

ld [%fp + 64], %l0

!add and store real part

ld [%i0 + re_offset], %o0

ld [%i1 + re_offset], %o1

add %o0, %o1, %o0

st %o0, [%l0 + re_offset]

!add and store im part

ld [%i0 + im_offset], %o0

ld [%i1 + im_offset], %o1

add %o0, %o1, %o0

st %o0, [%l0 + im_offset]

ret

restore

Slide -2 is bellow

/**

main()

{

struct complex c, c1, c2;

c1 = complex_set(1,2);

c2 = complex_set(2,3);

 

c = complex_add(&c1, &c2);

}

**/

 

Slide -2

.global main

main:

save %sp, (-92+str3_offset)&-8 , %sp

!initialize the first structure

add %fp, str1_offset, %l0

st %l0, [%sp+64]

mov 1, %o0

mov 2, %o1

call complex_set

nop

!initialize the second structure

add %fp, str2_offset, %l1

st %l1, [%sp+64]

mov 2, %o0

mov 3, %o1

call complex_set

nop

!add the complex numbers stored in the two structures

add %fp, str3_offset, %l2

st %l2, [%sp+64]

mov %l0, %o0

mov %l1, %o1

call complex_add

nop

mov 1, %g1

ta 0

Part -D

a. Translate the following machine language into assemble language:

(gdb)   x/x   &main

0x2290   <main>:                  0x9de3bfc0

(gdb)

0x2294   <main+4>:              0x90820012

(gdb)

0x2298   <main+8>:              0x1cbff75a

(gdb)

0x229c   <main+12>:            0x92100012

(gdb)

0x22a0   <main+16>:            0x81c7e008

(gdb)

0x22a4   <main+20>:            0x81e80000

                        Please see the b. bellow 

b. Translate the following assembly language program into machine code:

           .global main

main:  save     %sp, -64, %sp

         mov          4,      %l1  

         mov         -2, %l2

loop:   addcc    %l1,  %l2,  %l0  

         ble,a   loop

         sub    %l1,  1,  %l1

         mov         1, %g1

          ta        0

Reference no: EM13347724

Questions Cloud

Problem 1greatest common divisor write code for a recursive : problem 1greatest common divisor write code for a recursive implementation of euclids algorithm for searching the
Question 1calculation of a laplace transform from first : question 1calculation of a laplace transform from first principles.write a comment in each of the boxes to explain the
Part - 1q 1 define benchmarkingq 2 what is the need for : part - 1q. 1. define benchmarking.q. 2. what is the need for benchmarking?q. 3. what are the types of benchmarking?q.
Write a market research reportfinal conclusion of the : write a market research reportfinal conclusion of the launching of this mall either this shopping malls idea is
Part a write a program to evaluate the first 20 numbers of : part a write a program to evaluate the first 20 numbers of fibonacci series. use the stack memory to store the
Part-1reinforce understanding of power beta and : part-1reinforce understanding of power beta and alpha.problem a packing process is designed to fill steel drums with
Methods are commonly used to break a problem down into : methods are commonly used to break a problem down into small manageable pieces. a large task can be broken down into
This is a simulation of rolling dice actual results : this is a simulation of rolling dice. actual results approach theory only when the sample size is large. so we will
Problem 1 in a study relating college grade point average : problem 1 in a study relating college grade point average to time spent in various activities students are asked how

Reviews

Write a Review

Application Programming Questions & Answers

  Question 1we are given the following knowledge base of

question 1we are given the following knowledge base of travel informationnbspbycaraucklandhamilton.

  Objectives1login to unix system and logout2learn features

objectives1.login to unix system and logout2.learn features of the vi editor and to use online help man pages. gain

  Problem descriptionyou are working as an engineer for a

problem descriptionyou are working as an engineer for a materials manufacturing research lab and have been asked to

  Question 1 detail for each of the four following mips

question 1. detail for each of the four following mips instructions which actions are being taken at each of their

  Part - 1 object-oriented designwrite a program that allows

part - 1 object-oriented designwrite a program that allows an instructor to keep a grade book. each students has scores

  1 menu optionsthe shell script should generate a menu to

1. menu optionsthe shell script should generate a menu to allow the user to choose each option. after executing options

  In this project you will create an application to run in

in this project you will create an application to run in the amazon ec2 service and you will also create a client that

  Problem 1 create a simple shell basically your shell should

problem 1. create a simple shell. basically your shell should read the line from standard input parse the line with

  If the user wants to read the input from a file then the

if the user wants to read the input from a file then the output will also go into a different file. if the user wants

  Questions mylocation sdword

questions mylocation sdword 14thetestnbspnbspnbspnbspnbspnbspnbsp sdword 8nbspnbsp nbspmovnbspnbsp

  Problemthe manager of the super supermarket would like to

problemthe manager of the super supermarket would like to be able to compute the unit price for products sold there. to

  Questions on programing problem step 1 we ask you to

questions on programing problem step 1 we ask you to produce a project plan and an interim description of the project

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd