ChipCenter Questlink
SEARCH CHIPCENTER
Search Type:
Search for:




Knowledge Centers
Product Reviews
Data Sheets
Guides & Experts
News
International
Ask Us
Circuit Cellar Online
App Notes
NetSeminars
Careers
Resources
FAQ
EE Times Network
Electronics Group Sites

Answer2


Circuit Cellar Online
THE MAGAZINE FOR COMPUTER APPLICATIONS
Circuit Cellar Online offers articles illustrating creative solutions
and unique applications through complete projects, practical
tutorials, and useful design techniques.

Archive

WHAT'S YOUR ENGINEERING QUOTIENT?

Test Your EQ

Problem 2A NOP (no operation) instruction is included in most of processors. Is just idles the CPU hardware for one instruction cycle and does nothing useful. Why is it needed?


Answer

The NOP instruction has several important applications, including:

  • Modern pipelined processors sometimes have a "branch delay" slot following each branch instruction. An instruction placed there will be executed whether or not the branch is taken. If the compiler doesn't have anything that needs to be done at that point, it must fill the slot with a NOP.
  • When doing physical I/O (especially in embedded applications), it is sometimes necessary to introduce tiny time delays between actions. A sequence or loop of NOP instructions is one way to do this.
  • When hand-patching binary code, NOP instructions can be used to blot out an unwanted instruction, or to pad a patch that is shorter than the code it is replacing.

Contributor: Naveen P N

 

10-01 — NEXT Q&A


For questions or comments about
Test Your EQ, e-mail eq@circuitcellar.com
.
Click here to get your listing up.

Copyright © 2003 ChipCenter-QuestLink
About ChipCenter-Questlink  Contact Us  Privacy Statement   Advertising Information  FAQ