参见英文答案 > What are the sizes of tword, oword and yword operands? 2个
DB分配1个字节.
DW分配2个字节.
DD分配4个字节.
DQ分配8个字节.
所以我假设:
RESB 1分配1个字节.
RESW 1分配2个字节.
RESD 1分配4个字节.
RESQ 1分配8个字节.
我对么?
documentation并没有多说:
3.2.2 RESB and Friends: Declaring Uninitialized Data
RESB, RESW, RESD, RESQ, REST, RESO, RESY and RESZ are designed to be
used in the BSS section of a module: they declare uninitialized
storage space. Each takes a single operand, which is the number of
bytes, words, doublewords or whatever to reserve. As stated in section
2.2.7, NASM does not support the MASM/TASM syntax of reserving uninitialized space by writing DW ? or similar things: this is what it
does instead. The operand to a RESB-type pseudo-instruction is a
critical expression: see section 3.8.For example:
buffer: resb 64 ; reserve 64 bytes
wordvar: resw 1 ; reserve a word
realarray resq 10 ; array of ten reals
ymmval: resy 1 ; one YMM register
zmmvals: resz 32 ; 32 ZMM registers
Am I correct?
是.
对于d *和res *,整个NASM的大小后缀是一致的.它们将字节与xword的x86指令助记符后缀相匹配. (例如psubd使用压缩的dword元素).
甚至还有一个使用o(oct-word):cqo
的指令助记符.
y和z大小后缀明显匹配ymm和zmm寄存器大小,即使指令助记符现在像VBROADCASTI32X8
因为AVX512屏蔽粒度.