/*
----------------------------------------------------
--
-- Setbaud version 1.0
--
-- Copyright (c) 1983 by David Steffen
-- All Rights Reserved
--
-- Setbaud is Copyright (c) 1983 by David Steffen
-- who assumes no responsibility or liability for its
-- use.  Setbaud is released to the public domain
-- for non-commercial use only.
--
--
-- David Steffen encourages the public to freely
-- copy and use this program for non-commercial
-- purposes.  Any commercial use of this program
-- without prior written authorization by the
-- author, David Steffen, is strictly prohibited.
--
----------------------------------------------------

*/
#include	a:bdscio.h

#define	SETBAUD		20	/* for call on BIOS to change baud */
#define	RESET		0x57
#define BAUD300		0x56
#define BAUD1200	0x55
#define	BAUD9600	0x54

main( argc,argv )

int	argc;
char	*argv[];

{
   puts( "\n\n\n" );
   if ( argc < 1 )
   {
      help();
   }
   else
   {
      switch ( *argv[ 1 ] )
      {
	 case '3':
	 {
	    puts( "Setting baud rate to 300...\n\n" );
	    bios( SETBAUD,BAUD300 );
	    break;
	 }
	 case '1':
	 {
	    puts( "Setting baud rate to 1200...\n\n" );
	    bios( SETBAUD,BAUD1200 );
	    break;
	 }
	 case '9':
	 {
	    puts( "Setting baud rate to 9600...\n\n" );
	    bios( SETBAUD,BAUD9600 );
	    break;
	 }
	 default:
	 {
	    help();
	 }
      }
   }
}

help()

{
   puts( "USAGE:\n" );
   puts( "      SETBAUD \"baud\"<CR>\n\n" );
   puts( "Where \"baud\" is 300,1200, or 9600\n\n" );
}
