Does C.BNEZ compare two programmable registers?
No; its second operand is fixed as x0.
Branch if x[rs1'] is nonzero; otherwise PC+2. 16-bit CB format.
Extension condition: RV32C / RV64C; this page describes C extension version 2.0.
C.BNEZ uses the 16-bit CB format; its 3-bit rs1' selects x8-x15. If the register is nonzero, the target is the current instruction PC plus a sign-extended byte offset; otherwise execution continues at PC+2. The offset is even, from -256 through 254, including zero. It corresponds to bne rs1', x0, offset and writes no link register.
Three learning stages illustrate architectural rules, without modeling processor pipelines or cycles.
RV32C / RV64C; C sets IALIGN=16, so PC is an even byte address. Address arithmetic wraps at XLEN. Subsequent target instruction-fetch exceptions are outside this model.
c.bnez → Condition false; PC ← 0x00001002; no link register write
0xE005
Architectural result not committed yet.
C.BNEZ uses CB format; when restricted rs1' is nonzero, PC is updated by adding the sign-extended offset.
Understand this scenario with real code like «c.bnez x8, 32 # PC=0x1000: x8!=0 -> PC=0x1020; x8=0 -> PC=0x1002».
No; its second operand is fixed as x0.