Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Lets count 10 to 0 in Assembly Language (Assenbly Language program to loop 10 times)
;Author : Sanjib Narzary
;Institute: NIT Calicut
;Email: o-._.-o@live.com
;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
You can’t perform that action at this time.