Answer the following questions with reference to the assembl

Answer the following questions with reference to the assembly program below. Before the code is executed, the initial content of memory and registers is shown in the figure below. What will be the values (in hex) stored in the registers after the code segment is executed? What will be the content of the memory (in hex) after the code segment is executed?

Solution

After executing

LDRH R1,[R2,#2]

According to this instruction The values in R2 reg+2 its address(0X2002) and this half content move to R1 register.

so R1 holds 3.

Like wise R2 also hold 3

ADD R3,R2,R1 which execute the addition of R1+R2 values and stores in R3 value.

So R3 holds 6

Now STR R3,[R0]

which store the content of R3 value to address which store in R0

so the memory 0X2000 will hold the value of 0x06H.

so after executing

R1-0x3

R2-0x3

R3-0x6

R0-0x2000

In adddressmemory

0x2000.0000 will hold 6,

in other meory location noc changes

 Answer the following questions with reference to the assembly program below. Before the code is executed, the initial content of memory and registers is shown

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site