Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- %include 'functions.asm'
- section .bss
- num resb LEN
- section .data
- section .text
- global _start
- _start:
- mov eax,SYS_READ
- mov ebx,STDIN
- mov ecx,num
- mov edx,LEN
- int 80h
- mov ebx,1 ;divident
- mov ecx,0 ;number of zeros
- mov edx,5 ;to multiply the divident
- mov eax,0 ;quotient of divison
- loop:
- add ecx,eax ;add the quotient of result
- mov eax,ebx ;move divident to eax
- mov edx,5 ;move 5 to edx to multiply
- mul edx ;multiply last divident with 5
- mov ebx,eax ;move divident to ebx
- mov eax,num ;move number to eax to call atoi
- call atoi
- div ebx ;divide number by current divident
- cmp eax,1 ;if quotient is less than 1 finish
- jge loop
- out:
- mov eax,ecx ;move result to eax to print
- call iprintLF
- call quit
Add Comment
Please, Sign In to add comment