Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SECTION .data
- N DD 100
- msg DB "The result is %d",0xa,0
- SECTION .text
- global main
- extern printf
- main:
- mov ecx, 1
- mov eax, 1
- L1:
- cmp ecx, [N]
- jg L2
- mov eax, ecx
- imul eax, eax
- push eax
- inc ecx
- jmp L1
- L2:
- mov eax, 0
- dec ecx
- L3:
- cmp ecx, 0
- jle L4
- pop edx
- add eax, edx
- dec ecx
- jmp L3
- L4:
- push eax
- push msg
- call printf
- add esp, 8
- ende:
- mov ebx, 0
- mov eax, 1
- int 0x80
Add Comment
Please, Sign In to add comment