Assignment
Assignment
Id No 223317
Program BSCS
Submitted to Ma am Mahnoor
1. Write an efficient code segment to find Largest Number in an array of 10 unsigned
words. Store the largest number in location named “result”.
This program scans through an array of 10 numbers to find the largest value:
1. Start by assuming the first number in the array is the largest.
2. Go through each number in the array one by one.
3. If a number is bigger than the current largest, update the largest number.
4. When all numbers are checked, save the largest value to a memory location called
result.
2. Convert the following C++ code to equivalent Assembly Language instructions. (All the
variables are unsigned 32 bit integers).
while(op1 <= op2)
{
if(op1 > x || op1 > y)
{
Z += 10;
}
else
{
Z -= 10;
}
op1++;
}
This program repeatedly compares op1 with op2 and updates Z based on certain
conditions: