There are many instructions for storing values or IDs into the stack. These can be accessed later for an operation or stored in another variable. Here are most of them:
ldc | Loads a constant into the stack (ldc.i4 10: pushes an int32 value of 10 into the stack) |
ldfld | Loads a field of an object into a stack given its ID (takes 2 bytes for an ID or uses ldfld.s for 1 byte ID) |
ldsflda | Loads the address or the reference to a field into the stack (the object reference has to be in the stack already) |
ldobj | Loads an object into the stack |
ldelem | Loads an element of an array into the stack given its index (ldelem.s for short) |
ldelema | Loads the address of an element of an array into the stack |
ldarg | Loads an argument of a method into the stack given the argument number or ID |
ldstr | Loads a string from metadata (#US) into the stack given its ID |
ldnull | Pushes a null value into the stack |
ldloc | Loads a local variable into the stack given its ID (ldloc... |