The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: Gunner on January 22, 2011, 02:39:00 AM

Title: Question about function use
Post by: Gunner on January 22, 2011, 02:39:00 AM
If I have one parameter to a function and the pointer is already in esi, do I need to push esi?  Both work, but I am guessing the last one is better with a less push?

original:

invoke ParseLine, [esi]

ParseLine proc uses esi edi ebx pArray:DWORD

mov esi, pArray



call ParseLine

ParseLine proc uses esi edi ebx

mov esi, [esi]
Title: Re: Question about function use
Post by: jj2007 on January 22, 2011, 02:46:45 AM
"Less push" is better. And you don't need "use esi" except if your proc changes esi and you need the old value.
Title: Re: Question about function use
Post by: Gunner on January 22, 2011, 02:54:16 AM
Good to know!