News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

For what m2m

Started by KoDeR, May 04, 2005, 01:58:43 PM

Previous topic - Next topic

KoDeR

I can't understand for what this MACRO  ::)
   
m2m MACRO M1, M2
      push M2
      pop  M1
   ENDM

mnemonic

The m2m macro simply copies (moves) a value from one [m]emory location to [2] a different [m]emory location using the stack.
You can't do a mov mem, mem but you can simulate it via the m2m macro: m2m mem, mem. But be aware of the fact that you are effectively using the stack.
Be kind. Everyone you meet is fighting a hard battle.--Plato
-------
How To Ask Questions The Smart Way

pbrennick

KoDeR,
Just to add to mnemonic's excellent reply; the stack is a very efficient way of transporting values between memory locations due to the fact that since there are a limitted number of registers it would not be a good idea to waste any.  It is a very efficient macro.

Paul

KoDeR

Thank you mnemonic
it was very good answer  :thumbu