Saturday, September 26, 2026

‘Learn Arduino Using TinkerCAD Circuits Simulator’ eBook’s Simulation & Resource Hyperlinks list page

 


…till the next post, bye-bye & take care!


Smallest element in an array | 8085 Lab Program

Section: Array Operations & Code Conversions 

Aim: To find the smallest element in an array of data stored in memory and also to verify the result.

Apparatus Required: 8085 microprocessor kit, key board.

Algorithm:

  1. Place all the elements of an array in the consecutive memory locations.
  2. Fetch the first element from the memory location and load it in the accumulator.
  3. Initialize a counter (register) with the total number of elements in an array.
  4. Decrement the counter by 1.
  5. Increment the memory pointer to point to the next element.
  6. Compare the accumulator content with the memory content (next element).
  7. If the accumulator content is smaller, then move the memory content to the accumulator; else continue.
  8. Decrement the counter by 1.
  9. Repeat steps 5 to 8 until the counter reaches zero.
  10. Store the result (accumulator content) in the specified memory location.

Program:

AddressLabelMnemonicsOperandComment
4100STARTLXIH, 4200Initialize HL reg. to 4200H
4103MVIB, 04Initialize B reg with no. of comparisons (n-1)
4105MOVA, MTransfer first data to acc.
4106LOOP1INXHIncrement HL reg. to point next memory location
4107CMPMCompare M & A
4108JCLOOPIf A is lesser than M then go to loop
410BMOVA, MTransfer data from M to A reg
410CLOOPDCRBDecrement B reg
410DJNZLOOP1If B is not Zero go to loop1
4110STA4205Store the result in a memory location
4113HLTStop the program

Observation:

  • Input:
    • Address 4200: 01
    • Address 4201: 06
    • Address 4202: 03
    • Address 4203: 07
    • Address 4204: 02
  • Output:
    • Address 4205: 01

Result: Thus the smallest number in the given array is found and it is stored at location 4205.

Flowchart:

               +-------------------+
               |       START       |
               +---------+---------+
                         |
                         v
               +-------------------+
               |   [HL] <- 4200H   |
               +---------+---------+
                         |
                         v
               +-------------------+
               |     [B] <- 04H    |
               +---------+---------+
                         |
                         v
               +-------------------+
               |    [A] <- [M]     |
               +---------+---------+
                         |
                         v <------------------+
               +-------------------+          |
               |  [HL] <- [HL] + 1 |          |
               +---------+---------+          |
                         |                    |
                         v                    |
                       /   \                  |
                     /  Is   \                |
                   / [A] < [HL]? \            |
                  <   (CY = 1)    >           |
                   \             /            |
                     \         /              |
                       \     /                |
                        |   /                 |
            +-----------+--+                  |
            |              |                  |
           YES             NO                 |
            |              |                  |
            |              v                  |
            |    +-------------------+        |
            |    |    [A] <- [HL]    |        |
            |    +---------+---------+        |
            |              |                  |
            +-------+------+                  |
                    |                         |
                    v                         |
          +-------------------+               |
          |   [B] <- [B] - 1  |               |
          +---------+---------+               |
                    |                         |
                    v                         |
                  /   \                       |
                /  Is   \                     |
              /   [B] = 0? \                  |
             <              >                 |
              \  Is Zero?  / -- NO -----------+
                \        /
                  \    /
                    | YES
                    v
          +-------------------+
          |    <- [A]   |
          +---------+---------+
                    |
                    v
          +-------------------+
          |       STOP        |
          +-------------------+

Viva Questions:

  1. What is meant by instruction JC?
  2. Tell about the instruction SHLD.
  3. Summarize the instruction STAX B.
  4. State the logic behind the finding of smallest element.
  5. Why address bus is unidirectional?
  6. List few instructions to clear accumulator?
  7. What is the function of NOP instruction?

For all 2026 published articles list: click here: 

…till the next post, bye-bye & take care

Friday, September 25, 2026

