Google
 

Trailing-Edge - PDP-10 Archives - BB-Z759A-SM - cobol-source/siz23.mac
There are 7 other files named siz23.mac in the archive. Click here to see a list.
; UPD ID= 1042 on 4/29/83 at 12:07 AM by NIXON                          
TITLE	SIZ23 FOR COBLIB
SUBTTL	CHECK 2-WORD ITEM FOR SIZE ERROR		AL BLACKINGTON/CAM

	SEARCH COPYRT
	SALL

;THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY ONLY BE USED
;  OR COPIED IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE.

COPYRIGHT (C) 1974, 1983, 1984 BY DIGITAL EQUIPMENT CORPORATION


	HISEG
	.COPYRIGHT		;Put standard copyright statement in REL file

;EDITS

;NAME	DATE		COMMENTS
;DMN	 7-FEB-80	;[615] CHECK OVERFLOW FLAGS FOR "ON SIZE ERROR".

	SEARCH	LBLPRM

ENTRY SIZE.2	;LITERAL TO BE COMPARED AGAINST IS 1 WORD.
ENTRY SIZE.3	;LITERAL TO BE COMPARED AGAINST IS 2 WORDS.

PP=17	;PUSH-DOWN POINTER
PA=16	;INPUT UUO
TA=13	;HIGH-ORDER AC
TB=14	;LOW-ORDER AC
TC=15	;TEMP
TH=10	;HIGH-ORDER OF LITERAL
TL=11	;LOW-ORDER OF LITERAL

EXTERNAL SZERA.	;SIZE ERROR INDICATOR
EXTERNAL OVFLO.	;OVERFLOW INDICATION
EXTERNAL RET.2	;SKIP RETURN

;EDIT HISTORY
;**** VERSION 12 *****
;DAW	20-FEB-79	[554] ENCLOSE QUAD-WORD ROUTINES IN BIS CONDITIONAL
;		THIS IS ACTUALLY PART OF COBOL EDIT 634-- CUSTOMERS MUST
;		REBUILD BOTH COBOL AND LIBOL
;CALLING SEQUENCE:
;	MOVEI	PA,<FIRST OF 2 AC'S TO BE TESTED>
;	PUSHJ	PP,SIZE.2  (OR SIZE.3)
;	XWD	<EXIT IF SIZE ERROR>,<ADDRESS OF VALUE TO BE COMPARED AGAINST>

SIZE.2:	MOVE	TC,@0(PP)	;PICK UP XWD
	MOVEI	TH,0		;HIGH ORDER HALF OF LITERAL IS ZERO
	MOVE	TL,0(TC)	;PICK UP LOW ORDER HALF
	JRST	SIZ.23

SIZE.3:	MOVE	TC,@0(PP)	;PICK UP XWD
	DMOVE	TH,0(TC)	;PICK UP LITERAL


SIZ.23:	SKIPE	OVFLO.		;WAS THERE ANY OVERFLOW?
	JRST	SIZ23E		;YES
	JFCL	11,SIZ23E	;[615] TEST FOR OVERFLOW FLAGS SET
	MOVE	TB,1(PA)	;PICK UP LOW-ORDER AC
	SKIPGE	TA,0(PA)	;IS HIGH-ORDER PART NEGATIVE?
	DMOVN	TA,TA		;YES, MAKE POSITIVE

	CAMGE	TA,TH		;COMPARE THE HIGH-ORDER HALVES
	JRST	RET.2		;SMALLER, RETURN TO WORD FOLLOWING THE XWD

SIZ23C:	CAME	TA,TH		;NO, ARE HIGH-ORDER PARTS EQUAL?
	JRST	SIZ23E		;NO

	CAMGE	TB,TL		;COMPARE LOW-ORDER HALVES
	JRST	RET.2		;AC LESS THAN LITERAL--OK

SIZ23E:	HLRM	TC,0(PP)	;NO--SIZE ERROR--SET UP RETURN
	SETOM	SZERA.		;SET ERROR INDICATOR
	POPJ	PP,
SUBTTL	CHECK 4-WORD ITEM FOR SIZE ERROR IN LOWER 2-WORDS

ENTRY SIZE.4	;LITERAL TO BE COMPARED AGAINST IS 1 WORD.
ENTRY SIZE.5	;LITERAL TO BE COMPARED AGAINST IS 2 WORDS.

SIZE.4:	PUSHJ	PP,SIZE4T	;TEST HIGH 2-WORDS
	JRST	SIZE.2		;TEST LOWER 2-WORDS

SIZE.5:	PUSHJ	PP,SIZE4T	;TEST HIGH 2-WORDS
	JRST	SIZE.3		;TEST LOWER 2-WORDS

SIZE4T:	SKIPE	TH,0(PA)	;BOTH WORDS MUST BE 0
	AOJN	TH,SIZE4F	;OR -1
	SKIPE	TL,1(PA)
	AOJN	TL,SIZE4F
	ADDI	PA,2		;POINT TO LOWER 2-WORDS
	POPJ	PP,

SIZE4F:	POP	PP,(PP)
	MOVE	TC,@0(PP)	;PICKUP XWD
	JRST	SIZ23E		;FAILED


	END