brk
Breakpoint
BRK #<imm>
Generates a Breakpoint instruction exception.
Details
Generate a breakpoint exception (ESR_ELx.EC = 0x3C). The 16-bit immediate is encoded in the instruction and passed to the exception handler but does not affect architectural state. Execution does not proceed to the next instruction unless the exception handler explicitly resumes. This is an AArch64-only instruction.
Pseudocode Operation
AArch64.SystemSideEffect()
ESR_ELx.EC ← 0x3C
ESR_ELx.ISS ← imm16
TakeSynchronousException(Breakpoint)
Example
BRK #16
Encoding
Binary Layout
11010100
001
imm16
000
00
Operands
-
imm
ID (16-bit)
Reference (Arm A64 ISA)
Instruction Forms
| Encoding | Instruction | ISA | Bit pattern | ||
|---|---|---|---|---|---|
| 0xD4200000 | BRK #<imm> | A64 | 11010100 | 001 | imm16 | 000 | 00 |
Description
Breakpoint instruction. A BRK instruction generates a Breakpoint Instruction exception. The PE records the exception in ESR_ELx, using the EC value 0x3C, and captures the value of the immediate argument in ESR_ELx.ISS.
Within a guarded memory region, while PSTATE.BTYPE != 0b00, a BRK instruction will not generate a Branch Target Exception and will generate a Breakpoint Instruction exception as normal. For more information, see PSTATE.BTYPE.
Operation
AArch64.SoftwareBreakpoint(imm16);