Write a Subroutine for 8085 to generate delay 0f 10ms(assume .333us clock cycle)

; REQUIRED T STATES
; = 10ms/.333us
; = 30030 T STATES
; SO WE CAN SAY VALUE OF COUNT HERE WILL BE HIGH
; THEREFORE TAKING A REGISTER PAIR AS A COUNTER


LXI B, COUNT ; 10T LOWER ADDRESS IN B HIGHER IN C
L1 DCX B ; 6T
MOV A,B ; 4T MOVE LOWER ADDRESS IN A
ORA C ; 4T SEE IF BOTH A AND C ARE ZERO
JNZ L1 ; 10/7T
RET ; 10T
; Td = 10 + COUNT X ( 6 + 4 + 4 + 10) + 10 – 3 = 30030
; 24COUNT = 30030 – 17 = 30013
; COUNT = 1250(DEC) = 04E2(HEX)

2 thoughts on “Write a Subroutine for 8085 to generate delay 0f 10ms(assume .333us clock cycle)

  1. Pingback: Quora

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s