Saturday, October 3, 2026

Traffic light controller - Interfacing 8255 with 8085 | 8085 Lab Program

 Section: Hardware Interfacing Experiments

Aim: To design a traffic light controller using the 8085 microprocessor through the Programmable Peripheral Interface 8255.

Apparatus Required: 8085 µp kit, 8255 Interface board, DC regulated power supply, VXT parallel bus, Traffic light controller interface board.

Algorithm:

  1. Start.
  2. Write the control word to initialize the 8255 IC. Obtain the signal data for each direction and store it in memory.
  3. Initialize a counter to indicate the number of directions.
  4. Initialize the HL pair to the starting address of the data.
  5. Send the control/status data to the ports.
  6. Call a delay subroutine between signal switching.
  7. Decrement the counter and repeat the process for all directions.

Program:

AddressLabelMnemonicsOperandComment
4100LXIH, DataLoad the data starting address in HL register pair
4103MVIC, 04Move 04 to C register for 4 directions
4105MOVA, MMove control word to Accumulator
4106OUTCNTSend control word to control register
4108INXHIncrement HL pair
4109LOOP1MOVA, MMove Port C signal data to Accumulator
410AOUTCPRTSend status word to Port C
410CINXHIncrement HL pair
410DMOVA, MMove Port B signal data to Accumulator
410EOUTBPRTSend status word to Port B
4110INXHIncrement HL pair
4111MOVA, MMove Port A signal data to Accumulator
4112OUTAPRTSend status word to Port A
4114CALLDELAYCall delay subroutine
4117INXHIncrement HL pair
4118DCRCDecrement direction counter C
4119JNZLOOP1Jump to LOOP1 if counter is non-zero
411CJMPSTARTRepeat traffic cycle
411FDELAYPUSHBPush BC register pair onto stack
4120MVIC, 0DMove 0D to C register
4122LOOP3LXID, FFFFHLoad DE pair with FFFFH
4125LOOP2DCXDDecrement DE pair
4126MOVA, DCopy D to Accumulator
4127ORAEOR Accumulator with E
4128JNZLOOP2Loop until DE becomes 0
412CJNZLOOP3Loop until C becomes 0
412FPOPBPop BC pair from stack
4130RETReturn to main program

Observation:

  • Mode 0 (Simple I/O) control word is sent to initialize Ports A, B, and C as output ports.
  • Output signals are sent sequentially to Port A, Port B, and Port C to illuminate Red, Yellow, and Green LEDs for four traffic directions with designated delay intervals.

Result: Thus the design of traffic light controller using 8085 microprocessor through programmable peripheral interface 8255 is done and the output is verified.

Flowchart:

               +-------------------+
               |       START       |
               +---------+---------+
                         |
                         v
               +-------------------+
               | Initialize 8255   |
               | Write Control Word|
               +---------+---------+
                         |
                         v
               +-------------------+
               | Load Data Pointer |
               |   [HL] <- Data    |
               +---------+---------+
                         |
                         v
               +-------------------+
               |    [C] <- 04H     |
               | (4 Directions)    |
               +---------+---------+
                         |
                         v <-------------------+
               +-------------------+           |
               | Output Signals to |           |
               | Ports C, B, and A |           |
               +---------+---------+           |
                         |                     |
                         v                     |
               +-------------------+           |
               |   Call Delay      |           |
               |   Subroutine      |           |
               +---------+---------+           |
                         |                     |
                         v                     |
               +-------------------+           |
               |   [C] <- [C] - 1  |           |
               +---------+---------+           |
                         |                     |
                         v                     |
                       /   \                   |
                     /  Is   \                 |
                   /  [C] = 0? \               |
                  <             >              |
                   \ Is zero?  / --- NO -------+
                     \       /
                       \   /
                        | YES
                        v
               +-------------------+
               | Jump to START     |
               | (Continuous Loop) |
               +-------------------+

Viva Questions:

  1. When the 8255 is reset, its I/O ports are all initialized as what?
  2. If the programmable counter timer 8254 is set in mode 1 and is to be used to count six events, the output will remain at logic 0 for how many number of counts?
  3. The devices that provide the means for a computer to communicate with the user or other computers are referred to as what?
  4. What is the maximum number of I/O devices which can be interfaced in the memory-mapped I/O technique?
  5. Interaction between a CPU and a peripheral device that takes place during an input/output operation is known as what?
  6. What is the other name for Programmable Peripheral Input-Output port?
  7. All the functions of the ports of 8255 are achieved by programming the bits of an internal register called what?
  8. What is the port that is used for the generation of handshake lines in Mode 1 or Mode 2?
  9. What is the pin that clears the control word register of 8255 when enabled?
  10. In 8255, if A1 = 0 and A0 = 1, then from where is the input read cycle performed?


For all 2026 published articles list: click here: 

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

Friday, October 2, 2026

ASCII to Hexadecimal conversion | 8085 Lab Program

 Section: Array Operations & Code Conversions

Aim: To write an assembly language program to convert the given ASCII number into its Hexadecimal equivalent and to verify the result.

Apparatus Required: 8085 microprocessor kit, keyboard.

Algorithm:

  1. Step 1: Load the ASCII number from the location.
  2. Step 2: Check for the digit or alphabet.
  3. Step 3: Using suitable logic and instructions convert the ASCII number into Hexadecimal.
  4. Step 4: Add the two converted values.
  5. Step 5: Display the result.
  6. Step 6: Stop.

Program:

AddressLabelMnemonicsOperandComment
4100LDA4500Load the memory content to Accumulator
4103SUI30Subtract with 30
4105CPI0ACompare with 0A
4107JCSKPIf carry skip
410ASUI07Subtract with 07
410CSKPSTA4201Store Accumulator content
410FHLTStop

Observation:

  • Input:
    • Address 4200: 41
  • Output:
    • Address 4201: 0A

Result: Thus assembly language program to convert the given ASCII number into its Hexadecimal equivalent is completed and also the result is verified.

Flowchart:

               +-------------------------------+
               |             START             |
               +---------------+---------------+
                               |
                               v
               +-------------------------------+
               |     Load the ASCII number     |
               +---------------+---------------+
                               |
                               v
               +-------------------------------+
               |  Convert ASCII into Hexa-     |
               |      decimal equivalent       |
               +---------------+---------------+
                               |
                               v
               +-------------------------------+
               |      Display the result       |
               +---------------+---------------+
                               |
                               v
               +-------------------------------+
               |             STOP              |
               +-------------------------------+

Viva Questions:

  1. What is the Hexadecimal for (35) ASCII?
  2. What is the purpose of branch instructions in 8085 microprocessor?
  3. Define one’s complement of an 8-bit numbers.
  4. What is the function of CMA instruction?
  5. What is the logic behind the conversion of ASCII number into Hexadecimal number?
  6. Give example for Machine control instruction?
  7. What is the need of code conversion?


For all 2026 published articles list: click here: 

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

Thursday, October 1, 2026

Hexadecimal to ASCII conversion | 8085 Lab Program

 Section: Array Operations & Code Conversions

Aim: To write an assembly language program to convert the given Hexadecimal number into its ASCII equivalent and to verify the result.

Apparatus Required: 8085 microprocessor kit, keyboard.

Algorithm:

  1. Load the Hexadecimal number from the location.
  2. Separate the nibbles.
  3. Convert each nibble to its ASCII Equivalent.
  4. Add the two converted values.
  5. Display the result.
  6. Stop.

Program:

AddressLabelMnemonicsOperandComment
4100LDA4200Get the data
4103MOVB, AMove Accumulator content to B reg
4104ANI0FMask upper nibble
4106CALLSUBGet ASCII code for upper nibble
4109STA4201Store the value of accumulator
410BMOVA, BMove B reg content to Acc
410DANIF0Mask lower nibble
410FRLCRotate left without carry 4 times
4110RLC
4111RLC
4112RLC
4113CALLSUBGet the ASCII code
4116STA4202Store the accumulator
4119HLTStop
411ASUBCPI0ACompare with 0A
411CJCSKPSkip if carry
411FADI07Add 07 to Acc
4121SKPADI30Add 30 to Acc
4123RETReturn

Observation:

  • Input:
    • Address 4200: A5
  • Output:
    • Address 4201: 35
    • Address 4202: 41

Result: Thus assembly language program to convert the given Hexadecimal number into its ASCII equivalent is completed and also the result is verified.

Flowchart:

               +-------------------------------+
               |             START             |
               +---------------+---------------+
                               |
                               v
               +-------------------------------+
               |  Load the Hexadecimal number  |
               +---------------+---------------+
                               |
                               v
               +-------------------------------+
               |   Convert each nibble into    |
               |       ASCII equivalent        |
               +---------------+---------------+
                               |
                               v
               +-------------------------------+
               |      Display the result       |
               +---------------+---------------+
                               |
                               v
               +-------------------------------+
               |             STOP              |
               +-------------------------------+

Viva Questions:

  1. What is ASCII number for 0AH?
  2. What is difference between byte and word?
  3. What is the immediate addressing mode?
  4. What are data transfer instructions?
  5. What is the use of immediate addressing mode?
  6. What are branching instructions?
  7. What is DMA?


For all 2026 published articles list: click here: 

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

Wednesday, September 30, 2026

Hexadecimal to Decimal conversion | 8085 Lab Program

 Section: Array Operations & Code Conversions

Aim: To convert a given hexadecimal number to decimal number and also to verify the result.

Apparatus Required: 8085 microprocessor kit, key board.

Algorithm:

  1. Initialize the memory location to the data pointer.
  2. Increment B register.
  3. Increment accumulator by 1 and adjust it to decimal every time.
  4. Compare the given hexadecimal number with B register value.
  5. When both match, the equivalent decimal value is in A register.
  6. Store the resultant in memory location.

Program:

AddressLabelMnemonicsOperandComment
4100LXIH, 4200Initialize HL reg. to 4200H
4103MVIA, 00Initialize A register
4105MVIB, 00Initialize B register
4107MVIC, 00Initialize C register for carry
4109LOOPINRBIncrement B reg
410AADI01Increment A reg
410CDAADecimal Adjust Accumulator
410DJNCNEXTIf there is no carry go to NEXT
4110INRCIncrement C register
4111NEXTMOVD, ATransfer A to D
4112MOVA, BTransfer B to A
4113CMPMCompare M & A
4114MOVA, DTransfer D to A
4115JNZLOOPIf acc and given number are not equal, then go to LOOP
4118STA4201Store the result in a memory location
411BMOVA, CTransfer C to A
411CSTA4202Store the carry in another memory location
411FHLTStop the program

Observation:

  • Input:
    • Address 4200: D5
  • Output:
    • Address 4201: 13
    • Address 4202: 02

Result: Thus an ALP program for conversion of hexadecimal to decimal was executed and the result is verified.

Flowchart:

               +-------------------+
               |       START       |
               +---------+---------+
                         |
                         v
               +-------------------+
               |   [HL] <- 4200H   |
               +---------+---------+
                         |
                         v
               +-------------------+
               |    [A] <- 00H     |
               +---------+---------+
                         |
                         v
               +-------------------+
               |    [B] <- 00H     |
               +---------+---------+
                         |
                         v
               +-------------------+
               |    [C] <- 00H     |
               +---------+---------+
                         |
                         v <------------------+
               +-------------------+          |
               |   [B] <- [B] + 1  |          |
               +---------+---------+          |
                         |                    |
                         v                    |
               +-------------------+          |
               |   [A] <- [A] + 1  |          |
               +---------+---------+          |
                         |                    |
                         v                    |
               +-------------------+          |
               |   Decimal Adjust  |          |
               |    Accumulator    |          |
               +---------+---------+          |
                         |                    |
                         v                    |
                       /   \                  |
                     /  Is   \                |
                   /  there a  \              |
                  <   Carry?   >              |
                   \  (CY = 1) /              |
                     \      /                 |
                       \  /                   |
                        |                     |
            +-----------+-----------+         |
            |                       |         |
           YES                      NO        |
            |                       |         |
            v                       |         |
  +-------------------+             |         |
  |   [C] <- [C] + 1  |             |         |
  +---------+---------+             |         |
            |                       |         |
            +-----------+-----------+         |
                        |                     |
                        v                     |
              +-------------------+           |
              |    [D] <- [A]     |           |
              |    [A] <- [B]     |           |
              +---------+---------+           |
                        |                     |
                        v                     |
                      /   \                   |
                    /  Is   \                 |
                  /   [A] =   \               |
                 <    [M]?     >              |
                  \           /               |
                    \       /                 |
                      \   /                   |
                       |                      |
           +-----------+------------+         |
           |                        |         |
          YES                       NO        |
           |                        +---------+
           v
 +-------------------+
 |    <- [A]         |
 |    [A] <- [C]     |
 |    <- [A]         |
 +---------+---------+
           |
           v
 +-------------------+
 |       STOP        |
 +-------------------+

