	.title	idadmy
;
; Idadmy - internal date to iday, imonth, iyear
; call idadmy( date, id, im, iyear )
; id, im, iyear = 0, if error
;
	.dsabl	gbl
	.globl

	.psect	user$i
idadmy::
	tst	(r5)+

	mov	@(r5)+,r0		; get date
	mov	r0,r1			; copy date
	beq	20$			; if zero date
	bic	#^c37,r1		; clear all but year bits
	add	#72.,r1			; make it real year
	mov	r1,@4.(r5)		; and return year

	mov	r0,r1			; copy date
	swab	r1
	asr	r1
	asr	r1
	bic	#^c17,r1
	mov	r1,@2.(r5)		; and return month no

	mov	r0,r1			; copy date
	asl	r1
	asl	r1
	asl	r1
	swab	r1
	bic	#^c37,r1
	mov	r1,@(r5)		; return day
	return

20$:	clr	@(r5)+			; error
	clr	@(r5)+
	clr	@(r5)+
	return

	.end
