TI to IAR 2.x/3.x Assembler Migration
E-5
E.2.6 File Reference Directives
Description Asm430 Directive (TI) A430 Directive (IAR)
Include source statements from another
file
.copy or .include #include or $
Identify one or more symbols that are
defined in the current module and used in
other modules
.def PUBLIC or EXPORT
Identify one or more global (external)
symbols
.global 1)
Define a macro library .mlib 2)
Identify one or more symbols that are
used in the current module but defined in
another module
.ref EXTERN or IMPORT
1) The directive .global functions as either .def if the symbol is defined in the current module, or .ref
otherwise. PUBLIC or EXTERN must be used as applicable with the A430 assembler to replace the
.global directive.
2) The concept of macro libraries is not supported. Include files with macro definitions must be used for this
functionality.
Modules may be used with the Asm430 assembler to create individually
linkable routines. A file may contain multiple modules or routines. All
symbols except those created by DEFINE, #define (IAR preprocessor
directive) or MACRO are “undefined” at module end. Library modules are,
furthermore, linked conditionally. This means that a library module is only
included in the linked executable if a public symbol in the module is
referenced externally. The following directives are used to mark the
beginning and end of modules in the A430 assembler.
Additional A430 Directives (IAR) A430 Directive (IAR)
Start a program module NAME or PROGRAM
Start a library module MODULE or LIBRARY
Terminate the current program or library module ENDMOD
E.2.7 Conditional-Assembly Directives
Description Asm430 Directive (TI) A430 Directive (IAR)
Optional repeatable block assembly .break 1)
Begin conditional assembly .if IF
Optional conditional assembly .else ELSE
Optional conditional assembly .elseif ELSEIF
End conditional assembly .endif ENDIF
End repeatable block assembly .endloop ENDR
Begin repeatable block assembly .loop REPT
1) There is no directive that directly corresponds to .break. However, the EXITM directive can be used with
other conditionals if repeatable block assembly is used in a macro, as shown:
SEQ MACRO FROM,TO ; Initialize a sequence of byte constants
LOCAL X
X SET FROM
REPT TO-FROM+1 ; Repeat from FROM to TO
IF X>255 ; Break if X exceeds 255
EXITM
ENDIF
DB X ; Initialize bytes to FROM...TO