问题
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
回答1:
SIZEOF
simply denotes the size of a type or structure.
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"
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.
来源:https://stackoverflow.com/questions/39863810/source-byte-this-is-the-source-string-0-target-byte-sizeof-source-dup0-0