Google
 

Trailing-Edge - PDP-10 Archives - decuslib10-10 - 43,50517/rpgprm.mac
There is 1 other file named rpgprm.mac in the archive. Click here to see a list.
UNIVERSAL	RPGPRM FOR RPGLIB VERSION 1.
SUBTTL	PARAMETERS FOR RPGLIB %1	10-JAN-76	/RBC/ACK

;USED TO BE
;COPYRIGHT 1974, 1975, DIGITAL EQUIPMENT CORP., MAYNARD MASS.
;WHEN IT WAS LBLPRM, BUT WAS MODIFIED TO RPGII VERSION BY
;BOB CURRIER.

	EDIT==0
	VERSION==10B29


.DIRECTIVE .NOBIN

	%%LBLP==1	;TO ASSURE THAT ALL MODULES ARE COMPILED WITH THE
			; SAME SWITCHES.

;REVISION HISTORY:
	SEARCH	INTERM	;DEFINE THE ASSEMBLY SWITCHES.

	DEBUG==:DEBUG
	SERCH==:SERCH
	RPW==:RPW
	ISAM==:ISAM
	DBMS==:DBMS
	MCS==:MCS
	STRING==:STRING
	EBCMP.==:EBCMP.
	MPWCEX==:MPWCEX
	TRAILB==:TRAILB
	MPWC.S==:MPWC.S
	BIS==:BIS

;DEFAULT ANY UNDEFINED ASSEMBLY SWITCHES.

	SWSET%==SWSET%		;DEFINE COMPILER'S ASSEMBLY SWITCH WORD.
	LIBSW%==LIBSW%		;DEFINE LIBOL'S ASSEMBLY SWITCH WORD.
;ACCUMULATIOR DEFINITIONS:

;NOTE:
;	ACCUMULATORS 0, 1, 2, 3 AND 4 SHOULD ALWAYS BE PRESERVED ON
;	 ANY CALL TO RPGLIB.

	S1==1		;SAVE THESE.
	S2==2
	S3==3
	CNT==12		;FIELD WIDTH.
	CH==5		;HOLDS A CHARACTER.
	T1==CH		;TEMPORARY.
	T2==T1+1	;    "
	T3==T2+1	;    "
	T4==T3+1	;    "
	T5==T4+1	;    "
	TAC1==5		;TEMPORARIES - USE THESE NAMES WHEN RENAMEING
	TAC2==6		; THE AC'S OTHERWISE THE ASSEMBLER WILL MESS
	TAC3==7		; THINGS UP.
	TAC4==10
	TAC5==11
	CPTR==T2	;CONVERSION POINTER.
	AC==T3		;THREE AC'S USED IN NUMERIC CONVERSIONS.
	IPTR==13	;THE INPUT BYTE POINTER.
	OPTR==14	;THE OUTPUT BYTE POINTER.
	SW==OPTR	;SWITCHES.
	JAC==15		;HOLDS THE RETURN ADDRESS FOR SUBROUTINES CALLED
			; VIA JSP.
	PARM==16	;POINTS TO THE PARAMETERS.
	PP==17		;PUSH DOWN POINTER.
;FLAGS:

	LS==(1B1)	;LEADING SIGN FLAG.
	LM==(1B2)	;LEADING MINUS FLAG.
	IS==(1B3)	;IMBEDDED OR TRAILING SIGN FLAG:
			; 0 ==> NONE OR POSITIVE
			; 1 ==> NEGATIVE.
	OECNT==(1B4)	;ODD OR EVEN COUNT FLAG.
			; 0 ==> CNT WAS ODD.
			; 1 ==> CNT WAS EVEN.
SUBTTL	REGISTERS AND FLAGS FOR BIS

IFE	BIS,<XLIST>
IFN BIS,<

; BASIC REGISTER DEFINITIONS
;INSTRUCTION REGS
BIS0==4
BIS1==5
BIS2==6
BIS3==7
BIS4==10
;TEMPS
BIST0==11
BIST1==12
BIST2==13
IFN	SW-14,<PRINTX BIS REGISTER ERROR>
IFN	JAC-15,<PRINTX BIS REGISTER ERROR>

