5

While using cheat engine I stumbled upon that both of these opcodes results in the same assembly code:

03C8 add ecx,eax

and

01C1 add ecx,eax

Why is this and is there any difference?

Tyilo
  • 28,998
  • 40
  • 113
  • 198
  • http://www.strchr.com/machine_code_redundancy – phuclv Mar 06 '14 at 14:04
  • http://stackoverflow.com/questions/22217436/encoding-adc-eax-ecx-2-different-ways-to-encode-arch-x86?rq=1 – phuclv Jan 05 '15 at 17:28
  • Possible duplicate of [Encoding ADC EAX, ECX - 2 different ways to encode? (arch x86)](https://stackoverflow.com/questions/22217436/encoding-adc-eax-ecx-2-different-ways-to-encode-arch-x86) – phuclv Dec 06 '17 at 12:37

1 Answers1

13

The 01 form is add r/m, r, the 03 form is add r, r/m. Since both operands are registers, it can be encoded either way.

harold
  • 61,398
  • 6
  • 86
  • 164