logo
pub struct FormatterOptions { /* private fields */ }
Expand description

Formatter options

Implementations

Creates default formatter options

Creates default gas (AT&T) formatter options

Creates default Intel (XED) formatter options

Creates default masm formatter options

Creates default nasm formatter options

Prefixes are uppercased

DefaultValueExample
_trueREP stosd
👍falserep stosd

Prefixes are uppercased

DefaultValueExample
_trueREP stosd
👍falserep stosd
Arguments
  • value: New value

Mnemonics are uppercased

DefaultValueExample
_trueMOV rcx,rax
👍falsemov rcx,rax

Mnemonics are uppercased

DefaultValueExample
_trueMOV rcx,rax
👍falsemov rcx,rax
Arguments
  • value: New value

Registers are uppercased

DefaultValueExample
_truemov RCX,[RAX+RDX*8]
👍falsemov rcx,[rax+rdx*8]

Registers are uppercased

DefaultValueExample
_truemov RCX,[RAX+RDX*8]
👍falsemov rcx,[rax+rdx*8]
Arguments
  • value: New value

Keywords are uppercased (eg. BYTE PTR, SHORT)

DefaultValueExample
_truemov BYTE PTR [rcx],12h
👍falsemov byte ptr [rcx],12h

Keywords are uppercased (eg. BYTE PTR, SHORT)

DefaultValueExample
_truemov BYTE PTR [rcx],12h
👍falsemov byte ptr [rcx],12h
Arguments
  • value: New value

Uppercase decorators, eg. {z}, {sae}, {rd-sae} (but not opmask registers: {k1})

DefaultValueExample
_truevunpcklps xmm2{k5}{Z},xmm6,dword bcst [rax+4]
👍falsevunpcklps xmm2{k5}{z},xmm6,dword bcst [rax+4]

Uppercase decorators, eg. {z}, {sae}, {rd-sae} (but not opmask registers: {k1})

DefaultValueExample
_truevunpcklps xmm2{k5}{Z},xmm6,dword bcst [rax+4]
👍falsevunpcklps xmm2{k5}{z},xmm6,dword bcst [rax+4]
Arguments
  • value: New value

Everything is uppercased, except numbers and their prefixes/suffixes

DefaultValueExample
_trueMOV EAX,GS:[RCX*4+0ffh]
👍falsemov eax,gs:[rcx*4+0ffh]

Everything is uppercased, except numbers and their prefixes/suffixes

DefaultValueExample
_trueMOV EAX,GS:[RCX*4+0ffh]
👍falsemov eax,gs:[rcx*4+0ffh]
Arguments
  • value: New value

Character index (0-based) where the first operand is formatted. Can be set to 0 to format it immediately after the mnemonic. At least one space or tab is always added between the mnemonic and the first operand.

DefaultValueExample
👍0mov•rcx,rbp
_8mov•••••rcx,rbp

Character index (0-based) where the first operand is formatted. Can be set to 0 to format it immediately after the mnemonic. At least one space or tab is always added between the mnemonic and the first operand.

DefaultValueExample
👍0mov•rcx,rbp
_8mov•••••rcx,rbp
Arguments
  • value: New value

Size of a tab character or 0 to use spaces

  • Default: 0

Size of a tab character or 0 to use spaces

  • Default: 0
Arguments
  • value: New value

Add a space after the operand separator

DefaultValueExample
_truemov rax, rcx
👍falsemov rax,rcx

Add a space after the operand separator

DefaultValueExample
_truemov rax, rcx
👍falsemov rax,rcx
Arguments
  • value: New value

Add a space between the memory expression and the brackets

DefaultValueExample
_truemov eax,[ rcx+rdx ]
👍falsemov eax,[rcx+rdx]

Add a space between the memory expression and the brackets

DefaultValueExample
_truemov eax,[ rcx+rdx ]
👍falsemov eax,[rcx+rdx]
Arguments
  • value: New value

Add spaces between memory operand + and - operators

DefaultValueExample
_truemov eax,[rcx + rdx*8 - 80h]
👍falsemov eax,[rcx+rdx*8-80h]

Add spaces between memory operand + and - operators

DefaultValueExample
_truemov eax,[rcx + rdx*8 - 80h]
👍falsemov eax,[rcx+rdx*8-80h]
Arguments
  • value: New value

Add spaces between memory operand * operator

DefaultValueExample
_truemov eax,[rcx+rdx * 8-80h]
👍falsemov eax,[rcx+rdx*8-80h]

Add spaces between memory operand * operator

DefaultValueExample
_truemov eax,[rcx+rdx * 8-80h]
👍falsemov eax,[rcx+rdx*8-80h]
Arguments
  • value: New value

Show memory operand scale value before the index register

DefaultValueExample
_truemov eax,[8*rdx]
👍falsemov eax,[rdx*8]

Show memory operand scale value before the index register

DefaultValueExample
_truemov eax,[8*rdx]
👍falsemov eax,[rdx*8]
Arguments
  • value: New value

Always show the scale value even if it’s *1

DefaultValueExample
_truemov eax,[rbx+rcx*1]
👍falsemov eax,[rbx+rcx]

Always show the scale value even if it’s *1

DefaultValueExample
_truemov eax,[rbx+rcx*1]
👍falsemov eax,[rbx+rcx]
Arguments
  • value: New value

Always show the effective segment register. If the option is false, only show the segment register if there’s a segment override prefix.

DefaultValueExample
_truemov eax,ds:[ecx]
👍falsemov eax,[ecx]

Always show the effective segment register. If the option is false, only show the segment register if there’s a segment override prefix.

DefaultValueExample
_truemov eax,ds:[ecx]
👍falsemov eax,[ecx]
Arguments
  • value: New value

Show zero displacements

DefaultValueExample
_truemov eax,[rcx*2+0]
👍falsemov eax,[rcx*2]

Show zero displacements

DefaultValueExample
_truemov eax,[rcx*2+0]
👍falsemov eax,[rcx*2]
Arguments
  • value: New value

Hex number prefix or an empty string, eg. "0x"

  • Default: "" (masm/nasm/intel), "0x" (gas)

Hex number prefix or an empty string, eg. "0x"

  • Default: "" (masm/nasm/intel), "0x" (gas)
Arguments
  • value: New value

Hex number prefix or an empty string, eg. "0x"

  • Default: "" (masm/nasm/intel), "0x" (gas)
Arguments
  • value: New value

Hex number suffix or an empty string, eg. "h"

  • Default: "h" (masm/nasm/intel), "" (gas)

Hex number suffix or an empty string, eg. "h"

  • Default: "h" (masm/nasm/intel), "" (gas)
Arguments
  • value: New value

Hex number suffix or an empty string, eg. "h"

  • Default: "h" (masm/nasm/intel), "" (gas)
Arguments
  • value: New value

Size of a digit group, see also digit_separator()

DefaultValueExample
_00x12345678
👍40x1234_5678

Size of a digit group, see also digit_separator()

DefaultValueExample
_00x12345678
👍40x1234_5678
Arguments
  • value: New value

Decimal number prefix or an empty string

  • Default: ""

Decimal number prefix or an empty string

  • Default: ""
Arguments
  • value: New value

Decimal number prefix or an empty string

  • Default: ""
Arguments
  • value: New value

Decimal number suffix or an empty string

  • Default: ""

Decimal number suffix or an empty string

  • Default: ""
Arguments
  • value: New value

Decimal number suffix or an empty string

  • Default: ""
Arguments
  • value: New value

Size of a digit group, see also digit_separator()

DefaultValueExample
_012345678
👍312_345_678

Size of a digit group, see also digit_separator()

DefaultValueExample
_012345678
👍312_345_678
Arguments
  • value: New value

Octal number prefix or an empty string

  • Default: "" (masm/nasm/intel), "0" (gas)

Octal number prefix or an empty string

  • Default: "" (masm/nasm/intel), "0" (gas)
Arguments
  • value: New value

Octal number prefix or an empty string

  • Default: "" (masm/nasm/intel), "0" (gas)
Arguments
  • value: New value

Octal number suffix or an empty string

  • Default: "o" (masm/nasm/intel), "" (gas)

Octal number suffix or an empty string

  • Default: "o" (masm/nasm/intel), "" (gas)
