C# Class Assembler.Assembler.SectionCode

Deals with the sections of assembly which are "code" ie any "rstXX" section, any interrupt and the "text" section
Show file Open project: CRogers/GbcEmulator

Public Methods

Method Description
AssembleCode ( string[]>.Dictionary sections, int offset, ushort>.Dictionary constants, int>.Dictionary data ) : byte[]>.Dictionary

Private Methods

Method Description
ChangeFromHex ( string strs ) : string[]

Search through the entire section, change each hex value to an ordinary one then return the changed lines of code

GetCode ( string code, ushort>.Dictionary labelDict, RegexOpcode regexOpcodes ) : byte[]

Gets the assembled machine code for section of code

GetLabels ( string[]>.IList sections, RegexOpcode[]>.Dictionary regexOpcodeDict, int offset ) : ushort>.Dictionary

Gets the labels' positions for every section of the code.

GetRegexOpcodes ( string code ) : RegexOpcode[]

Goes through each line of code - if it is a valid opcode, it assigns a RegexOpcode to it.

ReplaceAllConstantsData ( string strs, ushort>.Dictionary constants, int>.Dictionary data ) : string[]

Replaces all constants/(reserved/declared data) with the number representing their offset.

Method Details

AssembleCode() public static method

public static AssembleCode ( string[]>.Dictionary sections, int offset, ushort>.Dictionary constants, int>.Dictionary data ) : byte[]>.Dictionary
sections string[]>.Dictionary
offset int
constants ushort>.Dictionary
data int>.Dictionary
return byte[]>.Dictionary