VUsolutions Transferred to AchiKhasi.com

From December 2011, this blog www.VUsolutions.blogspot.com is transferred to http://achikhasi.com/vu/ . So, you may visit http://achikhasi.com/vu/ for latest study related help.

Back to home VUsolutions

VUsolutions Fans Club [join us for MORE solutions]

VUsolutions on Facebook

CS402

Saturday, November 07, 2009 Posted In Edit This
org 0x0100]

jmp start ; unconditionally jump over data

myarr: dw 20, 15, 203, 1004, 250, 91, 52, 666, 840, 1018
min: dw 0
max: dw 0

start:


mov bx, 0 ; initialize array index to zero
mov ax, 0 ; initialize min to zero



mov ax, [myarr+bx] ; minimum number to ax
mov cx,10


minfind: cmp ax, [myarr+bx]

jle incr1

mov ax,[myarr+bx] ;ax contains the minimum number


incr1:

add bx, 2 ; advance bx to next index

loop minfind


mov [min], ax ; write back minimum in memory



;This is the code for searching maximum number in array

mov bx, 0 ; initialize array index to zero

mov ax, 0 ; initialize max to zero

mov ax, [myarr+bx] ; maximum number to ax

mov cx,10



maxfind: cmp ax, [myarr+bx] ; are we find the maximum number

jge incr2 ; if greater or equal number

mov ax,[myarr+bx] ;ax contains the maximum number



incr2:

add bx, 2 ; incrementing the bx

loop maxfind



mov [max], ax ; writing max in memory


mov ax, 0x4c00 ; terminate program

int 0x21

Back to home VUsolutions

Shaadi.com: Just create ur account & find ur partner or EARN money, its reall & EASY

VUsolutions Followers (Join NOW and Get Extra Benefits)

Install LATEST toolbar having lot of features - GET solutions on Desktop

toolbar powered by Conduit
Caliplus 300x250 NoFlam VitoLiv 468x60 GlucoLo