3 ms·
Just being a little pedantic here, nop usually means actually no operations performed, not just "has no side effects". By this definition, this (6502asm) is als
by noobermin 4y ago
Just being a little pedantic here, nop usually means actually no operations performed, not just "has no side effects". By this definition, this (6502asm) is also a nop
bcc @dummy
@dummy:
With the special case of an extra cycle just on the off chance the bcc is at the end of the current page. It indeed leaves no side-effects but I don't know if people would really seriously call it a nop
- Karliss 4y agoEven "true" noop instructions then ones generated by writing corresponding opcode in assembly often decode to "no side effect instruction". Something like exchanging register with itself, or adding 0 to register. Modern high performance cpu designs will probably optimize those instructions and not preform the useless no side effect operation, but on simpler cpus extra logic for detecting it and not performing anything might not be worth it. So those noops will actually try to execute the no side effect operation which matches with decoded instruction. Wikipedia has table of them for different architectures https://en.wikipedia.org/wiki/NOP_(code) https://en.wikipedia.org/wiki/NOP_(code)
- MauranKilom 4y agoWell, if you take that into consideration then no nop instruction (of non-zero size) can exist in asm, because they still require advancing EIP (and decoding the instruction).