RISC-V nop Pseudo-Instruction Details
Assembler pseudo-instructionNo-operation pseudo-instruction, expands to addi x0, x0, 0. Changes no architectural state except advancing PC. Primarily used for code alignment, icache line padding, and runtime code patch reservation.
What This Pseudo Instruction Is Saving You From Writing
Provides the canonical NOP encoding defined by the ISA manual — addi x0, x0, 0 writes 0 to x0 (discarded by hardware), with the only architecturally visible effect being PC advancement.
Official Semantics Checklist
How To Read The Expansion
What You May See In objdump / Disassembly
Official References And Reading Order
This page treats pseudo-instructions as assembler-level aliases or macros: first read what real instructions they expand to, then use the official ISA manual for the behavior of those real instructions. ABI, relocation, and linker-relaxation details follow the psABI document.
When To Think Of It First
Pitfalls / Common Confusions
FAQ
Is nop a real RISC-V instruction?
nop is an assembler pseudo-instruction or alias, not a separate hardware opcode. The “Typical Real Expansion” section lists the official expansion, and behavior is defined by the expanded ISA instructions.
What is the main trap when using nop?
NOP still occupies instruction encoding and fetch bandwidth; exact execution cost is microarchitecture-dependent, so do not assume it is free