I hope you have read the previous posts about FASM. Else please read it here: http://terminalcoders.blogspot.in/search/label/FASM.
I hope most of you are familiar with Visual C++. Otherwise it will be hard to study FASM/MASM. Because you should know the syntax of Visual C++ and how you can convert it to FASM.
I hope the first GUI program you studied is how to show the MessageBox. Isn't? Now I will explain the important parts of code.
The syntax of MessageBox() in Visual C++ is,
I hope most of you are familiar with Visual C++. Otherwise it will be hard to study FASM/MASM. Because you should know the syntax of Visual C++ and how you can convert it to FASM.
I hope the first GUI program you studied is how to show the MessageBox. Isn't? Now I will explain the important parts of code.
The syntax of MessageBox() in Visual C++ is,
MessageBox(WindowHandle, YourMessage, CaptionOfMessageBox, IconsAndButtons);
Now we can convert it to FASM,
The function MessageBox() is declared in user32.dll in Windows OS. When the API function MessageBox() calls, the OS will pass its control to kernel modules where the function is actually declared. So we need to import user32.dll. The last import is ExitProcess() function. This function is declared in kernel32.dll. So kernel32.dll is must be included. The syntax of import part is,
data import library kernel32, 'kernel32.dll', user32, 'user32.dll' import kernel32, ExitProcess, 'ExitProcess' import user32, MessageBox, 'MessageBoxA' end data
In line ` library import kernel, 'kernel.dll', user32, 'user32.dll' ` the `kernel32` and `user32` are aliasing of long `kernel32.dll` and `user32.dll`. Like wise we have aliased ExitProcess and MessageBoxA.
The function `invoke` is used to invoke the system calls.
invoke MessageBox, 0, msg, cap, MB_ICONINFORMATION+MB_YESNO
The full source code is,
format PE GUI 4.0 ; ; ; AJITH KP > HTTP://WWW.TERMINALCODERS.BLOGSPOT.DE ; ; ; IMPORTED FROM MY ANOTHER BLOG DSPROGRAMMING.CO.VU ; include 'win32a.inc' invoke MessageBox, 0, msg, cap, MB_ICONINFORMATION+MB_YESNO msg db 'Do you like this blog http://www.dsprogramming.co.vu ???', 0 cap db 'D S', 0 exit: invoke ExitProcess data import library kernel32, 'kernel32.dll', user32, 'user32.dll' import kernel32, ExitProcess, 'ExitProcess' import user32, MessageBox, 'MessageBoxA' end data
Now check the size of programs in both FASM and Visual C++ of same program.
In FASM |
In Visual C++ |
The size of program in FASM is only 1 KB, but the program in Visual C++ is about 27 KB. So the program in ASM will execute more rapidly than programs in C++ or any other programming languages. So that ASM is used to create device drivers, game modules, even computer viruses!!!.
Hope you like this post. Please share with you friends who is interested in it.
7 comments
Write commentsbilecik
Replyvan
elazığ
tokat
uşak
NVZPR
C197A
ReplyDenizli Parça Eşya Taşıma
Bingöl Evden Eve Nakliyat
Maraş Lojistik
Ardahan Şehir İçi Nakliyat
Rize Evden Eve Nakliyat
Edirne Lojistik
Yenimahalle Parke Ustası
Vindax Güvenilir mi
Karabük Parça Eşya Taşıma
19412
Replyburdur rastgele görüntülü sohbet ücretsiz
Bartın Chat Sohbet
canlı görüntülü sohbet odaları
Balıkesir Ücretsiz Sohbet
erzurum en iyi ücretsiz görüntülü sohbet siteleri
erzurum telefonda canlı sohbet
parasız sohbet siteleri
Amasya Ücretsiz Sohbet Uygulamaları
aydın telefonda sohbet
FF10B
ReplyApenft Coin Hangi Borsada
Kripto Para Madenciliği Nasıl Yapılır
Soundcloud Takipçi Satın Al
Tiktok Beğeni Hilesi
Keep Coin Hangi Borsada
Mexc Borsası Kimin
Paribu Borsası Güvenilir mi
Parasız Görüntülü Sohbet
Pinterest Takipçi Hilesi
4EAF0
ReplyClubhouse Takipçi Hilesi
Facebook Takipçi Hilesi
Snapchat Takipçi Hilesi
Görüntülü Sohbet
Bitcoin Üretme
Xcn Coin Hangi Borsada
Kripto Para Üretme Siteleri
Pinterest Takipçi Satın Al
Bitcoin Nasıl Kazılır
E0A4B
ReplyTuzlukçu
Suruç
Altunhisar
Digor
Harmancık
Olur
Çüngüş
Hisarcık
Aybastı
شركة تسليك مجاري بالخبر KAQRShho77
Reply