/* (c) Copyright 1987 Michael Goetz								*/
/*																			*/
/*				File:		  	mash										*/
/*				Returns:	  	int										*/
/*				Parameters:	char string[] - null terminated	*/
/*																			*/
/*																			*/

#include <memory.h>

#include "advm.h"


int mash (string)
char *string;

{
	union {
		char ctemp [13];
		int itemp [6];
		} temp;
	int i,mush;

	temp.ctemp[12] = 0;
	strncpy(temp.ctemp,string,12);
	if ((i=strlen(temp.ctemp)) < 12)
		memset(&temp.ctemp[i], ' ', 12-i);
	for (i=0, mush = 0; i<6; i++)
		mush += temp.itemp[i];
	return (mush & 0x7fff);
	}


