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.
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.