
11. SAMPLE PROGRAM
B–61863E–1/06
APPLICATION
PROGRAMMING GUIDE
454
(1) Source file “demo.c”
/**
*
* Module name : demo.c
*
* Function : demonstration program
*
**/
#include ”stdlib.h”
#include ”stdio.h”
#include ”pmclib.h”
#define CRTTYPE 2 /* CRT type */
#define CRT_14 3 /* CRT 14” */
#define CRT_10 4 /* CRT 10” */
#define NOGRAP 6 /* graphic option nothing */
#define IP 0x98 /* key code(INPUT) */
#define FRAME_COLOR 7 /* white */
#define SCREEN_COLOR 4 /* blue */
#define FRAME_LINE 0 /* solid line */
void far main() ;
void titledsp();
void keycode() ;
/* message data */
const char * const title_data[12] = {
”INPUT KEY=”,
”KEY CODE(HEX)=”,
”KEY CODE(DEC)=”,
”KEY CODE(OCT)=”,
”COLOR INPUT KEY”,
”BLUE-------------------->B”,
”RED---------------------->R”,
”GREEN------------------->G”,
”YELLOW----------------->Y”,
”PINK-------------------->P”,
”SKYBLUE--------------->S”,
”WHITE------------------->W”
};
/* message position */
const static short strpos_14[][2] = {
45, 15,
45, 17,
45, 18,
45, 19,
45, 6,
45, 7,
45, 8,
45, 9,
45, 10,
45, 11,
45, 12,
45, 13
};
const static short strpos_9[][2] = {
20, 9,
20, 10,
20, 11,
20, 12,
20, 1,
20, 2,
20, 3,
20, 4,
20, 5,
20, 6,
20, 7,
20, 8
};
11.6
PROGRAM LISTING