Free Electronic Circuits & 8085 projects

Electronic projects with circuit diagram and 8085 microprocessor projects.

Generate and display binary up counter

Published on Nov 18 2009 // Working with Counters


Write a program for displaying binary up counter. Counter should count numbers from 00 to FFH and it should increment after every 0.5 sec.Assume operating frequency of 8085 equal to 2MHz. Display routine is available.

Source program:

  • LXI SP, 27FFH : Initialize stack pointer
  • MVI C, OOH : Initialize counter
  • BACK: CALL Display : Call display subroutine
  • CALL Delay : Call delay subroutine
  • INR C : Increment counter
  • MOV A, C
  • CPI OOH : Check counter is > FFH
  • JNZ BACK : If not, repeat
  • HLT : Stop

Delay Routine:

  • Delay: LXI B, count : Initialize count
  • BACK: DCX D : Decrement count
  • MOV A, E
  • ORA D : Logically OR D and E
  • JNZ BACK : If result is not 0 repeat
  • RET : Return to main program

Flowchart for Program

49.c-Generate and display binary up counter

Flowchart for subroutine

49.d-50.cGenerate and display binary up counter

Related Programs (Click down)

Find the largest of given numbers

Count number of one’s in a number

Execution format of instructions

Arrange in ascending order