; PeekA.asm
; Copyright Xerox Corporation 1979
; Last modified February 7, 1979  10:08 PM by Boggs

	.titl PeekA

.ent NovaDiv

	.srel

NovaDiv:	.NovaDiv

	.nrel


; NovaDiv(lvDividend, divisor, lvRemainder) = quotient
; Compute (@lvDividend)/divisor (dividend is 32 bits), return
; the quotient, and put the remainder in the word pointed to
; by lvRemainder.
.NovaDiv:
	sta 3 1,2
	sta 1 2,2	; save divisor
	mov 0 3		; move lvDividend
	lda 0 0,3	; get dividend into ACs
	lda 1 1,3
	mov 2 3		; preserve stack pointer
	lda 2 2,3	; get divisor
	div		; (ac0,ac1)/ac2 -> ac0, ac1
	 nop
	mov 3 2		; restore stack pointer
	sta 0 @3,2	; @lvRemainder = remainder
	mov 1 0		; return quotient
	lda 3 1,2
	jmp 1,3

	.end