 # RD, 13.7.93, changed DigitMult, added DigitMultAdd
 # Ralf Dentzer, 6.5.93
 # DigitType  DigitMultAdd (prod, a, b, carry)
 #			    $4, $5, $6, $7
 #	DigitType *prod, a, b, carry;
 #{	DigitType t0,  t1;
 #		  $11  $12
 #	*prod=LOW(a*b + carry);
 #	return HIGH(a*b + carry);
 #} 
	.text

        .set    noreorder

	.globl	DigitMult
	.ent	DigitMult
DigitMult:
        .frame  $sp, 0, $31
	multu	$5, $6			# a*b
	mflo	$12			# LOW(a*b)
	sw	$12, 0($4)		# *prod = LOW
	j	$31			# return
	mfhi	$2			# HIGH	(delay)

	.end	DigitMult

	.globl	DigitMultAdd
	.ent	DigitMultAdd
DigitMultAdd:
        .frame  $sp, 0, $31
	multu	$5, $6			# a*b
	mflo	$11			# LOW(a*b)
	addu	$12, $11, $7		# LOW(a*b + carry)
	sltu	$7, $12, $11		# CARRY
	mfhi	$11			# HIGH(a*b)
	sw	$12, 0($4)		# *prod = LOW
	j	$31			# return
	addu	$2, $11, $7		# HIGH	(delay)

	.end	DigitMultAdd

        .set    reorder
