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 8 bit nos

Posted By: Logan Evans     Category: Assembly Language     Views: 29622

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

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

DATA SEGMENT
A DB 5,2,5,6,4,3
B DB ?
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 AL,00
      MOV AH,BYTE PTR[BX]
   L1:CMP AL,BYTE PTR[BX]
      JNC L2
      MOV AL,BYTE PTR[BX]
   L2:CMP AH,BYTE PTR[BX]
      JC L3
      MOV AH,BYTE PTR[BX]
   L3:INC BX
      DEC CL
      CMP CL,00
      JNZ L1
      MOV AH,4CH
      INT 21H
CODE ENDS
END START

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



Logan Evans
Logan Evans author of Program to find the largest and smallest number from an array of n 8 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].

 
No Comment Found, Be the First to post comment!