c-tic54x.texi

来自「基于4个mips核的noc设计」· TEXI 代码 · 共 767 行 · 第 1/2 页

TEXI
767
字号
@c Copyright 1999, 2000 Free Software Foundation, Inc.@c This is part of the GAS manual.@c For copying conditions, see the file as.texinfo.@c TI TMS320C54X description by Timothy Wall, twall@cygnus.com@ifset GENERIC@page@node C54X-Dependent@chapter C54X Dependent Features@end ifset@ifclear GENERIC@node Machine Dependencies@chapter C54X Dependent Features@end ifclear@cindex C54X support@menu* C54X-Opts::              Command-line Options* C54X-Block::             Blocking* C54X-Env::               Environment Settings* C54X-Constants::         Constants Syntax* C54X-Subsyms::           String Substitution* C54X-Locals::            Local Label Syntax* C54X-Builtins::          Builtin Assembler Math Functions* C54X-Ext::               Extended Addressing Support* C54X-Directives::        Directives* C54X-Macros::            Macro Features* C54X-MMRegs::            Memory-mapped Registers@end menu@node C54X-Opts@section Options@cindex options, C54X@cindex C54X optionsThe 'c54x version of @code{@value{AS}} has a few machine-dependent options.@cindex @samp{-mfar-mode} option, far-mode@cindex @samp{-mf} option, far-modeYou can use the @samp{-mfar-mode} option to enable extended addressing mode.All addresses will be assumed to be > 16 bits, and the appropriaterelocation types will be used.  This option is equivalent to using the@samp{.far_mode} directive in the assembly code.  If you do not use the@samp{-mfar-mode} option, all references will be assumed to be 16 bits.  This option may be abbreviated to @samp{-mf}.@cindex @samp{-mcpu} option, cpuYou can use the @samp{-mcpu} option to specify a particular CPU.This option is equivalent to using the @samp{.version} directive in theassembly code.  For recognized CPU codes, see@xref{C54X-Directives,,@code{.version}}.  The default CPU version is@samp{542}.   @cindex @samp{-merrors-to-file} option, stderr redirect@cindex @samp{-me} option, stderr redirectYou can use the @samp{-merrors-to-file} option to redirect error outputto a file (this provided for those deficient environments which don'tprovide adequate output redirection).  This option may be abbreviated to@samp{-me}. @node C54X-Block@section BlockingA blocked section or memory block is guaranteed not to cross the blockingboundary (usually a page, or 128 words) if it is smaller than theblocking size, or to start on a page boundary if it is larger than theblocking size.@node C54X-Env@section Environment Settings@cindex environment settings, C54X@cindex @samp{A_DIR} environment variable, C54X@cindex @samp{C54XDSP_DIR} environment variable, C54X@samp{C54XDSP_DIR} and @samp{A_DIR} are semicolon-separatedpaths which are added to the list of directories normally searched forsource and include files.  @samp{C54XDSP_DIR} will override @samp{A_DIR}.@node C54X-Constants@section Constants Syntax@cindex constants, C54XThe C54X version of @code{@value{AS}} allows the following additionalconstant formats, using a suffix to indicate the radix:@smallexample@cindex binary constants, C54XBinary                  @code{000000B, 011000b}Octal                   @code{10Q, 224q}Hexadecimal             @code{45h, 0FH}@end smallexample@node C54X-Subsyms@section String SubstitutionA subset of allowable symbols (which we'll call subsyms) may be assignedarbitrary string values.  This is roughly equivalent to C preprocessor#define macros.  When @code{@value{AS}} encounters one of thesesymbols, the symbol is replaced in the input stream by its string value.Subsym names @strong{must} begin with a letter. Subsyms may be defined using the @code{.asg} and @code{.eval} directives(@xref{C54X-Directives,,@code{.asg}},@xref{C54X-Directives,,@code{.eval}}. Expansion is recursive until a previously encountered symbol is seen, atwhich point substitution stops.  In this example, x is replaced with SYM2; SYM2 is replaced with SYM1, and SYM1is replaced with x.  At this point, x has already been encounteredand the substitution stops.@smallexample @code .asg   "x",SYM1  .asg   "SYM1",SYM2 .asg   "SYM2",x add    x,a             ; final code assembled is "add  x, a"@end smallexampleMacro parameters are converted to subsyms; a side effect of this is the normal@code{@value{AS}} '\ARG' dereferencing syntax is unnecessary.  Subsymsdefined within a macro will have global scope, unless the @code{.var}directive is used to identify the subsym as a local macro variable@pxref{C54X-Directives,,@code{.var}}.Substitution may be forced in situations where replacement might beambiguous by placing colons on either side of the subsym.  The followingcode: @smallexample @code .eval  "10",xLAB:X:  add     #x, a@end smallexampleWhen assembled becomes:@smallexample @codeLAB10  add     #10, a@end smallexampleSmaller parts of the string assigned to a subsym may be accessed withthe following syntax:@table @code@item @code{:@var{symbol}(@var{char_index}):}Evaluates to a single-character string, the character at @var{char_index}.@item @code{:@var{symbol}(@var{start},@var{length}):}Evaluates to a substring of @var{symbol} beginning at @var{start} withlength @var{length}.@end table@node C54X-Locals@section Local LabelsLocal labels may be defined in two ways:@itemize @bullet@item$N, where N is a decimal number between 0 and 9@itemLABEL?, where LABEL is any legal symbol name.  @end itemizeLocal labels thus defined may be redefined or automatically generated.The scope of a local label is based on when it may be undefined or reset.This happens when one of the following situations is encountered:@itemize @bullet@item.newblock directive @pxref{C54X-Directives,,@code{.newblock}}@itemThe current section is changed (.sect, .text, or .data)@itemEntering or leaving an included file@itemThe macro scope where the label was defined is exited@end itemize@node C54X-Builtins@section Math Builtins@cindex math builtins, C54X@cindex C54X builtin math functions@cindex builtin math functions, C54XThe following built-in functions may be used to generate afloating-point value.  All return a floating-point value except@samp{$cvi}, @samp{$int}, and @samp{$sgn}, which return an integervalue. @table @code@cindex @code{$acos} math builtin, C54X@item @code{$acos(@var{expr})}Returns the floating point arccosine of @var{expr}.@cindex @code{$asin} math builtin, C54X@item @code{$asin(@var{expr})}Returns the floating point arcsine of @var{expr}.@cindex @code{$atan} math builtin, C54X@item @code{$atan(@var{expr})}Returns the floating point arctangent of @var{expr}.@cindex @code{$atan2} math builtin, C54X@item @code{$atan2(@var{expr1},@var{expr2})}Returns the floating point arctangent of @var{expr1} / @var{expr2}.@cindex @code{$ceil} math builtin, C54X@item @code{$ceil(@var{expr})}Returns the smallest integer not less than @var{expr} as floating point.@cindex @code{$cosh} math builtin, C54X@item @code{$cosh(@var{expr})}Returns the floating point hyperbolic cosine of @var{expr}.@cindex @code{$cos} math builtin, C54X@item @code{$cos(@var{expr})}Returns the floating point cosine of @var{expr}.@cindex @code{$cvf} math builtin, C54X@item @code{$cvf(@var{expr})}Returns the integer value @var{expr} converted to floating-point.@cindex @code{$cvi} math builtin, C54X@item @code{$cvi(@var{expr})}Returns the floating point value @var{expr} converted to integer.@cindex @code{$exp} math builtin, C54X@item @code{$exp(@var{expr})}Returns the floating point value e ^ @var{expr}.@cindex @code{$fabs} math builtin, C54X@item @code{$fabs(@var{expr})}Returns the floating point absolute value of @var{expr}.@cindex @code{$floor} math builtin, C54X@item @code{$floor(@var{expr})}Returns the largest integer that is not greater than @var{expr} asfloating point.@cindex @code{$fmod} math builtin, C54X@item @code{$fmod(@var{expr1},@var{expr2})}Returns the floating point remainder of @var{expr1} / @var{expr2}.@cindex @code{$int} math builtin, C54X@item @code{$int(@var{expr})}Returns 1 if @var{expr} evaluates to an integer, zero otherwise.@cindex @code{$ldexp} math builtin, C54X@item @code{$ldexp(@var{expr1},@var{expr2})}Returns the floating point value @var{expr1} * 2 ^ @var{expr2}.@cindex @code{$log10} math builtin, C54X@item @code{$log10(@var{expr})}Returns the base 10 logarithm of @var{expr}.@cindex @code{$log} math builtin, C54X@item @code{$log(@var{expr})}Returns the natural logarithm of @var{expr}.@cindex @code{$max} math builtin, C54X@item @code{$max(@var{expr1},@var{expr2})}Returns the floating point maximum of @var{expr1} and @var{expr2}.@cindex @code{$min} math builtin, C54X@item @code{$min(@var{expr1},@var{expr2})}Returns the floating point minimum of @var{expr1} and @var{expr2}.@cindex @code{$pow} math builtin, C54X@item @code{$pow(@var{expr1},@var{expr2})}Returns the floating point value @var{expr1} ^ @var{expr2}.@cindex @code{$round} math builtin, C54X@item @code{$round(@var{expr})}Returns the nearest integer to @var{expr} as a floating point number.@cindex @code{$sgn} math builtin, C54X@item @code{$sgn(@var{expr})}Returns -1, 0, or 1 based on the sign of @var{expr}.@cindex @code{$sin} math builtin, C54X@item @code{$sin(@var{expr})}Returns the floating point sine of @var{expr}.@cindex @code{$sinh} math builtin, C54X@item @code{$sinh(@var{expr})}Returns the floating point hyperbolic sine of @var{expr}.@cindex @code{$sqrt} math builtin, C54X@item @code{$sqrt(@var{expr})}Returns the floating point square root of @var{expr}.@cindex @code{$tan} math builtin, C54X@item @code{$tan(@var{expr})}Returns the floating point tangent of @var{expr}.@cindex @code{$tanh} math builtin, C54X@item @code{$tanh(@var{expr})}Returns the floating point hyperbolic tangent of @var{expr}.@cindex @code{$trunc} math builtin, C54X@item @code{$trunc(@var{expr})}Returns the integer value of @var{expr} truncated towards zero asfloating point.@end table@node C54X-Ext@section Extended AddressingThe @code{LDX} pseudo-op is provided for loading the extended addressing bitsof a label or address.  For example, if an address @code{_label} residesin extended program memory, the value of @code{_label} may be loaded asfollows:@smallexample @code ldx     #_label,16,a    ; loads extended bits of _label or      #_label,a       ; loads lower 16 bits of _label bacc    a               ; full address is in accumulator A@end smallexample@node C54X-Directives@section Directives@cindex machine directives, C54X@cindex C54X machine directives@table @code@cindex @code{align} directive, C54X@cindex @code{even} directive, C54X@item .align [@var{size}]@itemx .evenAlign the section program counter on the next boundary, based on@var{size}.  @var{size} may be any power of 2.  @code{.even} isequivalent to @code{.align} with a @var{size} of 2.@table @code@item 1Align SPC to word boundary@item 2Align SPC to longword boundary (same as .even)@item 128       Align SPC to page boundary@end table@cindex @code{asg} directive, C54X@item .asg @var{string}, @var{name}Assign @var{name} the string @var{string}.  String replacement isperformed on @var{string} before assignment.@cindex @code{eval} directive, C54X@itemx .eval @var{string}, @var{name}Evaluate the contents of string @var{string} and assign the result as astring to the subsym @var{name}.  String replacement is performed on@var{string} before assignment. @cindex @code{bss} directive, C54X@item .bss @var{symbol}, @var{size} [, [@var{blocking_flag}] [,@var{alignment_flag}]]Reserve space for @var{symbol} in the .bss section.  @var{size} is inwords.  If present, @var{blocking_flag} indicates the allocated spaceshould be aligned on a page boundary if it would otherwise cross a pageboundary.  If present, @var{alignment_flag} causes the assembler toallocate @var{size} on a long word boundary.@cindex @code{byte} directive, C54X@cindex @code{ubyte} directive, C54X@cindex @code{char} directive, C54X@cindex @code{uchar} directive, C54X@item .byte @var{value} [,...,@var{value_n}]@itemx .ubyte @var{value} [,...,@var{value_n}]@itemx .char @var{value} [,...,@var{value_n}]@itemx .uchar @var{value} [,...,@var{value_n}]Place one or more bytes into consecutive words of the current section.The upper 8 bits of each word is zero-filled.  If a label is used, itpoints to the word allocated for the first byte encountered.@cindex @code{clink} directive, C54X@item .clink ["@var{section_name}"]Set STYP_CLINK flag for this section, which indicates to the linker thatif no symbols from this section are referenced, the section should notbe included in the link.  If @var{section_name} is omitted, the currentsection is used.@cindex @code{c_mode} directive, C54X@item .c_modeTBD.@cindex @code{copy} directive, C54X@item .copy "@var{filename}" | @var{filename}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?