LAB2
1. Considerthe following source code fragment
Int a,b,c,d; a= (b +
c)/d ;
e= (b*c) - d;
e=(((a*b)/c)*d)
Assume that q,b, c, d,e are in registers. Develop an assembly language programto performthis assignment statements.
Int a,b,c,d;
a= (b + c)/d ;
e= (b*c) - d;
e=(((a*b)/c)*d)
Assume that b,e is in registers and c, d,a in memory. Develop an assembly language programto perform this assignment statements.
Int a,b,c,d;
a= (b AND c) XOR d;
a=(b XOR c) OR d;
Assume that a,b, c, d are in registers. Develop an assembly language programto performthis assignment statements.
Int a,b,c,d;
a= (b AND c) XOR d;
a=(b XOR c) OR d;
Assume that b, c are in registers and a,d in memory. Develop an assembly language programto perform this assignment statements.
LAB 3
1. Create an array of 10 elements and initialized the array elements with random values a. Assign array[5]=0 and array[8]=0 (array is the name of the array, youcancreate array with any name)
2.Value=array[3]+ array[6]
Array[7]=value+array[7]
c.Compare array[5] with array[8] , show whether both the values are equal or not.
.
d. Read the 7
th element ofthe array and check whetherit’s odd or even number
2. Given:sides of triangle
Find out the type oftriangle: isosceles,scalene, equilateral triangle
1. Develop an assembly language program to print n integers
2. Develop an assembly language program to find the factorial of a number.
3. Develop an assembly language program to perform addition, subtraction if n=1, multiplication, division if n=2 and all the above operations if n=3.
4. Develop an assembly language program to find the number of times an element is
repeating in an array.
a. Develop an assembly language program to add even indexed elements of onearray to even indexed elements of another array.
LAB4
Develop an assembly language program to perform the following
1. Create an uninitialized array and Print ‘n’ natural numbers in the created array.
2. Develop an assembly language program to insert a given element in an array at aspecified position.
Input Array: 10, 20, 30, 40, 50
Element to be inserted: 60
Position: 3
Output: 10, 20, 30, 60, 40, 50
3. Develop an assembly language program to remove an element in the array.
Input Array: 10, 20, 30, 40, 50
Element to be removed: 30
Output: 10, 20, 40, 50
4. Develop an assembly language program to filter out even numbersin the givenarrayInput: 2, 3, 7, 8, 6
Output: 2, 8, 6
5. Develop an assembly language program to generate the first n numbers in Fibonacci series.
7. Take two arrays and add the even index elements of first array with the odd
index elements of second array.
Find the number of times an element appeared in an array and their indices.
Add 1 to the elements of first array and create a second array with those
elements.
3) Compute GCD for the given two natural numbers
4) Compute LCM for the given two natural numbers
LAB 6
1.Searching an element in an array of ‘n’ numbers
2. Read a sentence with at least one special character and search for the special character and print it. E.g., consider the input {youremailid@msruas.ac.in }
Output: @, .
3.Develop an assembly language program to print the number of all occurrences of thecharacter ‘@’ in the given string.
LAB 5
1. Develop an assembly language program to perform the following
Copy the contents of STRING 1 to STRING 2
1. Develop an ALP to count the number of vowels in the given string
Input: Hi Welcome Output: 4
1. Develop an assembly language program to remove first character of each word in the given string.
Input: Hi Welcome All
Output: i elcome ll
1. Develop an assembly language program to compare two strings and print a message “Equal” if they are equal, “Not Equal” if they are not equal.
LAB7
Develop an assembly language program to compute the second smallest number in the given array.
• Develop an assembly language program to sort all the elements in the given array (ascending order).
Comments
Post a Comment