Largest element in an array | 8085 Lab Program

 Section: Array Operations & Code Conversions

Aim: To find the largest element in an array of data stored in memory and also to verify the result.

Apparatus Required: 8085 microprocessor kit, keyboard.

Algorithm:

  1. Place all the elements of an array in consecutive memory locations.
  2. Fetch the first element from the memory location and load it in the accumulator.
  3. Initialize a counter (register) with the total number of elements in an array (or total comparisons \(n-1\)).
  4. Decrement the counter by 1.
  5. Increment the memory pointer to point to the next element.
  6. Compare the accumulator content with the memory content (next element).
  7. If the accumulator content is smaller, then move the memory content (largest element) to the accumulator; else continue.
  8. Decrement the counter by 1.
  9. Repeat steps 5 to 8 until the counter reaches zero.
  10. Store the result (accumulator content) in the specified memory location.

Program:

AddressLabelMnemonicsOperandComment
4100LXIH, 4200Initialize HL reg. to data location
4103MVIB, 04Initialize B reg with no. of comparisons (\(n-1\))
4105MOVA, MTransfer first data to accumulator
4106LOOP1INXHIncrement HL reg. to point next memory location
4107CMPMCompare M & A
4108JNCLOOPIf A is greater than M then go to loop
410BMOVA, MTransfer data from M to A reg
410CLOOPDCRBDecrement B reg
410DJNZLOOP1If B is not Zero go to loop1
4110STA4205Store the result in a memory location
4113HLTStop the program

Observation:

  • Input:
    • 4200: 01
    • 4201: 06
    • 4202: 03
    • 4203: 07
    • 4204: 02
  • Output:
    • 4205: 07

Result: Thus the largest number in the given array is found and it is stored at location 4205.

Flowchart:

               +-------------------+
               |       START       |
               +---------+---------+
                         |
                         v
               +-------------------+
               |   [HL] <- 4200H   |
               +---------+---------+
                         |
                         v
               +-------------------+
               |     [B] <- 04H    |
               +---------+---------+
                         |
                         v
               +-------------------+
               |    [A] <- [M]     |
               +---------+---------+
                         |
                         v <------------------+
               +-------------------+          |
               |  [HL] <- [HL] + 1 |          |
               +---------+---------+          |
                         |                    |
                         v                    |
                       /     \                  |
                     /  Is     \                |
                   / [A] < [HL]? \            |
                  <   (CY = 1)    >           |
                   \             /            |
                     \         /              |
                       \     /                |
                        \   /                 |
            +-----------+--+                  |
            |              |                  |
           YES             NO                 |
            |              |                  |
            v              |                  |
  +-------------------+    |                  |
  |    [A] <- [HL]    |    |                  |
  +---------+---------+    |                  |
            |              |                  |
            +-------+------+                  |
                    |                         |
                    v                         |
          +-------------------+               |
          |   [B] <- [B] - 1  |               |
          +---------+---------+               |
                    |                         |
                    v                         |
                  /   \                       |
                /  Is   \                     |
              /   [B] = 0? \                  |
             <              >                 |
              \  Is Zero?  / -- NO -----------+
                \        /
                  \    /
                    | YES
                    v
          +-------------------+
          |     <- [A]  |
          +---------+---------+
                    |
                    v
          +-------------------+
          |       STOP        |
          +-------------------+

Viva Questions:

  1. What is meant by the instruction CMP M?
  2. What the instruction JNZ will do?
  3. State the logic behind the finding of largest element.
  4. List out the similarities b/w the CALL-RET and PUSH-POP instructions?
  5. What is the need of ALE signal in 8085?
  6. What are the addressing modes of 8085?


For all 2026 published articles list: click here: 

…till the next post, bye-bye & take care

Thursday, September 24, 2026

8 bit data division | 8085 Lab Program

 Section: Arithmetic & Logic Operations

Aim: To divide two 8-bit numbers stored in memory and also to verify the result.

Apparatus Required: 8085 microprocessor kit, key board.

