1 @c Copyright 2007, 2008, 2011 Free Software Foundation, Inc.
2 @c This is part of the GAS manual.
3 @c For copying conditions, see the file as.texinfo.
8 @chapter CR16 Dependent Features
11 @node Machine Dependencies
12 @chapter CR16 Dependent Features
17 * CR16 Operand Qualifiers:: CR16 Machine Operand Qualifiers
18 * CR16 Syntax:: Syntax for the CR16
21 @node CR16 Operand Qualifiers
22 @section CR16 Operand Qualifiers
23 @cindex CR16 Operand Qualifiers
25 The National Semiconductor CR16 target of @code{@value{AS}} has a few machine dependent operand qualifiers.
27 Operand expression type qualifier is an optional field in the instruction operand, to determines the type of the expression field of an operand. The @code{@@} is required. CR16 architecture uses one of the following expression qualifiers:
31 - @code{Specifies expression operand type as small}
33 - @code{Specifies expression operand type as medium}
35 - @code{Specifies expression operand type as large}
37 - @code{Specifies the CR16 Assembler generates a relocation entry for the operand, where pc has implied bit, the expression is adjusted accordingly. The linker uses the relocation entry to update the operand address at link time.}
39 - @code{Specifies the CR16 Assembler generates a relocation entry for the operand, offset from Global Offset Table. The linker uses this relocation entry to update the operand address at link time}
41 - @code{Specifies the CompactRISC Assembler generates a relocation entry for the operand, where pc has implied bit, the expression is adjusted accordingly. The linker uses the relocation entry to update the operand address at link time.}
44 CR16 target operand qualifiers and its size (in bits):
47 @item Immediate Operand
50 - m ---- 16 bits, for movb and movw instructions.
52 - m ---- 20 bits, movd instructions.
56 @item Absolute Operand
57 - s ---- Illegal specifier for this operand.
59 - m ---- 20 bits, movd instructions.
61 @item Displacement Operand
71 1 @code{movw $_myfun@@c,r1}
73 This loads the address of _myfun, shifted right by 1, into r1.
75 2 @code{movd $_myfun@@c,(r2,r1)}
77 This loads the address of _myfun, shifted right by 1, into register-pair r2-r1.
80 @code{.long _myfun@@c}
81 @code{loadd _myfun_ptr, (r1,r0)}
84 This .long directive, the address of _myfunc, shifted right by 1 at link time.
86 4 @code{loadd _data1@@GOT(r12), (r1,r0)}
88 This loads the address of _data1, into global offset table (ie GOT) and its offset value from GOT loads into register-pair r2-r1.
90 5 @code{loadd _myfunc@@cGOT(r12), (r1,r0)}
92 This loads the address of _myfun, shifted right by 1, into global offset table (ie GOT) and its offset value from GOT loads into register-pair r1-r0.
98 * CR16-Chars:: Special Characters
102 @subsection Special Characters
104 @cindex line comment character, CR16
105 @cindex CR16 line comment character
106 The presence of a @samp{#} on a line indicates the start of a comment
107 that extends to the end of the current line. If the @samp{#} appears
108 as the first character of a line, the whole line is treated as a
109 comment, but in this case the line can also be a logical line number
110 directive (@pxref{Comments}) or a preprocessor control command
111 (@pxref{Preprocessing}).
113 @cindex line separator, CR16
114 @cindex statement separator, CR16
115 @cindex CR16 line separator
116 The @samp{;} character can be used to separate statements on the same