Assembly language program to input 5 numbers of array from user and display smallest number

Code

org 100h
.stack 100h
.data   
string db "The smallest number is: $"
array db 5 dup ?
.code
main proc
    mov ax,@data
    mov ds,ax
    
    mov si,offset array
    
    mov cx,5
    get:
    mov ah,01
    int 21h
    mov [si],al
    inc si
    loop get
    
    
   ; mov bl,0
    mov si,offset array
    mov cx,5 
    mov bl,[si]
    inc si 
    dec cx
    
    l1:
    mov al,[si]
    cmp al,bl            
    jg skp
    mov bl,al
    
    skp:          
    inc si
    
    loop l1
    
    mov dx,10
    mov ah,02
    int 21h
    mov dx,13
    mov ah,02
    int 21h
    
    mov dx,offset string
    mov ah,09
    int 21h
    mov dl,bl
    mov ah,02
    int 21h          
   
   
   
    mov ah,4ch
    int 21h
    
    
    main endp
end main

Output



Comments

Popular posts from this blog

Assembly language program to input an integer from user and display whether the number is even or odd

Assembly language program to input string from user and display it

Assembly language program to input string from user and display its length