Skip to content

Instantly share code, notes, and snippets.

@japesinator
Created October 28, 2014 19:02
Show Gist options
  • Save japesinator/4c6f58be7cbf87db905c to your computer and use it in GitHub Desktop.
Save japesinator/4c6f58be7cbf87db905c to your computer and use it in GitHub Desktop.
Are these the same?
MOV $23133,%ebx
MOV $12733,%eax
MOV $27798,%ecx
CMP %eax,%ebx
JL L1
JMP L2
L1:
IMUL %eax,%ebx
ADD %eax,%ebx
MOV %ebx,%eax
SUB %ecx,%eax
JMP L3
L2:
IMUL %eax,%ebx
SUB %eax,%ebx
MOV %ebx,%eax
ADD %ecx,%eax
L3:
NOP
MOV ebx,23133
MOV eax,12733
MOV ecx,27798
CMP ebx,eax
JL L1
JMP L2
L1:
IMUL ebx,eax
ADD ebx,eax
MOV eax,ebx
SUB eax,ecx
JMP L3
L2:
IMUL ebx,eax
SUB ebx,eax
MOV eax,ebx
ADD eax,ecx
L3:
NOP
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment