问题描述
SIZEOF指的是什么?它是指源的大小吗(lengthOf * TYPE等于数组中元素的数量*每个元素的大小)?另外,有人可以解释DUP(0),0吗?这是指Assembly x86 MASM.谢谢
What is SIZEOF referring to? Is it referring to the size of the source (lengthOf * TYPE which is equal to number of elements in the array * the size of each element)? Also, can someone explain DUP(0),0? This is referring to Assembly x86 MASM. Thank you
推荐答案
SIZEOF
仅表示类型或结构的大小.
它指的是您在SIZEOF
关键字之后加上的任何内容.
It refers to whatever you put after the SIZEOF
keyword.
SIZEOF element ; refers to a single element in the array.
SIZEOF wholearray ; sizeof(element) * number_of_elements_in_array.
因为它是在编译时解析的,所以只有在数组大小为静态时才起作用.
Because it is resolved at compile-time it will only work if the size of an array is static.
The syntax for DUP
is:
count DUP (initialvalue [[, initialvalue]]...)
10 DUP (0) ; 10 zero's
2 DUP (3 DUP ("A"), "BC") ; "AAABCAAABC"
首先,您将获得重复计数,然后是关键字DUP
,然后是要在括号中重复的内容的说明.
重复规范可能包括其他DUP
语句.
First you get a repeat count, then the keyword DUP
and then a specification of what to repeat in brackets.
The repeat spec may include additional DUP
statements.
这篇关于源BYTE“这是源字符串",0目标BYTE SIZEOF源DUP(0),0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!