/* This program just puts some stats to the screen. Notice the lack of thje printf function. I am not going to recode it or bother ripping it out of Borland's libs. If you want, do that yourself. */ #include "pmc.h" STR nums (DWORD n); void putstrs (STR s1, STR s2); void PMmain (void) { static char processors[][6] = { "80386", "80486", "80586" }; static char PMtypes[][5] = { "raw", "XMS", "VCPI", "DPMI" }; putstrs ("Current CPL: ", nums (CPL)); putstrs ("Processor is: ", processors[processor - 3]); putstrs ("Protected mode type is: ", PMtypes[PMtype]); putstrs ("Master PIC base interrupt: ", nums (PICmaster)); putstrs ("Slave PIC base interrupt: ", nums (PICslave)); putstrs ("Largest free memory block: ", nums (coreleft ())); putstrs ("Largest free low memory block: ", nums (locoreleft ())); putstrs ("Largest free extended memory block: ", nums (hicoreleft ())); } void putstrs (STR s1, STR s2) { dosputstr (s1); dosputstr (s2); dosputstr ("\r\n"); } STR nums (DWORD n) { static char s[] = "________"; int a, b; for (a=7; a>=0; a--) { b = n&15; s[a] = b<10 ? b+'0' : b+'A'-10; n >>= 4; } return s; }