Saturday, November 5, 2011

Assembly language coding using C


This is a very simple code written in C language. You can read this program and can get help of, how to execute assembly codes in C compiler. This simple code will compare whether you have entered 1 or 2 or 3
#include<stdio.h>
#include<conio.h>
void main()
{
int n1,n2;
clrscr();
printf("Enter a number:");
scanf("%d %d",&n1);
asm mov ax,n1;

asm cmp ax,1;
asm jnz l1;
printf("1");
l1:
asm cmp ax,2;
asm jnz l2;
printf("2");
l2:
asm cmp ax,3;
asm jnz l3;
printf("3");
l3:
getch();
}

0 comments:

Post a Comment

You are most welcome for making comments here. I will consider your view and will reply you soon.