#include <dos.h>

main(argc, argv)
char **argv;
{
    union REGS regs;

    regs.h.ah = 0x0f;	/* get current video mode */
    int86(0x10, &regs, &regs);
    printf("current mode is %d (0x%x)\n", regs.h.al);
    if (argc < 2)
	exit(0);

    regs.h.ah = 0;
    regs.h.al = atoi(argv[1]);
    int86(0x10, &regs, &regs);

    regs.h.ah = 0x0f;	/* get current video mode */
    int86(0x10, &regs, &regs);
    printf("new mode is %d (0x%x)\n", regs.h.al);
}
