[Original] MASM32 Novice Guide

xiaoxiao2021-03-06  22

If you use the assembly language to develop a program under Windows, Masm32 is a good choice.

(Masm32 download address, please use Google search.)

Workers must be good, and must first make a tool.

This article is mainly for Masm32 V8, three points:

1. Basic use method

How to build, assemble, link source files, and run-generated executables in Masm32.

2, how to open the online help function of MASM32

3, Chinese Qeditor menu

First, basic use

Establish Test.asm and generate Test.exe as an example under the C: / PWIN951 / TEMP folder.

After installing MASM32, open "Resource Manager" or "My Computer", enter the folder where MASM32 is located (assuming to c: / masm32), double click qeditor.exe

Icon, this enters the MASM32 integrated development environment.

1. [This step is optional, and the following optional steps are simply referred to as "Optional"] Enter the resource file, then use the menu file on the menu bar -> Save or shortcut in the disk function Icon, I need to enter the file name for the first time, pay attention to specify the extension .rc and store, note if the file name must be RSRC.RC if it is compiled in an integrated environment, and the file name must be RSRC.RC (Size).

2. [Optional] Compile the resource file. Use the menu project on the menu bar Project -> Compile Resource File. At this time, the system opens a DOS window to run the relevant batch file and report the result.

If it is not compiled, the information is (the specific error message varies from error):

Microsoft (R) Windows (R) Resource Compiler, Version 5.00.1823.1 - Build 1823

Copyright (c) Microsoft Corp. 1985-1998. All Rights Reserved.

Using CodePage 936 As Default

Creating Rsrc.res

RC: RCPP-CP 936 -F C: / PWIN951 / TEMP / RCA83947 -G C: / PWIN951 / TEMP / RDA83947 -DRC_IN VOKED -D_WIN32 -PC /: / -E-I. -I.

Rsrc.rc.rc.

Rsrc.rc (1): Error RC2135: File NOT Found: Mainicon.ico.

Writing Menu: 600, LANG: 0x409, Size 128

Microsoft (R) Windows Resource To

Object Converter Version 5.00.1736.1

CopyRight (C) Microsoft Corp. 1992-1997. All Rights Reserved.

Cvtres: Fatal Error Cvt1101: Cannot Open Rsrc.res forreading

..

The line number, error type code, and error message of the error statement are given.

At any one button, turn off this DOS window and modify the resource file according to the error message, after the deployment, and recompile.

Tips Tips: In qeditor.exe, press CTLR G to skip to the specified line

Until the following successful information:

Microsoft (R) Windows (R) Resource Compiler, Version 5.00.1823.1 - Build 1823

Copyright (c) Microsoft Corp. 1985-1998. All Rights Reserved.

Using CodePage 936 As Default

Creating RSRC.RESRC: RCPP -CP 936 -F C: / PWIN951 / TEMP / RCA81843 -G C: / PWIN951 / TEMP / RDA81843 -DRC_IN

VOKED -D_WIN32 -PC /: / -E -I. -I.

Rsrc.rc.rc.

Writing Menu: 600, LANG: 0x409, Size 128

Microsoft (R) Windows Resource To

Object Converter Version 5.00.1736.1

CopyRight (C) Microsoft Corp. 1992-1997. All Rights Reserved.

..

Note Generates RSRC.RES and RSRC.Obj files, and then close this DOS window again.

⒊ Enter the source program, then use the disk-shaped icon in the menu file -> Save or shortcut on the menu bar, the first time you need to enter the file name, pay attention to specify the extension .asm [this example C: /PWIN951/Temp/test.asm].

⒋ assembly source program. Use the menu project on the menu bar Project -> Assemblier ASM file. At this time, the system opens a DOS window to run the relevant batch file. After the end, a window report result called "/masm32/bin/asmbl.txt" will pop up.

If the compilation is unsuccessful, the display information is as follows (the specific error message varies from error):

Ask: C: /PWIN951/Temp/test.asm

C: /PWIN951/Temp/test.asm (60): Error A2006: undefined Symbol: NULL

C: /PWIN951/Temp/test.asm (60): Error A2114: Invoke Argument Type Mismatch: Argument: 1

Volume In Drive C Is Liu

Volume Serial Number IS 4061-17D7

Directory of C: / PWIN951 / TEMP

Test ASM 8,402 06-05-02 19:29 Test.asm

1 File (s) 13,010 bytes

0 DIR (s) 24, 403, 968 BYTES Free

This includes detailed error information. Such as

C: /PWIN951/Temp/test.asm (60): Error A2006: undefined Symbol: NULL

in

C: /PWIN951/Temp/test.asm is the file specifier for the source file file

(60) The line number of the statement that causes the wrong statement in the source program.

Error A2006 A2006 is the error type code

undefined Symbol: NULL is specific error message

At this time, the corresponding line should be modified in these information modifications, and the replication is returned. Until the window shows the following successful information:

Ask: C: /PWIN951/Temp/test.asm

