Page 1 of 1

converting

Posted: Sat Jul 10, 2004 11:00 pm
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();


}

RE:converting

Posted: Sun Jul 11, 2004 11:00 pm
by Anton
You can't translate this to ANSI C, since it does not support interrupts.

RE:converting

Posted: Sun Jul 11, 2004 11:00 pm
by deus_the_programmer
can it be converted into pure asm?
thanks,
ed.

RE:converting

Posted: Sun Jul 11, 2004 11:00 pm
by Anton
Yes, ofcourse. But you could as well use a (non standard-not ANSI) function called int86 or something of that sort.
Anton.

RE:converting

Posted: Sun Jul 11, 2004 11:00 pm
by deus_the_programmer
ok so how do  convert it into c?
ed.

RE:converting

Posted: Sun Jul 11, 2004 11:00 pm
by ASHLEY4
In asm what do you want to do, as i do not under stand some of the c++ code.

ASHLEY4.