# `outsb`

[x86-64 Documentation](https://asm-editor.specy.app/documentation/x86.md) › [Instructions](https://asm-editor.specy.app/documentation/x86/instruction.md)

Web page: https://asm-editor.specy.app/documentation/x86/instruction/outsb

**Output string bytes to I/O port** · Privileged

Category: Input/output

Loads a byte from [rsi] and writes it to the I/O port numbered in dx.

186 and later

[Intel's reference: OUTS/OUTSB/OUTSW/OUTSD](https://intel.github.io/SDM/instruction/OUTS-OUTSB-OUTSW-OUTSD.html)

## Flags

| Flag | Effect |
| --- | --- |
| CF | not changed |
| PF | not changed |
| AF | not changed |
| ZF | not changed |
| SF | not changed |
| DF | not changed |
| OF | not changed |

Reads: DF

## Forms

- `outsb`

## Description

The b suffix selects 1 byte per element; no quadword form exists. Flags are unchanged.

After the transfer, `rsi` increases by 1 when DF = 0 or decreases by 1 when DF = 1. In 64-bit mode addresses use this 64-bit register by default; `a32` selects `esi`. The `rep` prefix repeats using `rcx`, or `ecx` with `a32`, as the counter. A zero initial repeat count performs no transfer. Access to I/O ports is subject to operating-system privilege checks.

## Example

```x86
global _start

section .text
_start:
        mov rax, 12
        mov rbx, 5
        mov rcx, 3
        mov rsi, 9

        outsb

        mov rax, 60         ; syscall 60: exit
        xor rdi, rdi
        syscall
```
