Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

 Delay Subroutine

1
DELAY PROGRAM 1

 No. of T states Total T states
 MVI B,FFH 7 7
 LOOP:DCR B 4 255X4
 JNZ LOOP 10/7 254X10 +7

 Clock freq.=2MHz, one T state=.5 Microsecond


 Total T states= 3574
 (Total T states)*.5 Microsecond= Total delay
generated=1.787 ms
DELAY PROGRAM 2

 No. of T states
 LXI D,1111H 10
 LOOP: DCX D 6
 MOV A,E 4
 ORA D 4
 JNZ LOOP 10/7
4369 decimal
 Clock freq.=2 MHz, one T state=.5 Microsecond

 (Total T –states)*.5 Microsecond= Total delay


generated
DELAY PROGRAM 3

 No. of T states
 MVI B,30H 7
 LOOP 1: MVI C,FFH 7
 LOOP 2: DCR C 4
JNZ LOOP 2 10/7
 DCR B 4
 JNZ LOOP 1 10/7
 48 and 255 decimal
 one T state=.5 Microsecond

 (Total T –states)*.5 Microsecond= Total delay generated


DELAY CALCULATION

 No. of T states Total T states
 MVI B , (count)H 7 7
 LOOP:DCR B 4 NX4
 JNZ LOOP 10/7 (N-1)X10 +7
 Decimal value of count N
 Clock freq.=2MHz, one T state=.5 Microsecond
 Total T –states= 3574
 (Total T –states)*.5 Microsecond= Total delay
generated=1.787 ms
 Find N and count .

You might also like