This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
3. Do NOT use the linker link.exe (32 bit) in the masm32/bin directory. Use the linker version 5.60 to generate 16-bit DOS applications. http://www.scs.carleton.ca/~sivarama/asm_book_web/free_MASM.html
3.1. Download lnk563.exe size 274 KB from the following URL: http://download.microsoft.com/download/vc15/Update/1/WIN98/EN-US/Lnk563.exe http://www.scs.carleton.ca/~sivarama/asm_book/source/win_nasm_readme.pdf
4. Copy this file to C:\MASM32\BIN and run it. Answer Yes(y) when asked whether to overwrite existing files. http://www.intelligent-systems.info/classes/ee360/tutorial.htm
6. On the Advanced tab, click Environment Variables.
6. ท่ีแท็บ Advanced, คลิก Environment Variables
11
7. Under System variables box, select variable Path and click on Edit.
7. ในกรอบ System variables, ใน System variables เลือก Path คลิก Edit
8. In Variable value edit box add the new paths separated by semicolons (;) C:\masm32\bin, click OK, click OK and click Ok again.
8. ในช่อง Variable value ใส่เส้นทางใหม่ข้ันด้วยเครื่องหมายอัฒภาค (;) ดังนี้ C:\masm32\bin, คลิก OK, คลิก OK, และคลิก OK
9. Click Start, and then click Run.
9. คลิก Start, และคลิก Run
12
10. In the Open box, type cmd, and then click OK.
10. ในช่อง Open, พิมพ ์cmd, และคลิก OK
11. Create a folder to hold your Assembly source code file, using the mkdir command, and then change into the working directory, using the cd command. Finally, create your Assembly source code file by typing notepad hello.asm.
;tasm hello.asm ;tlink hello.obj ;For MASM, type: ;ml hello.asm ;This program prints the message "Hello World!" on the screen. .model small .stack .data Message db "Hello World!",10,13,"$" .code start: ;Get segment of Message. mov ax,SEG Message mov ds,ax ;Write 'Hello World!' to the screen. mov ah,9 mov dx,OFFSET Message int 21h ;Terminate program. mov ax,4c00h int 21h end start
15
16
14. To assemble and link, use the command: ml hello.asm
14. การแปลโค้ดและเช่ือม, ใช้ค าส่ัง: ml hello.asm
15. To run the program, use the command: hello
15. การรันโปรแกรม, ใช้ค าส่ัง: hello
16. The program prints the message Hello World! on the next line.
6. From the Tools menu, select Configure User Tools.
6. ท่ีเมนู Tools, เลือก Configure User Tools
27
7. In Preferences dialog box On User tools page click on the Group Name button to change the default group name Group 3.
7. ในกรอบ Preferences ท่ีหน้า User tools คลิกปุ่ม Group Name เพื่อเปล่ียนช่ือ
8. In the New Name text box, type MASM 6.14.8444
8. ในช่อง New Name, พิมพ์ MASM 6.14.8444
28
9. Select the Add Tool button.
9. คลิกปุ่ม Add Tool
10. Select Program from the popup menu.
10. เลือกเมนู Program
29
11. Set the options like this: Menu text: MASM Command: C:\masm32\bin\ml.exe Argument: $(FilePath) Initial directory: $(FileDir) Capture output: ON and then click Apply.
11. เซ็ตค่าต่างๆดังนี้
Menu text: MASM Command: C:\masm32\bin\ml.exe Argument: $(FilePath) Initial directory: $(FileDir) Capture output: ON หลังจากนั้นคลิกปุ่ม Apply
30
12. Select the Add Tool button.
12. คลิกปุ่ม Add Tool
13. Select Program from the popup menu.
13. เลือกเมนู Program
31
14. Set the options like this: Menu text: Run Command: $(FileNameNoExt) Argument: Initial directory: $(FileDir) Capture output: ON and then click OK.
14. เซ็ตค่าต่างๆดังนี้
Menu text: Run Command: $(FileNameNoExt) Argument: Initial directory: $(FileDir) Capture output: ON หลังจากนั้นคลิกปุ่ม OK
15. From the Tools menu, select User Tool Groups, and then MASM 6.14.8444
15. ท่ีเมนู Tools, เลือก User Tool Groups, เลือก MASM 6.14.8444
32
16. To compile, open the source file, select MASM from the Tools menu.