📄 c-m68hc11.texi
字号:
@c Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 2000@c Free Software Foundation, Inc.@c This is part of the GAS manual.@c For copying conditions, see the file as.texinfo.@ifset GENERIC@page@node M68HC11-Dependent@chapter M68HC11 and M68HC12 Dependent Features@end ifset@ifclear GENERIC@node Machine Dependencies@chapter M68HC11 and M68HC12 Dependent Features@end ifclear@cindex M68HC11 and M68HC12 support@menu* M68HC11-Opts:: M68HC11 and M68HC12 Options* M68HC11-Syntax:: Syntax* M68HC11-Float:: Floating Point* M68HC11-opcodes:: Opcodes@end menu@node M68HC11-Opts@section M68HC11 and M68HC12 Options@cindex options, M68HC11@cindex M68HC11 optionsThe Motorola 68HC11 and 68HC12 version of @code{@value{AS}} has a few machinedependent options.@cindex @samp{-m68hc11}This option switches the assembler in the M68HC11 mode. In this mode,the assembler only accepts 68HC11 operands and mnemonics. It producescode for the 68HC11.@cindex @samp{-m68hc12}This option switches the assembler in the M68HC12 mode. In this mode,the assembler also accepts 68HC12 operands and mnemonics. It producescode for the 68HC12. A fiew 68HC11 instructions are replaced bysome 68HC12 instructions as recommended by Motorola specifications.@cindex @samp{--strict-direct-mode}You can use the @samp{--strict-direct-mode} option to disablethe automatic translation of direct page mode addressing intoextended mode when the instruction does not support direct mode.For example, the @samp{clr} instruction does not support direct pagemode addressing. When it is used with the direct page mode,@code{@value{AS}} will ignore it and generate an absolute addressing.This option prevents @code{@value{AS}} from doing this, and the wrongusage of the direct page mode will raise an error.@cindex @samp{--short-branchs}The @samp{--short-branchs} option turns off the translation ofrelative branches into absolute branches when the branch offset isout of range. By default @code{@value{AS}} transforms the relativebranch (@samp{bsr}, @samp{bgt}, @samp{bge}, @samp{beq}, @samp{bne},@samp{ble}, @samp{blt}, @samp{bhi}, @samp{bcc}, @samp{bls},@samp{bcs}, @samp{bmi}, @samp{bvs}, @samp{bvs}, @samp{bra}) intoan absolute branch when the offset is out of the -128 .. 127 range.In that case, the @samp{bsr} instruction is translated into a@samp{jsr}, the @samp{bra} instruction is translated into a@samp{jmp} and the conditional branchs instructions are inverted andfollowed by a @samp{jmp}. This option disables these translationsand @code{@value{AS}} will generate an error if a relative branchis out of range. This option does not affect the optimizationassociated to the @samp{jbra}, @samp{jbsr} and @samp{jbXX} pseudo opcodes.@cindex @samp{--force-long-branchs}The @samp{--force-long-branchs} option forces the translation ofrelative branches into absolute branches. This option does not affectthe optimization associated to the @samp{jbra}, @samp{jbsr} and@samp{jbXX} pseudo opcodes. @cindex @samp{--print-insn-syntax}You can use the @samp{--print-insn-syntax} option to obtain thesyntax description of the instruction when an error is detected.@cindex @samp{--print-opcodes}The @samp{--print-opcodes} option prints the list of all theinstructions with their syntax. The first item of each linerepresents the instruction name and the rest of the line indicatesthe possible operands for that instruction. The list is printedin alphabetical order. Once the list is printed @code{@value{AS}}exits.@cindex @samp{--generate-example}The @samp{--generate-example} option is similar to @samp{--print-opcodes}but it generates an example for each instruction instead.@node M68HC11-Syntax@section Syntax@cindex M68HC11 syntax@cindex syntax, M68HC11In the M68HC11 syntax, the instruction name comes first and it maybe followed by one or several operands (up to three). Operands areseparated by comma (@samp{,}). In the normal mode,@code{@value{AS}} will complain if too many operands are specified fora given instruction. In the MRI mode (turned on with @samp{-M} option),it will treat them as comments. Example:@smallexampleinxlda #23bset 2,x #4brclr *bot #8 foo@end smallexample@cindex M68HC11 addressing modes@cindex addressing modes, M68HC11The following addressing modes are understood:@table @dfn@item Immediate@samp{#@var{number}}@item Address Register@samp{@var{number},X}, @samp{@var{number},Y}The @var{number} may be omitted in which case 0 is assumed.@item Direct Addressing mode@samp{*@var{symbol}}, or @samp{*@var{digits}}@item Absolute@samp{@var{symbol}}, or @samp{@var{digits}}@end table@node M68HC11-Float@section Floating Point@cindex floating point, M68HC11@cindex M68HC11 floating pointPacked decimal (P) format floating literals are not supported.Feel free to add the code!The floating point formats generated by directives are these.@table @code@cindex @code{float} directive, M68HC11@item .float@code{Single} precision floating point constants.@cindex @code{double} directive, M68HC11@item .double@code{Double} precision floating point constants.@cindex @code{extend} directive M68HC11@cindex @code{ldouble} directive M68HC11@item .extend@itemx .ldouble@code{Extended} precision (@code{long double}) floating point constants.@end table@need 2000@node M68HC11-opcodes@section Opcodes@cindex M68HC11 opcodes@cindex opcodes, M68HC11@cindex instruction set, M68HC11@menu* M68HC11-Branch:: Branch Improvement@end menu@node M68HC11-Branch@subsection Branch Improvement@cindex pseudo-opcodes, M68HC11@cindex M68HC11 pseudo-opcodes@cindex branch improvement, M68HC11@cindex M68HC11 branch improvementCertain pseudo opcodes are permitted for branch instructions.They expand to the shortest branch instruction that reach thetarget. Generally these mnemonics are made by prepending @samp{j} tothe start of Motorola mnemonic. These pseudo opcodes are not affectedby the @samp{--short-branchs} or @samp{--force-long-branchs} options.The following table summarizes the pseudo-operations.@smallexample Displacement Width +-------------------------------------------------------------+ | Options | | --short-branchs --force-long-branchs | +--------------------------+----------------------------------+Pseudo-Op |BYTE WORD | BYTE WORD | +--------------------------+----------------------------------+ bsr | bsr <pc-rel> <error> | jsr <abs> | bra | bra <pc-rel> <error> | jmp <abs> | jbsr | bsr <pc-rel> jsr <abs> | bsr <pc-rel> jsr <abs> | jbra | bra <pc-rel> jmp <abs> | bra <pc-rel> jmp <abs> | bXX | bXX <pc-rel> <error> | bNX +3; jmp <abs> | jbXX | bXX <pc-rel> bNX +3; | bXX <pc-rel> bNX +3; jmp <abs> | | jmp <abs> | | +--------------------------+----------------------------------+XX: conditionNX: negative of condition XX@end smallexample@table @code@item jbsr@itemx jbraThese are the simplest jump pseudo-operations; they always map to oneparticular machine instruction, depending on the displacement to thebranch target.@item jb@var{XX}Here, @samp{jb@var{XX}} stands for an entire family of pseudo-operations,where @var{XX} is a conditional branch or condition-code test. The fulllist of pseudo-ops in this family is:@smallexample jbcc jbeq jbge jbgt jbhi jbvs jbpl jblo jbcs jbne jblt jble jbls jbvc jbmi@end smallexampleFor the cases of non-PC relative displacements and long displacements,@code{@value{AS}} issues a longer code fragment in terms of@var{NX}, the opposite condition to @var{XX}. For example, for thenon-PC relative case:@smallexample jb@var{XX} foo@end smallexamplegives@smallexample b@var{NX}s oof jmp foo oof:@end smallexample@end table
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -