Win32 assembly: HELLOASM

Source: Internet
Author: User
.386; 32-bit architecture. Model Flat, Stdcall;include masm32.incinclude kernel32.incincludelib masm32.libincludelib Kernel32.lib.data; Data segment    Sztext db "Hello asm!", 0.code; code snippet testprint proc near; process declaration        push EBP; Save stack Base address register        mov EBP , esp; new stack        sub esp,100h; open a new 256-byte stack space        push ebx; Save the base register        push ESI; Save the source address push EDI; Save the destination change address Lea edi,[ebp-100h]; The new stack top address to Edimov ecx,40h; Set the number of copies mov eax,0cccccccch; Copy the value Rep STOs dword ptr Es:[edi]; Copy the contents of the EAX to the place where the EDI is pointing mov eax,[ebp+8]; Take out the first parameter push eax, transfer eax to StdOut function call StdOut; invoke function pop edi; restore edipop esi; restore esipop ebx; restore Ebpmov esp,ebp; restore Esppop ebp; Restore Ebpret; function returns testprint Endpstart:lea eax,sztext; fetch string push eax; call Testprint; invoke function pop eax; restore stack balance end start


Win32 assembly: HELLOASM

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.