# `movabs`

[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/movabs

**Move with explicit immediate or absolute offset**

Category: Data movement

Copies a full-width immediate into a register, or transfers accumulator data using an absolute memory offset.

8086 and later

[Intel's reference: MOV](https://intel.github.io/SDM/instruction/MOV.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 |

## Forms

- `movabs reg, imm` (8, 16, 32, 64)
  - `movabs reg8, imm8`
  - `movabs reg16, imm16`
  - `movabs reg32, imm32`: 386 and later
  - `movabs reg64, imm64`
- `movabs acc, moffs` (8, 16, 32, 64)
  - `movabs al, moffs`
  - `movabs ax, moffs`
  - `movabs eax, moffs`: 386 and later
  - `movabs rax, moffs`
- `movabs moffs, acc` (8, 16, 32, 64)
  - `movabs moffs, al`
  - `movabs moffs, ax`
  - `movabs moffs, eax`: 386 and later
  - `movabs moffs, rax`

## Operands

- `reg`: A general-purpose register matching the operation’s size, for example `al`, `ax`, `eax` or `rax`.
- `imm`: An immediate value: a constant written in the instruction as a number, a character or a label, for example `10`, `0x1f`, `'a'` or `msg`. Open a row to see the size it has in each form, such as `imm8` or `imm32`.
- `acc`: The accumulator: `al`, `ax`, `eax` or `rax`, whichever matches the operation’s size. The form accepts no other register in this position.
- `moffs`: An absolute memory address with no base or index register, such as `[label]`, used by `mov` to transfer data to or from the accumulator.

## Description

For example, `movabs rax, 1` keeps the full 64-bit immediate and is 10 bytes, whereas NASM can shorten `mov rax, 1` to a 32-bit register write. Both `mov rax, 0x123456789abcdef0` and `movabs rax, 0x123456789abcdef0` load the complete constant.

The byte, word and doubleword register-immediate forms use their respective immediate widths. The memory forms transfer data between an absolute address and `al`, `ax`, `eax` or `rax`. Use an explicit 64-bit memory offset in 64-bit code, for example `movabs rax, [abs qword 0x1000]`. Their lengths depend on the address and data widths. The 10-byte length applies to `movabs reg64, imm64`.

## Example

```x86
global _start

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

        movabs rax, 5

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