F MIGRATION FROM MOTOROLA CLAS

This appendix contains the following sections:

Introduction
Absolute and Relative Mode
Object Format
Assembler Directives
Unsupported Directives
Changed Directives
New Directives
Structured Control Statements
Sections and Overlaying
Assembler Functions
Expressions
Forward References
Optimizations

1 Introduction

This appendix explains how you can migrate your assembly program from the Motorola CLAS assembler to the TASKING DSP56xxx assemblers (as56, and as563). It also describe the implementation differences between the TASKING DSP56xxx assembler, linker and locator and the Motorola CLAS assembler and linker/locator.

The TASKING assemblers are source compatible with the Motorola CLAS assembler. However, there are some exceptions to this rule. Most notable are the differences in the overlay and scoping (SECTION directive) support. These and other exceptions are discussed below. The TASKING assemblers also introduce some new features that are not supported by the CLAS assembler. Most notable are new keywords and the acceptance of forward references in almost all expressions. The TASKING assemblers are capable of performing optimizations like move parallelization and instruction reordering to adjust for pipelining restrictions.

2 Absolute and Relative Mode

The TASKING assembler always produces relocatable code. The behavior of the sections (SECTION directive) is the same as with the Motorola CLAS assembler in absolute mode.

3 Object Format

The TASKING assemblers generate object files that conform to the IEEE-695 object format. This format has no support for floating point numbers and name scopes. Therefore, relocatable expressions may not contain floating point expressions, and these expressions (when defined with equate directives) cannot be exported to other modules using the GLOBAL directive. The assembler will emit an error message on emitting floating point expressions. When it is necessary to share floating point expressions between different modules it is possible to define these expressions using an equate directive in a file, and include that file in all necessary modules. As the object format does not support name scopes, as introduced by the SECTION directive, non-global symbols defined within scopes (i.e. enclosed in a SECTION/ENDSEC pair) must be renamed to symbols on the global module level. How this is done, and when you can use these symbols from other modules, is documented in section 3.4 Scopes .

4 Assembler Directives

4.1 Unsupported Directives

The following directives are not supported by the TASKING assemblers (as56 and as563). The assemblers issue a warning when an unsupported directive is found in the input file and the directive is ignored.

Unsupported CLAS-specific directives (because IEEE-695 object format does not support them):

Other unsupported assembler directives:

HIMEM and LOMEM directives

RDIRECT directive

MACLIB directive

MODE directive

XDEF directive

XREF directive

4.2 Changed Directives

The following Motorola CLAS directives have a slightly different behavior in the TASKING assemblers:

COMMENT directive

INCLUDE directive

EQU/SET/GSET directives

FORCE/SCSJMP directives

LOCAL and GLOBAL directive

OPT directive

ORG directive

SECTION directive

4.3 New Directives

The following directives are new with respect to the Motorola CLAS assembler:

ALIGN - specify alignment

EXTERN - declare extern symbols

SYMB - pass high level language debug information to the object file

CALLS - pass call information to object file. Used to build a call tree at link time for overlaying overlay sections.

VOID - Control DO loop optimization.

5 Structured Control Statements

The assemblers do an extensive job for producing semantically legal data move code when the SCS statements are used. As the CLAS assembler does not do this, the TASKING assemblers will produce different code. It will be necessary to check the code generated by the SCS statements on register usage.

6 Sections and Overlaying

The CLAS assembler overlays sections by defining attributes to the ORG directive (using runtime and load location counters). The TASKING assemblers overlay sections using a different, more flexible, strategy. In the paragraph 3.3 Sections the overlay mechanism is explained in detail.

7 Assembler Functions

The following assembler mode functions are not supported:

8 Expressions

Expressions are typed with respect to the semantics of the different operators. Possible types are: address (with attributes to denote the memory space and address range), floating-point, integer and string. Therefore, the TASKING assemblers may type complex expressions differently than the CLAS assembler. Use the conversion functions to resolve possible typing conflicts.

9 Forward References

The CLAS assembler does not accept forward references in expressions. The TASKING assemblers do accept forward references in almost every expression. Exceptions are expressions that are used to reserve memory space, like DS and BSM, and expressions that are used as parameters to preprocessor directives, like IF and DUP. The expressions supplied with these kind of directives must be evaluated before the assembler can proceed. Therefore, they may not contain forward references.

10 Optimizations

The TASKING assemblers can perform optimizations to the supplied assembly program. When this is requested (using the -O command line parameter, or the OPT OP directive) the supplied source is changed. The new instruction combinations and ordering can be examined in the list file, and by using the pr56 utility. The list file is annotated which source line is moved to which place and which source line is combined with another instruction. This can be very complex.


Copyright © 2002 Altium BV