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.
April 14th Tuesday (四月 十四日 火曜日)
最新推荐文章于 2021-12-18 14:48:30 发布
本文详细介绍了程序设计中的.bss段概念及其用途,解释了如何在.bss段中预留存储空间而不进行初始化。此外,还深入探讨了多种位操作指令,包括旋转左移、旋转右移、算术移位等,并说明了这些指令如何处理进位标志。
1496

被折叠的 条评论
为什么被折叠?



