CPUs and architecture

When a program calls a subroutine (function), which area is generally used to temporarily save the return address and similar information?

  1. AThe stack
  2. BCache tags
  3. CA fixed region of ROM
Show answer and explanation

Answer: A. The stack

When a subroutine is called, the return address, register values, local variables and so on are pushed onto the stack. The stack is last-in, first-out (LIFO), so even nested calls return in the correct order. The stack pointer indicates the top of the stack.

  • A. Correct. Return addresses and similar data are saved on the stack.
  • B. Cache tags indicate which address the cached data belongs to.
  • C. ROM cannot be written, so it cannot be used for temporary storage at run time.
Practice this topic Back to topic

More CPUs and architecture questions

  1. Which correctly lists the "three Cs" classification of cache misses?
  2. In an out-of-order CPU, which mechanism commits (retires) the results of instructions executed out of order in the program's original order?
  3. What is the main purpose of register renaming in out-of-order CPUs?
  4. In AI accelerators and similar, which architecture arranges many multiply-accumulate units in a grid and computes matrix products by passing data from one unit to the next?
  5. Which model plots whether a program's performance is limited by compute throughput or memory bandwidth, using arithmetic intensity (operations per byte) on the horizontal axis?