flat assembler
Message board for the users of flat assembler.

Index > Heap > top 20 instructions of x86 architecture

Author
Thread Post new topic Reply to topic
vbVeryBeginner



Joined: 15 Aug 2004
Posts: 884
Location: \\world\asia\malaysia
vbVeryBeginner
Image

i found this chart on peter website and think (it would quite nice for everybody to see it)
http://smallcode.weblogs.us/2006/04/22/x86-machine-code-statistics/
Post 10 May 2006, 11:56
View user's profile Send private message Visit poster's website Reply with quote
zhak



Joined: 12 Apr 2005
Posts: 490
Location: Belarus
zhak
hmm, CALL has 6% but RET only 1%.
So then there's no return from every 6th procedure...
Post 10 May 2006, 12:55
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
zhak: you can call same procedure multiple times Wink
Post 10 May 2006, 13:04
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
Barf



Joined: 17 Sep 2004
Posts: 34
Location: Poland
Barf
zhak, why? You have one function, but you can call it 6 times Wink
Post 10 May 2006, 13:05
View user's profile Send private message Reply with quote
Madis731



Joined: 25 Sep 2003
Posts: 2140
Location: Estonia
Madis731
The page says that its the code they measure not EXECUTION. So it makes me wonder - sometimes you have many exits from your call. Event1 happens RET here, but if event7 happens, RET here.

The amount of push means that the code they used was C originally. Usually ASMers don't use much stack but more registers...

I think there are a lot of XOR/OR/AND/ etc in my ASM-code and a lot less MOVes.
Post 10 May 2006, 13:30
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger Reply with quote
zhak



Joined: 12 Apr 2005
Posts: 490
Location: Belarus
zhak
Quote:
You have one function, but you can call it 6 times

Oh, sure. It's certainly so.
I just frequently don't return from my own procedures, using various tricks... or use rets without calls.
Post 10 May 2006, 13:44
View user's profile Send private message Reply with quote
MazeGen



Joined: 06 Oct 2003
Posts: 977
Location: Czechoslovakia
MazeGen
This statistic would be also interesting:

http://vx.netlux.org/lib/vzo15.html
Post 10 May 2006, 14:41
View user's profile Send private message Visit poster's website Reply with quote
f0dder



Joined: 19 Feb 2004
Posts: 3170
Location: Denmark
f0dder
Quote:

The amount of push means that the code they used was C originally. Usually ASMers don't use much stack but more registers...

If you claim to measure "Top 20 x86 instructions", you need to analyze either "all programs out there" (infeasible) or "a good repesentative of the code out there". HLLs have absolute dominance, and I guess C/C++ has a pretty fair share of the HLL languages.

zhak wrote:
Quote:
You have one function, but you can call it 6 times

Oh, sure. It's certainly so.
I just frequently don't return from my own procedures, using various tricks... or use rets without calls.

That's pretty bad for performance on recent architectures with call/ret pairing...

_________________
Image - carpe noctem
Post 10 May 2006, 14:50
View user's profile Send private message Visit poster's website Reply with quote
peter



Joined: 09 May 2006
Posts: 63
peter
Quote:
This statistic would be also interesting

Thank you for this link! It's nice so see that top 3 instructions (mov, push, call) are the same as in my chart.

Quote:
If you claim to measure "Top 20 x86 instructions", you need to analyze either "all programs out there" (infeasible) or "a good repesentative of the code out there". HLLs have absolute dominance, and I guess C/C++ has a pretty fair share of the HLL languages.


Yes, I analyzed three applications compiled with MS Visual C++ 6.0. Total size of exe files was about 1.3 Mb. May be somewhen in future, I will try to get more representative results by analyzing code from other compilers too.
Post 11 May 2006, 01:35
View user's profile Send private message Visit poster's website Reply with quote
Madis731



Joined: 25 Sep 2003
Posts: 2140
Location: Estonia
Madis731
f0dder wrote:
Quote:

