You are on page 1of 17

LAB 05

LAB 05

TASK 1
• In the following task I am making Fibonacci series by taking to initial
values and storing their sum in eax after which I mov the value of edx in
ebx and eax in edx to store the next element of series and this happens in
a loop which runs for 10 iterations.

OUTPUT:
LAB 05

TASK 2
• In this task I am using the traditional bubble sort code and sorting the
array by checking if an element is greater than the element on the index
then I am swapping them with help of registers like eax,ebx,edi,esi
LAB 05
LAB 05

OUTPUT:
LAB 05

TASK 3
• In the following task I am generating the patterns by storing data in an
array and to print from 1 to 1111 index I am using the inner counter as 1
and then adding 1 in it after every iteration to generate the pattern
whereas to print from 4321 to 1, I am using the inner counter as 4 and
decrementing it by 1 after every iteration to generate the pattern and my
outer loop number of iterations are same throughout which is 4
PATTERN 1
LAB 05

OUTPUT:

PATTERN 2
LAB 05

OUTPUT:
LAB 05

PATTERN 3
LAB 05

OUTPUT:

PATTERN 4
LAB 05

OUTPUT:
LAB 05

TASK 4
• In the following task I am running a loop 5 times to take input from the
user employee name, id, birth year, and Salary and storing them in it their
respective array. In the I am traversing the salary array and adding its
element in sum variable and printing it.
LAB 05
LAB 05

OUTPUT:
LAB 05

TASK 5
• In the following task I am initializing the source array with a string copying
its element into the target array and then printing it

OUTPUT:
LAB 05

TASK 6
• In the following task I am traversing through the start of the array and the
end of the array together and swapping the elements of the array with
the help of registers like esi,edi,eax,ebx, etc.
LAB 05

OUTPUT:

You might also like