liljazz2007 0 Newbie Poster

I need help where it says "DEFINE YOUR CODE" Ive defined the 12 out of the 20 lines required but Im not sure how to do the remainding parts. Please help. Thankyou

; 	Multiplication and division (integer division) using addition and
;		subtraction in SRC assembly language.
;	If the second operand in division is zero, store -1 in the result.
;
	.org	1000
	ld	r1,	op1		; r1 holds operand1
	ld	r2,	op2		; r2 holds operand2
	ld	r3,	operator	; r3 holds the operator
	lar	r4,	result		; r4 points to the location of result 
	lar	r8,	end
	lar	r10,	multiplication
	lar	r12,	division

	addi	r5,r3,-42		; check for multiplication operation
	brzr	r10,r5			; if yes, branch to multiplication
	addi	r5,r3,-47		; check for division operation
	brzr	r12,r5			; if yes, branch to division				
	br	r8

multiplication:
	lar	r13, aa
	lar	r14, bb
	lar	r15, loop1
	lar	r16, store

	la	r20, 0	; r20: number of negative values in op1 and op2
	brpl	r13,r1	; check the sign of multiplier
	neg	r1,r1		; if the sign is negative, make it to be positive
	addi	r20,r20,1	; 

aa:			; DEFINE YOUR CODE	; check the sign of multiplicand
			; DEFINE YOUR CODE	; if the sign is negative, make it to be positive
			;	
bb:	addi	r22,r2, 0	;save second operand as counter 
	la	r6, 0

loop1: 	add		; DEFINE YOUR CODE
	addi		; DEFINE YOUR CODE	; decrement the value of r22
			; DEFINE YOUR CODE		; if r22’s value is nonzero, go to loop1
	
	addi	r20, r20, -1	; r20's possible value was 0, 1, or 2
	brnz	r16,r20		; if r20 = 0, 
	neg		; DEFINE YOUR CODE ; one of multiplier/multiplicand was negative
store: 	st		; DEFINE YOUR CODE
	br		; DEFINE YOUR CODE
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.