Google
 

Trailing-Edge - PDP-10 Archives - BB-H506D-SM_1983 - cobol/source/ascebc.mac
There are 7 other files named ascebc.mac in the archive. Click here to see a list.
TITLE	ASCEBC	ASCII TO EBCDIC CONVERSION TABLE.
SUBTTL	/ACK



;THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY ONLY BE USED
;  OR COPIED IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE.
;
;COPYRIGHT (C) 1975, 1981 BY DIGITAL EQUIPMENT CORPORATION


	SEARCH	P
	%%P==:%%P
	DEBUG==:DEBUG

	SEARCH	CHREQV		;DEFINE THE CHARACTER EQUIVALENCES.

;EDITS:
;V10********************
;NAME	DATE		COMMENTS
;ACK	13-MAR-75	CREATION.
;***********************

	HISEG
	SALL
	.XCREF

	ENTRY	ASEBC.
COMMENT	\

	THIS MODULE CONTAINS THE CONVERSION TABLE FOR CONVERTING ASCII
CHARACTERS TO EBCDIC.

THE TABLE IS STRUCTURED AS FOLLOWS:

	WORD ASEBC.+N CONTAINS:

	IN BITS			THE EBCDIC CHARACTER EQUIVALENT TO THE
				ASCII CHARACTER WHOSE VALUE IS

	0-8				N*4
	9-17				N*4+1
	18-26				N*4+2
	27-35				N*4+3

	GIVEN AN ASCII CHARACTER IN TAC1 THE FOLLOWING CODE COULD BE
USED TO CONVERT IT TO EBCDIC:

	IDIVI	TAC1,	4
	LDB	TAC1,	PTRS(TAC1+1)
	.
	.
	.
PTRS:	POINT	9,ASEBC.##(TAC1),8
	POINT	9,ASEBC.##(TAC1),17
	POINT	9,ASEBC.##(TAC1),26
	POINT	9,ASEBC.##(TAC1),35

\
;MACROS USED TO GENERATE THE TABLE.

	DEFINE	X0	(I)<
	I0==I
	I1==I+1
	I2==I+2
	I3==I+3

	X1	\I0,\I1,\I2,\I3

>	;END OF DEFINITION OF X0.


	DEFINE	X1	(I0,I1,I2,I3)<BYTE	(9)AE%'I0,AE%'I1,AE%'I2,AE%'I3>


	DEFINE	TBLGEN<
	IFE	DEBUG,<XLIST>		;;DON'T LIST THE TABLE UNLESS WE
					;; ARE DEBUGGING IT.
	I==0
	REPEAT	40,<
		X0	I
		I==I+4
>	;END OF REPEAT 40.
	LIST
>	;END OF DEFINITION OF TBLGEN.


;GENERATE THE TABLE.

	.CREF
ASEBC.:	BLOCK	0
	.XCREF

	TBLGEN

	END