Viva Questions:

  1. What is meant by instruction DAA?
  2. Why data bus is bi-directional?
  3. Specifies the function of address bus and the direction of address bus?
  4. How many memory location can be addressed by a microprocessor with the 14 address lines?
  5. List various instructions that can be used to clear accumulator in 8085?
  6. When the Ready signal of 8085 is sampled by the processor?
  7. List out the similarities b/w the CALL_RET and PUSH_POP instructions?


For all 2026 published articles list: click here: 

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

Tuesday, September 29, 2026

Decimal to Hexadecimal conversion | 8085 Lab Program

 Section: Array Operations & Code Conversions

Aim: To convert a given decimal number to hexadecimal number.

Apparatus Required: 8085 microprocessor kit, key board.

Algorithm:

  1. Initialize the memory location to the data pointer.
  2. Increment B register.
  3. Increment accumulator by 1 and adjust it to decimal every time.
  4. Compare the given decimal number with accumulator value.
  5. When both matches, the equivalent hexadecimal value is in B register.
  6. Store the resultant in memory location.

Program:

AddressLabelMnemonicsOperandComment
4100LXIH, 4200Initialize HL reg. to 4200H
4103MVIA, 00Initialize A register
4105MVIB, 00Initialize B register
4107LOOPINRBIncrement B reg.
4108ADI01Increment A reg
410ADAADecimal Adjust Accumulator
410BCMPMCompare M & A
410CJNZLOOPIf acc and given number are not equal, then go to LOOP
410FMOVA, BTransfer B reg to acc
4110STA4201Store the result in a memory location
4113HLTStop the program

Observation:

  • Input: Address 4200: 21
  • Output: Address 4201: 15

Result: Thus an ALP program for conversion of decimal to hexadecimal was written and executed.

Flowchart:

               +-------------------+
               |       START       |
               +---------+---------+
                         |
                         v
               +-------------------+
               |   [HL] <- 4200H   |
               +---------+---------+
                         |
                         v
               +-------------------+
               |    [A] <- 00H     |
               +---------+---------+
                         |
                         v
               +-------------------+
               |    [B] <- 00H     |
               +---------+---------+
                         |
                         v <------------------+
               +-------------------+          |
               |   [B] <- [B] + 1  |          |
               +---------+---------+          |
                         |                    |
                         v                    |
               +-------------------+          |
               |   [A] <- [A] + 1  |          |
               +---------+---------+          |
                         |                    |
                         v                    |
               +-------------------+          |
               |   Decimal Adjust  |          |
               |    Accumulator    |          |
               +---------+---------+          |
                         |                    |
                         v                    |
                       /   \                  |
                     /  Is   \                |
                   /   [A] =   \              |
                  <    [M]?     >             |
                   \           /              |
                     \       /                |
                       \   /                  |
                        |                     |
            +-----------+------------+        |
            |                        |        |
           YES                       NO       |
            |                        +--------+
            v
  +-------------------+
  |    [A] <- [B]     |
  +---------+---------+
            |
            v
  +-------------------+
  |     <- [A]  |
  +---------+---------+
            |
            v
  +-------------------+
  |       STOP        |
  +-------------------+

Viva Questions:

  1. What is meant by ADI instruction?
  2. What is the function of DAA instruction?
  3. What is the function of XCHG instruction?
  4. How you can load 16-bit data in 8500H and 8501H memory locations?
  5. What is the difference between LHLD and SHLD instructions?
  6. What is physical address?
  7. Define OFFSET address.


For all 2026 published articles list: click here: 

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

Monday, September 28, 2026

Sorting an array of data in Descending order | 8085 Lab Program

 Section: Array Operations & Code Conversions

Aim: To sort the given numbers in the descending order using 8085 microprocessor.

Apparatus Required: 8085 microprocessor kit, key board.

