www.digitalmars.com         C & C++   DMDScript  

c++.dos.32-bits - Cannot get out and in to work

reply Arthur Becker <artbeck hotmail.com> writes:
I am trying to read the cpu tick counter using port 61h with this code:
	out((in(0x61) & ~0x02) | 0x01, 0x61);
the compiler completes the command (dmc   sysinfo.c) without error but when
attempting to link it fails with the error:
 Error 42: Symbol Undefined _out
 Error 42: Symbol Undefined _in

I tried linking in about 5 of the different lib files in dm\lib but to no avail.
Please help as I can't figure out the running proc speed w/out a tick counter
of some kind.
Thanks.
Feb 14 2007
next sibling parent tjulian <tjulian removethis.oldi.com> writes:
In DMC, the functions you want are _inp() and _outp().

Arthur Becker wrote:
 I am trying to read the cpu tick counter using port 61h with this code:
 	out((in(0x61) & ~0x02) | 0x01, 0x61);
 the compiler completes the command (dmc   sysinfo.c) without error but when
 attempting to link it fails with the error:
  Error 42: Symbol Undefined _out
  Error 42: Symbol Undefined _in
 
 I tried linking in about 5 of the different lib files in dm\lib but to no
avail.
 Please help as I can't figure out the running proc speed w/out a tick counter
 of some kind.
 Thanks.
Feb 15 2007
prev sibling parent Heinz Saathoff <newshsaat arcor.de> writes:
Hello,

Arthur Becker schrieb...
 I am trying to read the cpu tick counter using port 61h with this code:
 	out((in(0x61) & ~0x02) | 0x01, 0x61);
 the compiler completes the command (dmc   sysinfo.c) without error but when
 attempting to link it fails with the error:
  Error 42: Symbol Undefined _out
  Error 42: Symbol Undefined _in
As tjulian already noted the functions are called _inp and _outp (declared in header dos.h). Even if you use this calls you may not get what you want because you compiled your program as a Windows console application. - Heinz
Feb 16 2007