Google
 

Trailing-Edge - PDP-10 Archives - tops10_integ_tools_v4_10jan-86 - 70,6067/dumpr2/cvt.mar
There are 3 other files named cvt.mar in the archive. Click here to see a list.
	.TITLE	CVT		CONVERT DEC-10 DATATYPES FOR VAX
;+
;	CVT -- A SUBROUTINE PACKAGE FOR THE DUMPER/BACKUP
;	TAPE READING UTILITIES.  THESE SUBROUTINES CONVERT
;	DEC-10 DATATYPES INTO THOSE USABLE ON THE VAX.
;
;	ENTRY POINTS:
;	CVT36	TO CONVERT 5 BYTE DEC-10 MAGTAPE RECORDS INTO
;		THE PROPERLY ALIGNED 36 BIT VALUES (2 WORDS
;		PER VALUE)
;	CVT72   TO CONVERT 9 BYTE CCC TU70 DEC-10 MAGTAPE RECORDS
;		INTO THE PROPERLY ALIGNED 36 BIT VALUES (2 WORDS
;		PER VALUE DONE 2 AT A TIME).
;	CVTASZ	TO CONVERT ASCIZ STRINGS TO 8 BIT ASCII DATA
;		AND TO APPEND IT TO THE SUPPLIED STRING.
;	CVTHALF	TO CONVERT 18 BIT HALFWORDS TO TWO LONGWORD
;		INTEGERS.
;	CVTSIX	TO CONVERT A SIX SIXBIT CHARACTERS TO 8 BIT
;		ASCII AND TO APPEND IT TO THE SUPPLIED STRING
;	COPY5	TO COPY THE OUTPUT OF CVT36 OR CVT72 INTO A
;		BYTE STREAM
;	COPYASC	TO COPY 7-BIT ASCII DATA INTO A BYTE STREAM.
;-
;	COMPBS	TO COMPARE A BYTE ARRAY TO A STRING
.ENTRY	CVT36,^M<R2,R3,R4>
;+
;	ENTRY POINT: CVT36
;	CALLING SEQUENCE:
;	CALL CVT36(A,B,C)
;	A -- A BYTE ARRAY CONTAINING THE DATA TO BE CONVERTED
;	B -- A 2 BY C LONGWORD ARRAY TO RECIEVE THE DATA.
;	C -- THE NUMBER OF WORDS TO CONVERT
;-
	MOVL	4(AP),R3		;GET THE INPUT ADDRESS
	MOVL	8(AP),R4		;GET THE OUTPUT ADDRESS
	MOVL	@12(AP),R2		;AND THE COUNT
CVTL:
	INSV	(R3),#28,#8,(R4)	;NOW MOVE THINGS AROUND
	INSV	1(R3),#20,#8,(R4)	;LIKE SO...
	INSV	2(R3),#12,#8,(R4)
	INSV	3(R3),#4,#8,(R4)
	INSV	4(R3),#0,#4,(R4)
	ADDL2	#5,R3			;MOVE ALONG TO NEXT 36-BIT WORD
	ADDL2	#8,R4			;AND TO NEXT QUADWORD
	SOBGTR	R2,CVTL
	RET
.ENTRY	CVT72,^M<R2,R3,R4>
;+
;	ENTRY POINT: CVT72
;	CALLING SEQUENCE:
;	CALL CVT72(A,B,C)
;	A -- A BYTE ARRAY CONTAINING THE DATA TO BE CONVERTED
;	B -- A 2 BY C LONGWORD ARRAY TO RECIEVE THE DATA.
;	C -- THE NUMBER OF WORDS TO CONVERT
;-
	MOVL	4(AP),R3		;GET THE INPUT ADDRESS
	MOVL	8(AP),R4		;GET THE OUTPUT ADDRESS
	MOVL	@12(AP),R2		;AND THE COUNT
	ASHL	#-1,R2,R2
CVTL2:
	INSV	(R3),#28,#8,(R4)	;NOW MOVE THINGS AROUND
	INSV	1(R3),#20,#8,(R4)	;LIKE SO...
	INSV	2(R3),#12,#8,(R4)
	INSV	3(R3),#4,#8,(R4)
	EXTZV	#4,#4,4(R3),R0
	INSV	R0,#0,#4,(R4)
	INSV	4(R3),#32,#4,8(R4)
	INSV	5(R3),#24,#8,8(R4)
	INSV	6(R3),#16,#8,8(R4)
	INSV	7(R3),#8,#8,8(R4)
	INSV	8(R3),#0,#8,8(R4)
	ADDL2	#9,R3			;MOVE ALONG TO NEXT 72-BIT WORD
	ADDL2	#16,R4			;AND TO NEXT PAIR OF QUADWORDS
	SOBGTR	R2,CVTL2
	RET
.ENTRY CVTASZ,^M<R2,R3>
;+
;	ENTRY POINT: CVTASZ
;	CALLING SEQUENCE:
;	CALL CVTASZ(DAT,LINE,LINEL)
;	DAT   -- IS THE START OF THE 2 BY N LONGWORD ARRAY
;	THAT CONTAINS THE ASCIZ STRING
;	LINE  -- A BYTE ARRAY TO RECIEVE THE DATA
;	LINEL -- THE INDEX TO THE BYTE ARRAY
;-
	DAT = 4
	LINE = 8
	LINEL = 12
;
	MOVAL	@DAT(AP),R0
	MOVAL	@LINE(AP),R1
	ADDL2	@LINEL(AP),R1
	DECL	R1
