	.even
/"orig" prints or substitutes for one or several originating companies
/   or BTL areas
orig:
	mov	r1,-(sp)		/save regs
	mov	r2,-(sp)
	mov	(r5)+,r2
	tst	r2
	bne	1f			/branch if only 1 originating co
	tst	token2			/"/" present?
	beq	0f
	jsr	r5,mesg
	<3ILLEGAL USE OF "OS"4\n\0>
	.even
	br	9f
0:
	jsr	r5,sorig
	j.orig1
	mov	$1,r0
	sys	write; nl; 1
	jsr	r5,sorig
	j.orig2
	mov	$1,r0
	sys	write; nl; 1
	jsr	r5,sorig
	j.orig3
	mov	$1,r0
	sys	write; nl; 1
	jsr	r5,sorig
	j.orig4
	mov	$1,r0
	sys	write; nl; 1
	br	9f
1:					/only one originating co.
	tst	token2			/"/" present?
	bne	1f
	mov	r2,0f
	jsr	r5,sorig		/write originating co1,2,3,or 4
0:	0
	br	9f
1:
	tst	token3			/"*" present?
	beq	1f			/branch if no
	clr	(r2)			/clear originating co1,2,3,or 4
	br	9f
1:
	mov	token2,r0
	inc	r0
	cmpb	(r0),$'A
	bne	0f
	mov	$1,(r2)
	br	9f
0:
	cmpb	(r0),$'W
	bne	0f
	mov	$2,(r2)
	br	9f
0:
	mov	r0,digitptr
	jsr	r5,atoi
0:	.=.+4
	tst	0b+2
	bne	1f
	jsr	r5,mesg
	<3ILLEGAL ORIGIN4\n\0>
	.even
	movb	$1,eflag
	br	9f
1:
	mov	0b+2,(r2)
9:
	mov	(sp)+,r2		/restore regs
	mov	(sp)+,r1
	rts	r5			/return



/"sorig" writes an originating company
sorig:
	mov	(r5)+,r0
	cmp	(r0),$1
	bne	0f
	jsr	r5,mesg
	<AT&T\0>
	.even
	br	9f
0:
	cmp	(r0),$2
	bne	0f
	jsr	r5,mesg
	<WECo\0>
	.even
	br	9f
0:
	tst	(r0)
	beq	9f
	clr	temp
	mov	(r0),temp+2
	jsr	r5,itoa
	temp
9:
	rts	r5
