Sunday, September 13, 2009

Generate and display binary up counter (8085)

Statement: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
CPI OOH : Check counter is > FFH
JNZ BACK : If not, repeat
HLT : Stop
Delay Subroutine:
Delay: LXI B, count : Initialize count
BACK: DCX D : Decrement count
ORA D : Logically OR D and E
JNZ BACK : If result is not 0 repeat
RET : Return to main program

No comments:

Post a Comment