现在的位置: 首页 > 综合 > 正文

April 14th Tuesday (四月 十四日 火曜日)

2013年02月06日 ⁄ 综合 ⁄ 共 2453字 ⁄ 字号 评论关闭

   Today we begin writting the detail design reports.  Some is so easy, some has complex logic, such as dattrcol.  I don't know whether
the project can be completed on schedule.

  There is another section called the .bss. This section is like the data section, except that it doesn't take up space in the executable.
This section can reserve storage, but it can't initialize it.  In the .data section, you could reserve storage and set it to an initial value.
In the .bss section, you can't set an initial value.  This is useful for buffers because we don't need to initialize the many way, we just
need to reserve storage.

.section .bss
.lcomm my_buffer, 500

  This directive, .lcomm, will create a symbol, my_buffer, that refers to a 500-byte storage location that we can use as a buffer.

ADDRESS_OR_OFFSET(%BASE_OR_OFFSET,%INDEX,MULTIPLIER) -> FINAL ADDRESS = ADDRESS_OR_OFFSET + %BASE_OR_OFFSET + MULTIPLIER * %INDEX

.lcomm SYMBOL,SIZE

  This is used in the .bss section to specify storage that should be allocated when the program is executed.  Defines the symbol with the
address where the storage will be located, and makes sure that it is the given number of bytes long.

rcll I/%cl,R/M

  Rotates the given location's bits to the left the number of times in the first operand, which is either an immediate-mode value or
the register%cl.  The carry flag is included in the rotation, making it use 33 bits instead of 32.  Also sets the overflow flag.

rcrl I/%cl,R/M

  Same as above, but rotates right.
 
roll I/%cl,R/M

  Rotate bits to the left.  It sets the overflow and carryflags, but does not count the carry flag as part of the rotation. The number
of bits to roll is either specified in immediate mode or is contained in the %cl register.

rorl I/%cl,R/M

  Same as above, but rotates right.
 
sall I/%cl,R/M
  Arithmetic shift left.  The sign bit is shifted out to the carry flag, and a zero bit is placed in the least significant bit.  Other bits
are simply shifted to the left.  This is the same as the regular shift left.  The number of bits to shift is either specified in immediate
mode or is contained in the %cl register.

sarl I/%cl,R/M

  Arithmetic shift right.  The least significant bit is shifted out to the carry flag.  The sign bit is shifted in, and kept as the sign bit.
Other bits are simply shifted to the right.  The number of bits to shift is either specified in immediate mode or is contained in the %cl register.

shll I/%cl,R/M
  Logical shift left.  This shifts all bits to the left (sign bit is not treated specially).  The left most bit is pushed to the carry flag.
The number of bits to shift is either specified in immediate mode or is contained in the %cl register.

shrl I/%cl,R/M
  Logical shift right.  This shifts all bits in the register to the right (sign bit is not treated specially).  The right most bit is pushed
to the carry flag.  The number of bits to shift is either specified in immediate mode or is contained in the %cl register.

抱歉!评论已关闭.