Thread: calling ...
View Single Post
Re: calling ...
Old
  (#8)
Lazy
Member
 
Lazy's Avatar
 
Status: Offline
Posts: 236
Join Date: Jan 2004
Location: Toronto, Ontario, Canada
Default Re: calling ... - 16-02-2005

If you pass say 5 parameters to a function using variable parameters...

main:
--------
push 9
push 7
push 3
push 5
push "a string"
call Function1

Function1:
-------------
push "a string" ( Same one as was passed to us )
call Function2

Function2:
-------------
Hopes that the variable arguments are still in the correct order on the stack!

Ofcourse that is inaccurate but hopefully it shows that when anything wants to access those variable arguments they may get the address of a string instead since things are popped off the stack in reverse order.

Hopefully I'm not too wrong on that so correct me if thats the case.
  
Reply With Quote