brk

Breakpoint

BRK #<imm>

Generates a Breakpoint instruction exception.

Pseudocode Operation

AArch64.SystemSideEffect()
ESR_ELx.EC ← 0x3C
ESR_ELx.ISS ← imm16
TakeSynchronousException(Breakpoint)

Example

BRK #16

Encoding

Binary Layout
11010100
31:24
001
23:21
imm16
20:5
000
4:2
00
1:0
 
Format Exception
Opcode 0xD4200000
Extension Base

Operands

  • imm
    ID (16-bit)

Related

Across architectures

Breakpoint Trap : how x86, ARM, RISC-V, and PowerISA each do this.

More in Base

Reference

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);