Arguments
  • value: New value

Octal number suffix or an empty string

  • Default: "o" (masm/nasm/intel), "" (gas)
Arguments
  • value: New value

Size of a digit group, see also digit_separator()

DefaultValueExample
_012345670
👍41234_5670

Size of a digit group, see also digit_separator()

DefaultValueExample
_012345670
👍41234_5670
Arguments
  • value: New value

Binary number prefix or an empty string

  • Default: "" (masm/nasm/intel), "0b" (gas)

Binary number prefix or an empty string

  • Default: "" (masm/nasm/intel), "0b" (gas)
Arguments
  • value: New value

Binary number prefix or an empty string

  • Default: "" (masm/nasm/intel), "0b" (gas)
Arguments
  • value: New value

Binary number suffix or an empty string

  • Default: "b" (masm/nasm/intel), "" (gas)

Binary number suffix or an empty string

  • Default: "b" (masm/nasm/intel), "" (gas)
Arguments
  • value: New value

Binary number suffix or an empty string

  • Default: "b" (masm/nasm/intel), "" (gas)
Arguments
  • value: New value

Size of a digit group, see also digit_separator()

DefaultValueExample
_011010111
👍41101_0111

Size of a digit group, see also digit_separator()

DefaultValueExample
_011010111
👍41101_0111
Arguments
  • value: New value

Digit separator or an empty string. See also eg. hex_digit_group_size()

DefaultValueExample
👍""0x12345678
_"_"0x1234_5678

Digit separator or an empty string. See also eg. hex_digit_group_size()

DefaultValueExample
👍""0x12345678
_"_"0x1234_5678
Arguments
  • value: New value

Digit separator or an empty string. See also eg. hex_digit_group_size()

DefaultValueExample
👍""0x12345678
_"_"0x1234_5678
Arguments
  • value: New value

Add leading zeros to hexadecimal/octal/binary numbers. This option has no effect on branch targets and displacements, use branch_leading_zeros and displacement_leading_zeros.

DefaultValueExample
_true0x0000000A/0000000Ah
👍false0xA/0Ah

Add leading zeros to hexadecimal/octal/binary numbers. This option has no effect on branch targets and displacements, use branch_leading_zeros and displacement_leading_zeros.

DefaultValueExample
_true0x0000000A/0000000Ah
👍false0xA/0Ah
Arguments
  • value: New value

Use uppercase hex digits

DefaultValueExample
👍true0xFF
_false0xff

Use uppercase hex digits

DefaultValueExample
👍true0xFF
_false0xff
Arguments
  • value: New value

Small hex numbers (-9 .. 9) are shown in decimal

DefaultValueExample
👍true9
_false0x9

Small hex numbers (-9 .. 9) are shown in decimal

DefaultValueExample
👍true9
_false0x9
Arguments
  • value: New value

Add a leading zero to hex numbers if there’s no prefix and the number starts with hex digits A-F

DefaultValueExample
👍true0FFh
_falseFFh

Add a leading zero to hex numbers if there’s no prefix and the number starts with hex digits A-F

DefaultValueExample
👍true0FFh
_falseFFh
Arguments
  • value: New value

Number base

Number base

Arguments
  • value: New value

Add leading zeros to branch offsets. Used by CALL NEAR, CALL FAR, JMP NEAR, JMP FAR, Jcc, LOOP, LOOPcc, XBEGIN

DefaultValueExample
👍trueje 00000123h
_falseje 123h

Add leading zeros to branch offsets. Used by CALL NEAR, CALL FAR, JMP NEAR, JMP FAR, Jcc, LOOP, LOOPcc, XBEGIN

DefaultValueExample
👍trueje 00000123h
_falseje 123h
Arguments
  • value: New value

Show immediate operands as signed numbers

DefaultValueExample
_truemov eax,-1
👍falsemov eax,FFFFFFFF

Show immediate operands as signed numbers

DefaultValueExample
_truemov eax,-1
👍falsemov eax,FFFFFFFF
Arguments
  • value: New value

Displacements are signed numbers

DefaultValueExample
👍truemov al,[eax-2000h]
_falsemov al,[eax+0FFFFE000h]

Displacements are signed numbers

