C# Class kOS.Safe.Compilation.OpcodeStore

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

If the variable does not exist in the local scope, then it will attempt to look for it in the next scoping level up, and the next one up, and so on until it hits global scope and if it still hasn't found it, it will CREATE the variable anew there, at global scope, and then store the value there.

This is the usual way to make a new GLOBAL variable, or to overwrite an existing LOCAL variable. 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
ファイルを表示 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