208. Instruction nop
implement the NOP operation.
Lesson 208 of 356 · tests/chapter_01_cpu/test_208_instruction_nop.py
Why this step exists
In this step, add `emulator/cpu/instructions.py::nop`. The explicit no-op gives the official instruction a callable while leaving opcode-fetch concerns to CPU.step.
Suggested implementation
def nop(cpu: CPU):
passInvariant: a direct call changes no register, P bit, S, PC, or memory. The common misconception is to increment PC inside `nop`; dispatch has already fetched the opcode, and the operation itself owns no bytes.
Out of scope: importing NOP and mapping official opcode $EA in `emulator/cpu/opcodes.py::OPCODE_TABLE` belongs to step 209. Unofficial NOP variants, timing changes, and later tracing facilities are not introduced.
Run this lesson
uv run pytest tests/chapter_01_cpu/test_208_instruction_nop.py -v