News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

accum

Started by DanWebb314, June 13, 2012, 05:41:21 AM

Previous topic - Next topic

DanWebb314

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

jj2007

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.

dedndave

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

DanWebb314

Great response!
Thank you
:greenclp: