C# Class kOS.Safe.Compilation.OpcodeStoreLocal

Consumes the topmost 2 values of the stack, storing the topmost stack value into a variable described by the next value down the stack.

The variable must not exist already in the local nesting level, and it will NOT attempt to look for it in the next scoping level up.

Instead it will attempt to create the variable anew at the current local nesting scope.

This is the usual way to make a new LOCAL variable. Do not attempt to use this opcode to store the value into an existing variable - just use it when making new variables. If you use it to store into an existing local variable, it will generate an error at runtime.

Note that since this is the way to make a variable, it's impossible to make a variable that hasn't been given an initial value. Its the act of storing a value into the variable that causues it to exist. This is deliberate design.
Inheritance: Opcode
Exibir arquivo Open project: KSP-KOS/KOS

Public Methods

Method Description
Execute ( ICpu cpu ) : void

Method Details

Execute() public method

public Execute ( ICpu cpu ) : void
cpu ICpu
return void