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 fmp;
15mod id;
16mod instruction;
17pub mod linker;
18mod mast_forest_builder;
19mod procedure;
20
21#[cfg(test)]
22mod mast_forest_merger_tests;
23#[cfg(any(test, feature = "testing"))]
24pub mod testing;
25#[cfg(test)]
26mod tests;
27
28pub use miden_assembly_syntax::{
30 KernelLibrary, Library, LibraryNamespace, LibraryPath, ModuleParser, Parse, ParseOptions, ast,
31 debuginfo::{
32 self, DefaultSourceManager, SourceFile, SourceId, SourceManager, SourceSpan, Span, Spanned,
33 },
34 diagnostics,
35 diagnostics::{Report, report},
36 library,
37};
38pub use miden_core::{mast, utils};
41
42#[doc(hidden)]
43pub use self::linker::{LinkLibraryKind, LinkerError};
44pub use self::{
45 assembler::Assembler,
46 id::{GlobalProcedureIndex, ModuleIndex},
47 procedure::{Procedure, ProcedureContext},
48};
49
50const ADVICE_READ_LIMIT: u8 = 16;
56
57const MAX_U32_SHIFT_VALUE: u8 = 31;
59
60const MAX_U32_ROTATE_VALUE: u8 = 31;
62
63const MAX_EXP_BITS: u8 = 64;
65
66fn push_value_ops(value: miden_core::Felt) -> alloc::vec::Vec<miden_core::Operation> {
71 use miden_core::Operation::*;
72
73 if value == ZERO {
74 vec![Pad]
75 } else if value == ONE {
76 vec![Pad, Incr]
77 } else {
78 vec![Push(value)]
79 }
80}