Computer Science: An Overview: Global Edition (12th Edition)

Published by Pearson Higher Education
ISBN 10: 1292061162
ISBN 13: 978-1-29206-116-0

Chapter 8 - Data Abstractions - Chapter Review Problems - Page 409: 16

Answer

In this case would be address 11.

Work Step by Step

The value retrieved by a pop instruction would be the value at the current stack pointer, which is \( \mathrm{~A} \) (at address 12). After the pop operation, the stack pointer would point to the next value in the stack, which in this case would be address 11. Given table: Address Contents 10 F 11 C 12 A 13 B 14 E Given: Base of the stack = address 10 Stack pointer (SP) = 12 So: Value popped: → Value at address 12 = A Update stack pointer: → SP = SP − 1 = 12 − 1 = 11 Final Answers Question Answer Value retrieved by POP A New stack pointer value 11 Summary of the stack after the pop: Address Contents Comment 10 F still in stack 11 C now top of stack 12 A removed 13 B unused (above stack) 14 E unused (above stack) So the new top of stack is now C (at address 11).
Update this answer!

You can help us out by revising, improving and updating this answer.

Update this answer

After you claim an answer you’ll have 24 hours to send in a draft. An editor will review the submission and either publish your submission or provide feedback.