C.EBREAK

RISC-V C.EBREAK Instruction Details

Instruction ManualC-type

Compressed breakpoint instruction that performs the same environment-break operation as EBREAK.

Instruction Syntax

c.ebreak
Operand Breakdown
Compressed instructions are 16 bits; registers are often limited to x8–x15.
Immediate fields are narrower. Refer to the full encoding for this compressed instruction.
CCompressed Instruction

Instruction Behavior

C.EBREAK is the 16-bit compressed breakpoint instruction in the C extension. It has the same semantics as EBREAK, transferring control to the debug environment or raising an environment-break exception. It has no operands and does not read or write GPRs.

Quick Understanding & Search Notes

C.EBREAK is the compressed encoding form of EBREAK for breakpoint/debug entry; it is not an ignorable hint.

The official C extension defines it with no operands.
Whether it enters debug mode or exception handling is determined by the execution environment.

Common Usage Scenarios

Debug & Monitoring

Understand this scenario with real code like «c.ebreak # trigger debug exception».

System & Privilege

Understand this scenario with real code like «c.ebreak # trigger debug exception».

Pre-Use Checklist

Syntax Check
  • Confirm the current instruction format is C-type.
  • Confirm the operand order matches the example.
Semantic Check
  • Ensure the destination register usage is compatible with the calling convention.
  • Confirm this is not the lower-level form of a pseudo-instruction expansion.

Pitfalls / Common Confusions

C.EBREAK is not an ordinary NOP; executing it causes breakpoint/debug-related control transfer.
It has no rd/rs operands; do not interpret it using C.ADD register semantics.
Exception/debug handling depends on the execution environment and debug support.

FAQ

How is C.EBREAK related to EBREAK?

C.EBREAK performs the same environment-break semantics as EBREAK, encoded as a 16-bit compressed form.

Can C.EBREAK be used as NOP?

No. It is a breakpoint instruction.