flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
JohnFound 13 Aug 2003, 09:34
It's an exelent idea to make simple examples for newbies.
Only one note: Better make separate section for imports. The newbie will understand more clear this approach. |
|||
![]() |
|
scientica 13 Aug 2003, 10:49
Nice, but please use the code tags: (they work like html tags <code></code> but with the "< >" replaced with "[ ]")
Code: ; MsgBox example: FASMW version format PE GUI 4.0 entry start include '%include%\win32a.inc' section '.data' data readable writeable _MsgCaption db "Iczelion's tutorial no. 2",0 _MsgBoxText db "Win32 Assembly is Great!",0 section '.code' code readable executable start: invoke MessageBox, HWND_DESKTOP,\ _MsgBoxText, _MsgCaption, MB_ICONINFORMATION+MB_OK exit: invoke ExitProcess, 0 ; import data in the same section data import library kernel32,'KERNEL32.DLL',\ user32,'USER32.DLL' import kernel32,\ ExitProcess,'ExitProcess' import user32,\ MessageBox,'MessageBoxA' end data ;Cheers, ;The I I learned the most asm actually from looking at examples (well documented are the best), and a good opcode/win32 API reference is very useful to understand the example(s). Here's teh example using the win32ax.inc: (and the macros) Code: ; MsgBox example: FASMW version include '%include%\win32ax.inc' .data _MsgCaption db "Iczelion's tutorial no. 2",0 _MsgBoxText db "Win32 Assembly is Great!",0 .code start: invoke MessageBox, HWND_DESKTOP,\ _MsgBoxText, _MsgCaption, MB_ICONINFORMATION+MB_OK exit: invoke ExitProcess, 0 .end start _________________ ... a professor saying: "use this proprietary software to learn computer science" is the same as English professor handing you a copy of Shakespeare and saying: "use this book to learn Shakespeare without opening the book itself. - Bradley Kuhn |
|||
![]() |
|
imagineer 14 Aug 2003, 02:16
JohnFound wrote:
Quote:
Thanks, the revised code is here. Code: ; MsgBox example: FASMW version format PE GUI 4.0 entry start include '%include%\win32a.inc' section '.data' data readable writeable _MsgCaption db "Iczelion's tutorial no. 2",0 _MsgBoxText db "Win32 Assembly is Great!",0 section '.code' code readable executable start: invoke MessageBox, HWND_DESKTOP,\ _MsgBoxText, _MsgCaption, MB_ICONINFORMATION+MB_OK exit: invoke ExitProcess, 0 section '.idata' import data readable writeable library kernel32,'KERNEL32.DLL',\ user32,'USER32.DLL' import kernel32,\ ExitProcess,'ExitProcess' import user32,\ MessageBox,'MessageBoxA' Cheers, The I |
|||
![]() |
|
imagineer 14 Aug 2003, 02:19
Scientica wrote:
Quote:
I see that there are 3 macro sets ( for both ASCII and WIDE versions). For beginners, which version is recommended? Thks, The I |
|||
![]() |
|
JohnFound 14 Aug 2003, 05:36
imagineer wrote:
Actually, I think that it's a little bit dangerously to use big complex macro sets for beginers. Plain source (even larger as size) is better, because it gives the newbie clear idea what actually happens. When newbie becomes more experienced, he will discover these macro tricks. |
|||
![]() |
|
fasm9 14 Aug 2003, 05:39
thanks!
easy to understand it. but it is out of my attention. i think the macro set is not normalized, it's usage is very chaotic and unpredictable. -- sorry, i always interested in programmable graphic.(instead of letters!) |
|||
![]() |
|
imagineer 14 Aug 2003, 06:00
JohnFound wrote:
Quote:
Thanks, so I'll stick with win32a.inc. fasm9 wrote: Quote:
You are absolutely right fasm9. Especially among the assemblers available, there are many different macro sets. Unfortunately, there is no uniform macro sets among assemblers. Even within one assembler itself. I also use NASM and there are different macro sets, one from NaGoA and others. ![]() Cheers, The I |
|||
![]() |
|
boysoledad 24 Sep 2003, 13:37
[quote="imagineer"]JohnFound wrote:
[quote] Only one note: Better make separate section for imports. The newbie will understand more clear this approach. [/quote] Thanks, the revised code is here. [code] ; MsgBox example: FASMW version format PE GUI 4.0 entry start include '%include%\win32a.inc' section '.data' data readable writeable _MsgCaption db "Iczelion's tutorial no. 2",0 _MsgBoxText db "Win32 Assembly is Great!",0 section '.code' code readable executable start: invoke MessageBox, HWND_DESKTOP,\ _MsgBoxText, _MsgCaption, MB_ICONINFORMATION+MB_OK exit: invoke ExitProcess, 0 section '.idata' import data readable writeable library kernel32,'KERNEL32.DLL',\ user32,'USER32.DLL' import kernel32,\ ExitProcess,'ExitProcess' import user32,\ MessageBox,'MessageBoxA' [/code] Cheers, The I[/quote] Hi everybody i think dont need programming assembler, you can take a MessageBox with OS Windows.... you start Start -- Run -- then you type rundll32 user32.dll,MessageBoxA and enter Hey do you see it fun? |
|||
![]() |
|
eet_1024 25 Sep 2003, 05:57
Translations of the first 7 (2 -9) of Iczelion's Tutorials can be found at http://board.win32asmcommunity.net/showthread.php?s=&threadid=7358
|
|||
![]() |
|
boysoledad 25 Sep 2003, 06:39
[quote="imagineer"]JohnFound wrote:
[quote] Only one note: Better make separate section for imports. The newbie will understand more clear this approach. [/quote] Thanks, the revised code is here. [code] ; MsgBox example: FASMW version format PE GUI 4.0 entry start include '%include%\win32a.inc' section '.data' data readable writeable _MsgCaption db "Iczelion's tutorial no. 2",0 _MsgBoxText db "Win32 Assembly is Great!",0 section '.code' code readable executable start: invoke MessageBox, HWND_DESKTOP,\ _MsgBoxText, _MsgCaption, MB_ICONINFORMATION+MB_OK exit: invoke ExitProcess, 0 section '.idata' import data readable writeable library kernel32,'KERNEL32.DLL',\ user32,'USER32.DLL' import kernel32,\ ExitProcess,'ExitProcess' import user32,\ MessageBox,'MessageBoxA' [/code] Cheers, The I[/quote] Hi i need add icon for Hello.asm include '%include%/win32ax.inc' .code start: invoke MessageBox,HWND_DESKTOP,"Hi! I'm the example program!","Win32 Assembly",MB_OK invoke ExitProcess,0 .end start wherer i can put icon? |
|||
![]() |
|
JohnFound 25 Sep 2003, 08:04
Hi, boysoledad.
At first: UNcheck "Disable BBCode in this post" when you posting. At second: There is no need to quote whole previous post. Simply press [PostReply] button instead of [quote] button. Your question: No, you can't do this using simple MessageBox function. You must see MessageBoxIndirect description in API reference. regards. |
|||
![]() |
|
Tomasz Grysztar 25 Sep 2003, 09:15
If you mean the icon for the executable file, it can be done this way:
Code: include '%include%/win32ax.inc' .code start: invoke MessageBox,HWND_DESKTOP,"Hi! I'm the example program!","Win32 Assembly",MB_OK invoke ExitProcess,0 .end start section '.rsrc' resource data readable directory RT_ICON,icons,\ RT_GROUP_ICON,group_icons resource icons,\ 1,LANG_NEUTRAL,icon_data resource group_icons,\ 1,LANG_NEUTRAL,main_icon icon main_icon,icon_data,'hello.ico' |
|||
![]() |
|
boysoledad 26 Sep 2003, 03:02
Thanks Privalov ... i complier it have icon in view file tree....
Thanks |
|||
![]() |
|
boysoledad 26 Sep 2003, 03:09
Please help
I want take a dialog box as About notepad as a files gif i send...
|
||||||||||
![]() |
|
Dunduk 26 Sep 2003, 05:34
Use ShellAbout function from SHELL32.DLL. Using:
int ShellAbout ( HWND hWnd, // handle of parent window LPCTSTR szApp, // title bar and first line text LPCTSTR szOtherStuff, // other dialog text HICON hIcon // icon to display ); That is: Code: .... invoke ShellAbout, [hwnd], _title, _about, [hicon] .... _title db 'About my prog...', 0 _about db 'My prog', 13, 10, 'Copyright ', 169, ' Myself', 0 .... Something like that |
|||
![]() |
|
MattBro 08 Nov 2003, 20:06
Here's a real newbie question.
Where is the documentation for the api macro/instruction. I've seen it used in code like this api CreateFile,[filename],GENERIC_READ,0,NULL,\ OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL There is nothing about this in the manual. ![]() _________________ -- ------------------------------------------------------- "I am the Way and the Truth and the Light, no one comes to the Father except through me" - Jesus --------------------------------------------------------- |
|||
![]() |
|
eet_1024 11 Nov 2003, 07:09
I hope you don't think information on API's are suppost to be in the fasm manual.
Do a search for win32.hlp |
|||
![]() |
|
kaafe 11 Nov 2003, 22:27
you need this help file, a little big.
http://www.borland.com/devsupport/borlandcpp/patches/BC52HLP1.ZIP |
|||
![]() |
|
Tomasz Grysztar 12 Nov 2003, 01:39
Some similar links you can find in this thread: http://board.flatassembler.net/topic.php?t=230 (also fasm's "official" package of help files for Win32 programming).
|
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2023, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.