The MASM Forum

General => The Campus => Topic started by: DanWebb314 on June 13, 2012, 05:41:21 AM

Title: accum
Post by: DanWebb314 on June 13, 2012, 05:41:21 AM
In the help file (Intel Opcodes and Mnemonics) of "masm32\qeditor.exe" program,  'accum'  shows up an an opperand.  What is 'accum'?  Is it different than the 'EAX' reg?

Thank you
Dan
Title: Re: accum
Post by: jj2007 on June 13, 2012, 06:25:50 AM
In older CPUs, a special register served to "accumulate" intermediate results. Modern x86 CPUs do not distinguish any longer between accumulator (eax) and other general purpose registers. However, there are still traces of eax' history as an accumular; for example, xchg eax, reg32 is a one-byte instruction, while all other pairs take two bytes.

There are still many instructions that are linked to specific registers, e.g. cmpxchg, imul/mul, idiv/div, enter, leave, jecxz, cwd, cwde, cdq, scas, lods, stos, movs, cmps, push & pop, daa, das, in, out, ins, lahf, sahf, call, ret, xlat, and those opcodes that start with AA.
Title: Re: accum
Post by: dedndave on June 13, 2012, 06:57:17 AM
as Jochen mentioned - old school nomenclature   :P
for the 8088 (et al), the letters used to name registers actually meant something
AX - accumulator
BX - base
CX - count
DX - data
SI - source index
DI - destination index
BP - base pointer
SP - stack pointer
IP - instruction pointer

also - the term is quite often used by programmers to describe the way a certain operation works
you might have a loop that keeps a running total, adding something to it with each pass
that register may be thought of as an accumulator - no matter which register it is
that's just one example - there are many others
Title: Re: accum
Post by: DanWebb314 on June 13, 2012, 07:23:58 AM
Great response!
Thank you
:greenclp: