A software delay subroutine is written as given below: DELAY: MVI H, 255 D   MVI L, 255 D LOOP: DCR  L   JNZ  LOOP   DCR  H   JNZ  LOOP How many times DCR L instruction will be executed?

A software delay subroutine is written as given below: DELAY: MVI H, 255 D   MVI L, 255 D LOOP: DCR  L   JNZ  LOOP   DCR  H   JNZ  LOOP How many times DCR L instruction will be executed? Correct Answer 65279

H & L registers initialized with 255 D (i.e. FFH)

(H) = 255 ⇒ (L) is decremented 255 times

(H) = 254 ⇒ (L) is decremented 256 times

(H) = 0 ⇒ Looping terminated.

No. of times execution of DCR L instruction = 255 + (256 × 254) = 65279

Related Questions