$STORAGE: 2
$NOFLOATCALLS
c-----------------------------------------------------------------------
c
c	Mischy month making subroutine
c
c	part of Mitch Wyle's DTC program
c
c	Inputs: 
c		ib	-	begining day of the week
c		il	-	length of month in days
c		xoff	-	offset for x coordinate
c		xspa	-	number of spaces to skip between numbers
c		yspa	-	number of lines to skip between lines
c
c	Output:
c		display screen (see below)
c
c-----------------------------------------------------------------------
c

	SUBROUTINE mischy(ib,il,xoff,xspa,YOFF,yspa)

c
c	Declarations:
c

	integer	ib		
c 	begining day of the week
	integer il		
c 	length of month in days
	integer ix		
c 	x coordinate of where to put day
	integer iy		
c 	y coordinate of where to put day
	integer ip		
c 	the day of the week for date in hand
	integer xoff		
c 	x offset
	INTEGER YOFF
	integer xspa		
c 	number of spaces between numbers
	integer yspa		
c 	number of lines to skip between lines
c
c	Initialize:
c

	iterm = 0		
c 	Output terminal unit number
	iy = 4 + YOFF
	ip = ib - 1
C	If (yspa .ne. 0) iy = 12
c
c	Now write month out to screen, one day at a time:
c

	Do 5 i=1,il

	    ip = ip + 1			
c 	increment day number
	    If ( ip .gt. 7 ) then	
c 	is it Sunday again?
		ip = 1			
c 	reset day to Sunday.
		iy = iy + 1 + yspa	
c 	move down one line
	    End If
	    ix = (3+xspa) * ip - 2 + xoff
	    call dtcat(ix,iy)		
c 	position cursor
	    write(iterm,1) i		
c 	write day number to screen
1	    format(1X,i2,\)

5	Continue
	
	return
	end


