Accumulator
The word is latin and related to "cumulus" - pile,heap. So an accumulator piles something up.There are two meanings of accumulator:
- rechargeable battery - look under this term
- element of a central processing unit of a computer - is described here
The canonical example is summing a list of numbers. The accumulator is set to zero initially, each number in turn is added to the value in the accumulator and only when all numbers have been added is the result written to main memory.
Modern CPUs usually have many registers, all or many of which can be used as accumulators. For this reason, the term "accumulator" is somewhat archaic. Use of it as a synonym for "register" is a fairly reliable indication that the user has been around for quite a while and/or that the architecture under discussion is quite old. The term in full is almost never used of microprocessor registers, for example, though symbolic names for arithmetic registers beginning in "A" derive from historical use of the term "accumulator" (and not from "arithmetic" as is sometimes believed). Confusingly, though, an "A" register name prefix may also stand for "address", as for example on the Motorola 68000 family.
A register, memory location or variable being used for arithmetic or logic (as opposed to addressing or a loop index), especially one being used to accumulate a sum or count of many items. This use is in context of a particular routine or stretch of code. "The FOOBAZ routine uses A3 as an accumulator."
This article (or an earlier version of it) contains material from FOLDOC, used with permission.