TI to IAR 2.x/3.x Assembler Migration

E.2.9

Macro Directives

 

 

 

Description

 

Asm430 Directive (TI)

A430 Directive (IAR)

 

Define a macro

.macro

MACRO

 

Exit prematurely from a macro

.mexit

EXITM

 

End macro definition

.endm

ENDM

 

Additional A430 Directives (IAR)

 

A430 Directive (IAR)

 

Create symbol, local to a macro

 

LOCAL 1)

 

1)In Asm430 local symbols are suffixed by a question mark (?).

E.2.10 Miscellaneous Directives

Description

Asm430 Directive (TI)

A430 Directive (IAR)

Send user-defined error messages to the

.emsg

#error

output device

 

 

Send user-defined messages to the output

.mmsg

#message 1)

device

 

 

Send user-defined warning messages to

.wmsg

2)

the output device

 

 

Define a load address label

.label

3)

Directive produced by absolute lister

.setsect

ASEG 4)

Directive produced by absolute lister

.setsym

EQU or = 4)

Program end

.end

END

1)The syntax of the #message directive is: #message “<string>”

This causes ‘#message <string>’ to be output to the project build window during assemble/compile time.

2)Warning messages cannot be user-defined. #message may be used, but the warning counter will not be incremented.

3)The concept of load-time addresses is not supported. Run-time and load-time addresses are assumed to be the same. To achieve the same effect, labels can be given absolute (run-time) addresses by the EQU directives.

; Asm430 code

; A430 code

.label

load_start

load_start:

 

Run_start:

 

<code>

 

<code>

 

load_end:

 

Run_end:

 

run_start:EQU

240H

.label

load_end

run_end: EQU

run_start+load_end-load_start

4)Although not produced by the absolute lister ASEG defines absolute segments and EQU can be used to define absolute symbols.

MYFLAG

EQU

23EH

; MYFLAG is located at 23E

 

ASEG

240H

; Absolute segment at 240

MAIN:

MOV

#23CH, SP

; MAIN is located at 240

 

...

 

 

Additional A430 Directives (IAR)

A430 Directive (IAR)

Set the default base of constants

RADIX

Enable case sensitivity

CASEON

Disable case sensitivity

CASEOFF

E.2.11 Preprocessor Directives

The A430 assembler includes a preprocessor similar to that used in C programming. The following preprocessor directives can be used in include files which are shared by assembly and C programs.

E-7

Page 87
Image 87
Texas Instruments MSP-FET430 manual Macro Directives, Miscellaneous Directives, Preprocessor Directives