Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .data
- min:
- .long 0
- max:
- .long 0
- .text
- .type max_diff,@function
- .global max_diff
- #rdi - a
- #rsi - b
- #rdx - c
- #rcx - d
- max_diff:
- MOV %rdi, min
- MOV %rdi, max
- comp_b:
- CMP min, %rsi
- JL b_min
- MOV %rsi, max
- comp_c:
- CMP min, %rdx
- JL c_min
- MOV %rdx, max
- comp_d:
- CMP min, %rcx
- JL d_min
- MOV %rcx, max
- exit:
- MOVL min, %eax
- MOVL max, %ebx
- SUB %eax,%ebx
- MOVL %ebx, %eax
- RET
- b_min:
- MOV %rsi, min
- JMP comp_c
- c_min:
- MOV %rdx, min
- JMP comp_d
- d_min:
- MOV %rcx, min
- JMP exit
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement