I'm computing a memory requirement for my app handling with instructions.
I wonder what can be typical instruction lenght average of general-purpose, x86 FPU and system instructions (except MMX, SSE, SSE2 and PNI groups) in these days? Have in mind any typical programs for Win32 platforms.
IMHO maximal average is 7 bytes: although only a few instructions are 1-byte, but fewer are with more than 11-bytes.
(for instance <LOCK ADD ES:, imm32> is 13 bytes).

What do you think about? ;)

BitRAKE said in http://www.asmcommunity.net/board/showthread.php?threadid=13867, that average is 8 bytes - pesimistic on purpose.
Posted on 2003-10-16 11:06:00 by MazeGen
i say 6 on average...
Posted on 2003-10-17 00:32:28 by Qages
I think the maximum was 16 bytes.
Posted on 2003-10-17 13:08:15 by QvasiModo

I think the maximum was 16 bytes.

According to processor manuals, maximum is 15 bytes, but in reality software almost doesn't use such instructions (it is not recomended as well).
Posted on 2003-10-17 13:42:21 by MazeGen
When I'm size optimizing the average is two bytes! ;) (search the board for proof) 6-8 is a good guess for average, imho. Code can be wrote that hardly uses any registers and it has very high averages.
Posted on 2003-10-17 21:09:25 by bitRAKE
Just out of curiosity, I have tried to use random number generator and interpret the output bytes as code up to Pentium Pro processor (without MMX). After first tests I got about 2.5 bytes per instruction on average (when illegal instructions are 1-byte long, it means disassembly is synchronized at the next byte).
Posted on 2004-03-09 13:59:34 by MazeGen