Google
 

Trailing-Edge - PDP-10 Archives - decuslib10-01 - 43,50150/alpho.300
There are 2 other files named alpho.300 in the archive. Click here to see a list.
TITLE ALPHO.  V.007  	ALPHANUMERIC OUTPUT	FORTRAN IV
SUBTTL 20-SEPT-68
; MODIFIED BY LP WADE FOR SNOBOL
; TO ELIMINATE THE AUTO CONVERSION OF CHARS < 40 TO 40

;VERSION 006 WAS CREATED BY TIM MCGETTTIGAN

;"ALPHO." IS A ROUTINE WHICH OUTPUTS A WORD OF UP TO 5 7-BIT
;ASCII CHARACTERS, TO A ROUTINE "DEPOT.", ONE CHAR. AT A TIME.
;THE ENTIRE WORD IS CONTAINED IN AC1; AC0 CONTAINS THE
;SINGLE CHARACTERS.  THE OUTPUT ITEM IS RETURNED IN AC0.
;IF THE FIELD WIDTH W < 5, THE W LEFT CHARACTERS ARE USED.
;IF W > 5, 5 CHARACTERS ARE PRECEDED BY W-5 BLANKS.

;CALLING SEQUENCE:
;	PUSHJ P,ALPHO.
;PUSHDOWN LIST CONTAINS:
;	1.  FIELD WIDTH W IN LEFT HALF
;	2.  PROGRAM COUNTER (RETURN ADDRESS)
;	3.,4.,5.  FREE STORAGE

;THIS ROUTINE HAS BEEN MODIFIED TO HANDLE
;DOUBLE PRECISION VARIABLES.  IT CHECKS
;THE VARIABLE TYPE. TO DETERMINE THE TYPE OF THE VARIABLE 
;BEING OUTPUTED. IF IT IS DOUBLE PRECISION IT
;WILL OUTPUT TWO WORDS

	ENTRY ALPHO.
	EXTERN DEPOT.,TYPE.

ALPHO.:	PUSH	PDP,A3
	PUSH	PDP,ACT
	PUSH	PDP,A	;SAVE ACS
	MOVE	A3,TYPE.
	HLRZ ACT,-4(PDP)	;PICK UP FIELD WIDTH
	JUMPLE ACT,OVER	;IF WIDTH <,= 0, RETURN
	MOVE A,ACO	;STORE WHOLE WORD
	CAIN	A3,6	;IS IT D.P.
	MOVEI	A3,12	;YES
	CAIE	A3,12	;OTHERWISE POSSIBLE FIVE CHARACTER OUTPUT
	MOVEI	A3,5	;NOT D.P. OR COMPLEX
	CAMLE	ACT,A3
	JRST	NBA
ALM1:	CAIE	A3,12
	JRST	.+3
	CAILE	ACT,5
	MOVEI	ACT,5
	PUSHJ	PDP,ALMS
	CAIE	A3,12
	JRST	OVER	;IF NOT D.P. OR COMPLEX WE ARE THROUGH
	HLRZ	ACT,-4(PDP)	;GET WIDTH AGAIN
	CAIL	ACT,12
	MOVEI	ACT,12
	SUBI	ACT,5	;SUBTRACT THE 5 CHARACTERS ALREADY OUTPUTED
	MOVE	A,(PDP)
	MOVEM	A,ACO
	CAILE	ACT,0
	PUSHJ	PDP,ALMS
OVER:	POP	PDP,A
	POP	PDP,ACT
	POP	PDP,A3
	POPJ	PDP,

ALMS:	MOVEI ACO,0
	LSHC ACO,7	;NO, SHIFT IN ONE CHAR. OF WORD
;	CAIGE ACO,40	;IGNORE CHARS < 40
;	MOVEI ACO,40
	PUSHJ PDP,DEPOT.	;OUTPUT IT
	SOJG ACT,ALMS	;ANY CHARS LEFT?
	POPJ	PDP,
NBA:	SUB ACT,A3	;SET COUNTER = WIDTH - 5
	MOVEI ACO,40
	PUSHJ PDP,DEPOT.	;OUTPUT A BLANK
	SOJG ACT,.-1	;DECREMENT CNTR, IF > 0, OUTPUT A BLANK
	MOVE ACT,A3	;OTHERWISE, SET WIDTH = 5
	JRST ALM1		;OUTPUT 5 CHARS

	A=1		;STORAGE
	ACO=0		;RETURNS OUTPUT ITEM
	ACT=2		;FIELD WIDTH
	A3=3
	PDP=17		;PUSHDOWN POINTER

	END