why MASM generated this code

From: Madhur (a_madhur_at_vsnl.net)
Date: 12/30/03


Date: Tue, 30 Dec 2003 20:13:40 +0530


Why this code is generated by the MASM.
The procedure accepts 4 bytes of arguments but it pushes
6 bytes onto stack.

anyproc ptoro arg:dword

a1 db "sdfdf",0

invoke anyproc,a1
   * push 000h ;4 bytes pushed
   * mov al, a1
   * movzx ax, al
   * push ax ;2 bytes pushed

2nd question
========
I have seen this code to be used in local variables.
 lea eax,[ebp-4]

What is meaning of lea in the context of registers?
Registers dont have addresses?
Shouldn't lea be used only with program variables.
What is the meaning of this statement.

--
Winners dont do different things, they do things differently.
Madhur
India
email : madhur<underscore>ahuja<at>yahoo<dot>com


Relevant Pages

  • Re: why MASM generated this code
    ... > I have seen this code to be used in local variables. ... > Registers dont have addresses? ... > Shouldn't lea be used only with program variables. ... > What is the meaning of this statement. ...
    (alt.lang.asm)
  • Re: why MASM generated this code
    ... > Why this code is generated by the MASM. ... > Registers dont have addresses? ... > Shouldn't lea be used only with program variables. ... > What is the meaning of this statement. ...
    (alt.lang.asm)
  • "REPL" inside a function
    ... REPL inside a function (meaning that I could type in expressions ... containing local variables and they would evaluate). ...
    (comp.lang.lisp)
  • Re: "REPL" inside a function
    ... REPL inside a function (meaning that I could type in expressions ... containing local variables and they would evaluate). ...
    (comp.lang.lisp)
  • Re: "REPL" inside a function
    ... REPL inside a function (meaning that I could type in expressions ... containing local variables and they would evaluate). ...
    (comp.lang.lisp)