flat assembler
Message board for the users of flat assembler.

Index > High Level Languages > Stack Frames

Author
Thread Post new topic Reply to topic
yetifoot



Joined: 20 May 2006
Posts: 7
yetifoot 21 May 2006, 01:43
Looking at the PROC macro in FASM, and some disassembly of C procedures, i see that they use leave to tidy up. However some other compilers don't.

I'm a relative newbie in this area and was wondering why some compilers/coders use leave rather than mov esp, ebp pop ebp

Also, if they use leave why do they not use enter?
Post 21 May 2006, 01:43
View user's profile Send private message Reply with quote
yetifoot



Joined: 20 May 2006
Posts: 7
yetifoot 22 May 2006, 03:09
Its OK, I managed to track it down after many hours of googlin' at microsoft of all places!

For anyone interested I found it here.

http://www.microsoft.com/msj/0298/hood0298.aspx

Apparently its because leave is smaller compared to its equivilent, but enter actually is slower than the equivilent code.

I still don't get why some HLLs don't use leave, but thats another story i guess.
Post 22 May 2006, 03:09
View user's profile Send private message Reply with quote
zubi



Joined: 27 Apr 2006
Posts: 25
Location: Turkey
zubi 22 May 2006, 16:07
I think it's a nice article for anyone who wants to learn assembly.
Post 22 May 2006, 16:07
View user's profile Send private message MSN Messenger Reply with quote
yetifoot



Joined: 20 May 2006
Posts: 7
yetifoot 24 May 2006, 16:58
I found this on my travels too, its also on microsoft(strange!)

A blog by someone at microsoft, who seems like he knows what he's talking about. Some of the entrys on windows hacks are very interesting.

http://blogs.msdn.com/oldnewthing/archive/2004/01/08/48616.aspx
Post 24 May 2006, 16:58
View user's profile Send private message Reply with quote
f0dder



Joined: 19 Feb 2004
Posts: 3175
Location: Denmark
f0dder 24 May 2006, 17:46
Quote:

A blog by someone at microsoft, who seems like he knows what he's talking about. Some of the entrys on windows hacks are very interesting.

Contrary to popular belief Smile, Microsoft actually does have some very skilled programmers. The kernel team are a bunch of pretty decent programmers. Based on his blog, Raymond Chen (OldNewThing) is one of the more skilled guys there as well.

What ruins it, of course, is the incoherent win32 API, and all the bloat ontop of that.

Jay!!1one!
Post 24 May 2006, 17:46
View user's profile Send private message Visit poster's website Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid 24 May 2006, 21:11
it would be fine if someone wrote a goof procedure entry and exit tutorual. I wrote one, but just for classmates, in Slovak language, and there were not anything about local variables.
Post 24 May 2006, 21:11
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
yetifoot



Joined: 20 May 2006
Posts: 7
yetifoot 28 May 2006, 17:42
I didn't mean to rag on microsoft so much, i'm sure they have many good programmers there, and i really think XP in general is very good. My main issue is with the documentation, which often is very patchy, and as shown many times on Raymonds blog, points developers in the wrong direction (causing the need for the many shims he talks about)

I also found it quite refreshing that Raymond is not squeemish about talking about the bad things, and why they happen.
Post 28 May 2006, 17:42
View user's profile Send private message Reply with quote
f0dder



Joined: 19 Feb 2004
Posts: 3175
Location: Denmark
f0dder 28 May 2006, 17:45
Raymond's pretty cool, and I also like that he's not afraid to call a hack a hack Smile

IMHO MS did wrong in making shims to make broken software work - they should have let it break, but contact the developers about it. After all, MS are in a decent position to say "hey, we've noticed you do this wrong, you really ought to fix it".
Post 28 May 2006, 17:45
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-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.