C# Class kOS.Safe.Compilation.OpcodeLabelReset

Most Opcode.Label fields are just string-ified numbers for their index position. But sometimes, when they are the entry point for a function call (from a lock expression), the label is an identifier string. When this is the case, then the mere position of the opcode within the program is not enough to store the label. Therefore, for import/export to an ML file, in this case the numeric label needs to be stored. It is done by creating a dummy opcode that is just a no-op instruction intended to be removed when the program is actually loaded into memory and run. It exists purely to store, as an argument, the label of the next opcode to follow it.
Inheritance: Opcode
Exibir arquivo Open project: KSP-KOS/KOS

Private Properties

Property Type Description

Public Methods

Method Description
Execute ( ICpu cpu ) : void
OpcodeLabelReset ( string myLabel ) : System
PopulateFromMLFields ( List fields ) : void
ToString ( ) : string

Protected Methods

Method Description
OpcodeLabelReset ( ) : System

This variant of the constructor is just for ML file save/load to use.

Method Details

Execute() public method

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

OpcodeLabelReset() protected method

This variant of the constructor is just for ML file save/load to use.
protected OpcodeLabelReset ( ) : System
return System

OpcodeLabelReset() public method

public OpcodeLabelReset ( string myLabel ) : System
myLabel string
return System

PopulateFromMLFields() public method

public PopulateFromMLFields ( List fields ) : void
fields List
return void

ToString() public method

public ToString ( ) : string
return string