Indexed assembly of finite instruction blocks #
The assembler is independent of the source and target instruction types. Fixed block lengths provide exact prefix offsets; forward and reverse machine compilers share this construction.
theorem Cslib.Program.compileBlocks_decompose {α : Type u_1} {β : Type u_2} {block : ℕ → α → List β} {k start j : ℕ} {code : List α} {i : α} (hblock : ∀ (pc : ℕ), ∀ a ∈ code, (block pc a).length = k) (hi : code[j]? = some i) :
An indexed block occurs after a prefix of exactly k * j target instructions.
theorem Cslib.Program.getElem?_compileBlocks {α : Type u_1} {β : Type u_2} {block : ℕ → α → List β} {k start j n : ℕ} {code : List α} {i : α} {instruction : β} (hblock : ∀ (pc : ℕ), ∀ a ∈ code, (block pc a).length = k) (hi : code[j]? = some i) (localGet : (block (start + j) i)[n]? = some instruction) :
Fetch within a fixed-size compiled block agrees with fetching inside that block.