Google
 

Trailing-Edge - PDP-10 Archives - decuslib10-10 - 43,50517/spac.mac
There are 9 other files named spac.mac in the archive. Click here to see a list.
TITLE	SPAC FOR LIBOL V10 AND RPGII V1
SUBTTL	CHECK STRING FOR SPACES	13-DEC-74	/ACK

;MAIN ROUTINE
;COPYRIGHT 1974, 1975, DIGITAL EQUIPMENT CORP, MAYNARD, MASS.
;MODIFICATIONS FOR RPGII COPYRIGHT 1976, BOB CURRIER

;REVISION HISTROY:

;V10	*****

;	13-DEC-74	/ACK	CREATION.

;	5/10/75		/DBT	BIS CODE
;*****

	SEARCH	RPGPRM		;DEFINE PARAMETERS.
	%%LBLP==:%%LBLP
	EBCMP.==:EBCMP.
	BIS==:BIS

	EXTERN	EASTB.		;FORCE EASTBL TO BE LOADED.

	HISEG

COMMENT	\

	THIS ROUTINE CHECKS A STRING TO SEE IF IT CONTAINS ONLY SPACES.

CALL:
	MOVEI	16,PARAMETER ADDRESS
	PUSHJ	17,SPAC.6/SPAC.7/SPAC.9
	INDICATORS

PARAMETER:
	BITS	0-5	BYTE POINTER RESIDUE FOR INPUT FIELD.
	BIT	6	IGNORED (1 IF A SIGN IS PRESENT.)
	BITS	7-17	SIZE OF THE INPUT FIELD.
	BITS	18-35	ADDRESS OF THE FIRST CHARACTER OF THE INPUT FIELD.

RETURNS:
	CALL+2	TURNS ON EQUAL INDICATOR IF ALL SPACES, OTHERWISE
		TURN ON GREATER THAN INDICATOR

REGISTERS USED:
	CH,SPACE,JAC, IPTR, CNT, SW

\
	ENTRY	SPAC.6		;IF THE STRING IS SIXBIT.
	ENTRY	SPAC.7		;IF THE STRING IS ASCII.
IFN EBCMP.,<
	ENTRY	SPAC.9		;IF THE STRING IS EBCDIC.
>
	EXTERN	SIXSP.		;WHAT A SIXBIT SPACE LOOKS LIKE.
	EXTERN	ASCSP.		;WHAT AN ASCII SPACE LOOKS LIKE.
IFN EBCMP.,<
	EXTERN	EBCSP.		;WHAT AN EBCDIC SPACE LOOKS LIKE.
>

IFE	BIS,<

;LOCAL AC DEFINITIONS:

	SPACE==TAC4

	EXTERN	RET.2		;RETURNS TO CALL+2.
	EXTERN	SET1A.		;SETS UP THE PARAMETERS.

SPAC.6:	JSP	CH,	SPAC		;ENTER HERE IF THE INPUT IS SIXBIT,
SPAC.7:	JSP	CH,	SPAC		; HERE IF IT IS ASCII OR
IFN EBCMP.,<
SPAC.9:	JSP	CH,	SPAC		; HERE IF IT IS EBCDIC.
>

SPAC:	SUBI	CH,	SPAC.6-5	;FIND OUT WHAT THE INPUT LOOKS LIKE.
	MOVE	SPACE,	SPACES-6(CH)	;SELECT THE APPROPRATE SPACE.
	JSP	JAC,	SET1A.		;GO SET UP THE PARAMETERS.
					;NOTE:  IF THE STRING LENGTH IS ZERO
					; WE RETURN TO CALL+1, NOT HERE.

SPAC1:	ILDB	CH,	IPTR		;GET A CHAR.
	CAIE	CH,	(SPACE)		;IS IT A SPACE?
	JRST		.EQ.##		; TAKE EQUAL RETURN
	SOJG	CNT,	SPAC1		;LOOP IF THERE ARE MORE CHARS.
	JRST		.GT.##		; TAKE GREATER-THAN RETURN
>	;END OF NON-BIS


SPACES:	EXP		SIXSP.
	EXP		ASCSP.
IFN EBCMP.,<
IFN BIS,<
	BLOCK	1
>
	EXP		EBCSP.
>
IFN	BIS,<

	EXTERN	BSET1.		;SETS UP THE PARAMETERS.
SPAC.6:	JSP	BISCH,	SPAC		;ENTER HERE IF THE INPUT IS SIXBIT,
SPAC.7:	JSP	BISCH,	SPAC		; HERE IF IT IS ASCII OR
IFN EBCMP.,<
	BLOCK	1
SPAC.9:	JSP	BISCH,	SPAC		; HERE IF IT IS EBCDIC.
>

SPAC:	SUBI	BISCH,	SPAC.6-5	;FIND OUT WHAT THE INPUT LOOKS LIKE.
	MOVE	BIST0+E0.FLT,	SPACES-6(BISCH)	;SELECT THE APPROPRATE SPACE.
						;FOR FILL CHARACTER
	JSP	JAC,	BSET1.		;GO SET UP THE PARAMETERS.
					;NOTE:  IF THE STRING LENGTH IS ZERO
					; WE RETURN TO CALL+1, NOT HERE.

	SETZB	DSTPT,DSTCNT		;NO DESTINATION - COMPARE AGAINST
					; THE FILL CHARACTER
	MOVE	BIST0+E0.INS,[CMPSN,,0]	;COMPARE NOT EQUAL
	EXTEND	B.FLAG,BIST0
	JRST	.EQ.			; EQUAL TO SPACES
	JRST	.GT.			; NOT SPACES

>	;END OF BIS
	END