converting

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
deus_the_programmer

converting

Post by deus_the_programmer »

Hi can someone help me convert this code to ANSI C

many thanks,
ed.


#include<iostream.h>
#include<conio.h>
void main(void)
{
clrscr();
unsigned long int a, b, c, d;

  _asm mov eax, 0xe801
  _asm int 0x15
  _asm mov dword ptr a, ax
  _asm  mov dword ptr b, bx
  _asm mov dword ptr c, cx
  _asm mov dword ptr d, dx

cout<<a<<endl<<b<<endl<<c<<endl<<d<<endl;
unsigned long extendedSize = (unsigned long) a + ((unsigned long) b << 6);
unsigned long configuredSize = (unsigned long) c + ((unsigned long) d << 6);

cout<<endl<<extendedSize ;
getch();


}
Anton

RE:converting

Post by Anton »

You can't translate this to ANSI C, since it does not support interrupts.
deus_the_programmer

RE:converting

Post by deus_the_programmer »

can it be converted into pure asm?
thanks,
ed.
Anton

RE:converting

Post by Anton »

Yes, ofcourse. But you could as well use a (non standard-not ANSI) function called int86 or something of that sort.
Anton.
deus_the_programmer

RE:converting

Post by deus_the_programmer »

ok so how do  convert it into c?
ed.
ASHLEY4

RE:converting

Post by ASHLEY4 »

In asm what do you want to do, as i do not under stand some of the c++ code.

ASHLEY4.
Post Reply