Sandundhammika's Blog











Assuming that you had already installed the nasm and gcc under the windows.
Write the bellow source files and save them,
And in the command shell execute bellow commands to compile link and run.

message_box.asm:

global _WinMain@16
extern _MessageBoxA@16

[section .data]
title db "Message",0
message db "Hellow World!",0

[section .code]
_WinMain@16:
	push 0
	push title
	push message
	push 0
	call _MessageBoxA@16
	ret
 

compile and run:

J:\EXERCISES\Assembly\win32_message_box>nasm -f elf message_box.asm

J:\EXERCISES\Assembly\win32_message_box>gcc -o message_box.exe -mwindows messag_box.o

J:\EXERCISES\Assembly\win32_message_box>message_box

J:\EXERCISES\Assembly\win32_message_box>

assuming J:\Exercises\assembly\win32_message_box is your source code directory.and nasm and gcc
had already installed on your computer.

and finally hit message_box.exe in the shell or go to the folder that contain source files and double click
the message_box.exe file.

happy coding!



Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

et cetera
%d bloggers like this: