Re: [問題] .data 下的變數以及內容

看板CSIE_ASM作者 (pj2)時間19年前 (2006/11/05 11:50), 編輯推噓4(401)
留言5則, 3人參與, 最新討論串2/2 (看更多)
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

11/05 17:43, , 1F
喔~原來如此~但是我弄.data?
11/05 17:43, 1F

11/05 17:44, , 2F
numbers BYTE 268435456 DUP(?) build還是花不少時間
11/05 17:44, 2F

11/05 19:45, , 3F
嗯 還是花很多時間
11/05 19:45, 3F

11/07 18:34, , 4F
舊版的MASM會產生一些code(例如自動初始化為零), 但也做得太久
11/07 18:34, 4F

11/07 18:36, , 5F
了, 當數字不大時還好, 數字大時不知它怎麼做的
11/07 18:36, 5F
文章代碼(AID): #15JLzoCO (CSIE_ASM)
文章代碼(AID): #15JLzoCO (CSIE_ASM)