Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- %include "io.inc"
- section .text
- global CMAIN
- GCD:
- push ebp
- mov ebp, esp
- push ebx
- mov ecx, [ebp + 8]
- mov ebx, [ebp + 12]
- .LOOP:
- cmp ebx, 0
- jle .end
- mov eax, ecx
- cdq
- div ebx
- mov ecx, ebx
- mov ebx, edx
- jmp .LOOP
- .end:
- mov eax, ecx
- pop ebx
- leave
- ret
- CMAIN:
- GET_DEC 4, ebx
- GET_DEC 4, esi
- push ebx
- push esi
- call GCD
- pop esi
- pop ebx
- GET_DEC 4, ebx
- mov esi, eax
- push ebx
- push esi
- call GCD
- pop esi
- pop ebx
- GET_DEC 4, ebx
- mov esi, eax
- push ebx
- push esi
- call GCD
- pop esi
- pop ebx
- PRINT_DEC 4, eax
- xor eax, eax
- ret
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement