/NORMALIZED INTEGER DIVIDE SUBROUTINE
/EXECUTION TIME:  92 TO 96 MICROSECONDS
/CALLING SEQUENCE:
/   CALL DIVD(DIVDND,DIVSOR,QUOT,ERROR)
/   DIVDND:  NORMALIZED INTEGER DIVIDEND
/   DIVSOR:  NORMALIZED INTEGER DIVISOR
/   QUOT:    NORMALIZED INTEGER QUOTIENT
/   ERROR=0:  NO ERROR
/        =1:  DIVSOR NOT GREATER THAN DIVDND
/             (IN ABSOLUTE VALUE)
	.TITLE DIVD
	.GLOBL DIVD
DIVD	0
	ISZ DIVD
	LAC* DIVD
	DAC DIVDND
	SPA
	LAC* DIVDND   /INDIRECT
	DAC DIVDND	/DIVIDEND LOCATION
	ISZ DIVD
	LAC* DIVD
	DAC DIVSOR
	SPA
	LAC* DIVSOR /INDIRECT
	DAC DIVSOR	/DIVISOR LOCATION
	ISZ DIVD
	LAC* DIVD
	DAC QUOT
	SPA
	LAC* QUOT   /INDIRECT
	DAC QUOT	/QUOTIENT LOCATION
	ISZ DIVD
	LAC* DIVD
	DAC ERROR
	SPA
	LAC* ERROR	/INDIRECT
	DAC ERROR	/ERROR LOCATION
	DZM* ERROR	/ERROR=0
	ISZ DIVD	/BUMP TO EXIT
	LAC* DIVDND
	SMA!CLL	/CLEAR LINK
	JMP .+3
	CMA!CML	/COMPLEMENT DIVIDEND; SET LINK
	TAD (1
	DAC DIVDND	/STORE DIVIDEND
	LAC* DIVSOR
	SMA
	JMP .+3
	CMA!CML	/COMPLEMENT DIVISOR; COMPLEMENT LINK
	TAD (1
	DAC DIVSOR	/STORE DIVISOR
	CLA!RAR
	DAC SIGN	/STORE SIGN
	CLQ	/SET LEAST SIGNIFICANT DIVIDEND=0
	LAC DIVDND	/LOAD MOST SIGNIFICANT DIVIDEND
	DIV	/UNSIGNED DIVIDE
DIVSOR	XX
	SZL
	JMP ERROR1	/DIVIDE ERROR
	LAC SIGN
	RAL	/LINK=SIGN
	LACQ	/LOAD QUOTIENT
	SNL
	JMP .+3
	CMA	/COMPLEMENT QUOTIENT
	TAD (1
	RAR	/DIVIDE BY TWO TO MAKE IT RIGHT
	DAC* QUOT	/DEPOSIT QUOTIENT
	JMP* DIVD
ERROR1	ISZ* ERROR	/DIVISOR NOT GREATER THAN DIVIDEND
	JMP* DIVD
DIVDND
ERROR
QUOT
SIGN
	.END
