- Trending Categories
- Data Structure
- Operating System
- MS Excel
- C Programming
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Decimal counter using logic controller
We write a program in the 8085 which is written in assembly language just for the implementation of a decimal counter which is used by the logic controller interface. The input of the starting count must be the input through the complete interface and moreover we display the count on the interface.
Let us consider a sample program on this –
The program which follows it should always contain an infinite loop until the inputs of the user contains a valid value of two-digit Binary Coded Decimal value just only to the Port B. After that the initial count gets displayed by sending it to Port A. After the delay of every 0.5 sec the value of the count gets incremented by 1 in the decimal and is just sent to Port A terminal for the display. Just after rolling of the count value over to 00 from 99, the repetition of the operation is done without any end.
Here is the sample program code.
; FILE NAME COUNTER.ASM ORG C000H PA EQU D8H PB EQU D9H PC EQU DAH CTRL EQU DBH DELAY EQU 04BEH MVI A, 10001010B OUT CTRL ; Configure 8255 ports in desired modes ; All the next 9 instructions will ensure that control is transferred to next portion of program ; only after Port B receives a valid 2-digit BCD input. AGAIN: IN PB ANI 0FH CPI 0AH JNC AGAIN IN PB ANI F0H CPI A0H JNC AGAIN IN PB REPEAT: OUT PA ; Now displaying the count value PUSH PSW LXI D, FFFFH CALL DELAY ; Generating delay of 0.5 second POP PSW ADI 01H DAA ; Incrementing A value in decimal JNZ REPEAT JMP AGAIN
- Related Articles
- Description of logic controller interface
- Simulate decimal up counter in 8085 Microprocessor
- 8085 Program to simulate decimal up counter
- 8085 Program to simulate decimal down counter
- Program for decimal down counter in 8085 Microprocessor
- Program to simulate decimal down counter in 8085 Microprocessor
- OR Gate Using Diode Resistor Logic
- Programmatically set the initial view controller using Storyboards
- Implementation of Boolean Functions using Logic Gates
- Counter Size and Counter Overflow
- The Realization of Logic Functions Using NAND Gates
- How to create a simple counter Using ReactJS?
- Scintillation Counter
- How to get the windows performance counter using PowerShell?