/*
 * Sample Program for microVIEW-G(x)
 * <<< samp1.c >>>
 * 1995 @ advice Yokogawa Digital Computer Corp.
 */

/*
 * Include Files
 */

#include        "../samp0.h"
#include        "../samp1.h"
#include        "../samp2.h"

#define         TMP_MAX         99
#define         DEBUGER         "microVIEW-G"

/*
 * Data Definition
 */

/*
 *	NO MOVE FUNCTION
 */

void NOP1(char aaa,
		unsigned char bbb,
		short ccc,
		unsigned short ddd,
		int eee,
		unsigned int fff)
{
}


void NOP2(long ggg,
		unsigned long hhh,
		float iii,
		double jjj,
		long double kkk,
	 	enum LLL lll) 
{
}


 /*
  * static function
  */
static void S_samp(void)
{
    int    i;
    int    j;

    for (i=0; i<TMP_MAX; i++) {
	j = i;
    }
}

/*
 * Main Program
 */

int main(void)
{
    short               sret;
    unsigned long       i;
    int                 rcd;
    unsigned char       m;
    double              drd;
    int                 harb_count = 0;
	char aaa;
	unsigned char bbb;
	short ccc;
	unsigned short ddd;
	int eee;
	unsigned int fff;

    SystemCounter = 0;

/* program loop */

    i = 0;
    
	bitfld2.pp = &i;
	bitfld2.xx = 0xA;
	bitfld2.yy = 0xB;
	bitfld2.zz = 777;
    
    Fill(0);
    while (1) {
	m = (unsigned char)(i % MOD_NUM);
	STRcpy(MasterStr,DEBUGER);
	sret = ShortReturnFunc();
	NOP1(aaa,bbb,ccc,ddd,eee,fff);

	switch (m) {
	case 0:
	    rcd = Country( samp_data );
	    Sortbybig( samp_data, SAMP_DATA_MAX );
	    Counter();
	    if (SystemCounter > TMP_MAX) {
		SmallExec( samp_data );
	    }
	    Sortbysmall( samp_data, SAMP_DATA_MAX );
	    break;

	case 1:
	    rcd = Fr_and_Vg( samp_data );
	    if (rcd != 0) {
		Counter();
	    }
	    Sortbysmall( samp_data, SAMP_DATA_MAX );
	    Sortbybig( samp_data, SAMP_DATA_MAX );
	    drd = BigExec(samp_data,SystemCounter,
			samp_data[0].big[0],samp_data[0].big[1],
			samp_data[0].big[2],samp_data[0].big[3]);
	    if (SystemCounter != drd) {
		Counter();
		S_samp();
	    }
	    break;

	case 2:
	    rcd = Compose( samp_data );
	    Sortbysmall( samp_data, SAMP_DATA_MAX );
	    Counter();
	    Sortbybig( samp_data, SAMP_DATA_MAX );
	    break;

	case 3:
	    Harb ( samp_data, &harb_count );
	    break;

	case 4:
	    Dataput( samp_data );
	    Counter();
	    break;

	default:
	    Counter();
	    break;

	}
	bitfld.m1 = 0;
	bitfld.m2 = 0;
	bitfld.m3 = 0;
	i++;
	if (i >= ULONG_MAX) {
	    i = 0;
	}
    }
}
/* EOF */