$STORAGE: 2
$NOFLOATCALLS
	subroutine dtcat(ic,irXX)
	integer iwid
	common/scrn/iwid
	character esc
	CHARACTER*2 IRH,ICH
	character*3 ichw
	character ichwa(4)
	equivalence(ichw,ichwa(1))
	equivalence(ichwa(1),ich)
	CHARACTER IRA(2),ICA(2)
	EQUIVALENCE(IRA(1),IRH),(ICA(1),ICH)
	IR=IRXX+1
	esc = 27
	iterm = 0
C WRITE CURSOR POSITIONING ESCAPE SEQUENCES FOR ANSI TERMINAL SYSTEMS X3.64
c	WRITE(ITERM,1)
c1	FORMAT(1h+)
C	write(iterm,1) esc,'<'
C1	format(x,2a1,$)
c adapt to different width displays
	if(iwid.lt.80)iwid=80
	if(ic.gt.iwid)ic=iwid
	if(ir.gt.25)ir=25
	WRITE(IRH,22)IR
	if(iwid.lt.99)WRITE(ICH,22)IC
22	FORMAT(I2)
	if(iwid.ge.99)write(ichw,122)ic
122	format(i3)
	if(ichwa(2).eq.' ')ichwa(2)='0'
c force fillin of leading zeroes
	if(IRA(1).EQ.' ')IRA(1)='0'
	IF(ICA(1).EQ.' ')ICA(1)='0'
	if(iwid.lt.99)write(iterm,2) esc,'[',ira,';',ica,'H'
	if(iwid.ge.99)write(iterm,12) esc,'[',ira,';',ichw,'H'
2	format(1x,1a1,1a1,2a1,a1,2a1,a1,\)
12	format(1x,1a1,1a1,2a1,a1,1a3,a1,\)
	return
	end


