flat assembler
Message board for the users of flat assembler.

Index > Main > when proc argument name same as local variables

Author
Thread Post new topic Reply to topic
sleepsleep



Joined: 05 Oct 2006
Posts: 9130
Location: ˛                             ⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣Posts: 334455
sleepsleep
Code:
proc testing var1,var2,var3
locals
     var1 dd 20
  var2 dd 40
  var3 dd 60
endl
  cinvoke sprintf,buffConsole,<'%lu %lu %lu',CR,LF,0>,[var1],[var2],[var3]
    cinvoke printf,buffConsole
  ret
endp
    


i just wonder, should Fasm complain or inform users in such situation?
when proc argument name conflict with local variables?

btw, fasm will use the values inside locals.

or this is a designed feature to preload arguments with default values?
Post 12 Sep 2012, 19:37
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17664
Location: In your JS exploiting you and your system
revolution
sleepsleep wrote:
or this is a designed feature to preload arguments with default values?
No.
Post 12 Sep 2012, 20:39
View user's profile Send private message Visit poster's website Reply with quote
sleepsleep



Joined: 05 Oct 2006
Posts: 9130
Location: ˛                             ⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣Posts: 334455
sleepsleep
revolution wrote:
sleepsleep wrote:
or this is a designed feature to preload arguments with default values?
No.


maybe i just need to be careful when naming proc args and locals vars.

sorry for my stupid question,
Post 12 Sep 2012, 22:29
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17664
Location: In your JS exploiting you and your system
revolution
sleepsleep wrote:
maybe i just need to be careful when naming proc args and locals vars.
I think that is a sensible option. Wink
Post 12 Sep 2012, 22:44
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.