Write an assembly program which uses a loop to increment a counter from 1 to 10
ID: 3873223 • Letter: W
Question
Write an assembly program which uses a loop to increment a counter from 1 to 10 and print the count as it runs. Choose any of the loop styles.
The code should run here:
; file: asm_main.asm sinclude "asm io.inc" : initialized data is put in the .data segment segment .data ; uninitialized data is put in the .bss segment segment .bss ;code is put in the .text segment segment.text asm_main: global asm_main , ; setup routine enter pusha : next print out result message as series of steps popa mov Leave ret eax, return back to CExplanation / Answer
Answer)
below is corresponding c program.
#include <stdio.h>
int main()
{
int cnt=0;
for(cnt=1;cnt<=10;cnt++){
printf("%d",cnt);
}
}
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.