We are here with you hands in hands to facilitate your learning & don't appreciate the idea of copying or replicating solutions. Read More>>

www.vustudents.ning.com

 www.bit.ly/vucodes + Link For Assignments, GDBs & Online Quizzes Solution www.bit.ly/papersvu + Link For Past Papers, Solved MCQs, Short Notes & More

Dear Students! Share your Assignments / GDBs / Quizzes files as you receive in your LMS, So it can be discussed/solved timely. Add Discussion

# CS401 Assignment No 02 Fall 2019 Solution & Discussion Due Date: 26-11-2019

CS401 Assignment No 02 Fall 2019 Solution & Discussion Due Date: 26-11-2019

Q1. Write a subroutine that will find the first even number from an array of your VU ID and calculate its factorial.                        (10 Marks)Q1. Write a subroutine that will find the first even number from an array of your VU ID and calculate its factorial.                        (10 Marks)
Note: Skip 0’s in your VU ID as shown below,VU ID: BC190206435After skipping 0’s, array would be:Array: 1, 9, 2, 6, 4, 3, 5The first even number is 2 in the array so its factorial will be calculated and saved in AX register.
Q2. Write a code in assembly language (using appropriate jumps) equivalent to this given code in C. (10  Marks)#include <stdio.h>int main(){    int n1=1, n2=2;    int largest;    if( n1>n2)        largest=n1;else        largest = n2;    return 0;}

+ How to Join Subject Study Groups & Get Helping Material?

+ How to become Top Reputation, Angels, Intellectual, Featured Members & Moderators?

+ VU Students Reserves The Right to Delete Your Profile, If?

Views: 2403

.

+ http://bit.ly/vucodes (Link for Assignments, GDBs & Online Quizzes Solution)

+ http://bit.ly/papersvu (Link for Past Papers, Solved MCQs, Short Notes & More)

Attachments:

### Replies to This Discussion

A.o.A  Tariq sir cs410 assignment solution bilkil thek hai kiya

Question No 1
[org0*0100]
Mov ax, 1
Mov bx, 0
Mov cx, 0
Number: dw 0
Jmp start
Factnol:
f-loop: mul word [number]
sub word[number], 1
cmp word[number], 2
jge f-loop
ret
start:
clc
mov cx, [ID+bx]
mov [number], cx
shr cx, 1
call factnol
Mov ax, 0*4c00
int 0*21
ID: bc 1,7,0,4,0,6,4,8,6 write your id here

Question No 2 Solution:
[org 0*0100]
Number 1: dw 1
Number 2: dw 2
Large: dw 0
Mov ax, [number1]
Mov ax, [number2]
cmp ax , bx
Mov[large], bx
Jmp the end
Next:
Mov [large], ax
The end:
Mov ax , 0*4c00
Int 0*21

thanks for sharing TM sir

kia assignment solution sahi hai??

plz tell me …….anyone.

## Latest Activity

24 minutes ago
Aqsa Khan liked Asad's discussion آج جانے کی ضد نہ کرو
24 minutes ago
Aqsa Khan liked Asad's discussion مایوسی
24 minutes ago
1 hour ago
1 hour ago
+ ! ! !F∈@R|∈\$\$ 1 updated their profile
1 hour ago
1 hour ago
1 hour ago
Hamza khalid and Rida Jaffery joined + M.Tariq Malik's group

### CS201 Introduction to Programming

1 hour ago
+ ! ! ! ! ! UnkNowN updated their profile
2 hours ago
Hamza khalid, sanni khan, Ali khan and 3 more joined Virtual University of Pakistan
2 hours ago
2 hours ago

1

2

3