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

Looking For Something at vustudents.ning.com? Click Here to Search

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

How to Add New Discussion in Study Group ? Step By Step Guide Click Here.

CS401 Assignment No 02 Spring 2019 Solution & Discussion Due Date: 30-05-2019

+ How to Follow the New Added Discussions at Your Mail Address?

+ 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?


See Your Saved Posts Timeline

Views: 4434

.

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

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

+ Click Here to Search (Looking For something at vustudents.ning.com?)

+ Click Here To Join (Our facebook study Group)

Replies to This Discussion

here goes the solution. make sure you change the if to represent your vu id instead of this one found in the file.

https://drive.google.com/file/d/1m2b_hewjbpDQbQZ0NKSGjzNeBTgrFUwJ/v...

id kahan likhni 

Bhai jan ye bubble sort h g selection sort nhi h.

Cs401
[org 0x0100]
jmp start

data: dw 1,2,3,4,5,6,7,8,9
swap: db 0

start: mov bx,0 ;intialize array index to zero
mov byte [swap], 0 ;rest swap flag to noswap

loop1: mov ax, [data+bx] ;load in number in ax
cmp ax, [data+bx+2] ;compare with next number

jbe noswap ;no swap if already in order

mov dx, [data+bx+2] ;load second number in first
mov [data+bx+2], ax ;store first number in second
mov [data+bx], dx ;store second number in first
mov byte [swap], 1 ;flag that a swap has been done

noswap: add bx, 2 ;advance bx to next index
cmp bx, 18 ;are we at last index

jne loop1 ;if not compare next two

cmp byte [swap],1 ;check if swap has been done

je start ;if yes make another pass

mov ax, 0x4c00 ;terminate program
int 0x21

; sorting a list of number using selection sort; sorting a list of number using selection sort
[org 0x0100] jmp startdata: dw 6,5,5,0,5,5,3,1,7 yaha apni id likhni haswap: db 0start: mov; 0 ;initialize array index to zeromov byte [swap],0 ;reset swap flag to no swaps
loop1: mov ax, [data+bx] ;load number in axcmp ax, [data+bx+2] ;compare with next numberjbe noswap ;no swap if already in order
mov dx, [data+bx+2] ;load second element in dxmov [data+bx+2], ax ;store first number in secondmov [data+bx], dx ;store second number in firstmov btye [swap], 1 ;flag that a swap has been down
noswap:add bx,2 ;advance bx to next indexcmp bx, 18 ;are we at last indexjne loop1 :if not compare next two
cmp btye[swap],1 ;check if a swap has been doneje start ;if yes make another passmov ax,0x4c00 ;terminate programint 0x21

RSS

Latest Activity

zohaib iftikhar replied to zohaib iftikhar's discussion ...* MARD AUR AURAT KA GUNAH ...*
9 minutes ago
Profile IconAhtisham Hassan Qureshi and AYESHA KHATOON joined + M.Tariq Malik's group
52 minutes ago
+ daShiNg DudE꧂ updated their profile
1 hour ago
+ ! ! ! ! ! ! ! ! ! AG liked Moji's discussion CS 502 Assignment no 2
3 hours ago
Profile Iconosama butt, Umar Ahmed, MUHAMMAD MUZAMMIL BHUTTA and 8 more joined Virtual University of Pakistan
4 hours ago
Abdul Majid Jamil posted a photo
5 hours ago
Moji posted discussions
6 hours ago
+ ! ! ! ! ! Dîxîě Dûsť꧂ updated their profile
6 hours ago
+ ! ! ! ! ! ! maho+++ liked Azhar Sagar's discussion How to make srs Software Requirements Specification
6 hours ago
Aqsa Khan updated their profile
7 hours ago
+ IUUOƆƎUT + updated their profile
7 hours ago
+ M.Tariq Malik replied to Aijaz khan's discussion CS608 - Software Verification and Validation Assignment No. 2 Need Solution
8 hours ago
+ M.Tariq Malik liked Aijaz khan's discussion CS608 - Software Verification and Validation Assignment No. 2 Need Solution
8 hours ago
+ M.Tariq Malik replied to Waseem Aziz's discussion PROJECT MANAGEMENT (MGMT627)required Solution in the group MGMT627 Project Management
8 hours ago
+ M.Tariq Malik liked Waseem Aziz's discussion PROJECT MANAGEMENT (MGMT627)required Solution
8 hours ago
Ahsan Sandhu updated their profile
8 hours ago
Ahsan Sandhu liked Ahsan Sandhu's profile
8 hours ago
+ M.Tariq Malik replied to +¢αяєℓєѕѕ gιяℓ's discussion Best Places To Propose Someone :-P
8 hours ago
+ M.Tariq Malik liked +¢αяєℓєѕѕ gιяℓ's discussion Best Places To Propose Someone :-P
8 hours ago
+ M.Tariq Malik replied to waqas ahmad's discussion isl 201
8 hours ago

Today Top Members 

© 2019   Created by + M.Tariq Malik.   Powered by

Promote Us  |  Report an Issue  |  Privacy Policy  |  Terms of Service