Re: [问题] .data 下的变量以及内容

楼主: pj2 (pj2)   2006-11-05 12:19:07
In .data section, if you use ? in place of an initializer, the assembler
will allocate the space but doesn't initialize it. You should do it at
run time. All data declared in this section would take up space in .exe
file and will be copied into memory when the program is run.
In .data? section (or BSS segment), it doesn't take space in .exe file
for those uninitialized data. A declaration of initialized data in this
section brings a warning message. Please also note that microsoft
compiler stores uninitialized data separately due to the efficiency issue.
That is, in the following program, var1 and var2 will not be allocated in a
continuous space.
.data
var1 byte 01h
.data?
var2 byte ?
.data
var3 byte 02h
※ 引述《alex1025 (我不在系馆喔!!)》之铭言:
: as title
: 会在组译的时候写入到档案吗?
: 应该不会不是吗?
: 还是我的观念错误?
: 如果不写入档案
: 我在vc时
: .data
: numbers BYTE 10000 DUP(0)
: 需要两秒钟
: .data
: numbers BYTE 268435456 DUP(0)
: 跑了二十分钟还没出来
: 还有我发现只要数字很大 工作管理员ml.exe cpu100% 内存使用量不断往上跳
作者: alex1025 (超爱杨丞琳~我要打败恶魔)   2006-11-05 17:43:00
喔~原来如此~但是我弄.data?numbers BYTE 268435456 DUP(?) build还是花不少时间
作者: frankfbo (滑稽弟)   2006-11-05 19:45:00
嗯 还是花很多时间
楼主: pj2 (pj2)   2006-11-07 18:34:00
旧版的MASM会产生一些code(例如自动初始化为零), 但也做得太久了, 当数字不大时还好, 数字大时不知它怎么做的

Links booklink

Contact Us: admin [ a t ] ucptt.com