MI Lecture - 6
MI Lecture - 6
In this instruction the data available at the specified port address is moved to the
accumulator.
[A]← data from port
It is two byte instruction and no flag is affected after the execution of this instruction.
This instruction is basically used to read the data from the input devices such as data
read from key board, switches etc. during the computer run.
This two byte output instruction is used to send the contents of accumulator to the
specified port.
Output ← [A]
Time Delay Introduced by a Register Pair
• In this program the execution of loop is for 62500 times (as F424 H = 6250010).
• The condition for the check of zero flag can not be applied just after DCX
instruction, since no flag gets affected with this instruction. So to check the
zero flag ORA instruction affect the zero flag.
• The zero flag will be set if the contents of both D and E registers are zero.
The time delay introduced by the inner loop is:
The subroutine program for the delay using a register pair is given as:
FFFF H = 6553510
So TLOOP = 65535 x 24 x (1/3) µsec + 27x1x (1/3) µsec
= 524280+9 µsec
= 524289 µsec
= 0.52 sec
Write a program in assembly language to introduce a time delay of 1 sec using a
register pair. Let the system clock frequency is 3 MHz.
For one sec delay, the program can be executed as given below: