0% found this document useful (0 votes)
35 views1 page

Assembly Language Programming D FAST-NU, Lahore, Spring 2018

This document provides instructions for Homework 1 in an Assembly Language Programming course. It lists 4 problems to solve by writing code: 1) adding corresponding elements of 3 arrays of the same size, 2) rotating the elements of a byte array to the right once, 3) finding the most frequently occurring number in a sorted integer array, and 4) adding two numbers represented by byte arrays of equal size, carrying over values during addition. Students are instructed to submit their code by the due date to receive a grade out of 50 points.

Uploaded by

Arslan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
35 views1 page

Assembly Language Programming D FAST-NU, Lahore, Spring 2018

This document provides instructions for Homework 1 in an Assembly Language Programming course. It lists 4 problems to solve by writing code: 1) adding corresponding elements of 3 arrays of the same size, 2) rotating the elements of a byte array to the right once, 3) finding the most frequently occurring number in a sorted integer array, and 4) adding two numbers represented by byte arrays of equal size, carrying over values during addition. Students are instructed to submit their code by the due date to receive a grade out of 50 points.

Uploaded by

Arslan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Assembly Language Programming D

FAST-NU, Lahore, Spring 2018

Homework 1

Due Wednesday February 14 11:55 P.M. Marked out of 50 points.

Write code for the following problems. Submit soft copies via SLATE.

1) Declare three arrays arr1, arr2 and arr3, each of size stored in a variable called
size. Write code that adds the corresponding numbers in arr1 and arr2 and
stores their sums in arr3.
2) Declare a byte array arr1 (each of its elements is a byte) of size stored in a word
variable called size. Write code to rotate the elements of arr1 toward right once.
3) Create a sorted array of integers arr1 and store its size in a variable called size.
Write code to find the number which repeats the most number of times in arr1.
Store this number in a variable called num1 and store the number of times it
repeats in a variable called count1.
4) Create two arrays arr1 and arr2 whose each element is a byte. These arrays are
of equal size, stored in a variable called size. Both arr1 and arr2 represent
numbers of size-many digits – i.e. the entire array is considered a single number
with the elements of the array being its digits. Write code to add these two
numbers byte by byte to produce the sum in a third array called arr3. Be careful
that while adding two bytes the sum may generate a carry and this needs to be
carried to the next addition. Look into the instruction: ADC for this purpose. If the
overall addition generates an end carry set a flag variable called flag1, otherwise
clear it to zero.

THE END

You might also like