/*
This program just puts some stats to the screen. Notice the lack of the
printf function. I am not going to recode it or bother ripping it out of
Borland's libs. If you want, do that yourself.
*/
/*▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
INTERFACE
▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒*/
#include "pmc.h"
STR nums (DWORD n);
void putstrs (STR s1, STR s2);
/*▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
CODE
▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒*/
//════════════════════════════════════════════════════════════════════════════
void __cdecl PMmain (void)
{
static char processors[][6] = { "80386", "80486", "80586" };
static char PMtypes[][5] = { "raw", "XMS", "VCPI", "DPMI" };
putstrs ("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 ()));
}
/*░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
Put two strings and the a CRLF.
In:
STR s1 = first string to put
STR s2 = second string to put
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░*/
void putstrs (STR s1, STR s2)
{
dosputstr (s1);
dosputstr (s2);
dosputstr ("\r\n");
}
/*░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
Convert a DWORD to a string.
In:
DWORD n = DWORD to convert
Out:
STR = DWORD converted to hex string
Notes:
) The string returned is static, the next call to this function will destroy
the previous contents.
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░*/
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;
}