Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .data
- index:
- .long 0
- value:
- .long 0
- .text
- .type max_ind,@function
- .global max_ind
- #rdi->rsi->rdx->rcx
- max_ind:
- MOV %rdi, value
- MOV $1, index
- CMP value, %rsi
- JB b_max
- compare_c:
- CMP value, %rdi
- JB c_max
- compare_d:
- CMP value, %rdx
- JB d_max
- exit:
- MOV index, %rax
- RET
- b_max:
- CMP %rsi, value
- JE equal
- MOV %rsi, value
- MOV $2, index
- JMP compare_c
- c_max:
- CMP %rdi, value
- JE equal
- MOV %rdi, value
- MOV $3, index
- JMP compare_d
- c_max:
- CMP %rdx, value
- JE equal
- MOV %rdx, value
- MOV $4, index
- JMP exit
- equal:
- MOV $0, index
- JMP exit
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement