Question

Suppose that an 8-bit microcontroller has a 16-bit stack pointer and uses a 16-bit register to...

Suppose that an 8-bit microcontroller has a 16-bit stack pointer and uses a 16-bit register to access the stack from the top. Assume that initially the stack pointer and the 16-bit register contain 20C016 and 020516 respectively. After the PUSH operation

1. What are the contents of the stack pointer?

2. What are the contents of memory locations 20BE16 and 20BF16?

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

since a push operation is being performed which means the value is being put on the stack

hence the first stack pointer then stack pointer will be incremented and then the value will be put to the memory represented by the current stack pointer.

hence answer 1:

stack pinter = SP+1=20C016+1=20C017

answer 2:

since no changes have been made to the memories 20BE16 and 20BF16 hence both values will remain the same as before.

the contents cannot be determined with the question that has no details about the memory values currently on the stack.

Add a comment
Know the answer?
Add Answer to:
Suppose that an 8-bit microcontroller has a 16-bit stack pointer and uses a 16-bit register to...
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
  • a)Complete the following LC-3 PUSH routine. Assume R6 is the stack pointer, st grows towards 0...

    a)Complete the following LC-3 PUSH routine. Assume R6 is the stack pointer, st grows towards 0 and each element of the stack takes four memory locations PUSH ADD R6, R6, STR RO, R6, lowing operations, what are the contents of the stack? Show what the ck contains after each operation and the final stack contents. Multiply routine takes two operands off the stack, multiplies and pushes the result back on the stack push 2 push 2 multiply If the stack...

  • A mechatronics project based on general microcontroller has 8 bit data bus and 16 bit address...

    A mechatronics project based on general microcontroller has 8 bit data bus and 16 bit address bus. It is required to have access to the following devices: ? 1 Rom of size 8 Kbytes ? 1 RAM of size 16 Kbytes ? 4 Analog to digital converter. Each one has a data bus of 1 byte and register space of 8 data bytes ? 1 Digital to analog converter that has 8 bits data.? 4 display LEDs and 4 different...

  • Stack Operation 10. (10 pts.) Show the contents of the stack and affected registers at the two marked points in the exe...

    Stack Operation 10. (10 pts.) Show the contents of the stack and affected registers at the two marked points in the execution of the followin code. Assume RO-0, R1-1, R2-2, R3-3, R4-4, R5-5, and R6-6. The initial value for stack pointer (prior to executing this code block) is given as SP-0x20001000 PUSH R2,R3) ADD R4, R1, Re ;<---A POP R5, R6) ADD R5, R5, R4 ADD R6, R6, R5 PUSH (R4-R6); SUBS Re, RO,R1-B a) Show the contents of Stack,...

  • MARIE Assembly Code Problem For the following problem, please create new MARIE instructions by pr...

    MARIE Assembly Code Problem For the following problem, please create new MARIE instructions by providing the full MARIE RTN (register transfer notation) for the described operation. Your answer should include the fetch, decode, operand fetch (if necessary), execution and store result (if necessary) stages. When you see X in these instructions, this is a main memory address (the last 12 bits of the 16-bit instruction) – refer to this as IR[11..0] and not X. Also, assume there is an additional...

  • Problem 1 Write a find subroutine that can locate a specified 8-bit quantity in a null-terminated...

    Problem 1 Write a find subroutine that can locate a specified 8-bit quantity in a null-terminated string 8-bit quantities. (Remember that null terminated means "it ends with zero"). The subroutine is passed two parameters. The pointer to the array is passed in array X, the value to be found is passed in ACCA. The function should return the index of the first occurrence of the value in ACCB, or -1 (0xFF) if the value is not found. a) Write the...

  • 6. An 8-bit shift register has the binary equivalent of the decimal number 46 stored in it What a...

    6. An 8-bit shift register has the binary equivalent of the decimal number 46 stored in it What are the base-10 equivalent contents of the register after the following operations have been performed? For each case, assume the same initial state given. [15pts] (a) SHR 1 (b) SHL 1 (c) SHR 2 (d) ROR 2 6. An 8-bit shift register has the binary equivalent of the decimal number 46 stored in it What are the base-10 equivalent contents of the...

  • 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,...

  • 8. Given: struct STACK INF RC 1301 int top that the following functions have already been...

    8. Given: struct STACK INF RC 1301 int top that the following functions have already been declared in a stack tolkit and are available for create stack(s) push(s, item) pop(s, item) topls, item) empty(s) Boolean function use some or all of them to write the complete definition code for a function that passes in a stack (as an argument), removes the SECOND assume that there are at least two items in the stack). item (from the top) in the stack,...

  • The AVR provides a rich instruction set to support high-level languages. The AVR address- ing modes...

    The AVR provides a rich instruction set to support high-level languages. The AVR address- ing modes also simplify the access of complex data structures. The AVR has a version of the ADD instruction that includes the C flag as one of the source operands, which enables multiple- precision addition operation. The AVR also has a version of the SUB instruction that includes the C flag as one of source operands and hence is used to perform multiprecision subtraction operation. The...

  • Exercise 1. What is the size of the memory for the microprocessor if it has 24-bit...

    Exercise 1. What is the size of the memory for the microprocessor if it has 24-bit address lines (bus)? Furthermore, give the starting address and the last address of the memory. 2. List the operation modes of the ARM Cortex-M3. 3. What is the function of register R13? Register R14? Register R15? 4. On an ARM Cortex-M3, in any given mode, how many registers does a programmer see at one time? 5. Which bits of the ARM Cortex-M3 status registers...

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