Question: Need help using Linux CPE 221 Computer Organization Homework 4 9/21/2017 1. Submit your assembly code hw4 yourLastName.asm using Canvas by 11:59 pm on 103/2017



Need help using Linux
CPE 221 Computer Organization Homework 4 9/21/2017 1. Submit your assembly code hw4 yourLastName.asm using Canvas by 11:59 pm on 103/2017 (Tue). 2. Late penalty: 20% off until 11:59 p.m. on 10/9/2017 (Mon). Not accepted after that. 3. Incorrect code will get partial credit. Assemble error gets no credit Write an SRC assembly code to work both multiplication (*) and division (/). Operands are defined as constants, and the operator is defined as an ASCII character as follows: Character ASCII 47 opl *op2 OR opl op2 Your program must read first operand, the operator, and then the second operand as above. Store the result in the memory location for result. When the operation is division (), the result is the integer part of the division (e.g.. 9/4-2). If the second operand in division is zero, store -1 in the result. You may start with the following template CPE 221 HW 4 date: student name 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 ld r2. ldr3. operator lar r4, result lar r8, end lar r0 mutiplication lar r12, sion rl ; rl holds operandl : r2 holds operand2 ; r3 holds the operator ; r4 points to the location of result op : check for multiplication operation ; if yes, addi r5.r3.-42 brzr r0.r5 addi r5,r3,-47 brzr r12.r5 br branch to multiplication check for division operation ; if yes, branch to division r8 CPE 221 Computer Organization Homework 4 9/21/2017 1. Submit your assembly code hw4 yourLastName.asm using Canvas by 11:59 pm on 103/2017 (Tue). 2. Late penalty: 20% off until 11:59 p.m. on 10/9/2017 (Mon). Not accepted after that. 3. Incorrect code will get partial credit. Assemble error gets no credit Write an SRC assembly code to work both multiplication (*) and division (/). Operands are defined as constants, and the operator is defined as an ASCII character as follows: Character ASCII 47 opl *op2 OR opl op2 Your program must read first operand, the operator, and then the second operand as above. Store the result in the memory location for result. When the operation is division (), the result is the integer part of the division (e.g.. 9/4-2). If the second operand in division is zero, store -1 in the result. You may start with the following template CPE 221 HW 4 date: student name 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 ld r2. ldr3. operator lar r4, result lar r8, end lar r0 mutiplication lar r12, sion rl ; rl holds operandl : r2 holds operand2 ; r3 holds the operator ; r4 points to the location of result op : check for multiplication operation ; if yes, addi r5.r3.-42 brzr r0.r5 addi r5,r3,-47 brzr r12.r5 br branch to multiplication check for division operation ; if yes, branch to division r8
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
