35 Program to find smallest number in 8086 MicroProcessor

Code:

; PROGRAM TO FIND SMALLEST NUMBER
.MODEL SMALL
.STACK 100H
.DATA
   SMAL DB ?
   NUM1 DB 02H
   NUM2 DB 04H
.CODE
   MOV AX , @DATA  ; INITIALIZING DATA SEGMENT
   MOV DS , AX

   MOV AL , NUM1
 
   CMP AL , NUM2  ; IF DESTINATION > SOURCE CF =0
                  ; IF DESTINATION < SOURCE CF =1
   JC NEXT
    MOV BL , NUM2
    MOV SMAL , BL   
    JMP EXIT
NEXT:
    MOV SMAL , AL

EXIT:
   MOV AH , 4CH    ; INTRUPT FOR EXIT
   INT 21H
END




Ouput:

SMALL


Previous
Next Post »