Memory Operations
These mnemonics move values between registers and access runtime modules, globals, and embedded resources. See CandleVM memory opcodes for execution details and registers and globals for the storage model.
| CASM mnemonic | CandleVM opcode | Operands | CandleC behavior |
|---|---|---|---|
load_const | LoadConst | destination, literal | Accepts a number, boolean, character, or null literal and encodes it using CandleVM value encoding. A non-negative integer literal from 0 through 255 is encoded as a byte value; other numeric literals are encoded as numbers. |
mov | Mov | destination, source | Copies a value from one register to another. |
load_mod | LoadModule | destination, "module.name" | Looks up a module by its exact name and stores its reference. |
load_func | LoadFunction | destination, module, "function" | Takes a register containing a module reference and the exact function name. |
load_global | LoadGlobal | destination, "name" | Reads a named runtime global. |
store_global | StoreGlobal | source, "name" | The CASM source order is register then name; CandleC writes the name and source register in the order expected by CandleVM. |
load_res | LoadResource | destination, "resource/id" | Loads a resource by its exact ID into a runtime buffer. |
type | Type | destination, source | Stores the source value's type discriminator. |
obj_type | ObjectType | destination, object | Stores the object type discriminator for the object reference in the source register. |
load_mod, load_func, load_global, and load_res require quoted string operands. load_const does not construct a runtime String; use str_new for that.