Featured

    Featured Posts

What are NOP and HLT instructions ?



What are NOP and HLT instructions ?

NOP Instruction :

Mnemonic      NOP           Flags : It does not affect any flag.
                    NOP : No operation
Algorithm      Do nothing
Addr. mode    Implied addressing mode
Operation      The execution of this instruction causes the CPU to do nothing.

  1. This instruction causes the CPU to do nothing. This instruction uses three clock cycles and increments the instruction pointer to point to the next instruction.
  2. It can be used to increase the delay of a delay loop.
Example : 
MOV AL, 00011011b
NOT AL ; AL = 11100100b
RET
Flags : All unchanged.

HLT (Halt until interrupt or reset) Instruction :

Mnemonic      Halt processing           Flags : No flags are affected.

Operation :
  1. The HLT instruction will cause the 8086 to stop fetching and executing instructions. The 8086 enters into a half state. To come out of the halt state, there are 3 ways : (a) Interrupt signal on INTR pin, (b) Interrupt signal on NMI pin, (c) Reset signal on reset pin.
  2. It may be used as an alternative to an endless software loop in situations where a program must wait for an interrupt.

Explain NOP and HLT instructions in 8086 microprocessor in detail.


Explain NOP and HLT instructions in 8086 microprocessor in detail.

NOP instruction :


Mnemonic
NOP : No operation
It does not affect any flag
Algorithm
DO nothing

Addressing Mode
Implied addressing mode


Operation : The execution of this instruction causes the CPU to do nothing.

  1. This instruction causes the CPU to do nothing. This instruction uses three clock cycles and increments the instruction pointer to point to the next instruction.
  2. It can be used to increase the delay of a delay loop.
HLT (Halt until interrupt or reset) Instruction :-

Mnemonic  Halt     Flags : No flags are affected.

Operation :
  1. The HLT instruction will cause the 8086 enters to stop fetching and executing instructions. The 8086 enters into a half state. To come out of the halt state, there are 3 ways given below. (a) Interrupt signal on INTR pin, (b) Interrupt signal on NMI pin, (c) Reset signal on rest pin.
  2. It may be used as an alternative to an endless software loop in situation where a program must wait for an interrupt.

www.CodeNirvana.in

www.posthatke.com. Powered by Blogger.
Copyright © www.posthatke.com | Blogger Templates | Designed By posthatke.com