Created
May 30, 2018 15:06
-
-
Save kurotych/c69cd250272f097d96de7a28f6721542 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.text | |
.global _start | |
_start: | |
mov $2, %eax | |
mov $3, %edx | |
call power | |
mov %eax, %ebx | |
mov $1, %eax | |
int $0x80 | |
power: | |
test %edx, %edx | |
jz RETURN_ONE | |
mov %eax, %ebx | |
dec %edx | |
LOOP: | |
imul %ebx, %eax | |
dec %edx | |
jnz LOOP | |
cmp $0, %edx | |
jmp RETURN | |
jle LOOP | |
RETURN: | |
ret | |
RETURN_ONE: | |
mov $1, %eax | |
ret |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment