unix 汇编语言 GAS

2024-04-08 05:38
文章标签 汇编语言 unix gas

本文主要是介绍unix 汇编语言 GAS,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

    1. .macrocomm
      Beginthe definition of a macro called comm, which takes noarguments.
      .macroplus1 p, p1
      .macroplus1 p p1
      Eitherstatement begins the definition of a macro called plus1,which takestwo
      arguments;within the macro definition, write ‘\p’ or ‘\p1’ toevaluate t
      hearguments.
      .macroreserve_str p1=0 p2
      Beginthe definition of a macro called reserve_str, with two arguments.The fi
      rstargument has a default value, but not the second. After thedefinition is
      complete,you can call the macro either as ‘reserve_str a, b’ (with‘\p1’
      evaluatingto a and ‘\p2’ evaluating to b), or as ‘reserve_str ,b’(with ‘
      \p1’evaluating as the default, in this case ‘0’, and ‘\p2’evaluating to
      b).
      Whenyou call a macro, you can specify the argument values either byposition,
      orby keyword. For example, ‘sum 9,17’ is equivalent to ‘sumto=17, from=9
      .
      .endmMark the end of a macro definition.
      .exitmExit early from the current macro definition.
      \@as maintains a counter of how many macros it has executed in thispseudov-a
      riable;you can copy that number to your output with ‘\@’, but onlywithin a
      macrodefinition.


      7.50.macro
      本命令.macro.endm命令允许您定义宏来生成汇编输出。例如,下面的语句定义了一个宏
      sum
      ,这个宏把一个数字序列放入内存。

      .macrosum from=0, to=5
      .long\from
      .if\to-\from
      sum"(\from+1)",\to
      .endif
      .endm
      使用上述定义,'SUM0,5'语句就等于输入下面的汇编语句:
      .long0
      .long1
      .long2
      .long3
      .long4
      .long5

      .macromacname
      .macromacname macargs...
      开始定义一个名为macname的宏。如果您的宏需要使用参数,则在宏的名字后指定他们的名
      字,参数之间用逗号或空格分隔。您可以为任意的参数提供参数的缺省值,只需要在参数
      后使用“=deflt”,。例如,下列都是合法的宏定义语句:
      .macrocomm
      定义一个名为comm,不使用参数。
      .macroplus1 p, p1
      .macroplus1 pp1
      两个语句都声明要定义一个名为plus1的宏,这个宏需要两个参数,在宏定义体内,使用'
      \p'
      '\p1'来引用参数的值。
      .macroreserve_str p1=0p2
      声明要定义一个名为reserve_str的宏,使用两个参数。第一个参数有缺省值,第二个没有
      缺省值。宏定义完成后,您可以通过‘reserve_stra, b’(宏体中‘\p1’引用a的值,‘
      \p2’
      引用b)或通过‘reserve_str,b’(‘\p1’使用缺省值,在此为‘0’,‘\p2’
      b的值)来调用这个宏。

      当调用一个宏时,您既可以通过位置指定参数值,也可以通过关键字指定参数值。例如,
      sum9,17’
      和‘sumto=17, from=9’是等价的。
      .endm
      标志宏定义体的结束。
      .exitm
      提前从当前宏定义体中退出。
      \@
      这个伪变量其实是as维护的一个计数器,用来统计执行了多少个宏。您可以通过使用\
      @
      把这个数字复制到您的输出中,但仅限于在宏定义体中使用。


      7.51.nolist
      Control(in conjunction with the .list directive) whether or not assemblylist
      ingsare generated. These two directives maintain an internal counter(which i
      szero initially). .list increments the counter, and .nolistdecrements it. As
      semblylistings are generated whenever the counter is greater thanzero.

      7.51.nolist
      控制(和.list命令配合)是否生成汇编列表。这两个命令维护一个内部的计数器(计数器
      初始值为0.list命令增加计数器的值,.nolist减少计数器的值。当计数器的值大与0
      将汇编列表。


      7.52.octa bignums
      Thisdirective expects zero or more bignums, separated by commas. Foreach big
      num,it emits a 16-byte integer.
      Theterm “octa” comes from contexts in which a “word” is twobytes; hence
      octa-wordfor 16 bytes.

      7.52.octabignums
      本命令可以不带参数或多个由逗号分隔开的巨数bignum,针对每个巨数bignum,它生成一个
      16
      个字节的整数。
      术语"octa"来源:word2个字节,故此octa-word16个字节。


      7.53.org new-lc , fill
      Advancethe location counter of the current section to new-lc. new-lc iseithe
      ran absolute expression or an expression with the same section asthe current
      subsection.That is, you can’t use .org to cross sections: if new-lc hasthe
      wrongsection, the .org directive is ignored. To be compatible withformer as
      semblers,if the section of new-lc is absolute, as issues a warning, thenpret
      endsthe section of new-lc is the same as the current subsection.
      .orgmay only increase the location counter, or leave it unchanged; youcannot
      use.org to move the location counter backwards.
      Becauseas tries to assemble programs in one pass, new-lc may not beundefined
      .If you really detest this restriction we eagerly await a chance toshare you
      rimproved assembler.
      Bewarethat the origin is relative to the start of the section, not to thesta
      rtof the subsection. This is compatible with other people’sassemblers.
      Whenthe location counter (of the current subsection) is advanced, theinterve
      ningbytes are filled with fill which should be an absolute expression.If the
      commaand fill are omitted, fill defaults to zero.

      7.53.org new-lc ,fill
      向后移动当前段的位置计数器至new-lcnew-lc要么是一个纯粹的表达式,要么这个表达
      式与当前子段在同一个段中。换句话说,就是您不能使用.org进行段超越。如果new-lc
      向错误的段,则忽略.org命令。为了兼容以前的汇编器,如果new-lc指向一个地址独立的
      段,as发出一个警告,并假定new-lc指向当前子段。
      .org
      仅仅可以增大位置计数器,或者保持位置计数器不变;您不能使用.org命令把位置计
      数器向回移动。
      因为as尽量一次完成程序汇编,所以不能使用未定义的new-lc。如果您厌恶这个限制,我
      们急切期待有机会分享经过您改进的汇编器。
      注意起点相对于段的首地址,而不是子段的首地址。这与其他的汇编器相兼容。
      当(当前语句块)位置计数器到达指定位置,用fill填充该字节,fill必须是纯粹的表达
      式。如果没有给出逗号和fillfill值缺省为0


      7.54.p2align[wl] abs-expr, abs-expr, abs-expr
      Padthe location counter (in the current subsection) to a particularstorage b
      oundary.The first expression_r(which must be absolute) is the number oflow-or
      derzero bits the location counter must have after advancement. Forexample ‘
      .p2align3’ advances the location counter until it a multiple of 8. If thelo
      cationcounter is already a multiple of 8, no change is needed.
      Thesecond expression_r(also absolute) gives the fill value to bestored in the
      paddingbytes. It (and the comma) may be omitted. If it is omitted, thepaddi
      ngbytes are normally zero. However, on some systems, if the sectionis marked
      ascontaining code and the fill value is omitted, the space is filledwith no
      -opinstructions.
      Thethird expression is also absolute, and is also optional. If it ispresent,
      itis the maximum number of bytes that should be skipped by thisalignment di
      rective.If doing the alignment would require skipping more bytes than thespe
      cifiedmaximum, then the alignment is not done at all. You can omit thefill v
      alue(the second argument) entirely by simply using two commas after therequi
      redalignment; this can be useful if you want the alignment to befilled with
      no-opinstructions when appropriate.
      The.p2alignw and .p2alignl directives are variants of the .p2aligndirective.
      The.p2alignw directive treats the fill pattern as a two byte wordvalue. The
      .p2alignldirectives treats the fill pattern as a four byte longword value.F
      orexample, .p2alignw 2,0x368d will align to a multiple of 4. If itskips two
      bytes,they will be filled in with the value 0x368d (the exact placementof th
      ebytes depends upon the endianness of the processor). If it skips 1or 3 byte
      s,the fill value is undefined.

      7.54.p2align[wl] abs-expr, abs-expr,abs-expr
      增加位置计数器(在当前的子段)使它指向规定的存储边界。第一个表达式参数(结果必须是
      纯粹的数字)代表位置计数器移动后,计数器中连续为0的低序位数量。例如‘.align3’
      向后移动位置指针直至8的倍数(指针的最低的3位为0)。如果地址已经是8倍数,则无需
      移动。
      第二个表达式参数(结果必须是纯粹的数字)给出填充字节的值。用这个值填充位置计数器
      越过的地方。这个参数(和逗点)可以省略。如果省略它,填充字节的值通常默认为0。但在
      某些系统上,如果本段标识为包含代码,而填充值被省略,则使用no-op指令填充填充区。

      3个参数表达式的结果也必须是纯粹的数字,这个参数是可选的。如果存在第3个参数,
      它代表本对齐命令允许越过字节数的最大值。如果完成这个对齐需要跳过的字节比指定的
      最大值还多,则根本无法完成对齐。您可以在边界基准后简单地使用两个逗号,以省略填充
      值参数(第二参数);如果您想在适当的时候,对齐操作自动使用no-op指令填充,这个方法
      将非常奏效。
      .p2alignw
      .p2alignl.p2align命令的变化形式。.p2alignw使用2个字节来填充填充区
      .p2alignl使用4字节来填充。例如,..p2alignw2,0x368d将地址对齐到4的倍数,如果
      它跳过2个字节,GAS将使用0x368d填充这2个字节(字节的准确的位置视处理器的存储方式
      而定)。如果它跳过13个字节,填充值则不明确。


      7.55.previous
      Thisis one of the ELF section stack manipulation directives. The othersare .
      section(see Section 7.66 [Section], page 52), .subsection (see Section7.79 [
      SubSection],page 56), .pushsection (see Section 7.61 [PushSection], page50),
      and.popsection (see Section 7.56 [PopSection], page 50).
      Thisdirective swaps the current section (and subsection) with mostrecently r
      eferencedsection (and subsection) prior to this one. Multiple .previousdirec
      tivesin a row will flip between two sections (and their subsections).
      Interms of the section stack, this directive swaps the currentsection with t
      hetop section on the section stack.

      7.55.previous
      这是一个ELF段堆栈操作命令。其他的段堆栈操作命令还有.section(7.66[Section]
      ,52
      ),.subsection (7.79[SubSection], 56),.pushsection(7.61[PushS
      ection],50
      ),.popsection(7.56[PopSection],50)
      本命令交换当前段(及其子段)和最近访问过的段(及其子段)。多个连续的.previous
      令将使当前位置两个段(及其子段)之间反复切换。
      用段堆栈的术语来说,本命令使当前段和堆顶段交换位置。


      7.56.popsection
      Thisis one of the ELF section stack manipulation directives. The othersare .
      section(see Section 7.66 [Section], page 52), .subsection (see Section7.79 [
      SubSection],page 56), .pushsection (see Section 7.61 [PushSection], page50),
      and.previous (see Section 7.55 [Previous], page 49).
      Thisdirective replaces the current section (and subsection) with thetop sect
      ion(and subsection) on the section stack. This section is popped offthe stac
      k.

      7.56.popsection
      这是一个ELF段堆栈操作命令。其他的段堆栈操作命令还有.section(7.66[Section],
      52
      ),.subsection (7.79[SubSection], 56),.pushsection(7.61[PushSe
      ction],50
      ),.previous(7.55[Previous], 49).
      本命令用堆栈顶段(及其子段)替代当前段(及其子段)。堆栈顶段出栈。

      7.57.print string
      aswill print string on the standard output during assembly. You mustput stri
      ngin double quotes.

      7.57.print string
      as
      会在标准输出上打印string字符串。String必须使用双引号。


      7.58.protected names
      Thisone of the ELF visibility directives. The other two are .hidden(see Sect
      ion7.32 [Hidden], page 42) and .internal (see Section 7.39 [Internal],page 4
      4).
      Thisdirective overrides the named symbols default visibility (which isset by
      theirbinding: local, global or weak). The directive sets the visibilityto p
      rotectedwhich means that any references to the symbols from within thecompon
      entsthat defines them must be resolved to the definition in thatcomponent, e
      venif a definition in another component would normally preemptthis.

      7.58.protected names
      这是一条ELF可见度的相关命令。其它两条是.hidden(参见7.32[Hidden], 42).i
      nternal(
      参见7.39[Internal], 44)
      本命令将取消指定符号的可见度缺省值(可见度由其他命令捆绑设定:local,global,w
      eak
      )本命令将可见度设置为protected,这个可见度意味着:在定义此符号的部件内对此符
      号的任何访问,都必须解析到这个部件内的定义体。即使其他部件中存在一个正常情况下
      比此优先的定义体。

      7.59.psize lines, columns
      Usethis directive to declare the number of lines—and, optionally,the number
      ofcolumns—to use for each page, when generating listings.
      Ifyou do not use .psize, listings use a default line-count of 60. Youmay omi
      tthe comma and columns specification; the default width is 200columns.
      asgenerates formfeeds whenever the specified number of lines isexceeded (or
      wheneveryou explicitly request one, using .eject).
      Ifyou specify lines as 0, no formfeeds are generated save thoseexplicitly sp
      ecifiedwith .eject.

      7.59.psize lines ,columns
      当生成清单列表时,使用本命令声明每页的行数—还可以可选地声明列数。
      如果您不使用本命令,清单列表的行数为默认的60行。可以省略逗号和列参数:默认值为
      200
      列。
      当指定的行数过多的话,as会产生进纸操作。(如果您确实需要一个进纸动作,可以使用
      .eject
      命令)
      如果您指定行数为0,则不产生进纸操作,除非您明确地使用了.eject命令。


      7.60.purgem name
      Undefinethe macro name, so that later uses of the string will not beexpanded
      .See Section 7.50 [Macro], page 47.

      7.60.purgem name
      取消name的宏定义,后面使用字符串name不会被宏扩展。参见7.50[Macro], 47页。


      7.61.pushsection name , subsection
      Thisis one of the ELF section stack manipulation directives. The othersare .
      section(see Section 7.66 [Section], page 52), .subsection (see Section7.79 [
      SubSection],page 56), .popsection (see Section 7.56 [PopSection], page 50),a
      nd.previous (see Section 7.55 [Previous], page 49).
      Thisdirective is a synonym for .section. It pushes the current section(and s
      ubsection)onto the top of the section stack, and then replaces the currentse
      ctionand subsection with name and subsection.

      7.61.pushsection name , subsection
      本命令是一个ELF段堆栈操作命令。其余的几个是.section(参见7.66[Section], 52
      ), .subsection (
      参见7.79[SubSection], 56),.popsection(参见7.56[PopSecti
      on], 50
      ),.previous(参见7.55[Previous],49)
      本命令与.section命令是等价的。它将当前段(及子段)推入段堆栈的顶部。并使用name
      subsection来替代当前段和子段。

      7.62.quad bignums
      .quad expects zero or more bignums, separated bycommas. For each bignum, it e
      mits an 8-byte integer. If thebignum won’t fit in 8 bytes, it prints a warni
      ng message; andjust takes the lowest order 8 bytes of the bignum.
      The term“quad” comes from contexts in which a “word” is two bytes;hence
      quad-word for 8 bytes.

      7.62 .quad bignums
      .quad
      可带0或多个bignum参数,每个参数由逗号分隔。对于每个bignum都汇编成一个8
      节的整数。如果某个bignum8字节无法表示,则给出警告信息;只汇编这个bignum的最低
      8
      字节。
      术语“quad”源于一个“word”代表2个字节,所以quad-word代表8个字节。

      7.63.rept count
      Repeat the sequence of lines between the .reptdirective and the next .endr di
      rective count times.
      Forexample, assembling
      .rept 3
      .long 0
      .endr
      is equivalentto assembling
      .long 0
      .long 0
      .long 0

      7.63 .reptcount
      汇编.rept.endr之间的语句count次。
      ,汇编下列语句:
      .rept3
      .long 0
      .endr
      与下列语句是等价的:
      .long0
      .long 0
      .long 0

      7.64 sbttl "subheading"
      Usesubheading as the title (third line, immediately after the titleline) whe
      n generating assembly listings.
      This directiveaffects subsequent pages, as well as the current page if itapp
      ears within ten lines of the top of a page.

      7.64sbttl"subheading"
      当生成汇编清单时,使用subheading作为标题(第3行,紧跟在标题行之后)。
      本命令对清单的后续页起作用,如果它位于当前页的前10行内,则对当前页也起作用。



      7.65.scl class
      Set the storage-class value for a symbol. Thisdirective may only be used insi
      de a .def/.endef pair. Storageclass may flag whether a symbol is static or ex
      ternal, or itmay record further symbolic debugging information.
      The ‘.scl’directive is primarily associated with COFF output; whenconfigur
      ed to generate b.out output format, as accepts thisdirective but ignores it.


      7.65 .sclclass
      设置一个符号的存储类型值(storage-classvalue)。本命令只能在.def/.endef之间使
      用。符号的存储类型可以表明符号是static类型或是external类型,或者进一步记录符号
      的调试信息。
      ‘.scl’
      命令主要与在COFF输出有关,当生成b.out输出格式时,as接受本命令,但忽略本
      命令。




      7.66.section name (COFF version)
      Use the .section directive toassemble the following code into a section named
      name.
      Thisdirective is only supported for targets that actually supportarbitrarily
      named sections; on a.out targets, for example, it isnot accepted, even with
      a standard a.out section name.
      ForCOFF targets, the .section directive is used in one of thefollowing ways:

      .section name [, "flags"]
      .sectionname [, subsegment]
      If the optional argument is quoted, it istaken as flags to use for the sectio
      n. Each flag is a singlecharacter. The following flags are recognized:
      b bss section(uninitialized data)
      n section is not loaded
      w writablesection
      d data section
      r read-only section
      x executablesection
      s shared section (meaningful for PE targets)
      If noflags are specified, the default flags depend upon the sectionname. If
      the section name is not recognized, the default will befor the section to be
      loaded and writable. Note the n and wflags remove attributes from the section
      , rather than addingthem, so if they are used on their own it will be as if n
      oflags had been specified at all.
      If the optional argument to the.section directive is not quoted, it is taken
      as a subsegmentnumber (see Section 4.4 [Sub-Sections], page 25).

      7.66.section name (COFF
      版本)
      使用.section命令将后续的代码汇编进一个定名为name的段。
      本命令只能在目标格式真正支持任意命名段时使用;例如,汇编一个a.out目标格式时,即
      使name是一个标准的a.out段名,本命令也不被接受。
      当目标格式为COFF时,.section命令的使用为下面某一种格式:
      .sectionname[, "flags"]
      .section name[,subsegment]
      如可选参数使用了引号,它将被视为该段的标志(flags)。每个标记是单个的字符。下列是
      认可的标志。
      bbss
      (未初始化的数据)
      n
      未装入内存的段
      w
      可写的段
      d
      数据段
      r
      只读段
      x
      代码段(executablesection
      s
      共享段(目标为PE格式有意义)
      如果本命令没有指定标志,则依靠段名来确定标志缺省值。如果该段名没有使用标准段名
      ,则默认该段已装入内存并且可写。注意在使用nw标志组合时,不是增加这组属性,而
      是删除该段的属性。所以如果只存在这两个标志,就代表该段没有指定任何标志。
      如果本命令的可选参数没有使用引号,参数将被视为子段的编号。(参见4.4[Sub-Secti
      ons], 25
      )



      7.67.section name (ELF
      版本)
      Thisis one of the ELF section stack manipulation directives. The othersare .
      subsection (see Section 7.79 [SubSection], page 56),.pushsection (see Section
      7.61 [PushSection], page 50),.popsection (see Section 7.56 [PopSection], pag
      e 50), and.previous (see Section 7.55 [Previous], page 49).
      For ELFtargets, the .section directive is used like this:
      .section name[, "flags"[, @type]]
      The optional flags argument is aquoted string which may contain any combinati
      on of thefollowing characters:
      a section is allocatable
      w section iswritable
      x section is executable
      The optional type argumentmay contain one of the following constants:
      @progbits sectioncontains data
      @nobits section does not contain data (i.e.,section only occupies space)

      If no flags are specified, thedefault flags depend upon the section name. If
      the section nameis not recognized, the default will be for the section to hav
      enone of the above flags: it will not be allocated in memory, norwritable, n
      or executable. The section will contain data.
      ForELF targets, the assembler supports another type of .sectiondirective for
      compatibility with the Solaris assembler:
      .section"name"[, flags...]
      Note that the section name isquoted. There may be a sequence of comma separat
      edflags:
      #alloc section is allocatable
      #write section iswritable
      #execinstr section is executable
      This directivereplaces the current section and subsection. The replaced secti
      onand subsection are pushed onto the section stack. See the contentsof the g
      as testsuite directory gas/testsuite/gas/elf for someexamples of how this dir
      ective and the other section stackdirectives work.

      7.67 .section name (ELF
      版本)
      本命令是ELF的段堆栈操作命令之一,其他的段堆栈命令为.subsection(Section7.7
      9 [SubSection], page 56), .pushsection (
      Section7.61 [PushSection], page 50)
      , .popsection (
      Section7.56 [PopSection], page 50), and .previous (Secti
      on7.55 [Previous], page 49).
      当目标格式为ELF时,.section命令应如下使用:
      .sectionname [, "flags"[,@type]]
      可选参数flags是被引号包围的字符串,可以由下列字符的任意组合:
      a
      可分配的段(allocatable
      w
      可写段
      x
      代码段
      可选的参数type可以包含下列的任一常量:
      @progbits
      包含数据的段
      @nobits
      不包含数据的段(只占用空间的段)
      如果本命令没有指定标志,则依靠段名来确定标志缺省值。如果段名不是标准的段名,则
      默认的该段不包含上述标志:该段不可分配内存,不可写,不可执行。该段是包含数据的
      段。
      当目标格式为ELF,as还支持另一种形式的.section命令,以便兼容Solaris的汇编器:

      .section"name"[, flags...]
      注意段名是使用引号包围的,可能存在一系列由逗号分隔分隔的标志:
      #alloc
      可分配的段(sectionis allocatable
      #write
      可写的段
      #execinstr
      可执行的段
      本命令将(用段名为name的段)替代当前段和子段。被替换的段将被推入段堆栈。参见ga
      s
      的测试套件目录gas/testsuite/gas/elf,可以找到一些本命令和其他段堆栈操作命令的
      例子。

      7.68.set symbol, expression
      Set the value of symbol to expression.This changes symbol’s value and type t
      o conform toexpression. If symbol was flagged as external, it remainsflagged
      (see Section 5.5 [Symbol Attributes], page 30).
      Youmay .set a symbol many times in the same assembly.
      If you .set aglobal symbol, the value stored in the object file is the lastv
      alue stored into it.
      The syntax for set on the HPPA is‘symbol .set expression’.

      7.68 .set symbol,expression
      设置symbolexpression。这将改变symbol的值域和类型领域以符合expression参数。如
      symbol已被标志为external,则symbol保持它的标志。(5.5[SymbolAttributes],
      30
      )
      您可以在同一个汇编程序中多次使用.set命令来设置同一个符号。
      如果设置一个全局符号,该符号在目标文件中值为最后设定的值。
      HPPA上的语法是‘symbol.set expression’

      7.69.short expressions
      .short is normally the same as ‘.word’.See Section 7.92 [.word], page 59.

      In some configurations,however, .short and .word generate numbers of differen
      tlengths; see Chapter 8 [Machine Dependencies], page 61.

      7.69.short expressions
      本命令通常和’.word’命令一样,见7.92[.word], 59.
      然而在某些配置中,.short.word命令生成的数字长度却不相同;见第8[MachineDe
      pendencies], 61
      .

    2. 7.70.single flonums
      This directive assembles zero or more flonums,separated by commas. It has the
      same effect as .float. The exactkind of floating point numbers emitted depen
      ds on how as isconfigured. See Chapter 8 [Machine Dependencies], page 61.

      7.70.singleflonums
      本命令可以汇编0个或多个浮点参数,各个参数之间使用逗号分隔。它的作用和.float相同
      。生成浮点数的具体类型视as的配置而定。见第8[MachineDependencies], 61页。






      --------------------
      一切有为法如梦幻泡影




      #
      回复:linux下汇编的DirectiveOperands 2004-09-08 3:25 PM n9871009
      Re: 7
      汇编器命令()[re: amtb]



      位组合:bitpattern,想不出有什么特别的意义,大概指的是有限个数的01所有的组合
      吧。Fixme.
      sleb128/uleb128:
      基于128位的低地址结尾带/无符号的数。您有什么好建议?
      ==========================
      ==================================
      7.71.size (COFF
      版本)
      Thisdirective is generated by compilers to include auxiliary debugginginform
      ation in the symbol table. It is only permitted inside.def/.endef pairs.
      ‘.size’ is only meaningful whengenerating COFF format output; when as is ge
      nerating b.out, itaccepts this directive but ignores it.

      7.71 .size (COFF
      版本)
      本命令一般由编译器生成,以在符号表中加入辅助调试信息。本命令只能在.def/.endef
      令对之间使用。
      本命令只在生成COFF格式的输出文件有意义。当as生成b.out时,as接受本命令但忽略之。




      7.72.size name , expression_r(ELF
      版本)
      Thisdirective is used to set the size associated with a symbol name.The size
      in bytes is computed from expression which can make useof label arithmetic.
      This directive is typically used to set thesize of function symbols.
      本命令经常用来设置符号name的内存大小。内存大小的单位是字节,通过计算参数expres
      sion
      得到,参数expression中可以使用标签进行计算。本命令常用来设置函数符号的长度


      7.73.sleb128 expressions
      sleb128 stands for “signed little endianbase 128.” This is a compact, varia
      ble length representationof numbers used by the DWARF symbolic debugging form
      at. SeeSection 7.86 [Uleb128], page 58.

      7.73 .sleb128expressions
      sleb128
      代表“signedlittle endian base128”(低地址结尾的带符号128位基数)。这是
      一个紧凑的,变长的数字表示方法,当使用DWARF符号调试格式时使用。参见7.86[Uleb1
      28], 58
      页。



      7.74.skip size , fill
      This directive emits size bytes, each of valuefill. Both size and fill are ab
      solute expressions. If the commaand fill are omitted, fill is assumed to be z
      ero. This is thesame as ‘.space’.

      7.74 .skip size ,fill
      本命令生成size个字节,每个字节的值都是fill。参数sizefill都必须是纯粹的表达式
      。如果省略逗号和fill,则默认fill的值为0。这与’.space’相同。



      7.75.space size , fill
      This directive emits size bytes, each ofvalue fill. Both size and fill are ab
      solute expressions. If thecomma and fill are omitted, fill is assumed to be z
      ero. This isthe same as ‘.skip’.
      Warning: .space has a completelydifferent meaning for HPPA targets; use .bloc
      k as a substitute.See HP9000 Series 800 Assembly Language Reference Manual (H
      P92432-90001) for the meaning of the .space directive. See Section8.8.5 [HPP
      A Assembler Directives], page 84, for a summary.
      Onthe AMD 29K, this directive is ignored; it is accepted forcompatibility wi
      th other AMD 29K assemblers.
      Warning: Inmost versions of the gnu assembler, the directive .space has thee
      ffect of .block See Chapter 8 [Machine Dependencies], page61.

      7.75 .space size ,fill
      本命令生成size个字节,每个字节的值都是fill。参数sizefill都必须是纯粹的表达式
      。如果省略了逗号和fill,则默认fill的值为0。这与’.skip’相同。
      警告:在生成HPPA目标格式时,.space的意义完全不同。应该使用.block命令替代本命令
      。在HP9000系列800汇编语言参考手册(HP92432-90001),可以找到.space命令的用法。参
      8.8.5[HPPA Assembler Directives],84,可以找到使用摘要。
      AMD29K上,本命令将被忽略。出于兼容其它一些AMD29K汇编器的目的,as接受本命令

      警告:在gnu汇编器大多数版本中,这个.space命令和.block命令等效。见第8[Machin
      eDependencies], 61
      页。

      7.76.stabd, .stabn, .stabs
      There are three directives that begin‘.stab’. All emit symbols (see Chapter
      5 [Symbols], page29), for use by symbolic debuggers. The symbols are not ent
      eredin the as hash table:they cannot be referenced elsewhere in thesource fi
      le. Up to five fields are required:
      string This isthe symbol’s name. It may contain any character except ‘\000’
      ,so is more general than ordinary symbol names. Some debuggers usedto code a
      rbitrarily complex structures into symbol names usingthis field.
      type An absolute expression. The symbol’s type isset to the low 8 bits of th
      is expression. Any bit pattern ispermitted, but ld and debuggers choke on sil
      ly bitpatterns.
      other An absolute expression. The symbol’s “other”attribute is set to the
      low 8 bits of this expression.
      descAn absolute expression. The symbol’s descriptor is set to the low16 bit
      s of this expression.
      Value An absolute expressionthat becomes the symbol’s value.
      If a warning is detectedwhile reading a .stabd, .stabn, or .stabs statement,
      the symbolhas probably already been created; you get a half-formed symbolin
      your object file. This is compatible with earlierassemblers!
      .stabd type , other , desc
      The “name” of thesymbol generated is not even an empty string. It is a null
      pointer,for compatibility. Older assemblers used a null pointer so theydidn
      ’t waste space in object files with empty strings.
      Thesymbol’s value is set to the location counter, relocatably. Whenyour pro
      gram is linked, the value of this symbol is the addressof the location counte
      r when the .stabd was assembled.
      .stabntype , other , desc , value
      The name of the symbol is set to theempty string "".
      .stabs string , type , other , desc ,value
      All five fields are specified.

      7.76 .stabd, .stabn,.stabs
      3个以.stab开头的命令。它们都用来产生符号,(参见第5[Symbols],29),供符号
      调试器使用。这些符号没有收入as的散列表中:这些符号不能被源文件其他地方所访问。
      它们至少需要5个属性域:
      string
      这是符号的名字。它可以包含除‘\000’之外的任何字符,故此可用名比普通符号
      名更广泛。很多调试器经常利用这个空间,把任意复杂的结构编码为符号名。
      type
      这是一个纯粹的表达式。符号的类型属性由这个表达式的低8位设定。任何的位组合
      bitpattern)都可以,但连接器和调试器会被没有义的位组合所中断。
      other
      这是一个纯粹的表达式。由这个表达式的低8位设定此符号的“其它”属性。
      desc
      这是一个纯粹的表达式。由这个表达式的低16位设定此符号的描述符。
      Value
      这个纯粹的表达式将作为符号的值。

      如果汇编.stabd,.stabn, .stabs语句时引发了一个警告,该符号有可能已经被创建;
      在目标文件中存在一个半成品的符号。这样做兼容于早期的汇编器!

      .stabdtype , other ,desc
      生成符号的“名字”甚至不是空字符串,而是一个空指针(null),这样安排是出于对兼
      容性要求。早期的汇编器经常使用空指针,以避免空字符串在目标文件中浪费空间。
      这个符号的值(值域)在重定位时设置为位置计数器的值。当程序连接之后,这个符号的
      值是.stabd命令汇编时位置计数器的地址。
      .stabntype , other , desc , value
      这个符号的名字被设置为空字符串“”。
      .stabsstring , type , other , desc , value
      5
      个属性域全部指定好。



      7.77.string "str"
      Copy the characters in str to the objectfile. You may specify more than one s
      tring to copy, separatedby commas. Unless otherwise specified for a particula
      r machine,the assembler marks the end of each string with a 0 byte. You canu
      se any of the escape sequences described in Section 3.6.1.1[Strings], page 19
      .

      7.77 .string"str"
      将参数str中的字符复制到目标文件中去。您可以指定多个字符串进行复制,之间使用逗号
      分隔。除非另外指定了具体的机器,汇编器将在每个字符串后追加一个0字节作为标记。您
      可以使用任意的逃逸序列,参见19页中3.6.1.1[Strings]的描述。



      7.78.struct expression
      Switch to the absolute section, and set thesection offset to expression, whic
      h must be an absoluteexpression. You might use this as follows:
      .struct0
      field1:
      .struct field1 + 4
      field2:
      .struct field2 +4
      field3:
      This would define the symbol field1 to have thevalue 0, the symbol field2 to
      have the value 4, and the symbolfield3 to have the value 8. Assembly would be
      left in theabsolute section, and you would need to use a .section directive
      ofsome sort to change to some other section before furtherassembly.

      7.78 .structexpression
      切换到独立地址段,并用expression设定段的偏移量,expression必须是个纯粹的表达式
      。您可以如下使用:
      .struct0
      field1:
      .struct field1 + 4
      field2:
      .struct field2 +4
      field3:

      定义符号field1的值为0,符号field2的值为4,符号field3的值为8。这段汇编程序将保存
      在独立地址段中,在进行下一步汇编前,您需要使用一个某种类型的.section命令,以切
      换到相应的段。



      7.79.subsection name
      This is one of the ELF section stackmanipulation directives. The others are .
      section (see Section7.66 [Section], page 52),.pushsection (see Section 7.61[
      PushSection], page 50), .popsection (see Section 7.56[PopSection], page 50),
      and .previous (see Section 7.55[Previous], page 49).
      This directive replaces the currentsubsection with name. The current section
      is not changed. Thereplaced subsection is put onto the section stack in place
      ofthe then current top of stack subsection.

      7.79 .subsectionname
      本命令是一个ELF段堆栈操作命令。其它的几个命令是(参见7.66[Section], 52页),
      .pushsection(
      参见7.61[PushSection],50),.popsection (参见7.56[PopSectio
      n], 50
      ),and .previous (参见7.55[Previous],49)
      本命令用name子段替换当前子段。当前段并不改变。被替换的子段入段堆栈,成为段堆栈
      的新栈顶。



      7.80.symver
      Use the .symver directive to bind symbols to specificversion nodes within a s
      ource file. This is only supported onELF platforms, and is typically used whe
      n assembling files tobe linked into a shared library. There are cases where i
      t maymake sense to use this in objects to be bound into an applicationitself
      so as to override a versioned symbol from a sharedlibrary.
      For ELF targets, the .symver directive can be used likethis:
      .symver name, name2@nodename
      If the symbol name isdefined within the file being assembled, the .symver dir
      ectiveeffectively creates a symbol alias with the name name2@nodename,and in
      fact the main reason that we just don’t try and createa regular alias is th
      at the @ character isn’t permitted insymbol names. The name2 part of the nam
      e is the actual name ofthe symbol by which it will be externally referenced.
      The namename itself is merely a name of convenience that is used so that iti
      s possible to have definitions for multiple versions of afunction within a si
      ngle source file, and so that the compilercan unambiguously know which versio
      n of a function is beingmentioned. The nodename portion of the alias should b
      e the nameof a node specified in the version script supplied to the linkerwh
      en building a shared library. If you are attempting tooverride a versioned sy
      mbol from a shared library, thennodename should correspond to the nodename of
      the symbol you aretrying to override.
      If the symbol name is not defined within thefile being assembled, all referen
      ces to name will be changed toname2@nodename. If no reference to name is made
      , name2@nodenamewill be removed from the symbol table.
      Another usage of the.symver directive is:
      .symver name, name2@@nodename
      In thiscase, the symbol name must exist and be defined within the filebeing
      assembled. It is similar to name2@nodename. The differenceis name2@@nodename
      will also be used to resolve references toname2 by the linker.
      The third usage of the .symver directiveis:
      .symver name, name2@@@nodename
      When name is not definedwithin the file being assembled, it is treated as nam
      e2@nodename.When name is defined within the file being assembled, thesymbol
      name, name, will be changed to name2@@nodename.


7.80.symver
使用.symver命令把符号装订到在源文件里指定的节点。本命令只在ELF平台上可用,如果
当前汇编的文件被连接到一个共享库中时常常用到。有些情况下应该在目标文件中使用本
命令,把目标文件自我装订进某个应用软件中,从而取代共享库中旧版本符号。
对于ELF目标,.symver命令可以这样使用:
.symvername,name2@nodename
如果符号name的定义在当前正在汇编的文件中,这个.symver命令实际用name2@nodename
建一个符号别名,而且我们不打算创建一个正规的别名,因为在符号名中是不允许存在‘
@’
这个字符的。别名中name2才是符号的真正名字,外部访问是通过这个名字进行的。符
号自己的名字name仅仅为了使用上的方便,这样在同一个源文件中的一个函数才可能有多
个定义体;编译器才能够清楚当前使用的函数是哪个具体的定义。别名中的nodename部分
应是某个节点的名字,这个节点的名字是在建立共享库时,提供给连接器的版本脚本中指
定的。如果您想覆盖共享库中的旧版本符号,则nodename应该是将被取代符号的节点名。

如果符号name的定义不在当前正在汇编的文件中,则所有对name的访问都变为对name2@no
dename
的访问。如果根本没有对name的访问,将会把name2@nodename从符号表中删除。

.symver
命令的另一种用法:
.symvername,name2@@nodename
在这种情况下,符号name必须存在,并且它必须在当前正在汇编的文件中被定义。这类似
name2@nodename。区别是name2@@nodename还被连接器用来解析对name2的访问。//注:
name2的访问被转向到nodename
.symver
命令的第3种用法:
.symvername,name2@@@nodename
如果name不是在当前正在汇编的文件中被定义的时候,对符号的处理就如同name2@nodena
me
。如果name是当前正在汇编的文件中定义的,符号的名字name,会被转换为name2@@nod
ename




7.81.tag structname
This directive is generated by compilers toinclude auxiliary debugging inform
ation in the symbol table. Itis only permitted inside .def/.endef pairs. Tags
are used to linkstructure definitions in the symbol table with instances of
thosestructures.
‘.tag’ is only used when generating COFF formatoutput; when as is generatin
g b.out, it accepts this directivebut ignores it.

7.81 .tagstructname
本命令由编译器生成,用来在符号表中增加调试辅助的信息。本命令只允许在.def/.ende
f
语句对内使用。标饰(tags)常用来连接符号表中的结构定义和该结构实例。
‘.tag’
只能在生成COFF格式的输出文件时使用。当as生成b.out格式的输出文件时,接受
本命令但忽略之。



7.82.text subsection
Tells as to assemble the following statementsonto the end of the text subsect
ion numbered subsection, which isan absolute expression. If subsection is omi
tted, subsectionnumber zero is used.

7.82 .textsubsection
通知as把后续语句汇编到编号为subsection的正文子段的末尾,subsection是一个纯粹的
表达式。如果省略了参数subsection,则使用编号为0的子段。


7.83.title "heading"
Use heading as the title (second line,immediately after the source file name
and page number) whengenerating assembly listings.
This directive affects subsequentpages, as well as the current page if it app
ears within ten linesof the top of a page.

7.83 .title"heading"
当生成汇编清单时,把heading作为标题使用(标题在第2行,紧跟在源文件名和页号后)

如果这个命令出现在某页的前10行中,它不但作用影响到后续的页,也同样影响到当前页



7.84.type int (COFF version)
This directive, permitted only within.def/.endef pairs, records the integer i
nt as the type attributeof a symbol table entry.
‘.type’ is associated only with COFFformat output; when as is configured fo
r b.out output, it acceptsthis directive but ignores it.

7.84 .type int (COFF
版本)
本命令紧允许在.def/.endef命令对之间使用,把整数int作为类型属性记录进符号表表项

‘.type’
只和COFF格式的输出有关,当as配置生成b.out输出格式时,as接受本命令但忽
略之。

7.85.type name , type description (ELF version)
This directive is usedto set the type of symbol name to be either a function
symbol oran object symbol. There are five different syntaxes supported forth
e type description field, in order to provide compatibilitywith various other
assemblers. The syntaxes supported are:

.type<name>,#function
.type <name>,#object

.type<name>,@function
.type <name>,@object

.type<name>,%function
.type <name>,%object

.type<name>,"function"
.type <name>,"object"

.type<name> STT_FUNCTION
.type <name> STT_OBJECT

7.85.type name , type description (ELF
版本)
本命令经常用来设置符号name的类型(属性)为函数符号或是目标符号两者之一。typed
escription
部分允许使用5种不同的语法,以兼容众多的汇编器。这些语法是:

.type<name>,#function
.type <name>,#object

.type<name>,@function
.type <name>,@object

.type<name>,%function
.type <name>,%object

.type<name>,"function"
.type <name>,"object"

.type<name> STT_FUNCTION
.type <name> STT_OBJECT


7.86.uleb128 expressions
uleb128 stands for “unsigned little endianbase 128.” This is a compact, var
iable length representation ofnumbers used by the DWARF symbolic debugging fo
rmat. See Section7.73 [Sleb128], page 54.

7.86 .uleb128expressions
uleb128
代表“unsignedlittle endian base128”(低地址结尾的无符号128位基数)。这
是一个紧凑的,变长的数字表示方法,当使用DWARF符号调试格式时使用。参见7.83[Sle
b128], 54
页。



7.87.val addr
This directive, permitted only within .def/.endef pairs,records the address a
ddr as the value attribute of a symbol tableentry.
‘.val’ is used only for COFF output; when as isconfigured for b.out, it acc
epts this directive but ignoresit.

7.87 .valaddr
本命令只能在.def/.endef命令对之间使用,把addr的地址作为值属性存入符号表的表项中

‘.val’
命令只能在COFF输出时使用;当as被配置成生成b.out输出时,接受本命令但忽略
之。



7.88.version "string"
This directive creates a .note sectionand places into it an ELF formatted not
e of type NT VERSION. Thenote’s name is set to string.

7.88 .version"string"
本命令创建一个.note段,并把一个NTVERSION类型ELF格式的note放入该.note段。Note
名字被设置为string



7.89.vtable_entry table, offset
This directive finds or creates asymbol table and creates a VTABLE_ENTRY relo
cation for it with anaddend of offset.

7.89 .vtable_entry table,offset
本命令寻找或创建一个符号表,并用offset作偏移量的增量,为此符号表产生一个VTABLE
_ENTRY
重定位。



7.90.vtable_inherit child, parent
This directive finds the symbolchild and finds or creates the symbol parent a
nd then creates aVTABLE_INHERIT relocation for the parent whose addend is the
valueof the child symbol. As a special case the parent name of 0 istreated
as refering the *ABS* section.

7.90 .vtable_inheritchild, parent
本命令寻找符号child,并寻找或创建符号parent,为符号parent产生一个VTABLE_INHERI
T
重定位,parent的偏移量增量为符号child的值。一个特例,如果parent的名字为0,则将
它交给*ABS*段处理。



7.91.weak names
This directive sets the weak attribute on the commaseparated list of symbol n
ames. If the symbols do not alreadyexist, they will be created.

7.91 .weaknames
本命令设置names中每个符号(由逗号分隔)的weak属性。如果这些符号尚不存在,则创建
这些符号。


7.92.word expressions
This directive expects zero or more expressions,of any section, separated by
commas.
The size of the numberemitted, and its byte order, depend on what target comp
uter theassembly is for.
Warning: Special Treatment to supportCompilers
Machines with a 32-bit address space, but that do lessthan 32-bit addressing,
require the following special treatment.If the machine of interest to you do
es 32-bit addressing (ordoesn’t require it; see Chapter 8 [Machine Dependenc
ies], page61), you can ignore this issue.
In order to assemble compileroutput into something that works, as occasionall
y does strangethings to ‘.word’ directives. Directives of the form‘.word
sym1-sym2’ are often emitted by compilers as part ofjump tables. Therefore,
when as assembles a directive of the form‘.word sym1-sym2’, and the differe
nce between sym1 and sym2does not fit in 16 bits, as creates a secondary jump
table,immediately before the next label. This secondary jump table ispreced
ed by a short-jump to the first byte after the secondarytable. This short-jum
p prevents the flow of control fromaccidentally falling into the new table. I
nside the table is along-jump to sym2. The original ‘.word’ contains sym1 m
inusthe address of the long-jump to sym2.
If there were severaloccurrences of ‘.word sym1-sym2’ before the secondary
jumptable, all of them are adjusted. If there was a ‘.word sym3-sym4’,that
also did not fit in sixteen bits, a long-jump to sym4 isincluded in the seco
ndary jump table, and the .word directivesare adjusted to contain sym3 minus
the address of the long-jump tosym4; and so on, for as many entries in the or
iginal jump tableas necessary.

7.92 .wordexpressions
本命令可不带表达式或带多个表达式,这些表达式可以属于任意段,每个表达式由逗号分
隔。
汇编生成的数字的大小,字节顺序视生成程序运行的目标机器而定。
警告:支持编译器的特殊处理
有些机器具有32位地址空间,但不能完全进行32位寻址,需要下列的特殊处理。如果您关
心的机器能够进行32位寻址,(或者根本不需要32位寻址;见第8[机器相关性]61页)
则可以忽略这个问题。
为了使由编译器产生源码的汇编结果能够正确地运行,as偶尔会对'.word'命令进行些奇怪
的操作。编译器在跳转表部分经常生成类似'.wordsym1-sym2'形式的命令。所以,当as
编一条形如'.wordsym1-sym2'的命令,且sym1sym2之间的偏移量大于16位时,as会在下
个标签前创建一个'次级跳转表',在'次级跳转表'前面加插上一个短-跳转指令,这个短-
转指令的目的地址是'次级跳转表'之后的第一个字节。这个短跳转防止控制流程意外地落
入新的跳转表(次级跳转表)。在'次级跳转表'内是个目的地址为sym2的长-跳转指令。原
来的'.word'命令调整为sym1减去到sym2的长-跳转指令地址,。
如果在次级跳转表前出现了几个'.wordsym1-sym2',这些命令都要进行调整。如果存在一
'.wordsym3-sym4',且地址差也大与16位,次级跳转表中将包含一个至sym4的长-跳转
指令,且.word命令将被调整为包含sym3减去到sym4-跳转指令的地址;如是类推,处理
原始跳转表中的需要处理的各个表项。



7.93Deprecated Directives
One day these directives won’t work. Theyare included for compatibility with
olderassemblers.
.abort
.line

7.93
不赞成使用的命令
将来下列命令可能不再被支持,它们的存在只是为了与老版本的汇编器相兼容。
.abort
.line

这篇关于unix 汇编语言 GAS的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/884707

相关文章

【Linux进阶】UNIX体系结构分解——操作系统,内核,shell

1.什么是操作系统? 从严格意义上说,可将操作系统定义为一种软件,它控制计算机硬件资源,提供程序运行环境。我们通常将这种软件称为内核(kerel),因为它相对较小,而且位于环境的核心。  从广义上说,操作系统包括了内核和一些其他软件,这些软件使得计算机能够发挥作用,并使计算机具有自己的特生。这里所说的其他软件包括系统实用程序(system utility)、应用程序、shell以及公用函数库等

Unix、Minix和Linux

Unix介绍 UNIX操作系统(尤尼斯),是一个强大的多用户、多任务操作系统,支持多种处理器架构,按照操作系统的分类,属于分时操作系统,最早由KenThompson、DennisRitchie和DouglasMcIlroy于1969年在AT&T的贝尔实验室开发。目前它的商标权由国际开放标准组织所拥有,只有符合单一UNIX规范的UNIX系统才能使用UNIX这个名称,否则只能称为类UNIX(UNI

Unix/linux 编程实践教程 ---------- 服务器-客户端编程

一个简单到服务器可以写成这个样子: int main(){int sock,fd;void child_waiter(int),process_request(int);signal(SIGCHLD,child_waiter);if((sock=make_server_socket(PORTNUM)) == -1)err_deal("---");while(1){if(fd = ac

板凳---------unix网络编程卷1:第二章传输层:TCP、UDP 和 SCTP

2.1 概述 焦点是传输层,包括TCP、UDP和SCTP(Stream Control Transmission Protocol,流控制传输协议)。绝大多数客户/服务器网络应用使用TCP或UDP。SCTP是一个较新的协议,最初设计用于跨因特网传输电话信令。这些传输协议都转而使用网络层协议IP:或是IPv4,或是IPv6。绕过传输层直接使用IPv4或IPv6,称为原始套接字。 UDP是一个简单的

BEVM如何实现兼容OP Stack以WBTC为Gas的创新解决方案?

区块链技术在经历了十多年的不断发展后,也来到了技术爆发期,BEVM作为在比特币生态深耕超过7年的团队,在这一领域一直保持着卓越的创新能力和前瞻性思维。 近期在内部技术研讨和实践中,BEVM团队计划基于OPtimism团队的OP Stack和Starkware 的Madara模块,来继承以太坊网络的安全性,实现BEVM与以太坊网络之间的无缝连接。目前,BEVM团队正基于OP Stack开发一条服务

用Linux/Unix命令把十六进制转换成十进制

那天写个脚本,需要把十六进制的数字转成十进制的打出来,发现不知道要怎么弄,搜一下,原来还是很简单的,比用C语言什么的容易多了,就一些现成的命令就解决了。 先列两种简单的方法: 1) echo 自己就能实现,相当简单。不过,不知道如果要从十进制转换回十六进制能怎么写。     ]$ echo $((0xac))     172 2) printf 也可以哦,十六进制和十进制互相转换都没问题

UVa 400 Unix 的 1s命令

/* * 解题思路: * 解题步骤:计算最长字符串长度 -> 给字符串排序 -> 除最后一列为最长字符串长度,其他列均为最长字符串长度+2(输出该字符串,不足地方补空格) */ #include <stdio.h>#include <string.h>#define A 110#define B 65char s[ A ][ B ];int cmp( const void *

《UNIX环境高级编程》第三版(电子工业出版社出品)——两年磨一剑的匠心译作

历时两年,《UNIX环境高级编程》的翻译工作终于落下帷幕。这一路走来,真可谓是如鱼饮水,冷暖自知。还记得最初看到招募译者消息的那一刻,内心的激动难以言表。我毫不犹豫地报名,而后经历了试译、海选等激烈的角逐,最终和三个小伙伴幸运地被选中,并和电子工业出版社签下翻译合同,正式开启了这场翻译之旅。从开始翻译到最终定稿,每一个阶段都充满挑战与艰辛。但我深知,这是一本对于工程师们来说至关重要的书籍,我们

汇编语言程序设计 - 从键盘接收一个小写字母,然后找出它的前导字符和后续字符,再按顺序显示这三个字符

80x86汇编习题 题目描述:编写程序,从键盘接收一个小写字母,然后找出它的前导字符和后续字符,再按顺序显示这三个字符 思路: 1,用1号功能接收一个字符到VAR,确保在a-z之间 2,先将DL减一,再输出三次DL,DL逐次递增 3,(换行回车,输出提示字符,显示得好看一点。) DATAS SEGMENTTIPS DB 'Please enter a lowercase lette

汇编语言程序设计 - 将BX中的无符号数以八进制形式输出

8086汇编习题 题目描述:将BX中的无符号数以八进制形式输出 思路: 1,往bx写入一个数 2,每三位bit合起来显示一个八进制数,16/3=5余1,所以先处理一位最高位,再循环5次处理 3,用循环移位的方法,先输出第一位(最高位 4,用循环移位的方法,每次移动3位到最右边,将BL复制到DL中操作,按位与最后3位,加上'0'对应的aciil码 5,中断输出DL的内容,继续循环。