Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

byte_order

std › bitter › byte_order

Byte order for bitter. Its default is most significant byte first; LittleEndian asks for the reverse.

from std.binary import bits
from std.bitter.byte_order import LittleEndian

macro dw_le(value: int) {
    @emit LittleEndian<bits<16>, 16> { value: value as bits<16> }
}

dw_le 0x1234
34 12

Types

LittleEndian

struct LittleEndian<T, const width: int>

value, packed with its least significant byte first. width is value’s width in bits, and must be a multiple of 8.

FieldTypeDescription
valueTThe value to reverse, such as a whole instruction.