Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- global _lcm
- section .text
- _lcm:
- push ebp
- mov ebp, esp
- cmp dword [ebp+12], 0
- je .BaseCase
- .recurse:
- mov eax, [ebp+8] ; eax <-- 32-bit "a"
- xor edx, edx ; edx <-- upper 0 bits
- div dword [ebp+12]
- push edx ; reszta jest nowym "b"
- mov eax, [ebp+12]
- push eax ; stare "b" jest nowym "a"
- call _lcm ; wywołanie rekurencji dla ogona
- leave ; albo skaczemy do .done aby skończyć
- ret
- .BaseCase:
- mov eax, [ebp+8]
- .done:
- leave
- ret
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement