Solved programming problem

Find Max of an Array in Assembly.

Source code

org 100h

.model small

.stack 100h

.data

array dw 100,200,250,30,40,50,10,80

size dw 8

mx dw ?

.code  

main proc

mov dx,@data

mov ds,dx

lea si,array

mov dx,[si]

mov mx,dx

mov cx,word ptr size ; convert size data as a value

L1:

   mov dx,[si]

   cmp mx,dx

   jl updatemx ;if mx value greater than dx value

   jmp mxdoen  ;if mx value smaller than dx value

updatemx:

   mov mx,dx ; update mx value

 

mxdoen:

   add si,2  ; increment index

   loop L1

         

mov ah, 4ch

int 21h

endp

 

ret

Output

Output:

Join the discussion

Add your comment

2 previous comments

enjoype

Hardman, editor; <a href=https://cialis.lat/discover-the-best-prices-for-cialis>cialis coupon</a>

rrUxSCGNW

You have to start tempting on CD1 <a href=https://prilig.sbs>priligy tablet</a>