linux-assembly.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "uglyhunK" <mail@uglyhunk.in>
To: linux-assembly@vger.kernel.org
Subject: Win32 function call using GNU assembler
Date: Wed, 02 Sep 2009 13:41:08 +0530	[thread overview]
Message-ID: <20090902081109.40BBA300022A@bmail00.one.com> (raw)


Hi,

The following assembly source is not working. Really not sure where I'm going wrong.
Any guidance will be appreciated.

.section .data
	CLASS_NAME:
		.ascii "M\0a\0i\0n\0\0\0" # Main
	WINDOW_NAME:
		.ascii "A\0S\0M\0 \0W\0i\0n\0d\0o\0w\0\0\0" # ASM Window
		
.section .text
	.globl _WinMain@16
	_WinMain@16:
		# function prologue
		pushl	%ebp
		movl	%esp, %ebp
		
		pushl	$0				# LPVOID lpParam
		movl	8(%ebp), %eax
		pushl	%eax			# HINSTANCE hInstance
		pushl	$0				# HMENU hMenu
		pushl	$0				# HWND hWndParent
		pushl	$120			# nHeight
		pushl	$240			# nWidth
		pushl	$-2147483648	# y
		pushl	$-2147483648	# x
		pushl	$13565952		# dwStyle
		pushl	$WINDOW_NAME	# lpWindowName
		pushl	$CLASS_NAME		# lpClassName
		pushl	$512			# dwExStyle
		call	_CreateWindowExA@48
		add		$48, %esp
		
		# function epilogue
		movl	%ebp, %esp
		popl	%ebp
		ret

Thank you

             reply	other threads:[~2009-09-02  8:11 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-02  8:11 uglyhunK [this message]
2009-09-02 16:16 ` Win32 function call using GNU assembler Robert Plantz
2009-09-02 18:35 ` Brian Raiter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090902081109.40BBA300022A@bmail00.one.com \
    --to=mail@uglyhunk.in \
    --cc=linux-assembly@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).