.align 伪操作
用途
将当前位置计数器前进至达到 数字 参数指定的边界为止。
语法
描述
.align伪操作通常用于包含数据的控制部分(csect)。
)数字参数指定位置计数器所需对齐方式的对数基数 2(二进制对数)。 例如,如果指定 2,则 "
.align伪操作请求字对齐;如果指定 3,则 ".align伪操作请求双字对齐。
如果指定了Number2参数,只有当位置在所需对齐边界的Number2字节内时,才会进行对齐。 这在前缀指令之前最有用,可防止指令跨越 64 字节边界。
如果未指定 Number2 参数,那么汇编程序将通过插入字节来对齐位置计数器。 在大多数情况下,会插入 0s ,但如果当前 csect 具有存储映射类 "PR" 或 "GL" ,那么会插入无操作指令。 有关存储映射类的更多信息,请参阅 .csect pseudo-op。
参数
| 项 | 描述 |
|---|---|
| 编号 | 0 求值为 0 到 12 (包括 0 和 12) 之间的整数值的绝对表达式。 该值指示所需对齐的日志底数 2。 例如,8(一个双字)的对齐方式用 3 的整数值表示;4096(一页)的对齐方式用 12 的整数值表示。 |
示例
以下示例说明了 . 对齐 伪操作的用法:
.csect progdata[RW] .byte 1 # Location counter now at odd number .align 1 # Location counter is now at the next # halfword boundary. .byte 3,4 . . . .align 2 # Insure that the label cont # and the .long pseudo-op are # aligned on a full word # boundary. cont: .long 5004381.csect [PR] … .align 6,8 # Align the program counter if the # current location counter is less # than 8 bytes from a 64-bit byte # boundary plw r3,0x10000(r4) # Load a word into r3