Search This Blog

Tuesday, April 12, 2011

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)

No comments:

Post a Comment