This chapter contains the following sections:
Description
Invocation
Detailed Description of Assembler Options
Environment Variables used by the Assembler
List File
Absolute List File Generation
Page Header
Source Listing
The TriCore toolchain has two assemblers. The main assembler is astri, which assembles sources that are either hand written in the TriCore assembly language or generated by the compiler ctri. The other assembler is the PCP assembler aspcp, which assembles PCP coprocessor specific assembly files.
The TriCore assemblers astri and aspcp are optimizing assemblers. During assembly the assembler builds an internal representation of the program. This representation, the flow graph, is used to optimize the program. Examples of the optimizations are choosing alternatives for instructions. After optimization the object file and, optionally, the list file are generated.
The following phases can be identified during assembly:
1. Preprocess, check the syntax and create the flow graph
2. Type determination of all expressions
3. Legality check of all instructions
4. Optimization
5. Address calculation, jump optimization
6. Generation of object and (when requested) list file
The assembler generates relocatable object files using the IEEE-695 object format. This file format specifies a code part and a symbol part as well as a symbolic debug information part.
File inclusion and macro facilities are integrated into the assembler.
See the chapter
Macro Operations for more information.
The compiler control program, cctri, may call the assemblers automatically. cctri translates some of its command line options to options of astri or aspcp depending on the filename extension. Files with extension .asm or .src are sent to astri, files with extension .pcp are sent to aspcp. However, the assemblers can be invoked as individual programs also.
The PC invocation of astri is:
When you use a UNIX shell (C-shell, Bourne shell), options containing special characters (such as '( )' ) must be enclosed with "". The invocations for UNIX and PC are the same, except for the -? option in the C-shell:
Invocation with -V only displays a version header. -? shows the invocation syntax.
The source-file must be an assembly source file. This file is the input source of the assembler. This file contains assembly code which is either user written or generated by ctri. Any name is allowed for this file. If the file is not found and the filename does not have an extension, the extension .asm is assumed or, if the file is still not found, the extension .src is assumed.
The optional map-file is passed to the assembler when producing an absolute list file. The map file is produced by the locator. To produce an absolute list file, see section 2.7.1, Absolute List File Generation.
In the default situation, an object file with extension .obj is produced. With the -l option a list file with extension .lst is produced.
Options are preceded by a '-' (minus sign). Options can not be combined after a single '-'. If all goes well, the assembler generates a relocatable object module which contains the object code, with the default extension .obj. You can specify another output filename with the -o option. Error messages are written to the terminal, unless they are directed to an error list file with the -err assembler option.
The following list describes the assembler options briefly. Section 2.5 gives a more detailed description.
Option | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||
-? | Display invocation syntax | ||||||||||||||||||||||||||||||||||||||||||||||||||
-Ccpu | Include SFR definition file regcpu.def before source | ||||||||||||||||||||||||||||||||||||||||||||||||||
-Dmacro[=def] |
Define preprocessor macro
-FPU |
Allow the use of single precision floating point instructions. |
-Hfile |
Include file before source |
-Idirectory |
Look in directory for include files |
-L[flag...] |
Remove specified source lines from list file |
-MMU |
Allow memory management instructions in the assembly source. |
-TC2 |
Allow the use of TriCore2 instructions |
-V |
Display version header only |
-WAE |
Treat warning messages as errors |
-c |
Switch to case insensitive mode (default case sensitive) |
-e |
Remove object file on assembly errors |
-err |
Redirect error messages to error file |
-f file |
Read options from file |
-g[a|h|l|s
]
|
Generate assembly level debug information |
-hw_only |
All mnemonics are directly mapped on the corresponding instruction, no clever substitutions allowed |
-i[l|g] |
Default label style local or global |
-l |
Generate listing file |
-lllength |
Set number of lines per page in a list file |
-lnfile |
Specify a name for the list file |
-lttitle |
Specify a header title for list file pages |
-lwwidth |
Set the number of characters per line in a list file |
-o filename |
Specify name of output file |
-t[flag...] |
Display section summary |
-v |
Verbose mode. Print the filenames and numbers of the passes while they progress |
-w[num] |
Suppress one or all warning messages
|
-zdefect |
Enable checks for CPU functional problem defect | |
Table 2-1: Options summary astri
The PC invocation of aspcp is:
When you use a UNIX shell (C-shell, Bourne shell), options containing special characters (such as '( )' ) must be enclosed with "". The invocations for UNIX and PC are the same, except for the -? option in the C-shell:
Invocation with -V only displays a version header. -? shows the invocation syntax.
The source-file must be an assembly source file, either use the original PCP syntax or the PCP2 syntax. This file is the input source of the assembler. This file contains assembly code which is user written. Any name is allowed for this file. If the file is not found and the filename does not have an extension, the extension .pcp is assumed.
The optional map-file is passed to the assembler when producing an absolute list file. The map file is produced by the locator. To produce an absolute list file, see section 2.7.1, Absolute List File Generation.
In the default situation, an object file with extension .obj is produced. With the -l option a list file with extension .lst is produced.
Options are preceded by a '-' (minus sign). Options can not be combined after a single '-'. If all goes well, the assembler generates a relocatable object module which contains the object code, with the default extension .obj. You can specify another output filename with the -o option. Error messages are written to the terminal, unless they are directed to an error list file with the -err assembler option.
The following list describes the assembler options briefly. Section 2.5 gives a more detailed description.
Option | Description | ||||||||||||||||||||||||||||||||||||||
-? | Display invocation syntax | ||||||||||||||||||||||||||||||||||||||
-Ccpu | Include sfr definition file regcpu.def before source | ||||||||||||||||||||||||||||||||||||||
-Dmacro[=def] |
Define preprocessor macro
-Hfile |
Include file before source |
-Idirectory |
Look in directory for include files |
-L[flag...] |
Remove specified source lines from list file |
-Pprefix |
Add prefix to each global and external symbol (default '_PCP_') |
-V |
Display version header only |
-c |
Switch to case insensitive mode (default case sensitive) |
-e |
Remove object file on assembly errors |
-err |
Redirect error messages to error file |
-f file |
Read options from file |
-g[a|l]
|
Generate assembly level debug information |
-i[l|g] |
Default label style local or global |
-l |
Generate listing file |
-o filename |
Specify name of output file |
-p [1|2] |
Select PCP version (default is 1) |
-pTC1775 |
Generate code for PCP as found on the TC1775 |
-pRAPTOR |
Generate code for PCP as found on the Raptor |
-t |
Display section summary |
-v |
Verbose mode. Print the filenames and numbers of the passes while they progress |
-w[num] |
Suppress one or all warning messages
| |
Table 2-2: Options summary aspcp
All options in this section apply to both assembler astri and aspcp, unless explicitly stated otherwise.
With options that can be set from within EDE, you will
find a mouse icon that describes the corresponding action.
-?
Display an explanation of options at stdout.
astri -?
Select the Project | Processor Options... menu item and choose the CPU tab. Select a CPU type in the CPU type field.
If you select User defined in the CPU type field, type the name of your TriCore derivative in the User specified CPU name field.
If you select User defined in the CPU type field and leave the User specified CPU name field empty, the option -C is not used.
-Ccpu
The CPU name which identifies your TriCore derivative.
Use special function register definitions for cpu. The filename looked for is "regcpu.def". The search algorithm for .sfr files is the same as for include files that are enclosed in "" at the beginning of the C source. The file is included before the source.
To use SFR definitions from the file regtc10gp.def, enter:
astri -Ctc10gp test.src
Select the Project | Assembler Options | Project Options... menu item. Disable the
Assemble case sensitive check box in the Misc tab.
-c
Case sensitive
Switch to case insensitive mode. By default, the assembler operates in case sensitive mode.
To switch to case insensitive mode, enter:
astri -c test.src
Select the Project | Assembler Options | Project Options... menu item. Define a macro (syntax: macro[=def]) in the Define user macros field of the Files tab. You can define more macros by separating them with commas.
-Dmacro[=def]
The macro you want to define and optionally its definition.
Define macro as in 'define'. If def is not given ('=' is absent), '1' is assumed. Any number of symbols can be defined.
astri -DTWO=2 test.src
EDE always removes the output file on errors.
-e
Use this option if you do not want an object file when the assembler generates errors. With this option the 'make' utility always does the proper productions.
astri -e test.src
In EDE this option is not so useful. If you would use
this option you would not see the error messages in the
Build tab.
-err
The assembler redirects error messages to a file with the same basename as the output file and the extension .ers. The assembler uses the basename of the output file instead of the input file.
To write errors to the file test.ers instead of stderr, enter:
astri -err test.src
-f file
A filename for command line processing. The filename "-" may be used to denote standard input.
Use file for command line processing. To get around the limits on the size of the command line, it is possible to use command files. These command files contain the options that could not be part of the real command line. Command files can also be generated on the fly, for example by the make utility.
More than one -f option is allowed.
Some simple rules apply to the format of the command file:
1. It is possible to have multiple arguments on the same line in the command file.
2. To include whitespace in the argument, surround the argument with either single or double quotes.
3. If single or double quotes are to be used inside a quoted argument, we have to go by the following rules:
a. If the embedded quotes are only single or double quotes, use the opposite quote around the argument. Thus, if a argument should contain a double quote, surround the argument with single quotes.
b. If both types of quotes are used, we have to split the argument in such a way that each embedded quote is surrounded by the opposite type of quote.
Example:
"This has a single quote ' embedded"
or
'This has a double quote " embedded'
or
'This has a double quote " and \ a single quote '"' embedded"
4. Some operating systems impose limits on the length of lines within a text file. To circumvent this limitation it is possible to use continuation lines. These lines end with a backslash and newline. In a quoted argument, continuation lines will be appended without stripping any whitespace on the next line. For non-quoted arguments, all whitespace on the next line will be stripped.
Example:
"This is a continuation \ line" -> "This is a continuation line" control(file1(mode,type),\ file2(type)) -> control(file1(mode,type),file2(type))
5. It is possible to nest command line files up to 25 levels.
Suppose the file mycmds contains the following line:
-err test.src
The command line can now be:
astri -f mycmds
Select the Project | Assembler Options | Project Options... menu item. Enable the Use hardware single precision floating point instructions check box in the
Misc tab.
This option is only available (and relevant) when you
enable the presence of a floating point unit (FPU) check box on the
CPU tab in the Project | Processor Options... menu item.
-FPU
(none) The use of fpu instructions is not allowed.
The -FPU option allows the use of single precision floating point instructions in the assembly code. When you select this option, the define _FPU is set to 1 allowing you to use single precision floating point instructions. Default the define _FPU is set to 0.
For a more detailed description about
the floating point arithmetic see section Floating Point Arithmetic in
Chapter Runtime of the C Cross Compiler Users Manual.
To allow the use of floating point unit (FPU) instructions in the assembly code, enter:
astri -FPU test.src
Select the Project | PCP Assembler Options | Project Options... menu item. Choose a
Debug information option in the Debug tab.
-g[a|l]...
-gAL (no debug)
Specify to generate debug information. If you do not use this option or if you specify -g without a flag, the default is -gAL (no debug information).
Flags can be switched on with the lower case letter and switched off with the uppercase letter.
An overview of the flags is given below.
With -ga you enable assembler source line information. With -gl you enable the generation of local symbols debug information. You can use this option independent of the setting of option -ga.
To generate local symbols debug information, enter:
aspcp -gl test.pcp
To generate assembler source line information, enter:
aspcp -ga test.pcp
Select the Project | Assembler Options | Project Options... menu item. Choose a Debug information option in the Debug tab.
-g[a|h|l|s]...
-gAhLS (only HLL debug)
Specify to generate debug information. If you do not use this option or if you specify -g without a flag, the default is -gAhLS, which only passes the high level language debug information.
Flags can be switched on with the lower case letter and switched off with the uppercase letter.
An overview of the flags is given below.
With -ga you enable assembler source line information. With -gh the assembler passes the high level language debug information from the compiler to the object file. These two types of debug information cannot be used both. So, -gah is not allowed.
With -gl you enable the generation of local symbols debug information. You can use this option independent of the setting of the -ga and -gh options.
With -gs you instruct the assembler to always generate debug information. If HLL debug information is present in the source file, the assembler passes this information (same as -gAhL). If no HLL debug information is present, the assembler generates assembler source line information and local symbols debug information (same as -gaHl).
To pass high level symbolic debug information to the output files and generate local symbols debug information, enter:
astri -ghl test.src
To generate assembler source line information, enter:
astri -ga test.src
To always generate debug information, depending on the debug information in the source file, enter:
astri -gs test.src
Select the Project | Assembler Options | Project Options... menu item. Add the name of an include file
to the Include file before source field in the Files tab.
-Hfile
The name of an include file.
Include file before assembling the source.
To include the file tri.inc before any other include file, enter:
astri -Htri.inc test.src
-hw_only
none Substitutions by faster or smaller instructions is allowed.
Normally the assembler may replace instructions by other, smaller or faster instructions. For example, the instruction jeq d0,#0,label1 is replaced by jz d0,label1.
With the option -hw_only you instruct the assembler to encode all instruction as they are. The assembler does not substitute instructions with other, faster or smaller instructions. When you use this option, the define _HW_ONLY is set to 1 (no substition of instructions).
To prevent the assembler from substituting instructions with other, smaller or faster instructions:
astri -hw_only test.src
Select the Project | Assembler Options | Project Options... menu item. Add one or more directory paths
to the Include search path field in the Files tab. You can specify more directories by separating them with commas.
-Idirectory
The name of the directory to search for include file(s).
Change the algorithm for searching include files whose names do not have an absolute pathname to look in directory. Thus, include files whose names are enclosed in "" are searched for first in the directory of the file containing the include line, then in the current directory, then in directories named in -I options in left-to-right order. If the include file is still not found, the assembler searches in a directory specified with the environment variable ASTRIINC for astri or ASPCPINC for aspcp. This environment variable can contain more than one directory. Separate multiple directories with ';' for PC (':' for UNIX). Finally, the directory ../include relative to the directory where the assembler binary is located is searched.
For include files whose names are in <>, the directory of the file containing the include line and the current directory are not searched. However, the directories named in -I options (and the one in ASTRIINC or ASPCPINC and the relative path) are still searched.
astri -I/proj/include test.src
Select the Project | Assembler Options | Project Options... menu item. Choose one of the
Labels are by default Local/Global options in the Misc tab.
-i[l|g]
-il (local labels)
Select default handling for label identifiers. -il specifies that data and code assembly labels are by default treated as LOCAL labels, unless overruled by the .global directive. With -ig data and code assembly labels are by default treated as GLOBAL labels, unless overruled by the .local directive.
To specify that assembly label identifiers are treated as GLOBAL labels by default, enter:
astri -ig test.src
Select the Project | Assembler Options | Project Options... menu item. Enable or disable one or more
Include lines contaning check boxes in the Adv. List File tab.
-L[flag...]
Optionally one or more flags specifying which source lines are to be removed from the list file.
-LcDElMNPQsWX (for astri)
-LcDElMNPQWX (for aspcp)
Specify which source lines are to be removed from the list file. A list file is generated when the -l option is specified. If you do not specify the -L option the assembler removes source lines containing #line directives or symbolic debug information, empty source lines and puts wrapped source lines on one line. -L without any flags, is equivalent to -Lcdelmnpqswx, which removes all specified source lines form the list file.
Flags can be switched on with the lower case letter and switched off with the uppercase letter. The following flags are allowed:
c Default. Remove source lines containing assembler controls ($page).
C Keep source lines containing assembler controls.
d Remove source lines containing section directives (the .sdecl, .sect directives).
D Default. Keep source lines containing section directives.
e Remove source lines containing one of the symbol definition directives .extern, .global, .local or .calls.
E Default. Keep source lines containing symbol definition directives.
l Default. Remove source lines containing C preprocessor line information (lines with #line).
L Keep source lines containing C preprocessor line information.
m Remove source lines containing .macro/.dup directives (lines with .macro or .dup).
M Default. Keep source lines containing .macro/.dup directives.
n Remove empty source lines (newlines).
N Default. Keep empty source lines.
p Remove source lines containing conditional assembly (lines with .if, .elif, .else, .endif). Only the valid condition is shown.
P Default. Keep source lines containing conditional assembly.
q Remove source lines containing assembler equates (lines with .equ).
Q Default. Keep source lines containing assembler equates.
s Default. This option is for astri only. Remove source lines containing high level language symbolic debug information (lines with .symb).
S This option is for astri only. Keep source lines containing HLL symbolic debug information.
w Remove wrapped part of source lines.
W Default. Keep wrapped source lines.
x Remove source lines containing .macro/.dup expansions.
X Default. Keep source lines containing .macro/.dup expansions.
Example:
To remove source lines with assembler controls from the resulting list file and to remove wrapped source lines, enter:
astri -l -Lcw test.src
Select the Project | Assembler Options | Project Options... menu item. Enable the Generate list file check box in the List File tab.
-l
Generate listing file. The listing file has the same basename as the output file. The extension is .lst.
To generate a list file with the name test.lst, enter:
astri -l test.src
-L (remove source lines from list file)
-ll (set number of lines per page in a list file)
-ln (specify a name for the list file)
-lt (specify a header title for list file pages)
-lw (set the number of characters per line in a list file)
Select the Project | Assembler Options | Project Options... menu item. Select the List File tab and enter the page length in the Lines per page field.
-lllength
Sets the maximum number of lines on one page of the listing file. This number includes the lines used by the page header (4) and the lines with error messages. The default page length is 80. The minimum page length is 10.
To set the page length to 50 lines per page:
astri -l -ll50 test.src
Select the Project | Assembler Options | Project Options... menu item. Select the List File tab and enter a name in the Name of list file field.
-lnfile
When you use the option -l to generate a list file, the default name for the list file is source.lst. With this option you can specify another name for the list file.
To generate a list file with the name mylist.lst:
astri -l -lnmylist.lst test.src
Select the Project | Assembler Options | Project Options... menu item. Select the List File tab and enter a title in the Title of list file field.
-lttitle
This control specifies the title to be used in the page header of each page of the list file. The page number and date are automatically included in the page header.
To specify the title "MYTITLE" for the headers in the list file:
astri -l -ltMYTITLE test.src
Select the Project | Assembler Options | Project Options... menu item. Select the List File tab and enter the page length in the Characters per line field.
-lwwidth
Sets the maximum number of characters on one line in the list file. Lines that exceed this width are wrapped on the next lines. The default page width is 66. The minimum page width is 40.
To set the page width to 50 characters per page:
astri -l -lw50 test.src
Select the Project | Assembler Options | Project Options... menu item. Enable the Allow memory management instructions check box in the Misc tab.
This option is only available (and relevant) when you
enable the MMU Present
check box on the CPU tab in the Project | Processor Options... menu item.
-MMU
-MMU The use of memory management instructions is allowed.
The -MMU option allows the use of memory management instructions in the assembly source. When you select this option, the define _MMU is set to 1 allowing you to use memory management instructions.
To allow the use of memory management instructions in the assembly source, enter:
astri -MMU test.src
Select the Project | Processor Options... menu item. Select the CPU tab. Select TC2 in the CPU type box.
-TC2
(none) The use of TriCore2 instructions is not allowed.
The -TC2 option allows the use TriCore2 instructions in the assembly code. When you select this option, the define _TC2 is set to 1 allowing you to use single precision floating point instructions. Default the define _TC2 is set to 0.
To allow the use of TriCore2 instructions in the assembly code, enter:
astri -TC2 test.src
-o filename
An output filename. The filename may not start immediately after the option. There must be a tab or space in between.
Basename of assembly file with .obj suffix.
Use filename as output filename of the assembler, instead of the basename of the assembly file with the .obj extension.
To create the object file myfile.obj instead of test.obj, enter:
astri test.src -o myfile.obj
Select the Project | PCP Assembler Options | Project Options... menu item. Enter a prefix (or no prefix)
in the Prefix for global symbols field in the Misc tab.
-P[prefix]
-P_PCP_
With this option you can specify a prefix to use for global and external symbols. The default prefix is _PCP_. The prefix is useful to disinguish these symbols from symbols generated by the astri assembler.
To use no prefix for global and external symbols (same as astri assembler), enter:
aspcp -P test.pcp
Select the Project | PCP Assembler Options | Project Options... menu item. Select either PCP or PCP2
in the misc. tab.
-p[1|
2]
-p1
Choose the syntax for the PCP assembler, either the original syntax (-p1, the default), or the PCP2 syntax (-p2)
To use PCP syntax, enter:
aspcp less.PCP aspcp -p less.PCP aspcp -p1 less.PCP
To use PCP2 syntax, enter:
aspcp -p2less2.PCP
Select the Project | Processor Options... menu item. Select the CPU tab. Select either the Raptor in the CPU type box.
-pRAPTOR
With this option you tell the assembler to generate code for the Raptor.
To assemble the file test.src for the Raptor:
aspcp -pRAPTOR test.src
Select the Project | Processor Options... menu item. Select the CPU tab. Select either the TC1775A or the TC1775B in the CPU type box.
-pTC1775
With this option you tell the assembler to generate code for the TC1775A or TC1775B.
To assemble the file test.src for the TC1775A or TC1775B:
aspcp -pTC1775 test.src
Select the Project | Assembler Options | Project Options... menu item. Select the List File tab. Enable the
Section Summary checkbox. (Only available if the
Generate List File checkbox is enabled.)
-t[flag]
With this option you tell the assembler to display section information. For each section its memory address, size, number of cycles and name is listed on stdout or in the list file.
You can set the following flags. Use a lowercase letter to switch the flag 'on' and an uppercase letter to switch the flag 'off'.
c/C Display section information on stdout
l/L Write section information to the list file
With -tl, the assembler writes the section information to the list file. You must specify this option in combination with the option -l (generate listing file). If you specify -t without flags, both flags are enabled (-tcl).
astri -tcL test.src
The following section information is displayed on stdout:
Section summary: NR ADDR SIZE CYCLE NAME 1 0007 5 .text 2 021234 000e 0 .data 3 0001 0 .tiny
-V
With this option you can display the version header of the assembler. This option must be the only argument of of the assembler. Other options are ignored. The assembler exits after displaying the version header.
astri -V
TASKING TriCore assembler vx.yrz Build nnn Copyright 1996-year Altium BV Serial# 00000000
aspcp -V
TASKING PCP assembler vx.yrz Build nnn Copyright 1998-year Altium BV Serial# 00000000
-v
Verbose mode. With this option specified, the assembler prints the filenames and the assembly passes while they progress. So you can see the current status of the assembler.
astri -v test.src
Parsing "test.src" 30 lines (total now 31) Optimizing Evaluating absolute ORG addresses Parsing symbolic debug information Creating object file "test.obj" Closing object file
Select the Project | Assembler Options | Project Options... menu item. Select the Suppress all warnings check box in the Misc
tab.
-w[num]
Optionally the warning number to suppress.
-w suppress all warning messages. -wnum suppresses warning messages with number num. More than one -wnum option is allowed.
The following example suppresses warnings 113 and 114:
astri -w113 -w114 file.src
-WAE
Treat warning messages as errors. This also affects the return value of the application when only warnings occur. A build process will now stop when warnings occur.
astri -WAE test.src
Select the Project | Processor Options... menu and chooose the Bypasses TC1 v1.2 tab or the Bypasses TC1 v1.3 tab. Then select the bypasses you want to enable.
-zdefect
The name of a particular CPU functional problem that you want to be checked. The syntax used by Infineon to identify a CPU functional problems is:
For example: TC113_CPU5 (TC1, version 1.3, module "CPU", problem #5)
With the option -z you can enable or disable specific CPU functional problem checks. You can specify more than one defect.
To enable the assembler checks for all TriCore CPU TC112 problems (respectively TC113 problems) at once, use the command line option -zTC112_DEFECTS (respectively -zTC113_DEFECTS).
The following example enables the checks for CPU functional problem TC112_COR1:
astri -zTC112_COR1
Appendix CPU Functional
Problems in the C Cross-Compiler User's Guide for a complete overview of all CPU functional problems
that are supported by the assembler.
ASTRIINC With this environment variable you can specify directories where the astri assembler will search for include files. You can overrule this search path with the -I command line option. Multiple pathnames can be separated with semicolons.
ASPCPINC With this environment variable you can specify directories where the aspcp assembler will search for include files. You can overrule this search path with the -I command line option. Multiple pathnames can be separated with semicolons.
TMPDIR With
the TMPDIR environment symbol you can specify the directory where the assembler can generate temporary files. If the assembler terminates normally, the temporary file will be removed automatically.
If you do not set TMPDIR, the temporary file will be created in the current working directory.
The list file is the output file of the assembler which contains information about the generated code. The amount and form of information depends on the use of the -L option. The name is the basename of the output file with the extension .lst. The list file is only generated when the -l option is supplied. When -l is supplied, a list file is also generated when assembly errors/warnings occur. In this case the error/warning is given just below the source line containing the error/warning.
From EDE you can control the list file generation in
the Listing tab
of the Project | Assembler Options | Project Options... menu item.
After locating the whole application, an absolute list file can be generated for all assembly source input files with the assembler. To generate an absolute list file from an assembly source file the source code needs to be assembled again with use of the locator map file of the application the assembly source belongs to. See section 10.5, Locator Output, how to produce a locator map file.
An absolute list file contains absolute addresses whereas a standard list file contains relocatable addresses.
When a map file is specified as input for the assembler, only the absolute list file is generated when list file generation is enabled with the list file option -l. The previously generated object file is not overwritten when absolute list file generation is enabled. Absolute list file generation is only enabled when a map file is specified on the input which contains the filename extension .map.
When you want to generate an absolute list file, you
have to specify the same options as you did when generating the object file.
If the options are not the same you might get an incorrect absolute list
file.
Suppose your first invocation was:
astri -ig test.src
then when you want to generate an absolute list file you have to specify the same option (-ig) and the -l option:
astri -ig -l test.src test.map
With this command he absolute list file "test.lst" is created.
The page header consists of four lines.
The first line contains the following information:
- information about assembler name
- version and serial number
- copyright notice
The second line contains a title specified by the TITLE (first page) or STITLE (succeeding pages) control and a page number.
The third line contains the name of the file (first page) or is empty (succeeding pages).
The fourth line contains the header of the source listing as described in the next section.
TriCore assembler va.b rc SNzzzzzzzz-zzz (c) year TASKING, Inc. Title for demo use only page 1 /tmp/hello.asm ADDR CODE CYCLES LINE SOURCELINE
The following line appears in the page header:
ADDR CODE LINE SOURCELINE
The different columns are discussed below.
ADDR This is the memory address. The address is a (8 digit) hexadecimal number that represents the offset from the beginning of a relocatable section or the absolute address for an absolute section.
ADDR CODE LINE SOURCELINE 00000000 1 .sdecl "code.add",CODE,ABS24 00000000 2 .sect "code.add" 00000000 3 add: 00000000 85r5rrrr 4 ld.w d5,incr 00000004 0B540020 5 add d2,d4,d5 00000008 0090 6 ret 00000000 8 .sdecl "data.add",DATA,ABS18 00000000 9 .sect "data.add" 00000000 34120000 10 incr: .word 0x1234 00000000 12 .sdecl "bss.add",DATA,ABS18 00000000 13 .sect "bss.add" 00000000 14 buf: .space 4 | RESERVED 00000003
CODE This is the object code generated by the assembler for this source line, displayed in hexadecimal format. The displayed code need not be the same as the generated code that is entered in the object module. The code can also be relocatable code or a relocatable part and external part. In this case the letter 'r' is printed for the relocatable code part in the listing.
ADDR CODE LINE SOURCELINE . . 00000000 85r5rrrr 4 ld.w d5,incr 00000004 0B540020 5 add d2,d4,d5 00000008 0090 6 ret . . 00000000 34120000 10 incr: .word 0x1234 00000000 12 .sdecl "bss.add",DATA,ABS18 00000000 13 .sect "bss.add" 00000000 14 buf: .space 4 | RESERVED 00000003
LINE This column contains the line number. This is a decimal number indicating each input line, starting from 1 and incrementing with each source line. If listing of the line is suppressed (i.e. by $LIST OFF), the number increases by one anyway.
The following source part,
;Line 12 $LIST OFF ;Line 14 $LIST ON ;Line 16
results in the following list file part:
ADDR CODE CYCLES LINE SOURCELINE . . 12 ;Line 12 16 ;Line 16
SOURCELINE
This column contains the source text. This is a copy of the source line from the source module. For ease of reading the list file, tabs are expanded with sufficient numbers of blank spaces.
ADDR CODE LINE SOURCELINE 00000000 1 .sdecl "code.error",CODE,ABS24 00000000 2 .sect "code.error" 00000000 3 error: 00000000 C202 4 add d2,16 astri W140: error.asm line 4 : expression must be between -8 and 7 00000002 0090 5 ret