extern int _row1,_row2,_col1,_col2,_attr,g_row,g_col,g_fore,g_back;
jzwrite ( fstr )
char *fstr;
{
  int w,wscrseg,wndofs,wrow,wcol,wstart,wend;

  jzgetcur(&wrow,&wcol,&wstart,&wend);

  while (*fstr) {
    #if DEBUG
      int wi;
      printf("\n%d %d %d %d %d %d",_row1,_col1,_row2,_col2,g_row,g_col);
      for (wi = 0 ; wi < 255 ; wi ++)	 ;  /* do nothing pointer */
      printf("\n%d %d",wrow,wcol);
    #endif

    switch(*fstr) {
      case '\b' :
	wcol --;
	fstr++;
	break;
      case '\n' :
	wcol = _col2 + 1;	/* force new line condition */
	fstr++;
	break;
      case '\r' :
	wcol = _col1; /* back to column 1 */
	fstr++;
	break;
      case '\t' :
	do ; while(++wcol % 8);
	fstr++;
	break;
    }

    if (wcol > _col2) {
      wcol = _col1;
      if (wrow == _row2)
	jzscrlup(_row1 << 8 | _col1,_row2 << 8 | _col2,1,_attr);
      else
	++ wrow;
    }

    jzloccur(wrow,wcol);
    if (*fstr) {
      jzwrtchr(*fstr++,_attr,1);
      ++ wcol;
    }

  }
  g_row=wrow;
  g_col=wcol;
}
