Category : C Source Code
Archive   : SETCOMM_.ZIP
Filename : SETCOMM.C
Output of file : SETCOMM.C contained in archive : SETCOMM_.ZIP
/* setcomm.c */
/* assigns the base address */
/* of a comm port to the BIOS */
/******************************/
/* Raymond F. Genovese 12/88 */
/******************************/
#include
#include
#include
main(argc,argv)
int argc;
char *argv[];
{
char port,x,*endp;
unsigned address;
printf("\nExecuting program: %s\n\n",*argv);
printf("COM port BIOS base addresses.\n\n");
printf("PORT\tAddress(d)\tAddress(h)\n");
printf("--------------------------------------\n");
for(x=0;x<4;x++)
printf(" %d\t%6u\t\t%6X\n",x+1,peek(0x40,x*2),peek(0x40,x*2));
port=atoi(argv[1]);
if((strncmp("x",argv[2]+1,1)==0)||(strncmp("X",argv[2]+1,1)==0)){
endp=argv[2]+strlen(argv[2]);
address=strtoul(argv[2],&endp,16);
}
else
address=atoi(argv[2]);
if(argc!=3){
printf("\nTo modify a COM port base address, enter SETCOMM (com port number) (address)");
printf("\nIf (address) is hexadecimal, enter 0x as the first two digits");
printf("\ne.g., SETCOMM 3 744 or SETCOMM 3 0x2E8\n");
exit(1);
}
printf("\nSetting port %d to base address %6u(d) %4X(h)\n\n",port,address,address);
poke(0x40,(port-1)*2,address);
printf("New COM port BIOS base addresses.\n\n");
printf("PORT\tAddress(d)\tAddress(h)\n");
printf("--------------------------------------\n");
for(x=0;x<4;x++)
printf(" %d\t%6u\t\t%6X\n",x+1,peek(0x40,x*2),peek(0x40,x*2));
printf("\n");
}
Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!
This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.
But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/