Google
 

Trailing-Edge - PDP-10 Archives - BB-Z759A-SM - cobol-source/pnz.mac
There are 7 other files named pnz.mac in the archive. Click here to see a list.
; UPD ID= 1039 on 4/29/83 at 12:06 AM by NIXON                          
TITLE	PNZ FOR COBOTS.
SUBTTL	DETERMINE IF A STRING IS POSITIVE, NEGATIVE OR ZERO	/ACK

	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

	SEARCH	LBLPRM		;DEFINE PARAMETERS.
	%%LBLP==:%%LBLP

	EXTERN	EASTB.		;FORCE EASTBL TO BE LOADED.

	HISEG
	.COPYRIGHT		;Put standard copyright statement in REL file

;REVISION HISTORY:

;V10 *****

;	28-JAN-76	[424] FIX ZERO
;	19-DEC-74	/ACK	CREATION.

;	5/15/75		/DBT/	BIS
;*****

COMMENT	\

	THIS ROUTINE IS USED TO DETERMINE IF A STRING IS POSITIVE OR
IF A STRING IS NEGATIVE OR IF A STRING IS ZERO.

CALL:
	MOVEI	16,PARAMETER ADDRESS
	PUSHJ	17,POS.6/POS.7/POS.9/NEG.6/NEG.7/NEG.9/ZERO.6/ZERO.7/ZERO.9

PARAMETERS:
	BITS	0-5	BYTE POINTER RESIDUE FOR INPUT FIELD.
	BIT	6	1 IF AN OPERATIONAL SIGN IS PRESENT.
	BITS	7-17	SIZE OF THE INPUT FIELD.
	BITS	18-35	ADDRESS OF THE FIRST CHARACTER OF THE INPUT FIELD.


RETURNS:
	CALL+1	IF THE TEST FAILS.
	CALL+2	IF THE TEST SUCCEEDS.

REGISTERS USED:
	CH, T1 (ALIAS CH), T2, SW, JAC, PARM, CNT

\
;THE POSITIVE TEST:

	ENTRY	POS.6		;IF THE INPUT IS SIXBIT.
	ENTRY	POS.7		;IF THE INPUT IS ASCII.
	ENTRY	POS.9		;IF THE INPUT IS EBCDIC.

POS.6:	JSP	BISCH,	POS		;ENTER HERE IF THE INPUT IS SIXBIT,
POS.7:	JSP	BISCH,	POS		; HERE IF IT IS ASCII AND
	BLOCK	1
POS.9:	JSP	BISCH,	POS		; HERE IF IT IS EBCDIC.

POS:
	SUBI	BISCH,POS.6-5		;COMPUTE BYTE SIZE.
	HRLI	PARM,(<Z	DSTHI,0>)	;PUT DESTINATION AC INTO PARM
	PUSHJ	PP,	GDX.##		;CONVERT TO BINARY
	JUMPL	DSTHI,RET.1##		;NEGATIVE
	CAIN	DSTLO,0
	CAIE	DSTHI,0
	AOS	(PP)			;POSITIVE
	POPJ	PP,			;ZERO

;THE NEGATIVE TEST:

	ENTRY	NEG.6		;IF THE INPUT IS SIXBIT.
	ENTRY	NEG.7		;IF THE INPUT IS ASCII.
	ENTRY	NEG.9		;IF THE INPUT IS EBCDIC.

NEG.6:	JSP	BISCH,	NEG		;ENTER HERE IF THE INPUT IS SIXBIT,
NEG.7:	JSP	BISCH,	NEG		; HERE IF IT IS ASCII AND
	BLOCK	1
NEG.9:	JSP	BISCH,	NEG		; HERE IF IT IS EBCDIC.

NEG:
	SUBI	BISCH,NEG.6-5		;COMPUTE BYTE SIZE.
	HRLI	PARM,(<Z	DSTHI,0>)	;PUT DESTINATION AC INTO PARM
	PUSHJ	PP,GDX.
	JUMPL	DSTHI,RET.2##		;NEGATIVE
	POPJ	PP,			;POS/ZERO
;THE ZERO TEST:

	ENTRY	ZERO.6		;IF THE INPUT IS SIXBIT.
	ENTRY	ZERO.7		;IF THE INPUT IS ASCII.
	ENTRY	ZERO.9		;IF THE INPUT IS EBCDIC.

ZERO.6:	JSP	BISCH,	ZERO		;ENTER HERE IF THE INPUT IS SIXBIT,
ZERO.7:	JSP	BISCH,	ZERO		; HERE IF IT IS ASCII AND
	BLOCK	1
ZERO.9:	JSP	BISCH,	ZERO		; HERE IF IT IS EBCDIC.

ZERO:
	SUBI	BISCH,ZERO.6-5		;COMPUTE BYTE SIZE.

	HRLI	PARM,(<Z	DSTHI,0>)	;PUT DESTINATION AC INTO PARM
	PUSHJ	PP,GDX.
	CAIN	DSTLO,0			; [424] IS LOW PART ZERO?
	CAIE	DSTHI,0
	POPJ	PP,			;NON-ZERO
	JRST	RET.2##			;ZERO

	END