1 / 26

第 2 章

第 2 章. 使用 MASM 來組譯程式. 本章提要. 組合語言程式的開發過程 程式的基本構造 MASM 程式的基本構造 啟動 MASM 進一步的 MASM 程式. 組合語言程式的開發過程. 以編輯器來編寫原始程式. 以組譯器來組譯成目的檔. 以聯結器來聯結成可執行檔. 以偵錯器除錯. 較大型的程式很少一次就完全成功的, 所以偵錯的手續是不可免的。常用的偵錯工具 ( debugger) 程式有: DEBUG、CodeView 等等。. 整合工具.

truly
Download Presentation

第 2 章

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 第 2 章 使用 MASM 來組譯程式

  2. 本章提要 • 組合語言程式的開發過程 • 程式的基本構造 • MASM 程式的基本構造 • 啟動 MASM • 進一步的 MASM 程式

  3. 組合語言程式的開發過程

  4. 以編輯器來編寫原始程式

  5. 以組譯器來組譯成目的檔

  6. 以聯結器來聯結成可執行檔

  7. 以偵錯器除錯 • 較大型的程式很少一次就完全成功的, 所以偵錯的手續是不可免的。常用的偵錯工具 (debugger) 程式有:DEBUG、CodeView 等等。

  8. 整合工具 • MASM 6.x 附上了一個新的整合性的發展工具 –PWB。PWB 具有一個編輯器, 而且也提供了呼叫組譯器、聯結器、與偵錯器的功能。 • MASM 6.x 還有一個新的整合工具 –ML。ML.EXE 在組譯完之後, 會自動呼叫 LINK 來做聯結, 所以在使用上較 MASM.EXE 方便。

  9. 程式的基本構造

  10. MASM 程式架構

  11. MASM 程式

  12. MASM 6.x 的操作手續

  13. MASM 所組譯成的機械語言檔

  14. MASM 6.x 的 LINK 手續

  15. MASM 6.x 的 LINK 手續

  16. ML 手續

  17. ML 手續

  18. 進一步的 MASM 程式

  19. 進一步的 MASM 程式

  20. 標名 Label • 用以標示程式的位址 • 用以標示資料的位址

  21. 程式標名

  22. 資料標名 • 資料標名又稱為變數 (Variable) 名, 必須以指令來指定每一資料單位的長度:

  23. 資料標名 • 已初值化 (initialized) 變數 • 未初值化 (Uninitialized) 變數

  24. 定義實數型態的變數

  25. 定義未初值化的變數

  26. MASM 程式與 DEBUG 程式之比較 • DEBUG 程式較簡短, 也較原始, 其最大缺點是無法設立標名, 因此必須以人工計算出字串的開頭位址。 • MASM 程式, 因為可以設立標名, 可以用標名來代表字串之位址, 所以可直接寫 mov dx, OFFSET message, 而不必去算出字串的真正位址。 

More Related