Class DataSectionBuilder
- java.lang.Object
-
- ru.ispras.microtesk.test.template.DataSectionBuilder
-
public final class DataSectionBuilder extends java.lang.Object
TheDataSectionBuilder
class builds data sections.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
DataSectionBuilder.DataValueBuilder
-
Constructor Summary
Constructors Constructor Description DataSectionBuilder(BlockId blockId, DataDirectiveFactory directiveFactory, Section section, boolean isGlobal, boolean isSeparateFile)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addAsciiStrings(boolean zeroTerm, java.lang.String[] strings)
void
addComment(java.lang.String text)
DataSectionBuilder.DataValueBuilder
addDataValues(java.lang.String typeName)
DataSectionBuilder.DataValueBuilder
addDataValuesForSize(int typeBitSize)
protected void
addGeneratedData(DataDirectiveFactory.TypeInfo typeInfo, ru.ispras.microtesk.test.template.DataGenerator generator, int count)
void
addLabel(java.lang.String id, boolean global)
void
addSpace(int length)
void
addText(java.lang.String text)
void
align(java.math.BigInteger value, java.math.BigInteger valueInBytes)
Adds an alignment directive.DataSection
build()
boolean
isGlobal()
boolean
isSeparateFile()
void
setOrigin(java.math.BigInteger origin)
Sets allocation origin.void
setPhysicalAddress(java.math.BigInteger value)
void
setRelativeOrigin(java.math.BigInteger delta)
Sets allocation origin related to the current address.void
setVirtualAddress(java.math.BigInteger address)
Sets allocation origin that corresponds to the specified virtual address.
-
-
-
Constructor Detail
-
DataSectionBuilder
public DataSectionBuilder(BlockId blockId, DataDirectiveFactory directiveFactory, Section section, boolean isGlobal, boolean isSeparateFile)
-
-
Method Detail
-
setPhysicalAddress
public void setPhysicalAddress(java.math.BigInteger value)
-
isGlobal
public boolean isGlobal()
-
isSeparateFile
public boolean isSeparateFile()
-
setOrigin
public void setOrigin(java.math.BigInteger origin)
Sets allocation origin. Inserts the ".org" directive in the test program.- Parameters:
origin
- Origin value.
-
setRelativeOrigin
public void setRelativeOrigin(java.math.BigInteger delta)
Sets allocation origin related to the current address. The origin value is calculated depending on the context. Inserts the ".org" directive in the test program.- Parameters:
delta
- Relative origin value.
-
setVirtualAddress
public void setVirtualAddress(java.math.BigInteger address)
Sets allocation origin that corresponds to the specified virtual address. The origin value is calculated depending on the context. Inserts the ".org" directive in the test program.- Parameters:
address
- Virtual address.
-
align
public void align(java.math.BigInteger value, java.math.BigInteger valueInBytes)
Adds an alignment directive.- Parameters:
value
- Alignment amount in addressable units.valueInBytes
- Alignment amount in bytes.
-
addLabel
public void addLabel(java.lang.String id, boolean global)
-
addText
public void addText(java.lang.String text)
-
addComment
public void addComment(java.lang.String text)
-
addDataValues
public DataSectionBuilder.DataValueBuilder addDataValues(java.lang.String typeName)
-
addDataValuesForSize
public DataSectionBuilder.DataValueBuilder addDataValuesForSize(int typeBitSize)
-
addGeneratedData
protected void addGeneratedData(DataDirectiveFactory.TypeInfo typeInfo, ru.ispras.microtesk.test.template.DataGenerator generator, int count)
-
addSpace
public void addSpace(int length)
-
addAsciiStrings
public void addAsciiStrings(boolean zeroTerm, java.lang.String[] strings)
-
build
public DataSection build()
-
-