Volume In Drive C Is Liu

Volume Serial Number IS 4061-17D7

Directory of C: / PWIN951 / TEMP

Test ASM 8,401 06-05-02 19:34 Test.asm

Test Obj 3,720 06-05-02 19:35 Test.obj

2 File (s) 16,729 bytes

0 DIR (s) 22, 298, 624 bytes Free

This includes information about the newly generated target file Test.obj.

⒌Link the target file. Use the menu project on the menu bar Project -> Link Obj File. At this time, the system opens a DOS window to run the relevant batch file, and pops up the window of the window name "/masm32/bin/lnk.txt" is as follows: Volume In Drive C Is Liu

Volume Serial Number IS 4061-17D7

Directory of C: / PWIN951 / TEMP

Test ASM 8,401 06-05-02 19:34 Test.asm

Test Obj 3,720 06-05-02 19:35 Test.obj

Test EXE 4,608 06-05-02 19:38 Test.exe

3 File (s) 16,729 bytes

0 DIR (s) 24, 395, 776 bytes Free

This includes information about the newly generated executable Test.exe.

Note: Did not find the resource file is not an error, so if your program uses the window, the assembly and links are successfully completed, but it can't see the program window when running, but you will put the window information in the resource file, but resources The file has not been compiled or compiled without success.

⒍ Run the generated executable. Using the menu project on the menu bar, Project -> Run Program.

See the result of the program run?

If your program uses a window, but can not be seen when running, it is likely that you put the window information in the resource file, but the resource file has not been compiled or compiled without success.

In summary, it is important to note that the source program file or resource file must be modified first, and then the subsequent operation, otherwise the error is still.

The features and usage of other menu items in the Project menu:

Assemble & Link assembled sources and links, applicable to resource files are not modified, but modify the source program

Build All Compiles resource files, assembly sources and links, suitable for resource files and source programs

Console Link Obj File Compilation Console Source Program

& Console Assemble Link assembles and links console source programs

Console Build ALL Generates Console Executable Programs

Second, open the online help function of MASM32

When writing programs with MASM32, a large number of Windows API functions, many of the many functions, we are hard to remember, can only be checked.

The MASM32 provides an online help feature, but must be set according to the corresponding settings to "trick".

Press the function key F1 in Qeditor, pop up the dialog box, help files? HLP did not find? How to do? Do it with me:

Select Menu Tools -> Change Editor Settings, pop up the window named "Change Quick Editor Settings", found "F1 Help File =? HLP" item from the list box under Double Click Item to Edit, what did we see? .hlp is here, the original MASM32 does not know where our help files are placed, so we can only be specified by our users themselves.

Double-click this, pop up a dialog, enter the file specifier of the help file we use, [If me is "c: /pin951/help/win32.hlp", is the DLEPHI. ], Or click the "Browse ..." button to select from the Select File dialog box. After doing finished, click the "Save" button and close this window.

Restart the Qeditor, locate the cursor in an API function name, such as messagebox, press the function key F1, help the information! Note: After the modification is set, you want to restart the Qeditor, and the new settings work.

Third, the Chinese Qeditor menu

Qeditor's menu content is saved in the file qeditor.ini, change the menu item text to Chinese, complete the Chinese (of course you want to use the Chinese version of Windows).

Since qeditor.ini is a very important file, you must back up before modifying, and be careful when modifying. Below is the original content of the Hanhua I will correspond to the menu item text of the Project menu.

; ------------------------------------------------- -------

Do Not Edit this File Manually, the sequence of settings

; Must Be in the correct ORDER AND IT MUST HAVE THE CORRECT

Number of settings Otherwise the Editor May Not Function

Properly.

; ------------------------------------------------- -------

[editor settings]

Masm32 Version 6

Command.com

0

1

1

4

2

2

76

80

70

*

*

*

*

/PWIN951/HELP/WIN32.HLP

0

[Menu Settings]

; ------------------------------------------------- -----------

File Paths SHOULD HAVE THE Drive Added So That The Relative

Paths Become Absolute Paths. this allows the Tools to be

Accessed from DiffERENT DRIVES on The Computer.

; ------------------------------------------------- ------------

[& R Project]

& R Compile resource file, / masm32 / bin / bres.bat {b}

& A assembly source program file, / masm32 / bin / assmbl.bat {b}

-

& L Link target file, / masm32 / bin / lnk.bat {b}

Compilation Source Program and Link Target File, / Masm32 / Bin / Build.bat {B}

& B compile resource files, assemble sources and link target files, / masm32 / bin / bLDall.bat {b}

Run & makeit.bat to generate executables, makeit.bat

-

& O Link console target file, / masm32 / bin / lnkc.bat {b}

& C assembly and link console files, / masm32 / bin / buildc.bat {b}

& A one step generation console executable, / masm32 / bin / bLDALLC.BAT {B}

-

& R running program, {b} .exe

[& Tools]

转载请注明原文地址:https://www.9cbs.com/read-43140.html

New Post(0)