[GOLD] PowerPC relaxation corner case
[platform/upstream/binutils.git] / gas / doc / c-msp430.texi
index 33f3e83..cae3d8a 100644 (file)
@@ -1,4 +1,4 @@
-@c Copyright 2002, 2004 Free Software Foundation, Inc.
+@c Copyright (C) 2002-2014 Free Software Foundation, Inc.
 @c This is part of the GAS manual.
 @c For copying conditions, see the file as.texinfo.
 @ifset GENERIC
 @cindex options for MSP430 (none)
 @table @code
 
-@item -m
-select the mpu arch. Currently has no effect.
-@item -mP 
+@item -mmcu
+selects the mcu architecture.  If the architecture is 430Xv2 then this
+also enables NOP generation unless the @option{-mN} is also specified.
+
+@item -mcpu
+selects the cpu architecture.  If the architecture is 430Xv2 then this
+also enables NOP generation unless the @option{-mN} is also specified.
+
+@item -mP
 enables polymorph instructions handler.
 
-@item -mQ 
+@item -mQ
 enables relaxation at assembly time. DANGEROUS!
 
+@item -ml
+indicates that the input uses the large code model.
+
+@item -mn
+enables the generation of a NOP instruction following any instruction
+that might change the interrupts enabled/disabled state.  The
+pipelined nature of the MSP430 core means that any instruction that
+changes the interrupt state (@code{EINT}, @code{DINT}, @code{BIC #8,
+SR}, @code{BIS #8, SR} or @code{MOV.W <>, SR}) must be 
+followed by a NOP instruction in order to ensure the correct
+processing of interrupts.  By default it is up to the programmer to
+supply these NOP instructions, but this command line option enables
+the automatic insertion by the assembler, if they are missing.
+
+@item -mN
+disables the generation of a NOP instruction following any instruction
+that might change the interrupts enabled/disabled state.  This is the
+default behaviour.
+
+@item -my
+tells the assembler to generate a warning message if a NOP does not
+immediately forllow an instruction that enables or disables
+interrupts.  This is the default.
+
+Note that this option can be stacked with the @option{-mn} option so
+that the assembler will both warn about missing NOP instructions and
+then insert them automatically.
+
+@item -mY
+disables warnings about missing NOP instructions.
+
+@item -md
+mark the object file as one that requires data to copied from ROM to
+RAM at execution startup.  Disabled by default.
+
 @end table
 
 @node MSP430 Syntax
@@ -60,7 +101,7 @@ Additional built-in macros are:
 
 @table @code
 
-@item llo(exp) 
+@item llo(exp)
 Extracts least significant word from 32-bit expression 'exp'.
 
 @item lhi(exp)
@@ -69,27 +110,39 @@ Extracts most significant word from 32-bit expression 'exp'.
 @item hlo(exp)
 Extracts 3rd word from 64-bit expression 'exp'.
 
-@item  hhi(exp) 
+@item  hhi(exp)
 Extracts 4rd word from 64-bit expression 'exp'.
 
 @end table
 
 They normally being used as an immediate source operand.
 @smallexample
-    mov        #llo(1), r10    ;       == mov  #1, r10 
+    mov        #llo(1), r10    ;       == mov  #1, r10
     mov        #lhi(1), r10    ;       == mov  #0, r10
 @end smallexample
-       
+
 @node MSP430-Chars
 @subsection Special Characters
 
 @cindex line comment character, MSP 430
 @cindex MSP 430 line comment character
-@samp{;} is the line comment character.
+A semicolon (@samp{;}) appearing anywhere on a line starts a comment
+that extends to the end of that line.
+
+If a @samp{#} appears as the first character of a line then the whole
+line is treated as a comment, but it can also be a logical line number
+directive (@pxref{Comments}) or a preprocessor control command
+(@pxref{Preprocessing}).
+
+@cindex line separator, MSP 430
+@cindex statement separator, MSP 430
+@cindex MSP 430 line separator
+Multiple statements can appear on the same line provided that they are
+separated by the @samp{@{} character.
 
 @cindex identifiers, MSP 430
 @cindex MSP 430 identifiers
-The character @samp{$} in jump instructions indicates current location and 
+The character @samp{$} in jump instructions indicates current location and
 implemented only for TI syntax compatibility.
 
 @node MSP430-Regs
@@ -203,15 +256,29 @@ used for the directive called @code{.app-file} in the MSP 430 support.
 This directive is ignored; it is accepted for compatibility with other
 MSP 430 assemblers.
 
-@cindex @code{sect} directive, MSP 430
+@cindex @code{arch} directive, MSP 430
 @item .arch
-Currently this directive is ignored; it is accepted for compatibility with other
-MSP 430 assemblers.
+Sets the target microcontroller in the same way as the @option{-mmcu}
+command line option.
+
+@cindex @code{cpu} directive, MSP 430
+@item .cpu
+Sets the target architecture in the same way as the @option{-mcpu}
+command line option.
 
 @cindex @code{profiler} directive, MSP 430
 @item .profiler
 This directive instructs assembler to add new profile entry to the object file.
 
+@cindex @code{refsym} directive, MSP 430
+@item .refsym
+This directive instructs assembler to add an undefined reference to
+the symbol following the directive.  The maximum symbol name length is
+1023 characters.  No relocation is created for this symbol; it will
+exist purely for pulling in object files from archives.  Note that
+this reloc is not sufficient to prevent garbage collection; use a
+KEEP() directive in the linker file to preserve such objects.
+
 @end table
 
 @node MSP430 Opcodes
@@ -252,43 +319,43 @@ where:
 
 @samp{flags} is a combination of the following characters:
 
-@item  s 
+@item  s
 function entry
-@item  x  
+@item  x
 function exit
-@item  i  
+@item  i
 function is in init section
-@item  f  
+@item  f
 function is in fini section
-@item  l  
+@item  l
 library call
-@item  c  
+@item  c
 libc standard call
-@item  d  
+@item  d
 stack value demand
-@item  I  
+@item  I
 interrupt service routine
-@item  P  
+@item  P
 prologue start
-@item  p  
+@item  p
 prologue end
-@item  E  
+@item  E
 epilogue start
-@item  e  
+@item  e
 epilogue end
-@item  j  
+@item  j
 long jump / sjlj unwind
-@item  a  
+@item  a
 an arbitrary code fragment
 @item t
 extra parameter saved (a constant value like frame size)
 @end table
 
-@item function_to_profile 
+@item function_to_profile
 a function address
-@item cycle_corrector  
+@item cycle_corrector
 a value which should be added to the cycle counter, zero if omitted.
-@item extra  
+@item extra
 any extra parameter, zero if omitted.
 
 @end table
@@ -307,7 +374,7 @@ fxx:
   push r8
 .profiler "cdpt",fxx,0, .LFrameOffset_fxx  ; check stack value at this point
                                          ; (this is a prologue end)
-                                         ; note, that spare var filled with 
+                                         ; note, that spare var filled with
                                          ; the farme size
   mov r15,r8
 ...