I wanted to look at the object code for certain instructions to understand them better. My understanding of the modRM byte is that it is useful for the register-to-register opcode 8A
(8-bit) , as it is used to determine the destination and source registers/memory.
My intuition led me to believe that a modRM byte is not necessary for immediate to memory direct, as all you would need is the opcode, address of memory, and the hard coded value.
However when debugging Visual Studio:
mov x, 100 ; x is byte length
the object code is:
c6 05 xx xx xx xx 64
05
must be the modRM byte here.
My question is, what is its significance? Why is it necessary here?