Write an assembly language program to find the smallest number in an array using 8 bit microprocessor. (Assume appropriate array data and address where minimum array size of 15 should be considered.)

This answer is restricted. Please login to view the answer of this question.

Login Now

LXI H 8D01                          ; LOAD COUNTER TO MEMORY ADDRESS 8D01

MOV B M                              ; ASSIGNS B AS COUNTER

INX H                                    ; POINTS WHERE DATA ARE STORED

MOV A M                              ;  CONTENT TRANSFERRED TO ACCUMULATOR

DCR B                                     ;  COUNTER VALUE DECREASED

LOOP: INX H                        ;  POINTES TO ANOTHER MEMROY ADDRESS

CMP M                                    ;  ADDRESSED MEMORY AND ACCUMULATOR ARE COMPARED

JNC/JC AHEAD                   ; JUMPS IF ACCUMULATOR IS GEREATR

MOV A M                               ;  ACCUMULATOR CARRIES GREATER VALUE

AHEAD: DCR B                    ;  DECREASE OF COUNTER

JNZ LOOP                              ;  IF COUNTER IS NOT ZERO REPEAT THE PROCESS

STA 8D00  H                         ;  STORES IN MEMORY ADDRESS 8D00  HLT

If you found any type of error on the answer then please mention on the comment or report an answer or submit your new answer.
Leave your Answer:

Click here to submit your answer.

Discussion
0 Comments
  Loading . . .