📄 c-vax.texi
字号:
@c Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1998@c Free Software Foundation, Inc.@c This is part of the GAS manual.@c For copying conditions, see the file as.texinfo.@c VAX/VMS description exhanced and corrected by Klaus K"aempf, kkaempf@progis.de@ifset GENERIC@node Vax-Dependent@chapter VAX Dependent Features@cindex VAX support@end ifset@ifclear GENERIC@node Machine Dependencies@chapter VAX Dependent Features@cindex VAX support@end ifclear@menu* VAX-Opts:: VAX Command-Line Options* VAX-float:: VAX Floating Point* VAX-directives:: Vax Machine Directives* VAX-opcodes:: VAX Opcodes* VAX-branch:: VAX Branch Improvement* VAX-operands:: VAX Operands* VAX-no:: Not Supported on VAX@end menu@node VAX-Opts@section VAX Command-Line Options@cindex command-line options ignored, VAX@cindex VAX command-line options ignoredThe Vax version of @code{@value{AS}} accepts any of the following options,gives a warning message that the option was ignored and proceeds.These options are for compatibility with scripts designed for otherpeople's assemblers.@table @code@cindex @code{-D}, ignored on VAX@cindex @code{-S}, ignored on VAX@cindex @code{-T}, ignored on VAX@item @code{-D} (Debug)@itemx @code{-S} (Symbol Table)@itemx @code{-T} (Token Trace)These are obsolete options used to debug old assemblers.@cindex @code{-d}, VAX option@item @code{-d} (Displacement size for JUMPs)This option expects a number following the @samp{-d}. Like optionsthat expect filenames, the number may immediately follow the@samp{-d} (old standard) or constitute the whole of the command lineargument that follows @samp{-d} (@sc{gnu} standard).@cindex @code{-V}, redundant on VAX@item @code{-V} (Virtualize Interpass Temporary File)Some other assemblers use a temporary file. This optioncommanded them to keep the information in active memory ratherthan in a disk file. @code{@value{AS}} always does this, so thisoption is redundant.@cindex @code{-J}, ignored on VAX@item @code{-J} (JUMPify Longer Branches)Many 32-bit computers permit a variety of branch instructionsto do the same job. Some of these instructions are short (andfast) but have a limited range; others are long (and slow) butcan branch anywhere in virtual memory. Often there are 3flavors of branch: short, medium and long. Some otherassemblers would emit short and medium branches, unless told bythis option to emit short and long branches.@cindex @code{-t}, ignored on VAX@item @code{-t} (Temporary File Directory)Some other assemblers may use a temporary file, and this optiontakes a filename being the directory to site the temporaryfile. Since @code{@value{AS}} does not use a temporary disk file, thisoption makes no difference. @samp{-t} needs exactly onefilename.@end table@cindex VMS (VAX) options@cindex options for VAX/VMS@cindex VAX/VMS options@cindex Vax-11 C compatibility@cindex symbols with uppercase, VAX/VMSThe Vax version of the assembler accepts additional options whencompiled for VMS:@table @samp@cindex @samp{-h} option, VAX/VMS@item -h @var{n}External symbol or section (used for global variables) names are notcase sensitive on VAX/VMS and always mapped to upper case. This iscontrary to the C language definition which explicitly distinguishesupper and lower case. To implement a standard conforming C compiler,names must be changed (mapped) to preserve the case information. Thedefault mapping is to convert all lower case characters to uppercase andadding an underscore followed by a 6 digit hex value, representing a 24digit binary value. The one digits in the binary value represent whichcharacters are uppercase in the original symbol name.The @samp{-h @var{n}} option determines how we map names. This takesseveral values. No @samp{-h} switch at all allows case hacking asdescribed above. A value of zero (@samp{-h0}) implies names should beupper case, and inhibits the case hack. A value of 2 (@samp{-h2})implies names should be all lower case, with no case hack. A value of 3(@samp{-h3}) implies that case should be preserved. The value 1 isunused. The @code{-H} option directs @code{@value{AS}} to displayevery mapped symbol during assembly.Symbols whose names include a dollar sign @samp{$} are exceptions to thegeneral name mapping. These symbols are normally only used to referenceVMS library names. Such symbols are always mapped to upper case.@cindex @samp{-+} option, VAX/VMS@item -+The @samp{-+} option causes @code{@value{AS}} to truncate any symbolname larger than 31 characters. The @samp{-+} option also prevents somecode following the @samp{_main} symbol normally added to make the objectfile compatible with Vax-11 "C".@cindex @samp{-1} option, VAX/VMS@item -1This option is ignored for backward compatibility with @code{@value{AS}}version 1.x.@cindex @samp{-H} option, VAX/VMS@item -HThe @samp{-H} option causes @code{@value{AS}} to print every symbolwhich was changed by case mapping.@end table@node VAX-float@section VAX Floating Point@cindex VAX floating point@cindex floating point, VAXConversion of flonums to floating point is correct, andcompatible with previous assemblers. Rounding istowards zero if the remainder is exactly half the least significant bit.@code{D}, @code{F}, @code{G} and @code{H} floating point formatsare understood.Immediate floating literals (@emph{e.g.} @samp{S`$6.9})are rendered correctly. Again, rounding is towards zero in theboundary case.@cindex @code{float} directive, VAX@cindex @code{double} directive, VAXThe @code{.float} directive produces @code{f} format numbers.The @code{.double} directive produces @code{d} format numbers.@node VAX-directives@section Vax Machine Directives@cindex machine directives, VAX@cindex VAX machine directivesThe Vax version of the assembler supports four directives forgenerating Vax floating point constants. They are described in thetable below.@cindex wide floating point directives, VAX@table @code@cindex @code{dfloat} directive, VAX@item .dfloatThis expects zero or more flonums, separated by commas, andassembles Vax @code{d} format 64-bit floating point constants.@cindex @code{ffloat} directive, VAX@item .ffloatThis expects zero or more flonums, separated by commas, andassembles Vax @code{f} format 32-bit floating point constants.@cindex @code{gfloat} directive, VAX@item .gfloatThis expects zero or more flonums, separated by commas, andassembles Vax @code{g} format 64-bit floating point constants.@cindex @code{hfloat} directive, VAX@item .hfloatThis expects zero or more flonums, separated by commas, andassembles Vax @code{h} format 128-bit floating point constants.@end table@node VAX-opcodes@section VAX Opcodes@cindex VAX opcode mnemonics@cindex opcode mnemonics, VAX@cindex mnemonics for opcodes, VAXAll DEC mnemonics are supported. Beware that @code{case@dots{}}instructions have exactly 3 operands. The dispatch table thatfollows the @code{case@dots{}} instruction should be made with@code{.word} statements. This is compatible with all unixassemblers we know of.@node VAX-branch@section VAX Branch Improvement@cindex VAX branch improvement@cindex branch improvement, VAX@cindex pseudo-ops for branch, VAXCertain pseudo opcodes are permitted. They are for branchinstructions. They expand to the shortest branch instruction thatreaches the target. Generally these mnemonics are made bysubstituting @samp{j} for @samp{b} at the start of a DEC mnemonic.This feature is included both for compatibility and to helpcompilers. If you do not need this feature, avoid theseopcodes. Here are the mnemonics, and the code they can expand into.@table @code@item jbsb@samp{Jsb} is already an instruction mnemonic, so we chose @samp{jbsb}.@table @asis@item (byte displacement)@kbd{bsbb @dots{}}@item (word displacement)@kbd{bsbw @dots{}}@item (long displacement)@kbd{jsb @dots{}}@end table@item jbr@itemx jrUnconditional branch.@table @asis@item (byte displacement)@kbd{brb @dots{}}@item (word displacement)@kbd{brw @dots{}}@item (long displacement)@kbd{jmp @dots{}}@end table@item j@var{COND}@var{COND} may be any one of the conditional branches@code{neq}, @code{nequ}, @code{eql}, @code{eqlu}, @code{gtr},@code{geq}, @code{lss}, @code{gtru}, @code{lequ}, @code{vc}, @code{vs},@code{gequ}, @code{cc}, @code{lssu}, @code{cs}.@var{COND} may also be one of the bit tests@code{bs}, @code{bc}, @code{bss}, @code{bcs}, @code{bsc}, @code{bcc},@code{bssi}, @code{bcci}, @code{lbs}, @code{lbc}.@var{NOTCOND} is the opposite condition to @var{COND}.@table @asis@item (byte displacement)@kbd{b@var{COND} @dots{}}@item (word displacement)@kbd{b@var{NOTCOND} foo ; brw @dots{} ; foo:}@item (long displacement)@kbd{b@var{NOTCOND} foo ; jmp @dots{} ; foo:}@end table@item jacb@var{X}@var{X} may be one of @code{b d f g h l w}.@table @asis@item (word displacement)@kbd{@var{OPCODE} @dots{}}@item (long displacement)@example@var{OPCODE} @dots{}, foo ;brb bar ;foo: jmp @dots{} ;bar:@end example@end table@item jaob@var{YYY}@var{YYY} may be one of @code{lss leq}.@item jsob@var{ZZZ}@var{ZZZ} may be one of @code{geq gtr}.@table @asis@item (byte displacement)@kbd{@var{OPCODE} @dots{}}@item (word displacement)@example@var{OPCODE} @dots{}, foo ;brb bar ;foo: brw @var{destination} ;bar:@end example@item (long displacement)@example@var{OPCODE} @dots{}, foo ;brb bar ;foo: jmp @var{destination} ;bar:@end example@end table@item aobleq@itemx aoblss@itemx sobgeq@itemx sobgtr@table @asis@item (byte displacement)@kbd{@var{OPCODE} @dots{}}@item (word displacement)@example@var{OPCODE} @dots{}, foo ;brb bar ;foo: brw @var{destination} ;bar:@end example@item (long displacement)@example@var{OPCODE} @dots{}, foo ;brb bar ;foo: jmp @var{destination} ;bar:@end example@end table@end table@node VAX-operands@section VAX Operands@cindex VAX operand notation@cindex operand notation, VAX@cindex immediate character, VAX@cindex VAX immediate characterThe immediate character is @samp{$} for Unix compatibility, not@samp{#} as DEC writes it.@cindex indirect character, VAX@cindex VAX indirect characterThe indirect character is @samp{*} for Unix compatibility, not@samp{@@} as DEC writes it.@cindex displacement sizing character, VAX@cindex VAX displacement sizing characterThe displacement sizing character is @samp{`} (an accent grave) forUnix compatibility, not @samp{^} as DEC writes it. The letterpreceding @samp{`} may have either case. @samp{G} is notunderstood, but all other letters (@code{b i l s w}) are understood.@cindex register names, VAX@cindex VAX register namesRegister names understood are @code{r0 r1 r2 @dots{} r15 ap fp sppc}. Upper and lower case letters are equivalent.For instance@smallexampletstb *w`$4(r5)@end smallexampleAny expression is permitted in an operand. Operands are commaseparated.@c There is some bug to do with recognizing expressions@c in operands, but I forget what it is. It is@c a syntax clash because () is used as an address mode@c and to encapsulate sub-expressions.@node VAX-no@section Not Supported on VAX@cindex VAX bitfields not supported@cindex bitfields, not supported on VAXVax bit fields can not be assembled with @code{@value{AS}}. Someonecan add the required code if they really need it.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -