Program for decimal down counter in 8085 Microprocessor

MicroprocessorMicrocontroller8085

We write a program in 8085 assembly language for implementing a decimal down counter (from 99 to 00). The program must be working in the following conditions.

  • We load the accumulator with 99.
  • Displaying the count value in the accumulator which is present in the accumulator. RST5.5 is in unmasked condition and the interrupt system gets enabled.

The program is as follows:

FILE NAME DOWNCNTR.ASM
ORG C000H
CURDT: EQU FFF9H
UPDDT: EQU 06D3H
RDKBD: EQU 0634H
MVI A, 99H ; Initialize A with 99.
REP: STA CURDT ; Store A value in CURDT.
CALL UPDDT ; Display contents of CURDT in data field.
MVI A, 00001110B
SIM ; Unmask RST5.5
EI ; Enable Interrupt system
CALL RDKBD ; Wait till a key is pressed and load
; the key code in Accumulator, but ignore it.
LDA CURDT ; Reload A from location CURDT.
ADI 99H
DAA ; Decrement A in decimal notation by
; adding 99, which is 10's complement of 01.
JMP REP ; Jump to REP to display the next count.

 

raja
Published on 13-Mar-2019 10:58:32
Advertisements