"Hello,world!" Win32 Assembly Applet

Source: Internet
Author: User
Tags win32

"Hello,world!" Win32 Assembly Applet SZTEXT DB "Hello, world!", 0

Szcaption db "Win32asm", 0

    .code
start:
    push MB_OK
    lea eax,szCaption
    push eax
    lea eax,szText
    push eax
    push NULL
    call messageboxa
    xor eax,eax
    push eax
    call exitprocess
    end start

--------------------------------------------------

Compile Link:

In the following two steps:

ML/C/coff 3.asm

Link/subsystem:windows/libpath:d:masm7lib 3.obj

The first step is to compile the 3.obj file

/C means compile only, not link

/coff represents the target file for generating COFF format

The second chain delivered into 3. exe files

/subsystem:windows to generate Windows files

/libpath:d:masm7lib indicates that the path to the citation library is: D:masm7lib.

After installing Masm32, the introduction library is located in the Masm32lib directory.

You can also set the value of environment variable LIB: Type set lib=d:masm7lib at a DOS prompt, so that "link" can be simply written:

Link/subsystem:windows 3.obj, imagine, in the process of debugging, modify the source program is commonly used, each compile link to bring/libpath: ... How annoying would that be? Of course, we can also in the source program directly to the location of the input, so that the link is convenient, as follows:

Includelib D:masm7libkernel32.lib

Includelib D:masm7libuser32.lib

--------------------------------------------------

Execution: At the DOS prompt, type 3, enter, a message box, haha, the real Win32 program!

--------------------------------------------------

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.