Skip to content

Data Representation

Andrew Johnson edited this page May 24, 2024 · 3 revisions

The same data may be represented in multiple ways across multiple storage schemes. LM provides typesafe utilities to specify when a specific data representation is expected or when a transformation is needed.

Storage Schemes

Currently supported storage schemes are Constant, Reg8, Reg16, Reg32, Reg64, StackVariable, LocalVariable, and GlobalVariable. Constants are known at compile time and don't require runtime storage until they need to be constructed. Registers are either 8 bit, 16 bit, 32 bit, or 64 bit registers. Stack Variables are memory locations referenced relative to the stack pointer. Local Variables are memory locations referenced relative to the base pointer. Global Variables are .data section program locations.