1*b88e3e88Schristos@c Copyright (C) 2008-2020 Free Software Foundation, Inc. 2440a403fSchristos@c This is part of the GAS manual. 3440a403fSchristos@c For copying conditions, see the file as.texinfo. 4440a403fSchristos@ifset GENERIC 5440a403fSchristos@page 6440a403fSchristos@node RX-Dependent 7440a403fSchristos@chapter RX Dependent Features 8440a403fSchristos@end ifset 9440a403fSchristos@ifclear GENERIC 10440a403fSchristos@node Machine Dependencies 11440a403fSchristos@chapter RX Dependent Features 12440a403fSchristos@end ifclear 13440a403fSchristos 14440a403fSchristos@cindex RX support 15440a403fSchristos@menu 16*b88e3e88Schristos* RX-Opts:: RX Assembler Command-line Options 17440a403fSchristos* RX-Modifiers:: Symbolic Operand Modifiers 18440a403fSchristos* RX-Directives:: Assembler Directives 19440a403fSchristos* RX-Float:: Floating Point 20440a403fSchristos* RX-Syntax:: Syntax 21440a403fSchristos@end menu 22440a403fSchristos 23440a403fSchristos@node RX-Opts 24440a403fSchristos@section RX Options 25440a403fSchristos@cindex options, RX 26440a403fSchristos@cindex RX options 27440a403fSchristos 2806324dcfSchristosThe Renesas RX port of @code{@value{AS}} has a few target specific 29*b88e3e88Schristoscommand-line options: 30440a403fSchristos 31440a403fSchristos@table @code 32440a403fSchristos 33440a403fSchristos@cindex @samp{-m32bit-doubles} 34440a403fSchristos@item -m32bit-doubles 35440a403fSchristosThis option controls the ABI and indicates to use a 32-bit float ABI. 36440a403fSchristosIt has no effect on the assembled instructions, but it does influence 37440a403fSchristosthe behaviour of the @samp{.double} pseudo-op. 38440a403fSchristosThis is the default. 39440a403fSchristos 40440a403fSchristos@cindex @samp{-m64bit-doubles} 41440a403fSchristos@item -m64bit-doubles 42440a403fSchristosThis option controls the ABI and indicates to use a 64-bit float ABI. 43440a403fSchristosIt has no effect on the assembled instructions, but it does influence 44440a403fSchristosthe behaviour of the @samp{.double} pseudo-op. 45440a403fSchristos 46440a403fSchristos@cindex @samp{-mbig-endian} 47440a403fSchristos@item -mbig-endian 48440a403fSchristosThis option controls the ABI and indicates to use a big-endian data 49440a403fSchristosABI. It has no effect on the assembled instructions, but it does 50440a403fSchristosinfluence the behaviour of the @samp{.short}, @samp{.hword}, @samp{.int}, 51440a403fSchristos@samp{.word}, @samp{.long}, @samp{.quad} and @samp{.octa} pseudo-ops. 52440a403fSchristos 53440a403fSchristos@cindex @samp{-mlittle-endian} 54440a403fSchristos@item -mlittle-endian 55440a403fSchristosThis option controls the ABI and indicates to use a little-endian data 56440a403fSchristosABI. It has no effect on the assembled instructions, but it does 57440a403fSchristosinfluence the behaviour of the @samp{.short}, @samp{.hword}, @samp{.int}, 58440a403fSchristos@samp{.word}, @samp{.long}, @samp{.quad} and @samp{.octa} pseudo-ops. 59440a403fSchristosThis is the default. 60440a403fSchristos 61440a403fSchristos@cindex @samp{-muse-conventional-section-names} 62440a403fSchristos@item -muse-conventional-section-names 63440a403fSchristosThis option controls the default names given to the code (.text), 64440a403fSchristosinitialised data (.data) and uninitialised data sections (.bss). 65440a403fSchristos 66440a403fSchristos@cindex @samp{-muse-renesas-section-names} 67440a403fSchristos@item -muse-renesas-section-names 68440a403fSchristosThis option controls the default names given to the code (.P), 69440a403fSchristosinitialised data (.D_1) and uninitialised data sections (.B_1). 70440a403fSchristosThis is the default. 71440a403fSchristos 72440a403fSchristos@cindex @samp{-msmall-data-limit} 73440a403fSchristos@item -msmall-data-limit 74440a403fSchristosThis option tells the assembler that the small data limit feature of 75440a403fSchristosthe RX port of GCC is being used. This results in the assembler 76440a403fSchristosgenerating an undefined reference to a symbol called @code{__gp} for 77440a403fSchristosuse by the relocations that are needed to support the small data limit 78440a403fSchristosfeature. This option is not enabled by default as it would otherwise 79440a403fSchristospollute the symbol table. 80440a403fSchristos 81440a403fSchristos@cindex @samp{-mpid} 82440a403fSchristos@item -mpid 83440a403fSchristosThis option tells the assembler that the position independent data of the 84440a403fSchristosRX port of GCC is being used. This results in the assembler 85440a403fSchristosgenerating an undefined reference to a symbol called @code{__pid_base}, 86440a403fSchristosand also setting the RX_PID flag bit in the e_flags field of the ELF 87440a403fSchristosheader of the object file. 88440a403fSchristos 89440a403fSchristos@cindex @samp{-mint-register} 90440a403fSchristos@item -mint-register=@var{num} 91440a403fSchristosThis option tells the assembler how many registers have been reserved 92440a403fSchristosfor use by interrupt handlers. This is needed in order to compute the 93440a403fSchristoscorrect values for the @code{%gpreg} and @code{%pidreg} meta registers. 94440a403fSchristos 95440a403fSchristos@cindex @samp{-mgcc-abi} 96440a403fSchristos@item -mgcc-abi 97440a403fSchristosThis option tells the assembler that the old GCC ABI is being used by 98440a403fSchristosthe assembled code. With this version of the ABI function arguments 99440a403fSchristosthat are passed on the stack are aligned to a 32-bit boundary. 100440a403fSchristos 101440a403fSchristos@cindex @samp{-mrx-abi} 102440a403fSchristos@item -mrx-abi 103440a403fSchristosThis option tells the assembler that the official RX ABI is being used 104440a403fSchristosby the assembled code. With this version of the ABI function 105440a403fSchristosarguments that are passed on the stack are aligned to their natural 106440a403fSchristosalignments. This option is the default. 107440a403fSchristos 108440a403fSchristos@cindex @samp{-mcpu=} 109440a403fSchristos@item -mcpu=@var{name} 110440a403fSchristosThis option tells the assembler the target CPU type. Currently the 111*b88e3e88Schristos@code{rx100}, @code{rx200}, @code{rx600}, @code{rx610}, @code{rxv2}, 112*b88e3e88Schristos@code{rxv3} and @code{rxv3-dfpu} are recognised as valid cpu names. 113*b88e3e88SchristosAttempting to assemble an instructionnot supported by the indicated 114*b88e3e88Schristoscpu type will result in an error message being generated. 115440a403fSchristos 116440a403fSchristos@cindex @samp{-mno-allow-string-insns} 117440a403fSchristos@item -mno-allow-string-insns 118440a403fSchristosThis option tells the assembler to mark the object file that it is 119440a403fSchristosbuilding as one that does not use the string instructions 120440a403fSchristos@code{SMOVF}, @code{SCMPU}, @code{SMOVB}, @code{SMOVU}, @code{SUNTIL} 121440a403fSchristos@code{SWHILE} or the @code{RMPA} instruction. In addition the mark 122440a403fSchristostells the linker to complain if an attempt is made to link the binary 123440a403fSchristoswith another one that does use any of these instructions. 124440a403fSchristos 125440a403fSchristosNote - the inverse of this option, @code{-mallow-string-insns}, is 126440a403fSchristosnot needed. The assembler automatically detects the use of the 127440a403fSchristosthe instructions in the source code and labels the resulting 128440a403fSchristosobject file appropriately. If no string instructions are detected 129440a403fSchristosthen the object file is labelled as being one that can be linked with 130440a403fSchristoseither string-using or string-banned object files. 131440a403fSchristos@end table 132440a403fSchristos 133440a403fSchristos@node RX-Modifiers 134440a403fSchristos@section Symbolic Operand Modifiers 135440a403fSchristos 136440a403fSchristos@cindex RX modifiers 137440a403fSchristos@cindex syntax, RX 138440a403fSchristos@cindex %gp 139440a403fSchristos 140440a403fSchristosThe assembler supports one modifier when using symbol addresses 141440a403fSchristosin RX instruction operands. The general syntax is the following: 142440a403fSchristos 143440a403fSchristos@smallexample 144440a403fSchristos%gp(symbol) 145440a403fSchristos@end smallexample 146440a403fSchristos 147440a403fSchristosThe modifier returns the offset from the @var{__gp} symbol to the 148440a403fSchristosspecified symbol as a 16-bit value. The intent is that this offset 149440a403fSchristosshould be used in a register+offset move instruction when generating 150440a403fSchristosreferences to small data. Ie, like this: 151440a403fSchristos 152440a403fSchristos@smallexample 153440a403fSchristos mov.W %gp(_foo)[%gpreg], r1 154440a403fSchristos@end smallexample 155440a403fSchristos 156440a403fSchristosThe assembler also supports two meta register names which can be used 157440a403fSchristosto refer to registers whose values may not be known to the 158440a403fSchristosprogrammer. These meta register names are: 159440a403fSchristos 160440a403fSchristos@table @code 161440a403fSchristos 162440a403fSchristos@cindex @samp{%gpreg} 163440a403fSchristos@item %gpreg 164440a403fSchristosThe small data address register. 165440a403fSchristos 166440a403fSchristos@cindex @samp{%pidreg} 167440a403fSchristos@item %pidreg 168440a403fSchristosThe PID base address register. 169440a403fSchristos 170440a403fSchristos@end table 171440a403fSchristos 172440a403fSchristosBoth registers normally have the value r13, but this can change if 173440a403fSchristossome registers have been reserved for use by interrupt handlers or if 174440a403fSchristosboth the small data limit and position independent data features are 175440a403fSchristosbeing used at the same time. 176440a403fSchristos 177440a403fSchristos@node RX-Directives 178440a403fSchristos@section Assembler Directives 179440a403fSchristos 180440a403fSchristos@cindex assembler directives, RX 181440a403fSchristos@cindex RX assembler directives 182440a403fSchristos 183440a403fSchristosThe RX version of @code{@value{AS}} has the following specific 184440a403fSchristosassembler directives: 185440a403fSchristos 186440a403fSchristos@table @code 187440a403fSchristos 188440a403fSchristos@item .3byte 189440a403fSchristos@cindex assembler directive .3byte, RX 190440a403fSchristos@cindex RX assembler directive .3byte 191440a403fSchristosInserts a 3-byte value into the output file at the current location. 192440a403fSchristos 193440a403fSchristos@item .fetchalign 194440a403fSchristos@cindex assembler directive .fetchalign, RX 195440a403fSchristos@cindex RX assembler directive .fetchalign 196440a403fSchristosIf the next opcode following this directive spans a fetch line 197440a403fSchristosboundary (8 byte boundary), the opcode is aligned to that boundary. 198440a403fSchristosIf the next opcode does not span a fetch line, this directive has no 199440a403fSchristoseffect. Note that one or more labels may be between this directive 200440a403fSchristosand the opcode; those labels are aligned as well. Any inserted bytes 201440a403fSchristosdue to alignment will form a NOP opcode. 202440a403fSchristos 203440a403fSchristos@end table 204440a403fSchristos 205440a403fSchristos@node RX-Float 206440a403fSchristos@section Floating Point 207440a403fSchristos 208440a403fSchristos@cindex floating point, RX 209440a403fSchristos@cindex RX floating point 210440a403fSchristos 211440a403fSchristosThe floating point formats generated by directives are these. 212440a403fSchristos 213440a403fSchristos@table @code 214440a403fSchristos@cindex @code{float} directive, RX 215440a403fSchristos 216440a403fSchristos@item .float 217440a403fSchristos@code{Single} precision (32-bit) floating point constants. 218440a403fSchristos 219440a403fSchristos@cindex @code{double} directive, RX 220440a403fSchristos@item .double 221*b88e3e88SchristosIf the @option{-m64bit-doubles} command-line option has been specified 222440a403fSchristosthen then @code{double} directive generates @code{double} precision 223440a403fSchristos(64-bit) floating point constants, otherwise it generates 224440a403fSchristos@code{single} precision (32-bit) floating point constants. To force 225440a403fSchristosthe generation of 64-bit floating point constants used the @code{dc.d} 226440a403fSchristosdirective instead. 227440a403fSchristos 228440a403fSchristos@end table 229440a403fSchristos 230440a403fSchristos@node RX-Syntax 231440a403fSchristos@section Syntax for the RX 232440a403fSchristos@menu 233440a403fSchristos* RX-Chars:: Special Characters 234440a403fSchristos@end menu 235440a403fSchristos 236440a403fSchristos@node RX-Chars 237440a403fSchristos@subsection Special Characters 238440a403fSchristos 239440a403fSchristos@cindex line comment character, RX 240440a403fSchristos@cindex RX line comment character 241440a403fSchristosThe presence of a @samp{;} appearing anywhere on a line indicates the 242440a403fSchristosstart of a comment that extends to the end of that line. 243440a403fSchristos 244440a403fSchristosIf a @samp{#} appears as the first character of a line then the whole 245440a403fSchristosline is treated as a comment, but in this case the line can also be a 246440a403fSchristoslogical line number directive (@pxref{Comments}) or a preprocessor 247440a403fSchristoscontrol command (@pxref{Preprocessing}). 248440a403fSchristos 249440a403fSchristos@cindex line separator, RX 250440a403fSchristos@cindex statement separator, RX 251440a403fSchristos@cindex RX line separator 252440a403fSchristosThe @samp{!} character can be used to separate statements on the same 253440a403fSchristosline. 254