# `zext.h`

[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/zext.h

**Zero extend halfword**

Category: Arithmetic

Sets the first register to the low 16 bits of the second, with the rest of the register cleared.

[RISC-V manual: zext.h](https://docs.riscv.org/reference/isa/v20260120/unpriv/b-st-ext.html#insns-zext_h)

## Forms

- `zext.h t1, t2`

## Operands

- `t1`: Any integer register, `x0` to `x31`, or its named alias, such as `zero`, `t0` or `t6`.
- `t2`: An integer register. It may be the same register as `t1`.

## Example

```riscv
.text
li t0, -1
# t0=-1; zext.h writes 65535 to t2.
zext.h t2, t0
```
