#include <stdio.h>
#include <dos.h>
#include <conio.h>
int main()
    int i;
    printf("CMOS Dump (format [address=value])");
        printf(" [%2x=%2x] ",i,inp(0x71));

This program compile but not run ,it give runtime error.
How to solve it??

You're still not listening.

The OS does NOT allow you to go poking around the hardware in any manner you like. Even if you do manage to get it to compile, that's no guarantee of success.

Plus, saying "an error" is meaningless. Provide actual details.

I m looking for bios password...so trying to open 70h port.
it gives runtime error like this.... Abc.exe has encountered a problem and needs to close. We are sorry for the inconvenience.

send error report don't send
how to solve it??

i am using windows xp

With regard to the subject, NT and XP are quite alike.

Thanks..for solving problem to open port
I want to read cmos..value of bios data is stored in 1DH 1CH..my code is

void readpasschecksum()
     int i,j=0;
    printf("[Check sum cal from 0x10 to 0x2d = %x]\n",j);
    printf(" [ 0x2e = %x ]\n",inp(0x71));
    printf(" [ 0x2f = %x ]\n",inp(0x71));
    checksumcal = readcmos(0x1D); /*hashed value is stored at 1DH and 1CH
here is problem it can not read cmos
    checksumcal = checksumcal*256+readcmos(0x1C);
        printf("The check sum = %u ",checksumcal);

port 1DH and 1CH accessing..through porttalk
but when read cmos as i mentioned in code program can not run...it stops what to do??

Use winio perhaps? http://www.internals.com/
But this is really just a hack to get your hack to work.

There are some tutorials on the net for doing this "properly" using the proper access mechanisms through the NT drivers, but they don't make for very easy reading.