CAL:
	EXTZV	#29,#7,(R0),R2
	TSTL	R2
	BEQL	CAE
	MOVB	R2,(R1)+
	INCL	@LINEL(AP)
	EXTZV	#22,#7,(R0),R2
	TSTL	R2
	BEQL	CAE
	MOVB	R2,(R1)+
	INCL	@LINEL(AP)
	EXTZV	#15,#7,(R0),R2
	TSTL	R2
	BEQL	CAE
	MOVB	R2,(R1)+
	INCL	@LINEL(AP)
	EXTZV	#8,#7,(R0),R2
	TSTL	R2
	BEQL	CAE
	MOVB	R2,(R1)+
	INCL	@LINEL(AP)
	EXTZV	#1,#7,(R0),R2
	TSTL	R2
	BEQL	CAE
	MOVB	R2,(R1)+
	INCL	@LINEL(AP)
	ADDL2	#8,R0
	BRB	CAL
;
CAE:
	RET
.ENTRY CVTHALF,0
;+
;	ENTRY POINT: CVTHALF
;	CALLING SEQUENCE:
;	CALL CVTHALF(DAT,RH,LH)
;	DAT IS THE DATA TO BE CONVERTED
;	RH IS THE RIGHT HALF (LOW ORDER) 18 BITS OF DAT
;	LH IS THE LEFT HALF (HIGH ORDER) 18 BITS OF DAT
;-
	DAT = 4
	RH = 8
	LH = 12
;
	MOVAL	@DAT(AP),R0
	EXTZV	#0,#18,(R0),R1
	MOVL	R1,@RH(AP)
	EXTZV	#18,#18,(R0),R1
	MOVL	R1,@LH(AP)
	RET
.ENTRY	CVTSIX,0
;+
;	ENTRY POINT: CVTSIX
;	CALLING SEQUENCE:
;	CALL CVTSIX(DAT,LINE,LINEL)
;	DAT    -- THE QUADWORD CONTAINING THE SIXBIT DATA
;	LINE   -- THE LINE TO APPEND THE STRING TO
;	LINEL  -- THE CURRENT LENGTH OF THE LINE
;-
	MOVAL	@LINE(AP),R0
	ADDL2	@LINEL(AP),R0
	DECL	R0
;
	EXTZV	#30,#6,@DAT(AP),R1
	ADDL2	#32,R1
	MOVB	R1,(R0)+
	EXTZV	#24,#6,@DAT(AP),R1
	ADDL2	#32,R1
	MOVB	R1,(R0)+
	EXTZV	#18,#6,@DAT(AP),R1
	ADDL2	#32,R1
	MOVB	R1,(R0)+
	EXTZV	#12,#6,@DAT(AP),R1
	ADDL2	#32,R1
	MOVB	R1,(R0)+
	EXTZV	#6,#6,@DAT(AP),R1
	ADDL2	#32,R1
	MOVB	R1,(R0)+
	EXTZV	#0,#6,@DAT(AP),R1
	ADDL2	#32,R1
	MOVB	R1,(R0)+
	ADDL2	#6,@LINEL(AP)
	RET
.ENTRY	COPY5,^M<R2,R3,R4>
;+
;	ENTRY POINT: COPY5
;	CALLING SEQUENCE:
;	CALL COPY5(A,B,C)
;	A -- A 2 BY C LONGWORD ARRAY WITH THE DATA.
;	B -- A BYTE ARRAY TO RECIEVE THE DATA
;	C -- THE NUMBER OF WORDS TO CONVERT
;-
	A = 4
	B = 8
	C = 12
;
	MOVL	@C(AP),R0
	MOVAL	@A(AP),R1
	MOVAL	@B(AP),R2
C5L:
	MOVL	(R1),(R2)+
	MOVB	4(R1),(R2)+
	ADDL2	#8,R1
	SOBGTR	R0,C5L
	RET
.ENTRY COPYASC,^M<R2,R3>
;+
;	ENTRY POINT: COPYASC
;	CALLING SEQUENCE:
;	CALL CVTASZ(DAT,LINE,NUM)
;	DAT   -- IS THE START OF THE 2 BY N LONGWORD ARRAY
;	THAT CONTAINS THE ASCIZ STRING
;	LINE  -- A BYTE ARRAY TO RECIEVE THE DATA
;	NUM -- THE NUMBER OF 5 BYTE WORDS TO PROCESS
;-
	DAT = 4
	LINE = 8
	NUM = 12
;
	MOVAL	@DAT(AP),R0
	MOVAL	@LINE(AP),R1
	MOVL	@NUM(AP),R2
CAC:
	EXTZV	#29,#7,(R0),R3
	MOVB	R3,(R1)+
	EXTZV	#22,#7,(R0),R3
	MOVB	R3,(R1)+
	EXTZV	#15,#7,(R0),R3
	MOVB	R3,(R1)+
	EXTZV	#8,#7,(R0),R3
	MOVB	R3,(R1)+
	EXTZV	#1,#7,(R0),R3
	MOVB	R3,(R1)+
	ADDL2	#8,R0
	SOBGTR	R2,CAC
	RET
.ENTRY	COMPBS,^M<R2,R3,R4>
;+
;	ENTRY POINT: COMPBS
;	CALLING SEQUENCE:
;	CALL COMPBS(N,BYTES,STRING)
;	N       -- NUMBER OF BYTES TO COMPARE
;	BYTES   -- BYTE ARRAY TO COMPARE
;	STRING  -- CHARACTER STRING TO COMPARE
;-
	MOVAL	@12(AP),R1
	CMPC3	@4(AP),@8(AP),@4(R1)
	BNEQ	NOTEQ
	MOVL	#-1,R0
	RET
NOTEQ:	MOVL	#0,R0
	RET
;
	.END