Selecting the target 283
The das command 284
Assembler command line options 284
Assembler -X options 289
This section of the Diab C/C++ User's Guide describes the Diab Assembler for PowerPC microprocessors. For in-depth information on the PowerPC architecture and instructions, please refer to the Motorola and IBM documentation.
The target for the assembler is selected by the same methods as for the compiler. See Selecting a target, p.25 for details. When using the compiler drivers dcc, dplus, etc., the target for the assembler is selected automatically by the driver.
The command to execute Diab Assembler is as follows:
das [options] [input-files]
Diab Assembler assembles the input file and generates an object file as determined by the selected target configuration. By default, the output file has the name of the input file with an extension suffix of .o. The -o option can be used to change the output file name.
The form -@name can also be used for either options or input-file. If found, the name must be either that of an environment variable or file (a path is allowed), the contents of which replace -@name.
Example: assemble test.s with a symbol named DEBUG equal to 2 for use in conditional assembly statements:
das -D DEBUG=2 test.s
Assembler command line options
The following command line options are available. See also the next section Assembler -X options, p.289.
Define symbol name (-Dname=value)
Define symbol name to have the given value. If value is not given, 1 is used. The -D option can be used to set symbols used with conditional assembly. See the .if expression, p.329 for more information. | |
Generate debugging information (-g)
Include header in listing (-H)
Print a header on the first line of each page of the assembly listing. See Include header in listing (-Xheader...), p.291 for additional details. See p.357 for an example of an assembly listing. |
Set header files directory (-I path)
Specify a directory where the assembler will look for header files. May be given more than once. See the .include "file", p.332 for more information. |
Generate listing file (-l, -L)
See p.357 for an example of an assembly listing. |
Write the object file to file instead of the default (input-file.s). Applies only to the first file if a list of files is presented; remaining files in the list use the default. |
Remove the input file on termination (-R)
Specify assembler description (.ad) file (-T ad-file)
Specify which assembler description (.ad) file to use. This is normally set automatically by using the -t option, defining the DTARGET and the DOBJECT environment variables, or using the -WDDTARGET and the -WDDOBJECT command line options. It is primarily for internal use by Wind River. |
Specifies with one command the DTARGET (t), the DOBJECT (o), the DFP (f), and the DENVIRON (environ) configuration variables. See 4, Selecting a Target and Its Components, p.25 for details. |
Define configuration variable (-WDname=value)
Set a configuration variable for use in the configuration files with the given name to the given value. Overrides an environment variable of the same name. | |
Select object format and mnemonic type (-WDDOBJECT=object-format)
Specify the object format and mnemonic type. Overrides the environment variable DOBJECT if it is also set. | |
Select target processor (-WDDTARGET=target)
-WDDTARGET=target
| |
Specify the target processor. Overrides the environment variable DTARGET if it is also set. | |
Discard all local symbols (-x)
Discard all symbols starting with .L (-X)
Discard all symbols starting with .L; supports compilers using this form for automatically generated symbols, including the Diab compilers. |
Print command line options on standard output (-#)
The output of this option can be directed to a file. This can be convenient when contacting Technical Services. The -# should immediately follow the das command (after a space). |
Read command line options from file or variable (-@name, -@@name)
Read command line options from either a file or an environment variable. When -@name is encountered on the command line, the assembler first looks for an environment variable with the given name and substitutes its value. If an environment variable is not found then it tries to open a file with given name and substitutes the contents of the file. If neither an environment variable or a file can be found, an error message is issued and the assembler terminates. | |
Same as -@name; also prints all command line options on standard output. |
Redirect output (-@E=file, -@E+file, -@O=file, -@O+file)
The following options provide more detailed control of the assembler. The -X options are for use on the command line; -X options can also be set using the .xopt assembler directive. See .xopt, p.347.
Specify value to fill gaps left by .align or .alignn directive (-Xalign-fill-text)
Fill gaps left by the .align or .alignn directive with the value n, overriding the processor-specific default. |
Interpret .align directive (-Xalign-value, -Xalign-power2)
Interpret the value in an .align directive as the value to which the location counter is to be aligned, which must be a power of 2. Example: -Xalign-value=8 means .align is to align on an 8-byte boundary. | |
Interpret the value in an .align directive as the power of 2 to which the location counter is to be aligned. Example: -Xalign-power2=3 means .align is to align on an 8-byte boundary. This is the default. |
Generate debugging information (-Xasm-debug-... )
Do not generate debug line and file information. This is the default. | |
Generate debug line and file information. (ELF/DWARF format only). |
Align program data automatically based on size (-Xauto-align)
Set instruction type (-Xcpu-...)
Accept instructions only for the target processor designated by "...". This option is for internal use and is set automatically by the driver in response to the user-level -ttof:environ option. See Table 4-1, -t option values, p.26 for details. |
Set default value for section alignment (-Xdefault-align)
For COFF modules, set the default alignment of a section not otherwise aligned. The section is padded so that the size becomes a multiple of the alignment value. See also Align common symbols (-Xcommon-align=n), p.388. For both COFF and ELF modules, set the value use when calculating the default alignment for .comm, .lcomm, and .sbss directives, and the alignment used by the .even directive. The default value of -Xdefault-align is 8 if no value is given. Absent this directive, the default alignment for COFF sections is 8, and the default alignment for ELF sections is the maximum alignment of all objects in the section. Note that for ELF modules, -Xdefault-align does not set the alignment of sections - it sets the default for used by the .comm, .lcomm, .sbss, and .even directives. Only if one of these directives is in fact used in a section will the alignment be as set by -Xdefault-align rather than the maximum alignment of all objects in the section. |
Generate NOP for certain branch conditional instructions (-Xfix-bc-fw-mask-bug)
If a BC instruction branches to a forward label, generate a NOP instruction after the label. This option is provided as a work-around for a bug present in 800-family PowerPC processors as of this writing (mid-1998). |
Enable local GNU labels (-Xgnu-locals-...)
Disable local GNU labels. See for more information. The default setting is -Xgnu-locals-on. | |
Enable local GNU labels. See GNU-style locals, p.303 for more information. This is the default. |
Include header in listing (-Xheader...)
Include a header in the listing. See the -l and the -L options. This option is turned off as a default. This option has the same effect as the -H option. See also -Xheader-format below31. | |
Do not include a header in the listing file. This is the default. | |
See p.357 for an example of an assembly listing. |
Set header format (-Xheader-format="string")
Define the format of the header in the assembly listing. (The header is enabled by options -H or -Xheader above). The header string can contain format specifications in any order introduced by a `%'. Characters not preceded by `%' are printed as is, including spaces and escapes such as `\t' for tab. | |
Use n columns to display the subtitle given with the -Xsubtitle option. | |
Use n columns to display the title given with the -Xtitle option. | |
|
See p.357 for an example of an assembly file listing. | |
Set label definition syntax (-Xlabel-colon...)
Require that all label definitions have a colon `:' appended. When this option is selected, some directives are allowed to start the line. This is the default. Note that this applies to all directives, including .equ and .set. Thus, with this option: | |
Do not require label definitions to end with a colon `:'. When this option is selected, directives are not allowed to start in column 1. |
Set format of assembly line in listing (-Xline-format="string")
Define the format of each assembly line in a listing. The string can contain the following format specifications, in any order, starting with a `%'. Characters not preceded by `%' are printed as is, including spaces and escapes such as `\t' for tab. | |
Use n columns to display the generated code. A space is inserted at every mth column. | |
Display a maximum of n generated bytes for each source line. n may have a value from 1 through 32. More than one listing line might be used to display lines that produce many bytes. | |
Use n columns to display the current PLC (Program Location Counter) which corresponds to a section number. | |
The assembly source statement follows the above items on the listing line. The default line format string is: See p.357 for an example of an assembly listing. | |
Generate a listing file (-Xlist-...)
Generate a listing file to file input-file.L. Same as the -l option. | |
Generate a listing file to standard output. Same as the -L option. | |
See p.357 for an example of an assembly listing. |
Set line length of listing file (-Xllen=n)
Define the number of printable character positions per line of the listing file. The default is 132 characters. A value of 0 means unlimited line length. This value may also be set or changed by the .llen (p.333) and .psize (p.337) directives. | |
|
Enable blanks in macro arguments (-Xmacro-arg-space-...)
Set output object format (-Xobject-format=form)
Set the object format the assembler should produce. form is one of: The object format is set automatically by the DOBJECT environment variable and the -WDDOBJECT option and should not be set explicitly. |
Select branch size optimizations (-Xoptim-...)
Choose the shortest possible branch instruction for local branches. This is the default. | ||
To disable particular optimizations, specify a mask of 0xffff with the desired bits off. For example, -Xoptim=0xfffe enables all optimizations except that associated with mask bit 0x1. | ||
Set page break margin (-Xpage-skip=n)
|
|
Limit length of conditional branch(-Xprepare-compress=n)
Change the maximum length of a conditional branch from the default, which is 32,766 bytes; if n is not specified, the length is set to 1024. If a conditional branch exceeds this limit, the assembler inserts a reverse conditional around an unconditional branch to the label. |
Treat semicolons as statement separators (-Xsemi-is-newline)
|
Enable spaces between operands (-Xspace-...)
Do not allow spaces between operands in an assembly instruction. | |
Allow spaces between operands in an assembly instruction. This is the default. |
Delete local symbols (-Xstrip-locals..., -Xstrip-temps...)
Do not include local symbols in the symbol table. This is the same as the -x option. Local symbols are those not defined by .extern or .comm. | |
Include local symbols in the symbol table. This is the default. | |
Do not include local labels starting with string in the symbol table. If no string is specified, .L will be used. This is the same as the -X option. This option can be used to suppress the temporary symbols generated by the Diab compilers. | |
Include local symbols starting with .L in the symbol table. This is the default. |
Set subtitle (-Xsubtitle="string")
Define a subtitle that will be printed in the %S field of the header. See -Xheader-format for more information (p.291). |
Define a title that will be printed in the %T field of the header. See -Xheader-format for more information (p.291). |
support@windriver.com
Copyright © 2002, Wind River Systems, Inc. All rights reserved.