	.even
/"odate" handles printing and substituting of the opening date field
odate:
	mov	r1,-(sp)		/save r1
	tst	token2			/"/" present?
	bne	0f
	jsr	r5,wdate		/write date
	j.odate
	br	9f
0:
	tst	token3			/"*" present?
	beq	1f			/branch if no
	clr	j.odate			/null-out date
	movb	$1,cflag		/set core changed
	br	9f
1:
	inc	token2
	mov	token2,-(sp)
	jsr	r5,rdate		/validate date
	tst	r0			/date legal?
	bne	2f			/branch if yes
	jsr	r5,mesg
	<3ILL DATE4\n\0>
	.even
	movb	$1,eflag		/set error flag
	br	9f
2:
	mov	r0,j.odate		/substitute new date
	movb	$1,cflag		/set core changed
9:
	mov	(sp)+,r1		/restore r1
	rts	r5			/return


	.even
/"cdate" handles printing and substituting of the closing date field
cdate:
	mov	r1,-(sp)		/save r1
	tst	token2			/"/ present?
	bne	0f
	jsr	r5,wdate		/write date
	j.cdate
	br	9f
0:
	tst	token3			/"*" present?
	beq	1f			/branch if no
	clr	j.cdate			/null-out date
	movb	$1,cflag		/set core changed
	br	9f
1:
	inc	token2
	mov	token2,-(sp)
	jsr	r5,rdate		/validate date
	tst	r0			/date legal?
	bne	2f			/branch if yes
	jsr	r5,mesg
	<3ILL DATE4\n\0>
	.even
	movb	$1,eflag		/set error flag
	br	9f
2:
	mov	r0,j.cdate		/substitute new date
	movb	$1,cflag		/set core changed
9:
	mov	(sp)+,r1		/restore r1
	rts	r5			/return


	.even
/"ddate" handles printing and substituting of the deadline date field
ddate:
	mov	r1,-(sp)		/save r1
	tst	token2			/"/" present?
	bne	0f
	jsr	r5,wdate		/write date
	j.ddate
	br	9f
0:
	tst	token3			/"*" present?
	beq	1f			/branch if no
	clr	j.ddate			/null-out date
	movb	$1,cflag		/set core changed
	br	9f
1:
	inc	token2
	mov	token2,-(sp)
	jsr	r5,rdate		/validate date
	tst	r0			/date legal?
	bne	2f			/branch if yes
	jsr	r5,mesg
	<3ILL DATE4\n\0>
	.even
	movb	$1,eflag		/set error flag
	br	9f
2:
	mov	r0,j.ddate		/substitute new date
	movb	$1,cflag		/set core changed
9:
	mov	(sp)+,r1		/restore r1
	rts	r5			/return



	.even
/"wdate" subroutine writes an 8-char date
wdate:
	mov	*(r5)+,r0
	jsr	r5,edate
	bline
	mov	$1,r0
	sys	write; bline; 8.
	rts	r5