; MORE MEANINGFUL NAMES FOR THE REGS
BISCH==BIS2	;TEMP REGISTER USED BY BSET1. AND BSET2.
B.FLAG==BIS0	;FLAGS
SRCCNT==BIS0	;SOURCE COUNT
SRCPT==BIS1	;SOURCE POINTER
DSTCNT==BIS3	;DESTINATION COUNT
DSTPT==BIS4	;DESTINATION POINTER
PATRN==BIS0	;PATTERN
MARKAD==BIS3	;ADDRESS OF MARK POINTER
BD.FLG==BIS3	;FLAGS ARE HERE FOR BINARY TO DECIMAL CONVERSION
SRCHI==BIS0	;HIGH ORDER BITS OF SOURCE BINARY
SRCLO==BIS1	;LOW ORDER BITS OF SOURCE BINARY NUMBER
DSTHI==BIS3	;HIGH ORDER BITS OF DESTINATION BINARY NUMBER
DSTLO==BIS4	;LOW ORDER BITS OF DESTINATION BINARY NUMBER

;FLAGS IN LEFT HALF OF B.FLAG
BFLG.S==400000	;SIGNIFICANCE FLAG
BFLG.M==100000	;NEGATIVE FLAG
BFLG.N==200000	;NON-ZERO FLAG
BFLG.==700000	;ALL OF THEM

;NEW KL INSTRUCTIONS

OPDEF	DADD	[114000,,000000]	;DOUBLE ADD
OPDEF	DSUB	[115000,,000000]	;
OPDEF	DMUL	[116000,,000000]	;
OPDEF	DDIV	[117000,,000000]	;
OPDEF	DMOVE	[120000,,000000]
OPDEF	DMOVEM	[124000,,000000]
OPDEF	DMOVN	[121000,,000000]
OPDEF	DMOVNM	[125000,,000000]

;EXTENDED INSTRUCTION SET OP CODES

OPDEF	EXTEND	[123000,,000000]

CMPSL==001000	;COMPARE STRING LESS THAN
CMPSE==002000	;EQUAL
CMPSLE==003000	;LESS OR EQUAL
CMPSGE==005000	;GREATER OR EQUAL
CMPSN==006000	;NOT EQUAL
CMPSG==007000	;GREATER

EDIT==004000	;EDIT

CVTDBO==010000	;CONVERT DECIMAL TO BINARY OFFSET
CVTDBT==011000	;TRANSLATED
CVTBDO==012000	;BINARY TO DECIMAL OFFSET
CVTBDT==013000	;TRANSLATED

MOVSO==014000	;MOVE STRING OFFSET
MOVST==015000	;TRANSLATED
MOVSLJ==016000	;LEFT JUSTIFIED
MOVSRJ==017000	;RIGHT JUSTIFIED

; E0 BLOCK INDICES

E0.INS==0	;INSTRUCTION CODE
E0.OFF==0	;OFFSET
E0.TBL==0	;TRANSLATION TABLE ADDRESS
E0.FIL==1	;FILL CHARACTER
E0.FLT==2	;FLOAT CHARACTER
E0.$==3		;DOLLAR SIGN
E0.COM==4	;COMMA
E0..==5		;PERIOD
E0.BL==6	;BLANK
E0.0==7		;ZERO
E0.PL==10	;PLUS
E0.MI==11	;MINUS
E0.C==12	;"C"
E0.R==13	;"R"
E0.D==14	;"D"
E0.B==15	;"B"

;TRANSLATION TABLE CODES

T.SBIT==400000		;SET S AND N FLAGS
T.ABRT==100000		;ABORT
T.MCLR==200000		;CLEAR M FLAG
T.MSET==300000		;SET M FLAG
T.ABIS==1000		;ABORT IF SIGNIFICANCE IS ON (ONLY FOR CVDBO/T )

>	;END OF BIS
LIST
;MACROS

