Questions tagged [no-op]

No-op (also spelled as "noop" and "nop") is an abbreviation for "no-operation". It is code that does nothing and has no effect. It is used for filling space (adding padding) and/or wasting time. "nop" is a common instruction in assembly language.

The great art of doing nothing

What is it, and how did it come to be?

No-OPeration (nop, no-op) is the proper instruction to instruct a processor to do nothing (but waste time).
Just about every has at least some s which have no effect at all. They naturally occur because it pays to build a regular IS, which leads to curiosities like exchange A for A, assign A to A, bitwise-and/or A and A.

While some of those may be redefined for better instruction density, one will be chosen as intended nop.

Purpose/Uses

There are a great many uses for doing nothing. Some examples:

  • Reserving space for adding patches

    Some Windows system binariesreserve space to allow live-patching.

  • Neutralizing code

    An example is an implementation of a seldom changed flag in high-performance-code: Either there's an unconditional jump to additional code, or there's a single, efficient nop

  • Aligning code for better caching

    If a function begins at the start of a cache-line (or even memory-page), there will often be fewer cache-misses

  • Wasting time

    Counting instructions and busy-Loops for delaying are getting less common in high-end systems, though they are still alive and well on slower machines.

  • (Attacking) Making a bigger target for a (semi-)blind jump by building a nop-slide.

References

115 questions
0
votes
0 answers

JavaScript — Most performant no-op in mouse event listener?

Context I am building a Redux application, and would like click and mousemove event handlers to change depending on application state. To accomplish this, I am planning to attach a single click and single mousemove handler to the document. These…
A. Vidor
  • 2,502
  • 1
  • 16
  • 24
0
votes
1 answer

jQuery: attempting to make an 'if else' statement utilise 'noop' to make link inert - not working

Ultimately I am trying to make a link not work once it is pressed and has brought up the relevant div (I want the link to work again when the relevant div is not showing). Page does not reload, as the links merely change what divs are displaying. I…
JonnyBoy
  • 61
  • 1
  • 8
0
votes
2 answers

Nop Sled, can you explain it to me?

I have been reading this book: Hacking, the art of exploitation On page 140, the book explains the Nop Slide: We’ll create a large array (or sled) of these NOP instructions and place it before the shellcode; then, if the EIP register points to…
Harmonia
  • 5
  • 1
  • 3
0
votes
2 answers

printf of the NOP character 0x90 differs when compiled on x86_64 and i686

I have 2 systems: 3.13.0-35-generic ... x86_64 x86_64 x86_64 GNU/Linux with gcc: 4.8.2 2.6.32-21-generic #32-Ubuntu ... i686 GNU/Linux with gcc: 4.4.3 I compiled the following code on both systems: int numOfNops = 600; unsigned char…
no6
  • 31
  • 1
  • 5
0
votes
1 answer

Alter the behaviour when noop runs-noop metaparameter doesn't work?

I have following resource definition file { '/usr/lib/oozie/libext/hadoop-lzo-0.5.0.jar': ensure => present, group => 'root', owner => 'root', source => '/usr/lib/hadoop/lib/hadoop-lzo-0.5.0.jar', mode =>…
jaksky
  • 3,305
  • 4
  • 35
  • 68
0
votes
2 answers

how to create a 1 second delay Arduino

Hi i'm new to Arduino and i'm trying to create a 1 second delay but i don't know how i can generate a code that completes the delay_ms function I've tried to work it out but doesn't seem to get any better Thank you void setup() { word…
user3669884
  • 1
  • 1
  • 4
0
votes
1 answer

Block I/O scheduler with sorting and power failure

While reading about I/O schedulers (CFQ, noop, deadline) I found that some of them (for example deadline) sorts blocks before writing. Could anybody give a hint how file system survives power failures when blocks are sorted before writing? Let's say…
0
votes
1 answer

MIPS noOps and bubbles

Are there a specific set of MIPS operations which cause a bubble or noOp? Or is it just dependent on which registers will be needed for subsequent calls? Outside of predictive methods for branching, does a branch always cause two noOps? LW R2…
0
votes
2 answers

Cell get unselected without deselect command

Usually my typical didselectrowatindexpath is like this: -(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { UITableViewCell * cell = [tableView cellForRowAtIndexPath:indexPath]; …
user4234
  • 1,523
  • 1
  • 20
  • 37
-5
votes
1 answer

C Code NOP confusion

This file is in AT&T syntax - see http://www.imada.sdu.dk/Courses/DM18/Litteratur/IntelnATT.htm and http://en.wikipedia.org/wiki/X86_assembly_language#Syntax. Both gdb and objdump produce AT&T syntax by default. MOV $27163,%ebx MOV $13156,%eax MOV…
1 2 3 4 5 6 7
8