Google
 

Trailing-Edge - PDP-10 Archives - BB-H506D-SM_1983 - cobol/source/div11.mac
There are 7 other files named div11.mac in the archive. Click here to see a list.
TITLE	DIV11 FOR LIBOL
SUBTTL	SINGLE-PRECISION DIVIDE		AL BLACKINGTON/CAM



;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, 1981 BY DIGITAL EQUIPMENT CORPORATION

	HISEG

ENTRY DIV.11

;CALLING SEQUENCE:
;	MOVE	16,[Z AC,OPERAND]
;	PUSHJ	17,DIV.11

;ENTER WITH DIVIDEND IN ACCUMULATOR AC.
;EXIT WITH QUOTIENT IN ACCUMULATOR AC, REMAINDER IN AC+2

DIV.11:	MOVE	RS,0(PA)	;IS DIVISOR ZERO?
	TLZ	RS,1B18		;OR--IS IT 2**-35?
	JUMPE	RS,OVRFLO	;YES--TROUBLE (IF JUMP)

	LDB	RS,[POINT 4,PA,12]; GET OPERAND AC
	MOVE	TA,0(RS)	;GET OPERAND

	JOV	.+1		;CLEAR OVERFLOW FLAG
	IDIV	TA,0(PA)	;DO THE DIVIDE

	MOVEM	TA,0(RS)	;STASH QUOTIENT
	MOVEM	TA+1,2(RS)	;STASH REMAINDER

	JOV	OVRFLO		;SET ANY OVERFLOW INDICATION

	POPJ	PP,

OVRFLO:	SETOM	OVFLO.		;SET OVERFLOW CONDITION
	POPJ	PP,

EXTERNAL OVFLO.	;FLAG TO SHOW DIVIDE OVERFLOW


TA=13	;TEMPORARY (2 AC'S)
RS=15	;RESULT AC ADDRESS
PA=16	;ADDRESS OF DIVISOR
PP=17	;PUSH-DOWN POINTER

END