In the following 8085 program how many times (decimal) is the DCRC executed? LOOP : MVIC, 78 H DCRC JNZLOOP HLT
In the following 8085 program how many times (decimal) is the DCRC executed? LOOP : MVIC, 78 H DCRC JNZLOOP HLT Correct Answer 120
Concept:
- MVI: More immediate 8-bit.
|
Opcode |
Operand |
Bytes |
m-cycles |
T-states |
|
MVI |
Register/memory 8-bit data |
2 |
2/3 |
7T/10T |
Description: The 8-bit data are stored in the destination register or memory.
- DCR: Decrement source by 1.
|
Opcode |
Operand |
Bytes |
m-cycles |
T-states |
|
DCR |
Register/Memory |
1 |
1/3 |
4T/10T |
Description: The contents of the designated register/memory is discriminated by 1 and the result Is stored in the same place.
- JNZ loop: Jump execution of program immediately at the given address if condition is true. The machine cycles and 10 T-states are consumed if condition is true while two machine cycles and 7 T-states are consumed if condition is false.
- HLT: The microprocessor finishes executing the current instruction and halts any further execution. No. of T-state = 5T.
Analysis:
Loop: MVI C, 78 H ⇒ C = (78)H = (120)10
DCRC ⇒ Decrement value of ‘C’
JNZ loop ⇒ jump to loo libel
When c ≠ 0
HLT ⇒ stop the program
Conclusion:
[ alt="F1 Neha B 27.2.21 Pallavi D14" src="//storage.googleapis.com/tb-img/production/21/02/F1_Neha%20B_27.2.21_Pallavi_D14.png" style="width: 243px; height: 157px;">
