CS401 Assignment 2 Solution
Thursday, November 22, 2012 Edit ThisQ 1:



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 .

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