Skip to content

Instantly share code, notes, and snippets.

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
;Assembly Code
section .text
global main
extern printf
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
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.