Wednesday, March 23, 2016

8051 No Operation

NOP

The NOP instruction does nothing. Execution continues at the following instruction. Other than the PC, no registers or flags are affected. NOP is typically used to generate a delay in execution or to reserve space in code memory.

Encoding: 0 0 0 0 0 0 0 0

A low-going output pulse on bit 7 of Port 2 must last exactly 5 cycles. A simple SETB/CLR sequence generates a one-cycle pulse, so four additional cycles must be inserted. This may be done (assuming no interrupts are enabled) with the following instruction sequence,

CLR P2.7
NOP
NOP
NOP
NOP
SETB P2.7



Related topics:
8051 Complement Accumulator and Bit   |   8051 Set Bit   |   8051 Clear Accumulator and Bit   |   8051 Rotate Accumulator   |   8051 Swap Nibble   |   8051 Exchange Accumulator   |   8051 Exchange Digit   |   8051 Push and Pop

List of topics: 8051

No comments:

Post a Comment