Saturday, August 18, 2018

Q)  Write an program  to subtract two 8-bit data which is store in 2050H and 2051H   and display the result to output port 02H  using 8085 microprocessor.

 solution
  program                                                                         comments
LDA 2051                                                                       -Load the data from memory to accumulator
MOV C,A                                                                        -Move the data from A to C register
LDA 2050H                                                                    -Load the data from memory to accumulator
SUB C                                                                             -Subtract the two data
OUT 02H                                                                         -Display result
HLT                                                                                   -Stop

No comments:

Post a Comment

huhiuh