3 ms·
> For example, add eax, 512 translates to 05 00 02 00 00. > The first byte (05) is an opcode specifically representing adding the EAX register to a 16-bit numb
by tromp 3y ago
> For example, add eax, 512 translates to 05 00 02 00 00.
> The first byte (05) is an opcode specifically representing adding the EAX register to a 16-bit number. The remaining bytes are 512 (0x200) in little-endian byte order.
That explains only the first 3 of the 5 bytes in the instruction. What are the remaining 00s for? Did he perhaps mean that the opcode is for adding EAX to a 32-bit number?
- cormacrelf 3y agoIf it’s talking about x86, then yes the eax register is 32 bits wide. The low 16 bits of the same register are called “ax”.
- archmaster 3y ago*she and whoops, yep, I think that's supposed to say 32-bit. Good catch.