| Register | FAQ | Calendar | Search | Today's Posts | Mark Forums Read |
|
#1
| |||
| |||
| Hi guys as you know i have not learned much of asm till now but i wrote a simple programme using icezelion tutorial in fasm .I know there are lots of mistake so pleae help me to do away with the mistake.The code is Code: include 'win32a.inc' msgboxcap db "my first programme' msgboxtext db "asm is great" invoke MessageBox, NULL, addr MsgBoxText, addr MsgBoxCaption, MB_OK invoke ExitProcess, NULL fasm is opening another file called win32a and its written at the top of a dialog box :file not found. I opened the fasm file and looked into the include folder i saw the file "win32a".And another thing is that at the right hand bottom of the task bar there is a warning fasmw.exe is a corrupt file.When i bought the computer windows came installed with it.For the first time i installed linux in my box on my own and i made a partition from the drive where my fasm exist.Some softwares were ruined i had to install them again so can this be a problem for the above mentioned problem.Should i install the compiler again |
|
#2
| |||
| |||
| On Sep 3, 4:31*pm, palbodhisattwa2016 <spamt...@crayne.org> wrote: > Hi guys as you know i have not learned much of asm till now but i > wrote a simple programme using icezelion tutorial in fasm .I know > there are lots of mistake so pleae help me to do away with the > mistake.The code is > Code: include 'win32a.inc' > msgboxcap db "my first programme' > msgboxtext db "asm is great" > invoke MessageBox, NULL, addr MsgBoxText, addr MsgBoxCaption, MB_OK > invoke ExitProcess, NULL > fasm *is opening another *file called win32a and its written at the > top of a dialog box :file not found. I opened the fasm file and looked > into the include folder i saw the file "win32a".And another thing is > that at the right hand bottom of the task bar there is a warning > fasmw.exe is a corrupt file.When i bought the computer windows came > installed with it.For the first time i installed linux in my box on my > own and i made a partition from the drive where my fasm exist.Some > softwares were ruined i had to install them again so can this be a > problem for the above mentioned problem.Should i install the compiler > again If you look in the ..\source\win32 subdirectory, you will see an example of how to do a Windows program from Fasm. However, I believe it would be too big of a job for a beginner to attempt to convert an Iczelion Tutorial into Fasm code, so I suggest you enquire at the Fasm forum to see if anyone has already accomplished this task. http://board.flatassembler.net/ Nathan. |
|
#3
| |||
| |||
| On 3 Sep, 21:31, palbodhisattwa2016 <spamt...@crayne.org> wrote: > Hi guys as you know i have not learned much of asm till now but i > wrote a simple programme using icezelion tutorial in fasm .I know > there are lots of mistake so pleae help me to do away with the > mistake.The code is > Code: include 'win32a.inc' > msgboxcap db "my first programme' > msgboxtext db "asm is great" > invoke MessageBox, NULL, addr MsgBoxText, addr MsgBoxCaption, MB_OK > invoke ExitProcess, NULL First off I'd suggest you include more white space in your listings.... The above is awful hard to read and it's only five lines. Second, welcome to the whacky world of assembler. If it helps take a look at a piece of code to do something similar to what you are trying - i.e. pop up a message box and then exit. http://codewiki.wikispaces.com/winpopup.nasm Maybe it will help you find what else you need to do to your code. -- James |
|
#4
| |||
| |||
| On Sep 3, 4:31*pm, palbodhisattwa2016 <spamt...@crayne.org> wrote: > Hi guys as you know i have not learned much of asm till now but i > wrote a simple programme using icezelion tutorial in fasm .I know > there are lots of mistake so pleae help me to do away with the > mistake.The code is > Code: include 'win32a.inc' > msgboxcap db "my first programme' > msgboxtext db "asm is great" > invoke MessageBox, NULL, addr MsgBoxText, addr MsgBoxCaption, MB_OK > invoke ExitProcess, NULL I found a working example: ----8<---- format PE GUI entry start section '.code' code readable executable start: push 0 push _caption push _message push 0 call [MessageBox] push 0 call [ExitProcess] section '.data' data readable writeable _caption db 'Win32 assembly program',0 _message db 'Hello, world!',0 section '.idata' import data readable writeable dd 0,0,0,RVA kernel_name,RVA kernel_table dd 0,0,0,RVA user_name,RVA user_table dd 0,0,0,0,0 kernel_table: ExitProcess dd RVA _ExitProcess dd 0 user_table: MessageBox dd RVA _MessageBoxA dd 0 kernel_name db 'KERNEL32.DLL',0 user_name db 'USER32.DLL',0 _ExitProcess dw 0 db 'ExitProcess',0 _MessageBoxA dw 0 db 'MessageBoxA',0 section '.reloc' fixups data readable discardable ---->8---- Found that here: http://en.wikibooks.org/wiki/Transwi...indows.2C_FASM Nathan. |
|
#5
| |||
| |||
| Thanks for the sorce code but i want to ask what is the stack used for in asm.I know what is a stack,LIFO (last in first out).I made a linked list programme in c++.Does this"stack" denote any place in the memory or something else.In the following line push _caption As far as i think is _caption is a variable name .Where does this "_caption" go.Where does the stack exist.Some place in memory??? |
|
#6
| |||
| |||
| "palbodhisattwa2016" asked: > Thanks for the sorce code but i want to ask what is the stack used for > in asm. It can be used the same way as in C, but in ASM we got much more freedom to decide the how/why and when. > I know what is a stack,LIFO (last in first out).I made a > linked list programme in c++. > Does this "stack" denote any place in the memory or something else. Stack is precious memory anyway, pointed to by the SS:ESP pair. A problem might be that return-addresses from CALL/Invoke and arguments share the same stack in C-styled coding like winAPI (x86 CPUs unfortunately got only one stack-pointer). > In the following line > push _caption > As far as i think is _caption is a variable name. Yes. But we push a 32-bit var-pointer rather than its name. You wont find your variables by name in the final code. > Where does this "_caption" go. Usually defined somewhere in the data section, it's the compilers job to tranform this symbolic name into a binary address pattern, either an offset in a data-segment if DOS or a flat pointer if windoze, Lunix or another flat-OS. > Where does the stack exist. Some place in memory??? Yes, hopefully apart from code and other data, but we can (at least in real-mode DOS) define ourself where it shall reside in memory by loading SS and (E)SP. I'd recommend you to read any of the tutorials on basic things like registers, memory and stack, beside the mandatory RTFM ![]() __ wolfgang |
![]() |
| Thread Tools | |
| Display Modes | |
In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.