Expand description
The C face of the exarmo-aarch32 disassembler, declared in
include/exarmo/aarch32.h.
An instruction is decoded once into an opaque value the caller holds,
and then read through functions: what it is, what it does to the flags,
its operands as include/exarmo/aarch32.h lays them out, and its text as spans
of a buffer the caller owns. Nothing allocates on the caller’s behalf,
and no panic crosses the boundary. Each entry point catches one and
reports a failure.
A32 and T32 are two decode entry points into one instruction. A T32
decode is told the IT state, since a 16-bit encoding takes its
condition from a preceding IT instruction, and a caller that tracks the
blocks advances the state through exarmo_aarch32_it_state_after.
Modules§
- model
- Each type of
exarmo_aarch32::operandslaid out asinclude/exarmo/aarch32.hdeclares it, and the conversion from the Rust one. The header is the authority on layout, and every struct here follows its field order. - tables
- The tables the architecture fixes, laid out for C to read directly.
Structs§
- Branch
- What an instruction does to the flow of control, as C holds it.
- CInstruction
- Opaque storage for an
Instruction,exarmo_aarch32_instructionin C. - CItState
- The IT state a T32 decode is told,
exarmo_aarch32_it_state. - Flag
Effect - What an instruction does with the condition flags, as C holds it.
- Str
- A string that is not NUL-terminated.
- Text
Size - How much text and how many tokens an instruction has.
- Token
- One token of an instruction’s text, a span of the text buffer it was written into.
Enums§
- ItKind
- Whether a T32 instruction is inside an IT block,
exarmo_aarch32_it_kind. - Status
- The outcome of a decode,
<prefix>_status.
Functions§
- exarmo_
aarch32_ ⚠decode_ a32 - The former name of
exarmo_aarch32_decode_a32_word, which the header marks deprecated. - exarmo_
aarch32_ ⚠decode_ a32_ bytes - Decode the A32 instruction at the start of the
lenbytes atbytesintoout, which is written only onStatus::Ok. - exarmo_
aarch32_ ⚠decode_ a32_ word - Decode the A32 word
bitsintoout, which is written only onStatus::Ok. - exarmo_
aarch32_ ⚠decode_ t32 - The former name of
exarmo_aarch32_decode_t32_word, which the header marks deprecated. - exarmo_
aarch32_ ⚠decode_ t32_ bytes - Decode the T32 instruction at the start of the
lenbytes atbytes, under the IT statestate, intoout, which is written only onStatus::Ok. - exarmo_
aarch32_ ⚠decode_ t32_ word - Decode the T32 word
bits, its first halfword in the high half, under the IT statestate, intoout, which is written only onStatus::Ok. - exarmo_
aarch32_ encoding_ length - How many bytes an encoding is, or 0 for a value that is no encoding.
- exarmo_
aarch32_ encoding_ mnemonic - The mnemonic an encoding is written with. Returns
EXARMO_AARCH32_MNEMONIC_COUNTfor a value that is no encoding. - exarmo_
aarch32_ encoding_ name - An encoding’s name, or empty for a value that is no encoding.
- exarmo_
aarch32_ ⚠instruction_ branch - What the instruction does to the flow of control, as it reads at
address. Nothing for a null pointer. - exarmo_
aarch32_ ⚠instruction_ encoding - Which encoding the instruction is. Returns
EXARMO_AARCH32_ENCODING_COUNTfor a null pointer. - exarmo_
aarch32_ ⚠instruction_ flags - What the instruction does with the condition flags. Nothing for a null pointer.
- exarmo_
aarch32_ ⚠instruction_ length - How many bytes of the instruction stream the instruction is, 4 for an A32 instruction and 2 or 4 for a T32 one. Returns 0 for a null pointer.
- exarmo_
aarch32_ ⚠instruction_ mnemonic - The mnemonic the instruction is written with. Returns
EXARMO_AARCH32_MNEMONIC_COUNTfor a null pointer. - exarmo_
aarch32_ ⚠instruction_ operands - Write the instruction’s operands into
out, up tocapacity. Returns how many the instruction has. - exarmo_
aarch32_ instruction_ size - How many bytes of storage a decode writes, as the library was built.
- exarmo_
aarch32_ ⚠instruction_ sysreg - Write the system register the instruction accesses into
out, and return true. Returns false, leavingoutuntouched, for an instruction that reaches none or a null pointer. - exarmo_
aarch32_ ⚠instruction_ text - Write the instruction’s text into the caller’s buffer. Returns the length of the whole text.
- exarmo_
aarch32_ ⚠instruction_ tokens - Write the instruction’s text and tokens into the caller’s buffers.
- exarmo_
aarch32_ ⚠instruction_ unpredictable - Whether the word
instwas decoded from is CONSTRAINED UNPREDICTABLE, through its decode’s tests or a bit its diagram writes(0)or(1). Returns false for a null pointer. - exarmo_
aarch32_ ⚠it_ state_ after - The IT state the instruction after
instis in, on the straight line, given thatinstwas decoded understate. Returnsstateitself for a null pointer. - exarmo_
aarch32_ mnemonic_ name - A mnemonic’s text, or empty for a value that is no mnemonic.
- exarmo_
aarch32_ sysreg_ name - The name of the register with this key in this space, accessed in this direction, or empty where the architecture names none.
- exarmo_
aarch32_ t32_ length - How many bytes the T32 instruction beginning with the halfword
hw1takes, 2 or 4.