Advertisement
Coriic

Untitled

May 31st, 2017
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. .text
  2. .type max2, @function
  3. .global max2
  4.  
  5. #rdi rsi
  6.  
  7. max2:
  8. MOVL %esi, %edx
  9. ADDL %edi, %edx #a+b
  10. MOVL %edi, %ecx
  11. SUBL %esi, %ecx #a-b
  12. MULL %edi, %esi #a*b
  13. CMP %edx, %ecx
  14. JG sub
  15. add:
  16. MOV %edx, %eax
  17. CMP %eax, %esi
  18. JG mult
  19. RET
  20.  
  21. sub:
  22. MOV %ecx, %eax
  23. JMP add
  24.  
  25. mult:
  26. MOV %esi, %eax
  27. RET
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement