Google
 

Trailing-Edge - PDP-10 Archives - tops10and20_integ_tools_v9_3-aug-86 - tools/crc/browse/crmvch.mac
There are no other files named crmvch.mac in the archive.
	TITLE CRMVCH - MOVE CHARACTER STRING
	SEARCH CRCSYM,macsym
	ENTRY CRMVCH
	external gtbypt
;
;CALL FROM FORTRAN WITH
;      CALL CRMVCH(IA,I,JA,J,N)
;IA IS THE AREA TO START COPYING FROM
;I IS THE ITH CHARACTER IN IA TO START FROM
;JA IS THE DESTINATION AREA
;J IS THE JTH CHARACTER IN JA TO START RECEIVING
;
;
;SET UP I/P BYTE POINTER IN P2
;
CRMVCH:	setz	t1,			;want byte pointer for first arg
	call	gtbypt			;get it
	move	p1,t1			;put it where required
;	MOVEI	P1,@(CX)		;1ST ARG.IS ADRS TO MOVE FROM
;	SOJ	P1,			;POINT AT PREVIOUS WORD
;	HRLI	P1,100700		;POINT AT PENULT.CHAR,IN LT. 1/2
	MOVE	P2,@1(CX)		;2ND ARG - NTH BYTE
	CAIG	P2,0			;CHECK I > 0 ELSE RETURN
	 POPJ	P,			;RETURN WITH NO ACTION
	soj	p2,			;one less to allow for ildb
	ADJBP	P2,P1			;MOVE POINTER TO REQUIRED BYTE
;
;SET UP O/P BYTE POINTER IN P3
;
	movei	t1,2			;3rd arg is o/p address
	call	gtbypt			;get byte pointer to it
	move	p1,t1			;put it where required
;	MOVEI	P1,@2(CX)		;3RD ARG IS 2ND ADRS
;	SOJ	P1,			;POINT AT PREVIOUS WORD
;	HRLI	P1,100700		;POINT AT PENULT.CHAR.IN LT. 1/2
	MOVE	P3,@3(CX)		;4TH ARG - NTH BYTE
	CAIG	P3,0			;CHECK J >0 ELSE RETURN
	 POPJ	P,			;RETURN WITH NO ACTION
	soj	p3,			;one less to allow for ildb
	ADJBP	P3,P1			;MOVE POINTER TO REQUIRED BYTE
;
;TRANSFER CHARACTERS
;
	MOVE	P4,@4(CX)		;5TH ARG COUNT OF CHARS TO BE MOVED
	CAIGE	P4,1			;CHECK BYTE COUNT GE 1
	POPJ	P,			;RETURN IF NOT
LOOP:	ILDB	P5,P2			;GET BYTE
	IDPB	P5,P3			;PUT BYTE TO NEW LOCATION
	SOJG	P4,LOOP			;GO ROUND LOOP N TIMES
	POPJ	P,			;RETURN
	END