Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SquareRoot PROC
- push ebp
- mov ebp, esp
- mov EAX, [EBP + 8]
- push EBX
- push ECX
- mov ECX, 0
- mov EBX, 1
- calculate_root:
- sub EAX, EBX
- add ECX, 1
- add EBX, 2
- cmp EAX, 0
- jne calculate_root
- mov [EBP+12], ECX
- pop ECX
- pop EBX
- pop EBP
- RET 4
- SquareRoot ENDP
- start:
- mov ESI, 0
- begin:
- lea EBX, array
- mov EDX, [EBX][ESI] ; move next item in the array
- push EDX
- invoke crt_printf,addr PrintOriginal, EDX ; printf()
- pop EDX
- mov EAX, EDX
- push EDX
- push EAX
- call SquareRoot
- pop EAX
- invoke crt_printf, addr PrintRoot, EAX ; printf()
- add ESI, 4
- cmp ESI, 20
- jb begin
- invoke crt__getch ; getch()
- ret
- end start
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement