Monday 14 August 2017

Find the Smallest element from an array Assembly Language Program using tasm (MP)

data segment
arr dw 1111h,2222h,3333h,4444h,5555h
data ends
code segment
assume cs:code,ds:data
start:
mov ax,data
mov ds,ax
mov cx,04h
lea si,arr
mov ax,[si]
up:
cmp ax,[si+2]
jc down
mov ax,[si+2]
down:
inc si
inc si
dec cx
jnz up
int 03h
code ends
end start

No comments:

Post a Comment