Algorithm:

  1. Get the numbers to be sorted from the memory locations.
  2. Compare the first two numbers and if the first number is smaller than second then interchange the number.
  3. If the first number is larger, go to step 4.
  4. Repeat steps 2 and 3 until the numbers are in required order.

Program:

AddressLabelMnemonicsOperandComment
4100MVIB, 04Initialize B reg with number of comparisons (n-1)
4102LOOP3LXIH, 4200Initialize HL reg. to 4200H
4105MVIC, 04Initialize C reg with no. of comparisons (n-1)
4107LOOP2MOVA, MTransfer first data to acc.
4108INXHIncrement HL reg. to point next memory location
4109CMPMCompare M & A
410AJNCLOOP1If A is greater than M then go to loop1
410DMOVD, MTransfer data from M to D reg
410EMOVM, ATransfer data from acc to M
410FDCXHDecrement HL pair
4110MOVM, DTransfer data from D to M
4111INXHIncrement HL pair
4112LOOP1DCRCDecrement C reg
4113JNZLOOP2If C is not zero go to loop2
4116DCRBDecrement B reg
4117JNZLOOP3If B is not Zero go to loop3
4118HLTStop the program

Observation:

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

Result: Thus the descending order program is executed and the numbers are arranged in descending order.

Flowchart:

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

Viva Questions:

  1. Give out the purpose of the instruction DCX.
  2. What is meant by CALL instruction?.
  3. Briefly give out the LHLD instruction.
  4. State the logic behind the Sorting an array of data in Descending order.
  5. Name the various flag bits available in 8085 microprocessor?.
  6. Give the significance of SIM and RIM instructions available in 8085?.
  7. How do the address and data lines are demultiplexed in 8085?.


For all 2026 published articles list: click here: 

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

Sunday, September 27, 2026

Sorting an array of data in Ascending order | 8085 Lab Program

 Section: Array Operations & Code Conversions

Aim: To sort the given numbers in the ascending order using 8085 microprocessor.

Apparatus Required: 8085 microprocessor kit, key board.

Algorithm:

  1. Get the numbers to be sorted from the memory locations.
  2. Compare the first two numbers and if the first number is larger than the second, then interchange the numbers.
  3. If the first number is smaller, go to step 4.
  4. Repeat steps 2 and 3 until the numbers are in the required order.

Program:

AddressLabelMnemonicsOperandComment
4100MVIB, 04Initialize B reg with number of comparisons (n-1)
4102LOOP3LXIH, 4200Initialize HL reg. to 4200H
4105MVIC, 04Initialize C reg with no. of comparisons (n-1)
4107LOOP2MOVA, MTransfer first data to acc.
4108INXHIncrement HL reg. to point next memory location
4109CMPMCompare M & A
410AJCLOOP1If A is less than M then go to loop1
410DMOVD, MTransfer data from M to D reg
410EMOVM, ATransfer data from acc to M
410FDCXHDecrement HL pair
4110MOVM, DTransfer data from D to M
4111INXHIncrement HL pair
4112LOOP1DCRCDecrement C reg
4113JNZLOOP2If C is not zero go to loop2
4116DCRBDecrement B reg
4117JNZLOOP3If B is not Zero go to loop3
4118HLTStop the program

Observation:

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

Result: Thus the ascending order program is executed and the numbers are arranged in ascending order.

Flowchart:

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

|

                            v
                          /   \
                        /  Is   \
                      /  [C] = 0? \
                     <            >
                      \ Is zero? / -- NO ----------> (To LOOP2)
                        \      /
                          \  /
                           | YES
                           v
                 +-------------------+
                 |   [B] <- [B] - 1  |
                 +---------+---------+
                           |
                           v
                         /   \
                       /  Is   \
                     /  [B] = 0? \
                    <            >
                     \ Is zero? / -- NO -----------> (To LOOP3)
                       \      /
                         \  /
                          | YES
                          v
                 +-------------------+
                 |       STOP        |
                 +-------------------+


Viva Questions:

  • Explain the INX operation.

  • State the logic behind sorting an array of data in descending order.

  • What are the advantages of using memory segmentation in 8085?

  • What is a macro and when is it used?

  • What is the function of the direction flag?

  • What is DMA?

  • Define machine cycle and instruction cycle.

For all 2026 published articles list: click here: 

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