Created
January 11, 2012 06:59
-
-
Save sanjibnarzary/1593466 to your computer and use it in GitHub Desktop.
Lets count 10 to 0 in Assembly Language (Assenbly Language program to loop 10 times)
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
;Author : Sanjib Narzary | |
;Institute: NIT Calicut | |
;Email: [email protected] | |
;Assembly Code | |
section .text | |
global main | |
extern printf | |
main: | |
mov ebx,10 ;number 10 to ebx | |
loop: push ebx ;first parameter | |
push message ;second parameter | |
call printf ;call inbuilt printf statement for outputting | |
dec ebx ;decrement the value of ebx by 1 | |
jnz loop ;if not equal to zero go to loop | |
add esp,80 ;clear all the stack | |
ret | |
message db "Value = %d",10,0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Too much comments...
However, these are useful for beginners, but it impacts readibility a lot