The amount of push means that the code they used was C originally. Usually ASMers don't use much stack but more registers...

If you claim to measure "Top 20 x86 instructions", you need to analyze either "all programs out there" (infeasible) or "a good repesentative of the code out there". HLLs have absolute dominance, and I guess C/C++ has a pretty fair share of the HLL languages.


Well, I thought that this was ASM board and would be nice to know something close to us Smile but anyway, good job!

To make it more interesting why not try to read statistics from games (3D, MMX, SSE) and then CAD programs etc. It think they will all have different results at least on some instructions.

_________________
My updated idol Very Happy http://www.agner.org/optimize/
Post 11 May 2006, 07:23
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger Reply with quote
f0dder



Joined: 19 Feb 2004
Posts: 3170
Location: Denmark
f0dder
Quote:

Well, I thought that this was ASM board and would be nice to know something close to us Smile but anyway, good job!

Sure, that *would* be interesting, especially compared against the HLL chart!

Quote:

To make it more interesting why not try to read statistics from games (3D, MMX, SSE) and then CAD programs etc. It think they will all have different results at least on some instructions.

Yeah - and analyze a lot more programs Smile
Post 11 May 2006, 13:26
View user's profile Send private message Visit poster's website Reply with quote
peter



Joined: 09 May 2006
Posts: 63
peter
Quote:
why not try to read statistics from games (3D, MMX, SSE) and then CAD programs

Licenses for these programs prohibit disassembling, that's why I can't do it (at least, I can't publish such results Wink.

Here is the awk script I used to gather statistics. You can analyze your favorite programs with it to see what instructions they contain.
Post 18 May 2006, 10:41
View user's profile Send private message Visit poster's website Reply with quote
f0dder



Joined: 19 Feb 2004
Posts: 3170
Location: Denmark
f0dder
Peter, do you think that anybody really cares? Also, is "disassembling" prohibitied, or is it just reverse engineering?

A lot of games probably can't be analyzed that way though, because of compression/encryption.
Post 18 May 2006, 11:39
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
peter: that wouldn't be disassembling. Disassembling is converting from machine code to assembly. You don't need to convert anything, you just look at the instruction in machine code.
Post 18 May 2006, 11:40
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
f0dder



Joined: 19 Feb 2004
Posts: 3170
Location: Denmark
f0dder
vid wrote:
peter: that wouldn't be disassembling. Disassembling is converting from machine code to assembly. You don't need to convert anything, you just look at the instruction in machine code.


That does require disassembly of the instructions... not disassembly as in "convert to text", but even if you just want to get the instructions lengths, you'll need a Length Diassembly Engine Smile

_________________
Image - carpe noctem
Post 18 May 2006, 12:07
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
same thing is done by your processor during execution. is this too violation of law?
Post 18 May 2006, 13:25
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
f0dder



Joined: 19 Feb 2004
Posts: 3170
Location: Denmark
f0dder
vid wrote:
same thing is done by your processor during execution. is this too violation of law?


I were going to ask just about that question if you hadn't Smile

Many EULAs are very silly, and just about everything would be illegal according to them if you were faced by a pedantic judge.

_________________
Image - carpe noctem
Post 18 May 2006, 13:28
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
i don't know where you from, but our law says that if some part of license is against law, or contradictory, then it is not valid...
Post 18 May 2006, 13:47
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
f0dder



Joined: 19 Feb 2004
Posts: 3170
Location: Denmark
f0dder
vid wrote:
i don't know where you from, but our law says that if some part of license is against law, or contradictory, then it is not valid...


I think it's like that in Denmark too, and probably even in the USA. But time and time again it has been shown that you shouldn't underestimate the power of big corporations >_<

_________________
Image - carpe noctem
Post 18 May 2006, 17:18
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 can attach files in this forum
You can download files in this forum


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

Website powered by rwasa.