I was looking at the different instructions in assembly and I am confused on how the lengths of different operands and opcodes are decided upon.
Is it something you ought to know from experience, or is there a way to find out which operand/operator combination takes up how many bytes?
For eg:
push %ebp ; takes up one byte
mov %esp, %ebp ; takes up two bytes
So the question is:
Upon seeing a given instruction, how can I deduce how many bytes its opcode will require?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…