DefaultValueExample
👍truemov al,[eax-2000h]
_falsemov al,[eax+0FFFFE000h]
Arguments
  • value: New value

Add leading zeros to displacements

DefaultValueExample
_truemov al,[eax+00000012h]
👍falsemov al,[eax+12h]

Add leading zeros to displacements

DefaultValueExample
_truemov al,[eax+00000012h]
👍falsemov al,[eax+12h]
Arguments
  • value: New value

Options that control if the memory size (eg. DWORD PTR) is shown or not. This is ignored by the gas (AT&T) formatter.

Options that control if the memory size (eg. DWORD PTR) is shown or not. This is ignored by the gas (AT&T) formatter.

Arguments
  • value: New value

Show RIP+displ or the virtual address

DefaultValueExample
_truemov eax,[rip+12345678h]
👍falsemov eax,[1029384756AFBECDh]

Show RIP+displ or the virtual address

DefaultValueExample
_truemov eax,[rip+12345678h]
👍falsemov eax,[1029384756AFBECDh]
Arguments
  • value: New value

Show NEAR, SHORT, etc if it’s a branch instruction

DefaultValueExample
👍trueje short 1234h
_falseje 1234h

Show NEAR, SHORT, etc if it’s a branch instruction

DefaultValueExample
👍trueje short 1234h
_falseje 1234h
Arguments
  • value: New value

Use pseudo instructions

DefaultValueExample
👍truevcmpnltsd xmm2,xmm6,xmm3
_falsevcmpsd xmm2,xmm6,xmm3,5

Use pseudo instructions

DefaultValueExample
👍truevcmpnltsd xmm2,xmm6,xmm3
_falsevcmpsd xmm2,xmm6,xmm3,5
Arguments
  • value: New value

Show the original value after the symbol name

DefaultValueExample
_truemov eax,[myfield (12345678)]
👍falsemov eax,[myfield]

Show the original value after the symbol name

DefaultValueExample
_truemov eax,[myfield (12345678)]
👍falsemov eax,[myfield]
Arguments
  • value: New value

(gas only): If true, the formatter doesn’t add % to registers

DefaultValueExample
_truemov eax,ecx
👍falsemov %eax,%ecx

(gas only): If true, the formatter doesn’t add % to registers

DefaultValueExample
_truemov eax,ecx
👍falsemov %eax,%ecx
Arguments
  • value: New value

(gas only): Shows the mnemonic size suffix even when not needed

DefaultValueExample
_truemovl %eax,%ecx
👍falsemov %eax,%ecx

(gas only): Shows the mnemonic size suffix even when not needed

DefaultValueExample
_truemovl %eax,%ecx
👍falsemov %eax,%ecx
Arguments
  • value: New value

(gas only): Add a space after the comma if it’s a memory operand

DefaultValueExample
_true(%eax, %ecx, 2)
👍false(%eax,%ecx,2)

(gas only): Add a space after the comma if it’s a memory operand

DefaultValueExample
_true(%eax, %ecx, 2)
👍false(%eax,%ecx,2)
Arguments
  • value: New value

(masm only): Add a DS segment override even if it’s not present. Used if it’s 16/32-bit code and mem op is a displ

DefaultValueExample
👍truemov eax,ds:[12345678]
_falsemov eax,[12345678]

(masm only): Add a DS segment override even if it’s not present. Used if it’s 16/32-bit code and mem op is a displ

DefaultValueExample
👍truemov eax,ds:[12345678]
_falsemov eax,[12345678]
Arguments
  • value: New value

(masm only): Show symbols in brackets

DefaultValueExample
👍true[ecx+symbol] / [symbol]
_falsesymbol[ecx] / symbol

(masm only): Show symbols in brackets

DefaultValueExample
👍true[ecx+symbol] / [symbol]
_falsesymbol[ecx] / symbol
Arguments
  • value: New value

(masm only): Show displacements in brackets

DefaultValueExample
👍true[ecx+1234h]
_false1234h[ecx]

(masm only): Show displacements in brackets

DefaultValueExample
👍true[ecx+1234h]
_false1234h[ecx]
Arguments
  • value: New value

(nasm only): Shows BYTE, WORD, DWORD or QWORD if it’s a sign extended immediate operand value