Algorithm:

  1. Load Divisor and Dividend.
  2. Subtract divisor from dividend.
  3. Count the number of times of subtraction, which equals the quotient.
  4. Stop subtraction when the dividend is less than the divisor. The dividend now becomes the remainder. Otherwise, go to step 2.
  5. Stop the program execution.

Program:

AddressLabelMnemonicsOperandComment
4100MVIB,00Clear B reg for quotient
4102LXIH,4200Initialize HL reg. to 4200H
4105MOVA,MTransfer dividend to acc.
4106INXHIncrement HL reg. to point next mem. Location.
4107LOOPSUBMSubtract divisor from dividend
4108INRBIncrement B reg
4109JNCLOOPJump to LOOP if result does not yield borrow
410CADDMAdd divisor to acc.
410DDCRBDecrement B reg
410EINXHIncrement HL reg. to point next mem. Location.
410FMOVM,ATransfer the remainder from acc. to memory.
4110INXHIncrement HL reg. to point next mem. Location.
4111MOVM,BTransfer the quotient from B reg. to memory.
4112HLTStop the program

Observation:

  • Input:
    • Address 4200: 06
    • Address 4201: 02
  • Output:
    • Address 4202: 00 (Remainder)
    • Address 4203: 03 (Quotient)

Result: Thus an ALP was written for 8-bit division and also the result is verified.

Flowchart:

               +-------------------+
               |       START       |
               +---------+---------+
                         |
                         v
               +-------------------+
               |    [B] <- 00H     |
               +---------+---------+
                         |
                         v
               +-------------------+
               |   [HL] <- 4200H   |
               +---------+---------+
                         |
                         v
               +-------------------+
               |    [A] <- [M]     |
               +---------+---------+
                         |
                         v
               +-------------------+
               |  [HL] <- [HL] + 1 |
               +---------+---------+
                         |
                         v <------------------+
               +-------------------+          |
               |  [A] <- [A] - [M] |          |
               +---------+---------+          |
                         |                    |
                         v                    |
               +-------------------+          |
               |   [B] <- [B] + 1  |          |
               +---------+---------+          |
                         |                    |
                         v                    |
                       /   \                  |
                     /  Is   \                |
                   /  there a  \              |
                  <   Borrow?  >              |
                   \  (CY = 1) /              |
                     \      /                 |
                       \  /                   |
                        |                     |
            +-----------+-----------+         |
            |                       |         |
           YES                      NO        |
            |                       +---------+
            v
  +-------------------+
  |  [A] <- [A] + [M] |
  +---------+---------+
            |
            v
  +-------------------+
  |   [B] <- [B] - 1  |
  +---------+---------+
            |
            v
  +-------------------+
  |  [HL] <- [HL] + 1 |
  +---------+---------+
            |
            v
  +-------------------+
  |    [M] <- [A]     |
  |    (Remainder)    |
  +---------+---------+
            |
            v
  +-------------------+
  |  [HL] <- [HL] + 1 |
  +---------+---------+
            |
            v
  +-------------------+
  |    [M] <- [B]     |
  |     (Quotient)    |
  +---------+---------+
            |
            v
  +-------------------+
  |       STOP        |
  +-------------------+

Viva Questions:

  1. What SUB M instruction will do?
  2. Describe SBB M instruction.
  3. Express the use of SUI with an example.
  4. Where SBI can be used?
  5. Give the purpose of the instruction LDAX D.
  6. How will you perform Division using ADD instruction?
  7. What is the need of ALE signal in 8085?
  8. What are the addressing modes of 8085?
  9. List the interrupt signals of 8085?


For all 2026 published articles list: click here: 

…till the next post, bye-bye & take care

Wednesday, September 23, 2026

8 bit data multiplication | 8085 Lab Program

 Section: Arithmetic & Logic Operations

Aim: To multiply two 8 bit numbers stored at consecutive memory locations and also to verify the result.

Apparatus Required: 8085 microprocessor kit, key board.

