/*This C program displays the size of installed extended memory as reported by BIOS to CMOS RAM locations 30H and 31H during power-up. */ #include #include main() { unsigned char b1,b2; int extmem; int w; /* upper byte of word size extended memory */ outp(0x70,0x30); /* get the low byte */ b1=inp(0x71); outp(0x70,0x31); /* get the high byte */ b2=inp(0x71); w=0x100*b2; /* shift left 2 hex digits to make it upper byte */ extmem=w+b1; /* add it to lower byte and display the size */ printf("The extended memory installed is: %d KB \n",extmem); }