关于align对齐问题

striderYu 2008-10-22 12:52:40
align是伪指令还是指令?

.data
ALIGN 2
mybytes BYTE 1,2,3,4
;这样定义的话,是1,2,3,4都偶地址对齐呢,还是只对第一个变量进行偶地址对齐?
...全文
163 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
大熊猫侯佩 2008-10-22
  • 打赏
  • 举报
回复
伪指令,参看masm手册:

Syntax: ALIGN [number]

Description:

ALIGN aligns the next variable or instruction on an offset address
that is a multiple of <expression>. The <number> parameter must be
a power of 2 (1,2,4,8,...) less than or equal to the alignment of
the current segment. If <number> is omitted, the alignment is
determined by the align field of the preceding SEGMENT directive.

In a segment containing no instructions, the assembler pads each

skipped byte with nulls (00h). In a code segment, the assembler
inserts a no-operation sequence (not necessarily NOP instructions)
to fill the gap.

This directive is useful for optimizing data and instruction
fetches on processors with 16 or 32 bit data paths.

EVEN is a synonym for ALIGN 2.
cnzdgs 2008-10-22
  • 打赏
  • 举报
回复
align是伪指令。
第一个变量进行偶地址对齐。

21,500

社区成员

发帖
与我相关
我的任务
社区描述
汇编语言(Assembly Language)是任何一种用于电子计算机、微处理器、微控制器或其他可编程器件的低级语言,亦称为符号语言。
社区管理员
  • 汇编语言
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