Mix (C++ and Assembly) Program to Subtract Two 16 bit Numbers (With DAS)

#include<iostream.h>
#include<conio.h>
#include<stdio.h>
void main()
{
clrscr();
int a,b,c;
cout<<"Enter First Number:";
cin>>a;
cout<<"Enter Second Number:";
cin>>b;
asm mov ax,a
asm mov bx,b
asm sub ax,bx
asm das
asm mov c,ax
cout<<"Result:";
cout<<c;
getch();
}

/*

Enter First Number:999
Enter Second Number:351                                                         
Result:642                                                                      
                                                                                
*/

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.