看板 CSIE_ASM 關於我們 聯絡資訊
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% 記憶體使用量不斷往上跳 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 218.167.199.60
alex1025:喔~原來如此~但是我弄.data? 11/05 17:43
alex1025:numbers BYTE 268435456 DUP(?) build還是花不少時間 11/05 17:44
frankfbo:嗯 還是花很多時間 11/05 19:45
pj2:舊版的MASM會產生一些code(例如自動初始化為零), 但也做得太久 11/07 18:34
pj2:了, 當數字不大時還好, 數字大時不知它怎麼做的 11/07 18:36