# M&AL all past/Previous question paper

-M&AL –Computer Science all subject past paperÂ  – M&AL Â Â Â with source code â€“ M&AL Â Â Course â€“ M&AL Â Â Â idea â€“ M&AL Â MCQ- M&AL Â Â Interview QuestionÂ  –Computer Science all courses -Technology –University Past Paper -Programming language –Question paperold paper

MPAL S1

## M&AL Sessional II in past paper

Write a program (MASM code) that subtracts three integers (X, Y, Z). Insert a call DumpRegs statement to display the register values.

Y = X*2

Z = 10

## Question 02:Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  [05×01]

Â Calculate the number of elements of the following arrays

1. a) Array1 BYTE 10h,20h,30h
2. b) Array2 WORD 1000h,2000h,3000h
3. c) Array3 DWORD 10000h,20000h,30000h
4. Array4 WORD 1,2,3
5. Array5 DWORD 4,5,6

Hint: Use \$ Operator. Complete code is not required just write one MASM code statement.

## M&AL Sessional I in final paper

The greatest common divisor (GCD) of two integers is the largest integer that will evenly divide both integers. The GCD algorithm involves integer division in a loop, described by the following C++ code:

int GCD(int x, int y)

{

x = abs(x); // absolute value y = abs(y);

do {

int n = x % y; x = y;

y = n;

} while (y > 0); return x;

}

Implement this function in assembly language and write a test program that calls the function several times, passing it different values. Display all results on the screen.

## Question 02:Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  [10]

Write an application that does the following:

• Fill an array with 9 random integers and use Your Roll Number as 10th
• Sort through the array, displaying each value, and count the number of negative values
• After the loop finishes, display the count and the last

#M&AL Â #Computer Science all subject past paperÂ  # M&AL Â # M&AL Â Â with source code #M&AL Â idea â€“M&AL Â MCQ#M&AL Â Interview QuestionÂ  #Computer Science all courses #Technology –University Past Paper #Programming language #Question paper #old paper

Scroll to Top