What does `dup (?)` mean in TASM?

大憨熊 提交于 2019-11-30 11:46:13

STACK16_SIZE dup (?) means to duplicate the data in parenthesis by STACK16_SIZE times. It is equivalent to writing ?, ?, ?, ?, ... (100h times)

The data in parens is "uninitialized data". That is, memory is allocated, but not set to any particular value on load.

Assembly does not provide an array "type". If it does, it is only for debuggers for use when inspecting the data. However, in this code snippet, stack16 is a symbol with an address beginning a memory block of bytes—which is counter-intuitive and potentially a source of a subtle bug. For a CPU stack, it really ought to be defined as 16 bit words (dw) or 32 bit words (dd).

? means no particular value, uninitialized. DUP means duplicate.

So you get 100h bytes that are uninitialized.

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