Question: MIPS does not provide flags like carry etc. This makes addition of 64 bit quantities difficult. However, we can derive carry from the ob-
MIPS does not provide flags like carry etc. This makes addition of 64 bit quantities difficult. However, we can derive carry from the ob- servation that if a carry occurs, the sum has to be smaller than both quantities being added. Thus we can use the instruction slt to compare the sum with either operand and the result will put the carry into a register. Write a program in MIPS assembly language to calculate the unsigned sum of two 64 bit operands. The first operand is in registers $al, $a0 while the second is in registers $a3, $a2. ($al and a3 are the more sig- nificant 32 bit halves of the two operands). The sum should be placed 6 in $v1 and $vo, with the overall carry in $s0. Your code should be clear and well commented. Code without comments or with poor comment- ing will incur marks penalty.
Step by Step Solution
3.42 Rating (149 Votes )
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
