Search code examples
performanceassemblycpucpu-architecturecpu-registers

Must CPU have an accumulator?


Before you laugh at me: I want to ask arithmetic operation is done in ALU unit or accumulator. I read a book it says accumulator is a register for doing arithmetic.

This Accumulator said

Without a register like an accumulator, it would be necessary to write the result of each calculation (addition, multiplication, shift, etc.) to main memory, perhaps only to be read right back again for use in the next operation.

Does this mean that without accumulator the operation itself still can be done?

I'm from high level language I need to understand it.


Solution

  • Yes, you don't need an accumulator for a CPU. For example, stack-based processors typically only have one or two stack pointers but no accumulator. As the article says, these processors load the values to operate on from memory just prior to operation.