Logo 
Search:

Assembly Language Articles

Submit Article
Home » Articles » Assembly Language » Homework HelpRSS Feeds

Program to find the largest and smallest number from an array of n 16 bit nos

Posted By: Paige Hughes     Category: Assembly Language     Views: 15982

Write a program to find the largest and smallest number from an array of n 16 bit nos.

Code for Program to find the largest and smallest number from an array of n 16 bit nos in Assembly Language

DATA SEGMENT
A DW 8,2,5,6,1,3
DATA ENDS
CODE SEGMENT
      ASSUME DS:DATA,CS:CODE
START:
      MOV AX,DATA
      MOV DS,AX
      MOV CX,0000
      MOV CL,06
      LEA BX,A
      MOV DX,WORD PTR[BX]
      MOV AX,0000
   L1:CMP AX,WORD PTR[BX]
      JNC L2
      MOV AX,WORD PTR[BX]
   L2:CMP DX,WORD PTR[BX]
      JC L3
      MOV DX,WORD PTR[BX]
   L3:ADD BX,02
      DEC CL
      CMP CL,00
      JNZ L1
      MOV AH,4CH
      INT 21H
CODE ENDS
END START

;OUTPUT:->
;-G CS: 0028
;
;AX=0008  BX=000C  CX=0000  DX=0001  SP=0000  BP=0000  SI=0000  DI=0000
;DS=0BF4  ES=0BE4  SS=0BF4  CS=0BF5  IP=0028   NV UP EI PL ZR NA PE NC
;0BF5:0028 B44C          MOV     AH,4C
  
Share: 



Paige Hughes
Paige Hughes author of Program to find the largest and smallest number from an array of n 16 bit nos is from London, United Kingdom.
 
View All Articles

 

Other Interesting Articles in Assembly Language:


 
Please enter your Comment

  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].

 
Anushya Sai from Australia Comment on: Oct 07
assembly language program to compute the standard deviation and variance of the given array of numbers. Execute the program using 8086 microprocessor.

View All Comments