source BYTE “This is the source string”,0 target BYTE SIZEOF source DUP(0),0

旧城冷巷雨未停 提交于 2019-12-20 04:09:21

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!