DefaultValueExample
_trueor rcx,byte -1
👍falseor rcx,-1

(nasm only): Shows BYTE, WORD, DWORD or QWORD if it’s a sign extended immediate operand value

DefaultValueExample
_trueor rcx,byte -1
👍falseor rcx,-1
Arguments
  • value: New value

Use st(0) instead of st if st can be used. Ignored by the nasm formatter.

DefaultValueExample
_truefadd st(0),st(3)
👍falsefadd st,st(3)

Use st(0) instead of st if st can be used. Ignored by the nasm formatter.

DefaultValueExample
_truefadd st(0),st(3)
👍falsefadd st,st(3)
Arguments
  • value: New value

Show useless prefixes. If it has useless prefixes, it could be data and not code.

DefaultValueExample
_truees rep add eax,ecx
👍falseadd eax,ecx

Show useless prefixes. If it has useless prefixes, it could be data and not code.

DefaultValueExample
_truees rep add eax,ecx
👍falseadd eax,ecx
Arguments
  • value: New value

Mnemonic condition code selector (eg. JB / JC / JNAE)

Default: JB, CMOVB, SETB

Mnemonic condition code selector (eg. JB / JC / JNAE)

Default: JB, CMOVB, SETB

Arguments
  • value: New value

Mnemonic condition code selector (eg. JAE / JNB / JNC)

Default: JAE, CMOVAE, SETAE

Mnemonic condition code selector (eg. JAE / JNB / JNC)

Default: JAE, CMOVAE, SETAE

Arguments
  • value: New value

Mnemonic condition code selector (eg. JE / JZ)

Default: JE, CMOVE, SETE, LOOPE, REPE

Mnemonic condition code selector (eg. JE / JZ)

Default: JE, CMOVE, SETE, LOOPE, REPE

Arguments
  • value: New value

Mnemonic condition code selector (eg. JNE / JNZ)

Default: JNE, CMOVNE, SETNE, LOOPNE, REPNE

Mnemonic condition code selector (eg. JNE / JNZ)

Default: JNE, CMOVNE, SETNE, LOOPNE, REPNE

Arguments
  • value: New value

Mnemonic condition code selector (eg. JBE / JNA)

Default: JBE, CMOVBE, SETBE

Mnemonic condition code selector (eg. JBE / JNA)

Default: JBE, CMOVBE, SETBE

Arguments
  • value: New value

Mnemonic condition code selector (eg. JA / JNBE)

Default: JA, CMOVA, SETA

Mnemonic condition code selector (eg. JA / JNBE)

Default: JA, CMOVA, SETA

Arguments
  • value: New value

Mnemonic condition code selector (eg. JP / JPE)

Default: JP, CMOVP, SETP

Mnemonic condition code selector (eg. JP / JPE)

Default: JP, CMOVP, SETP

Arguments
  • value: New value

Mnemonic condition code selector (eg. JNP / JPO)

Default: JNP, CMOVNP, SETNP

Mnemonic condition code selector (eg. JNP / JPO)

Default: JNP, CMOVNP, SETNP

Arguments
  • value: New value

Mnemonic condition code selector (eg. JL / JNGE)

Default: JL, CMOVL, SETL

Mnemonic condition code selector (eg. JL / JNGE)

Default: JL, CMOVL, SETL

Arguments
  • value: New value

Mnemonic condition code selector (eg. JGE / JNL)

Default: JGE, CMOVGE, SETGE

Mnemonic condition code selector (eg. JGE / JNL)

Default: JGE, CMOVGE, SETGE

Arguments
  • value: New value

Mnemonic condition code selector (eg. JLE / JNG)

Default: JLE, CMOVLE, SETLE

Mnemonic condition code selector (eg. JLE / JNG)

Default: JLE, CMOVLE, SETLE

Arguments
  • value: New value

Mnemonic condition code selector (eg. JG / JNLE)

Default: JG, CMOVG, SETG

Mnemonic condition code selector (eg. JG / JNLE)

Default: JG, CMOVG, SETG

Arguments
  • value: New value

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more
Feeds this value into the given Hasher. Read more
Feeds a slice of this type into the given Hasher. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.