;THIS MACRO IS USED BY THE OTHER MACROS TO GENERATE "LDB AC1,[POINT ?,?(AC2),?]"
; WHERE THE ?'S ARE DETERMINED BY THE STRUCTURE OF EASTBL, WHERE THE EXTERNALS
; ?'FLD'? ARE DEFINED.

	DEFINE	PICKUP	(FLD,N,AC1,AC2,%LH,%RH,%A,%B)<
		.XCREF
		;;DO DEFAULTS THIS WAY SINCE MACRO DOESN'T WORK RIGHT.
		%A==N
		IFB <N>,<%A==6>
		%B==AC1
		IFB <AC1>,<%B==CH>
		%C==AC2
		IFB <AC2>,<%C==%B>
		%B==%B&17
		%LH==S'FLD'L.##
		%RH==S'FLD'R.##
		IFE %A-7,<%LH==A'FLD'L.##
			%RH==A'FLD'R.##>
		IFE %A-^D9,<%LH==E'FLD'L.##
			%RH==E'FLD'R.##>
		LDB	%C,	[XWD	%LH+%B,%RH]
		.CREF
		LIST
>	;END OF DEFINE PICKUP.





COMMENT	\

MACRO TO DETERMINE IF A CHARACTER REPRESENTS A DIGIT WITH AN OVERPUNCHED "-".

CALL:
	SIGN	N,AC1,AC2;
WHERE:
	N=6 ==> THE INPUT CHAR IS SIXBIT
	N=7 ==> THE INPUT CHAR IS ASCII
	N=9 ==> THE INPUT CHAR IS EBCDIC
	(AC1) = THE INPUT CHAR
	(AC2) = 1 IF THE CHAR HAS AN OVERPUNCHED "-", OTHERWISE 0.
DEFAULTS:
	N:	6	(OMITTED OR NEITHER 7 NOR 9)
	AC1:	CH	(THIS IS NOT NECESSARILY THE CH DEFINED IN LBLPRM)
	AC2:	AC1

\

	DEFINE	SIGN	(N,AC1,AC2)<PICKUP	SGN,N,AC1,AC2
			PURGE	%A,%B,%C
			>
COMMENT	\

MACRO TO CONVERT A CHARACTER TO A DIGIT.

CALL:
	CVTNM	N,AC1,AC2;
WHERE:
	N=6 ==> THE INPUT CHAR IS SIXBIT
	N=7 ==> THE INPUT CHAR IS ASCII
	N=9 ==> THE INPUT CHAR IS EBCDIC
	(AC1) = THE INPUT CHAR
	(AC2) = THE DIGIT
DEFAULTS:
	N:	6	(OMITTED OR NEITHER 7 NOR 9)
	AC1:	CH	(THIS IS NOT NECESSARILY THE CH DEFINED IN LBLPRM)
	AC2:	AC1

\

	DEFINE	CVTNM	(N,AC1,AC2)<
			PICKUP	DGT,N,AC1,AC2
			TRNN	%C,IBNCH.##
			TRZE	%C,SPCCH.##
			CAIE	%C,3
			TRZA	%C,777600
			TRZ	%C,-1
			IFE	N-6,<ADDI %C,20>
			IFE	N-7,<ADDI %C,60>
			IFE	N-^D9,<ADDI %C,360>
			PURGE	%C
			>
COMMENT	\

MACRO TO CONVERT A CHARACTER TO A DIGIT AND SET BIT 0 TO 1 IF THE CHARACTER
REPRESENTS A DIGIT WITH AN OVERPUNCHED "-".

CALL:
	CVTSNM	N,AC1,AC2;
WHERE:
	N=6 ==> THE INPUT CHAR IS SIXBIT
	N=7 ==> THE INPUT CHAR IS ASCII
	N=9 ==> THE INPUT CHAR IS EBCDIC
	(AC1) = THE INPUT CHAR
	(AC2) = THE DIGIT
DEFAULTS:
	N:	6	(OMITTED OR NEITHER 7 NOR 9)
	AC1:	CH	(THIS IS NOT NECESSARILY THE CH DEFINED IN LBLPRM)
	AC2:	AC1

\

	DEFINE	CVTSNM	(N,AC1,AC2)<
		PICKUP	SDG,N,AC1,AC2;
		TRNE	%C,IBNCH.##
		TLOA	%C,(1B0)
		TRZE	%C,SPCCH.##
		CAIE	%C,3
		TRZA	%C,777600
		TRZ	%C,-1
		IFE	N-6,<ADDI %C,20>
		IFE	N-7,<ADDI %C,60>
		IFE	N-^D9,<ADDI %C,360>
		PURGE	%C
>

	END