miden_assembly/
lib.rs

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