miden_assembly/
lib.rs

1#![no_std]
2
3#[macro_use]
4extern crate alloc;
5
6#[cfg(any(test, feature = "std"))]
7extern crate std;
8
9use miden_core::{ONE, ZERO};
10
11mod assembler;
12mod basic_block_builder;
13mod id;
14mod instruction;
15pub mod linker;
16mod mast_forest_builder;
17mod procedure;
18
19#[cfg(test)]
20mod mast_forest_merger_tests;
21#[cfg(any(test, feature = "testing"))]
22pub mod testing;
23#[cfg(test)]
24mod tests;
25
26// Re-exported for downstream crates
27pub use miden_assembly_syntax::{
28    KernelLibrary, Library, LibraryNamespace, LibraryPath, ModuleParser, Parse, ParseOptions, ast,
29    debuginfo::{
30        self, DefaultSourceManager, SourceFile, SourceId, SourceManager, SourceSpan, Span, Spanned,
31    },
32    diagnostics,
33    diagnostics::{Report, report},
34    library,
35};
36/// Syntax components for the Miden Assembly AST
37/// Merkelized abstract syntax tree (MAST) components defining Miden VM programs.
38pub use miden_core::{mast, utils};
39
40#[doc(hidden)]
41pub use self::linker::{LinkLibraryKind, LinkerError};
42pub use self::{
43    assembler::Assembler,
44    id::{GlobalProcedureIndex, ModuleIndex},
45    procedure::{Procedure, ProcedureContext},
46};
47
48// CONSTANTS
49// ================================================================================================
50
51/// The maximum number of elements that can be popped from the advice stack in a single `adv_push`
52/// instruction.
53const ADVICE_READ_LIMIT: u8 = 16;
54
55/// The maximum number of bits by which a u32 value can be shifted in a bitwise operation.
56const MAX_U32_SHIFT_VALUE: u8 = 31;
57
58/// The maximum number of bits by which a u32 value can be rotated in a bitwise operation.
59const MAX_U32_ROTATE_VALUE: u8 = 31;
60
61/// The maximum number of bits allowed for the exponent parameter for exponentiation instructions.
62const MAX_EXP_BITS: u8 = 64;