# `blez`

[RISC-V Documentation](https://asm-editor.specy.app/documentation/risc-v.md) › [Instructions](https://asm-editor.specy.app/documentation/risc-v/instruction.md)

Web page: https://asm-editor.specy.app/documentation/risc-v/instruction/blez

**Branch if less than or equal to zero** · Pseudo-instruction

Category: Control flow

Branches to label if the register is less than or equal to zero.

[RISC-V manual: bge](https://docs.riscv.org/reference/isa/v20260120/unpriv/rv32.html#norm:bge_bgeu_op)

Used in: [Drawing shapes on the screen](https://asm-editor.specy.app/learn/courses/risc-v/examples/drawing-on-the-screen.md) (RISC-V assembly), [A bouncing ball](https://asm-editor.specy.app/learn/courses/risc-v/examples/bouncing-ball.md) (RISC-V assembly), [Move a square with the keyboard](https://asm-editor.specy.app/learn/courses/risc-v/examples/keyboard-control.md) (RISC-V assembly), [Flappy ASM](https://asm-editor.specy.app/learn/courses/risc-v/examples/flappy-asm.md) (RISC-V assembly)

## Forms

- `blez t1, label`
  - `blez t1,label` → `bge zero, t1, label`

## Operands

- `t1`: Any integer register, `x0` to `x31`, or its named alias, such as `zero`, `t0` or `t6`.
- `label`: A named address in the program, such as the start of a loop or a variable in `.data`.

## Example

```riscv
# First blez case is taken; second is not. t2 ends at 11 (10 + 1).
.text
li t2, 0
li t0, -1
blez t0, taken
addi t2, t2, 1
j first_done # Skip the other marker unconditionally.
taken:
addi t2, t2, 10
first_done:
li t0, 1
blez t0, missed
addi t2, t2, 1
j second_done # Skip the other marker unconditionally.
missed:
addi t2, t2, 10
second_done:
# t2=11 proves one taken and one untaken path.
```
