How would I know how many bytes is the size of a specific instruction?

Does it have to do with the number of operands that the instruction takes?
Like mov, has 2 operands, therefore 2 bytes in size.

Is there a reference table that has the most commonly used instructions with their sizes?
Posted on 2006-10-07 09:31:22 by belhifet
Instruction size depends on a number of factors, for example a register to register move may take 2 bytes but since an address is 4 bytes, a move from an address to a register would take at least 5 bytes. If you are executing an instruction that uses a different data size than the default you would also have a mod prefix to indicate that, another byte. Relative addresses (relative to EIP) are +/- 127 bytes from EIP and therefore the the address is encoded in a single byte. The full table and mods are given in the Intel I86 instruction set reference.
Posted on 2006-10-07 09:45:03 by donkey
It's a somewhat complex task to disassemble instructions, even if you only want their lengths. Can be useful sometimes, like Microsoft "detours" package.
Posted on 2006-10-08 16:53:08 by f0dder