Conversation

If NOP does nothing, why does the program counter change?

I think Architects and ISA designers should have more courage to say NOP means NOP, without this program counter funny business.

2
0
0

@lenary it doesn't do nothing, it performs no operation. subtle difference

1
0
0

@dysfun it's performing an operation on my program counter, tyvm, and i don't want it to

1
0
0
@lenary @dysfun the RISC-V specs used to say this ;)
1
0
2

@palmer @dysfun I thought the RISC-V spec's attitude was "who needs NOP when you've got mov x0..."

2
0
0
@lenary @dysfun we've got everything: x0, NOP, hints, MOPs ...
1
0
2
@lenary @palmer @dysfun

> The NOP instruction does not change any user-visible state, except for advancing the pc. NOP is encoded as ADDI x0, x0, 0
1
0
0

@ahfrom oh yeah, I forgot that RISC-V doesn't actually have MOV, it just has ADDI. Oops. So everything's an ADDI, even when nothing is happening.

0
0
0

@lenary obviously you've never written a bunch of NOPs to time the on/off of blinkenlights

1
0
0