Algorithm:

  1. Initialize memory pointer to data location.
  2. Move multiplicand to a register.
  3. Move the multiplier to another register.
  4. Clear the accumulator.
  5. Add multiplicand to accumulator.
  6. Decrement multiplier.
  7. Repeat step 5 till multiplier comes to zero.
  8. The result, which is in the accumulator, is stored in a memory location.

Program:

AddressLabelMnemonicsOperandComment
4100STARTLXIH, 4200Initialize HL reg. to 4500
4103MOVB, MTransfer first data to reg. B
4104INXHIncrement HL reg. to point next mem. Location.
4105MVIA, 00HClear the acc.
4107MVIC, 00HClear C reg for carry
4109L1ADDMAdd multiplicand multiplier times.
410AJNCNEXTJump to NEXT if there is no carry
410DINRCIncrement C reg
410ENEXTDCRBDecrement B reg
410FJNZL1Jump to L1 if B is not zero.
4112INXHIncrement HL reg. to point next mem. Location.
4113MOVM, ATransfer the result from acc. to memory.
4114INXHIncrement HL reg. to point next mem. Location.
4115MOVM, CTransfer the result from C reg. to memory.
4116HLTStop the program

Observation:

  • Input:
    • Address 4200: 02
    • Address 4201: 04
  • Output:
    • Address 4202: 08
    • Address 4203: 00

Result: Thus the 8-bit multiplication was done in 8085 μp using repeated addition method and also the result is verified.

Flowchart:

               +-------------------+
               |       START       |
               +---------+---------+
                         |
                         v
               +-------------------+
               |   [HL] <- 4200H   |
               +---------+---------+
                         |
                         v
               +-------------------+
               |    [B] <- [M]     |
               +---------+---------+
                         |
                         v
               +-------------------+
               |  [HL] <- [HL] + 1 |
               +---------+---------+
                         |
                         v
               +-------------------+
               |    [A] <- 00H     |
               |    [C] <- 00H     |
               +---------+---------+
                         |
                         v <------------------+
               +-------------------+          |
               |  [A] <- [A] + [M] |          |
               +---------+---------+          |
                         |                    |
                         v                    |
                       /   \                  |
                     /  Is   \                |
                   /  there a  \              |
                  <   Carry?   >              |
                   \          /               |
                     \      /                 |
                       \  /                   |
                        |                     |
            +-----------+-----------+         |
            |                       |         |
           YES                      NO        |
            |                       |         |
            v                       |         |
  +-------------------+             |         |
  |   [C] <- [C] + 1  |             |         |
  +---------+---------+             |         |
            |                       |         |
            +-----------+-----------+         |
                        |                     |
                        v                     |
              +-------------------+           |
              |   [B] <- [B] - 1  |           |
              +---------+---------+           |
                        |                     |
                        v                     |
                      /   \                   |
                    /  Is   \                 |
                  /   [B] = 0? \              |
                 <             >              |
                  \  Is zero? / -- NO --------+
                    \      /
                      \  /
                        | YES
                        v
              +-------------------+
              |  [HL] <- [HL] + 1 |
              +---------+---------+
                        |
                        v
              +-------------------+
              |    [M] <- [A]     |
              +---------+---------+
                        |
                        v
              +-------------------+
              |  [HL] <- [HL] + 1 |
              +---------+---------+
                        |
                        v
              +-------------------+
              |    [M] <- [C]     |
              +---------+---------+
                        |
                        v
              +-------------------+
              |       STOP        |
              +-------------------+

Viva Questions:

  1. Define two’s complement of an 8-bit numbers.
  2. What is meant by instruction ADC M?
  3. What is the use of the instruction MOV A,M?
  4. What is the function of program counter?
  5. Mention the types of 8085 instruction set.
  6. How will you perform multiplication using ADD instruction?
  7. Describe about DAD B instruction.
  8. What is the purpose of the instruction MOV M,A?


For all 2026 published articles list: click here: 

…till the next post, bye-bye & take care