AssemblerOutput
This module creates assembler source files in Accelerate format.
AssemblerOutput(file)
Create output files in Accelerate assembler format.
| PARAMETER | DESCRIPTION |
|---|---|
file
|
The output file handle.
TYPE:
|
begin_object(name, section=None, visibility=None, alignment=None)
Begin a new object.
| PARAMETER | DESCRIPTION |
|---|---|
name
|
The name of the object.
TYPE:
|
section
|
The section to place the object in. If
TYPE:
|
visibility
|
The visibility of the object.
TYPE:
|
alignment
|
The alignment of the object.
TYPE:
|
byte(value)
Add a byte value as .data to current object.
| PARAMETER | DESCRIPTION |
|---|---|
value
|
The byte value.
TYPE:
|
bytes(bytes_array)
Add a byte array as .data to current object.
| PARAMETER | DESCRIPTION |
|---|---|
bytes_array
|
The byte array.
TYPE:
|
bytes_object(name, bytes_array, section='data', visibility=None, alignment=None)
Create an object containing a byte array.
| PARAMETER | DESCRIPTION |
|---|---|
name
|
The name of the object.
TYPE:
|
bytes_array
|
The byte array.
TYPE:
|
section
|
The section to place the object in. If
TYPE:
|
visibility
|
The visibility of the object.
TYPE:
|
alignment
|
The alignment of the object.
TYPE:
|
combine_names(prefix, name)
Combine a prefix and name (either of which can be None) into a single name.
| PARAMETER | DESCRIPTION |
|---|---|
prefix
|
The prefix.
TYPE:
|
name
|
The name.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
str
|
The combined name. |
| RAISES | DESCRIPTION |
|---|---|
RuntimeError
|
If both prefix and name are None. |
comment(comment)
Add a comment line.
| PARAMETER | DESCRIPTION |
|---|---|
comment
|
The comment text.
TYPE:
|
constant(name, value)
Define a constant.
| PARAMETER | DESCRIPTION |
|---|---|
name
|
The name of the constant.
TYPE:
|
value
|
The value of the constant.
TYPE:
|
data(value, encoding=None, line_length=16)
Add data as .data to current object.
| PARAMETER | DESCRIPTION |
|---|---|
value
|
The data value or list of values.
TYPE:
|
encoding
|
The encoding to use for strings.
TYPE:
|
line_length
|
The number of values per line.
TYPE:
|
data_object(name, data, section='data', visibility=None, alignment=None)
Create an object containing data.
| PARAMETER | DESCRIPTION |
|---|---|
name
|
The name of the object.
TYPE:
|
data
|
The data.
TYPE:
|
section
|
The section to place the object in.
TYPE:
|
visibility
|
The visibility of the object.
TYPE:
|
alignment
|
The alignment of the object.
TYPE:
|
empty_line()
Add an empty line to the output.
end_object()
End the current object.
header(input_file)
Add standard file header comment.
| PARAMETER | DESCRIPTION |
|---|---|
input_file
|
The input file name, if any.
TYPE:
|
label(name, visibility=None)
Add a label.
| PARAMETER | DESCRIPTION |
|---|---|
name
|
The name of the label.
TYPE:
|
visibility
|
The visibility of the label.
TYPE:
|
parts(name, parts, include_count=True, include_index=True, names=None)
Create multiple objects from parts.
| PARAMETER | DESCRIPTION |
|---|---|
name
|
The base name of the objects.
TYPE:
|
parts
|
The data for each part.
TYPE:
|
include_count
|
Whether to create an object with the count of parts.
TYPE:
|
include_index
|
Whether to create an index object referencing each part.
TYPE:
|
names
|
Optional list of name suffixes for the parts. If not provided, parts are named by their index.
TYPE:
|
pre_else()
Add a preprocessor else directive.
pre_end()
Add a preprocessor end directive.
pre_if(predicate)
Add a preprocessor if directive.
| PARAMETER | DESCRIPTION |
|---|---|
predicate
|
The predicate for the if directive.
TYPE:
|
section(section)
Change current section.
| PARAMETER | DESCRIPTION |
|---|---|
section
|
The section name.
TYPE:
|
string(value, encoding=None, nul_terminate=False)
Add a string as .data to current object.
| PARAMETER | DESCRIPTION |
|---|---|
value
|
The string value.
TYPE:
|
encoding
|
The encoding to use for the string.
TYPE:
|
nul_terminate
|
Whether to add a NUL terminator.
TYPE:
|
visibility(visibility)
Change current visibility.
| PARAMETER | DESCRIPTION |
|---|---|
visibility
|
The visibility level.
TYPE:
|
word(value)
Add a word value as .data to current object.
| PARAMETER | DESCRIPTION |
|---|---|
value
|
The word value.
TYPE:
|