    
 int adr(char ch)                          /* FUNCTION TO EDIT ADDRESS */
 {
  int c1 = '0', c2 = '1', c3 = '2', c4 = '3', c5;
  char buff[8];
  while(1) {
	c5 = getch();
	if( (c5 >= '0' && c5 <= '9' ) || (c5 >= 'a' && c5 <= 'f') ) {
		c1 = c2;
		c2 = c3;
		c3 = c4;
		c4 = c5;
		gotoxy(1,0);
		sprintf(buff,"%c%c%c%c    ",c1 , c2 , c3 , c4);
		write(1,buff,8);
	}
	else break;
  }
  if( (c5 == 'x') && (ch == 'g' || ch == 't') )
	return( ( (ascci_to_int(c1) * 0x10 + ascci_to_int(c2)) * 0x10 +
		ascci_to_int(c3) ) * 0x10 + ascci_to_int(c4));
  if( (c5 == 'n' || c5 == 'p') && (ch == 'm') )
	return( ( (ascci_to_int(c1) * 0x10 + ascci_to_int(c2)) * 0x10 +
		ascci_to_int(c3) ) * 0x10 + ascci_to_int(c4));
  if( c5 != 'r') reset();
  gotoxy(1,0);
  write(1,"_ups  85",8);
  gotoxy(0,21);
  write(1," SELECT A MODE",14);
  return(-1);
 }       /* END OF FUNCTION "adr()" */

