CS401 Assignment 2 Solution
Thursday, November 22, 2012 Edit ThisQ 1:
![Name: 01.PNG
Views: 10
Size: 86.2 KB Name: 01.PNG
Views: 10
Size: 86.2 KB](http://www.vu39.com/forum/attachments/cs401-computer-architecture-assembly-language-programming/8490d1353855617-cs401-assignment-2-solution-fall-2012-26-november-2012-01.png)
![Name: 02.PNG
Views: 9
Size: 84.4 KB Name: 02.PNG
Views: 9
Size: 84.4 KB](http://www.vu39.com/forum/attachments/cs401-computer-architecture-assembly-language-programming/8491d1353855629-cs401-assignment-2-solution-fall-2012-26-november-2012-02.png)
![Name: 03.PNG
Views: 9
Size: 48.6 KB Name: 03.PNG
Views: 9
Size: 48.6 KB](http://www.vu39.com/forum/attachments/cs401-computer-architecture-assembly-language-programming/8492d1353855639-cs401-assignment-2-solution-fall-2012-26-november-2012-03.png)
Q- 2 Solution
@ All-- This is just idea. es ki logic mai koi galti nai hai. 10000 percent theeek execute ho k theek result deta hai. but overall gud programing practice nai ki mai nai es mai. Coz yeh mjy just as idea share krna tha .
![Name: 111.png
Views: 9
Size: 50.5 KB Name: 111.png
Views: 9
Size: 50.5 KB](http://www.vu39.com/forum/attachments/cs401-computer-architecture-assembly-language-programming/8493d1353855660-cs401-assignment-2-solution-fall-2012-26-november-2012-111.png)
Solution of Q2:
; To All, kindly make changes before submit.
; I know the logic of the program is very bad. But this is just Idea.
[ORG 0x0100]
mov ax, 0
mov bx, 2
mov cx, 18
mov dx, [values]
CALL l1
mov [minimum], dx
mov ax, 0x4C00
int 0x21
values: dw 9,72,7,11,6,8,14,5,10,2
minimum: dw 0
l1: mov ax, [values + bx]
cmp dx, ax
jge l2
add bx, 2
sub cx, 2
jnz l1
ret
l2: mov dx, ax
add bx, 2
sub cx, 2
jnz l1
ret