/	SUBROUTINE A5TOA1(A,B,D)
/(pdp11:)SUBROUTINE A5TOA1(A,B,C,D)
/
/ THIS ROUTINE TAKES THE UP TO 6 CHARACTER "WORD" IN A:B:C
/ AND TYPES IT OUT, FOLLOWED BY THE PUNCTUATION MARK IN D.
/ IT ALSO APPENDS A CRLF TO GET TO A NEW LINE.
/ For OS/8: the word is in A,B with nothing in C.
/
/	IMPLICIT INTEGER (A-Z)
/	COMMON	/ALPHAS/ BLANK

	EXTERN	SIXOUT
	EXTERN	CGET
	EXTERN	CPUT
	SECT	A5TOA1
	JA	#ST
#XR,	ORG	.+10
	TEXT	+A5TOA1+
#RET,	SETX	#XR
	SETB	#BASE
	JA	.+3
#BASE,	ORG	.+6
A,	ORG	.+3
B,	ORG	.+3
D,	ORG	.+3
BLANK,	TEXT +      +
ZERO,	F 0
THREE,	F 3
	ORG	#BASE+30
	FNOP
	JA	#RET
	FNOP
#GOBAK,	0;0

#RTN,	BASE	#BASE
	JA	#GOBAK

FIVE,	F 5
SEVEN,	F 7

#ST,	STARTD
	0210
	FSTA	#GOBAK,0
	0200
	SETX	#XR
	SETB	#BASE
	LDX	0,1
	FSTA	#BASE
	FLDA%	#BASE,1+
	FSTA	A
	FLDA%	#BASE,1+
	FSTA	B
	FLDA%	#BASE,1+
	FSTA	D
	STARTF
	FLDA%	A
	FSTA	A
	FLDA%	B
	FSTA	B
	FLDA%	D
	FSTA	D
/	IF (A .NE. BLANK) TYPE 1,A
	FLDA	A
	FSUB	BLANK
	JEQ	#G0001
	JSR	TRIM
	JA	.+4
	JA	A
	JSR	SIXOUT
	JA	.+10
	JA	A
	JA	ZERO
	JA	SEVEN
/	IF (B .NE. BLANK) TYPE 1,B
#G0001,	FLDA	B
	FSUB	BLANK
	JEQ	#G0002
	JSR	TRIM
	JA	.+4
	JA	B
	JSR	SIXOUT
	JA	.+10
	JA	B
	JA	ZERO
	JA	SEVEN
/	IF (C .NE. BLANK) TYPE 1,C
/	TYPE 2,D
#G0002,	JSR	T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