Question

Assume SP = 0x20001010 before the following instructions are executed: MOV R0, #0 MOV R1, #1 MOV ...

Assume SP = 0x20001010 before the following instructions are executed:

MOV R0, #0

MOV R1, #1

MOV R2, #2

PUSH {R0, R1, R2}

After these instructions execute:

What is the value of the SP? _________________

What is the value of the following memory locations (place X in the blank if it cannot be calculated):

Address 32-bit Data

0x2000101C ____________

0x20001018 ____________

0x20001014 ____________

0x20001010 ____________

0x2000100C ____________

0x20001008 ____________

0x20001004 ____________

0x20001000 ____________

0 0
Add a comment Improve this question Transcribed image text
Answer #1

The stack pointer stores the address of the most recent entry that was pushed onto the stack.The push instruction first subtracts and then inserts the data.
SP = 0x20001010
MOV R0, #0 //R0<-0
MOV R1, #1 //R1<-1
MOV R2, #2 //R2<-2

PUSH {R0, R1, R2}
Here three push
SP = SP-4
0x20001010 - 4 = 0x2000100C
then push data at 0x2000100C = R0
SP = SP-4
0x2000100C - 4 = 0x20001008
then push data at 0x20001008 = R1
SP = SP-4
0x20001008 - 4 = 0x20001004
then push data at 0x20001004 = R2

The value of the SP = 0x20001004

Address 32-bit Data

0x2000101C ______X______

0x20001018 ______X______

0x20001014 ______X______

0x20001010 ______X______

0x2000100C ______0______

0x20001008 ______1______

0x20001004 ______2______

0x20001000 ______X______

Add a comment
Know the answer?
Add Answer to:
Assume SP = 0x20001010 before the following instructions are executed: MOV R0, #0 MOV R1, #1 MOV ...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • 4. What will r0 and r1 contain after each of the following instructions? Consider the instructions...

    4. What will r0 and r1 contain after each of the following instructions? Consider the instructions in sequence. Give your answers in decimal format. mov r0,#1 @ r0 =_____________ mov r1,#0x30 @ r0= _____________ r1= _____________ orr r1,r1,r0 @ r0= _____________ r1= _____________ lsl r1,#0x2 @ r0= _____________ r1= _____________ orr r1,r1,r0 @ r0= _____________ r1= _____________ eor r0,r0,r1 @ r0= _____________ r1= _____________ lsr r1,r0,#3 @ r0= _____________ r1= ______________

  • 2. Encode the following four TM4C Thumb-2 instructions using 16-bit instructions if possible: LDR R3,[R0] MOV...

    2. Encode the following four TM4C Thumb-2 instructions using 16-bit instructions if possible: LDR R3,[R0] MOV R2,R3 STR R6, [SP, #0x08] RSB R11,R7,R7, LSL #2 Note: uVision may NOT give the 16-bit answer for encoding when you check.

  • 3) (5) What value will the carry flag contain after these instructions: a) MOV R1,#3 MOVS...

    3) (5) What value will the carry flag contain after these instructions: a) MOV R1,#3 MOVS R2, R1, LSR #1 b) MOV R1,#2 MOVS R2, R1, LSR #1 4) (5) Will this instruction update the flags in the CPSR? ADD R1, R0, #1 Alo it Why or why not?

  • Assignment 4: Answer the following questions with reference to the assembly program below. Before the code...

    Assignment 4: 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 memory 0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08 address Use BIG ENDIAN, and 0x2000.0000 0x2000.0001 0x2000.0002 show all steps register 0x2000.0000RO Ox2000.0003 0x2000.0004 0x2000.0005 0xFFFF.FFFF R2 ox2000.0006 0x1234.5678 R3 0x2000.0007 Ox0000.0000 R1 LDRH R1, [R0 , #2]! LDRH R2 , [R0 , #2)! ADD R3, R1, R2 STR...

  • Suppose r0 = 0 times 20008000, and the memory layout is as follows: (a) What is...

    Suppose r0 = 0 times 20008000, and the memory layout is as follows: (a) What is the value of r1 after running LDR r1, [r0] if the system is little endian? What is the value if the system uses the big-endian? b) Suppose the system is set as little endian. What are the values of r1 and r0 if the following instructions are executed separately? LDR r1, [r0, #4] LDR r1, [r0], #4 LDR r1, [r0, #4]!

  • 2. After initialization a user executes the following instructions: ORGO 0000 MOV A, #30H 0002 PUSH...

    2. After initialization a user executes the following instructions: ORGO 0000 MOV A, #30H 0002 PUSH A 0003 LCALL 0500H 0006 .. What are the contents of memory locations 8, 9 and 10 after the LCALL? (A) OSH OOH 30H (B) 30H OOH O5H (C) 30H 06H OOH (D) none of the above 3. If in question #2 a RET instruction is assembled and located at 0500H. The next instruction executed after this RET will be the instruction at memory...

  • QUESTION 12 Assume the 8051 has yust beeh posered up Reference the below code when onswering...

    QUESTION 12 Assume the 8051 has yust beeh posered up Reference the below code when onswering The f MOV SP, #5511 MOV R3, #17H MOV R1 #1111 MOVk0, #15H PUSH 3 PUSH PUSH 2 PUSHO Whet is O 54H 05801 ○ 59H the oddness heid by the SP atter the abave code is executed? QUESTION 13 Assume the 8051 hos just been powered up Reference the below code when answering the folliawing questions MOV SP. W55H MOV R3, #17H MOV...

  • Assume the stack pointer (SP) is initialized to 0x20000000 . Registers RO, R1, R2 and R12...

    Assume the stack pointer (SP) is initialized to 0x20000000 . Registers RO, R1, R2 and R12 are initialized to 2, 3, 8 and 15 respectively. Answer the following: Show the content of the stack and the SP after the following sequence of operations. PUSH (R12} PUSH {R1-R2} PUSH (RO) Answer format example=> {1,2,3,4} if 1,2,3,4 are values in stack and with no spaces. Answer: Does the following cause a data hazard for the 5-stage LEGV8 pipeline? i1: ADD XO, X1,...

  • 37. What is the binary value of AL after the following instructions have mov al,01101011b stc...

    37. What is the binary value of AL after the following instructions have mov al,01101011b stc rcl al,2 38. What is the binary value of AX after the following instructions have executed? mov ax, 0000000010011101b mov bx, 1010101010000000b shld ax, bx,1 39. What is the binary value of AX after the following instructions have executed? mov ax, 0000000010011101b mov bx, 1010101010001011b shrd ax, bx, 2 will be the hexadecimal values of DX and AX after the following instructions have executed?...

  • The registers in the HCS12 show the following -$2245 x-$1234 Y 5678, SP S0900 Assume the...

    The registers in the HCS12 show the following -$2245 x-$1234 Y 5678, SP S0900 Assume the following sequence of code is executed and then specify what is in the stack and what is in the registers psha pshx psha puly What are the register contents after the program sequence is executed: A SP B. Show the contents of the stack after the program sequence is executed (in hexadecimal): Memory Address Memory Contents (hex) Pane 12 of 12 The registers in...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT