At the risk of sounding incredibly stupid ,not that there's anything wrong with bieng stupid , I will ask a question that you ASM Gurus must have answered very frequently .... How do I start with Assembly programming ?? I have expirience in C , and have always wanted to become familliar with the low level details of Assembly language programming ..... I've read a few chapters of Randall hyde's incredible  book 'the art of assembly ..... ' (dos edition) and am flabbergasted :) ..... lots of details and lots of things to learn just to write that first "hello world" program ..... I like the book and have learnt some basics (instructions like mov , add , sub etc.) from it ..... I want to write a 'hello world' program in assembly ..... but have no idea on using masm32 under winXP ...

can someone please write a hello world program , and possibly provide the commands that'll be used to compiler n link the code for masm32 ......

regards
Posted on 2006-06-01 08:17:05 by dmesgPy
Hi,

I'd suggest that you read (also) Iczelion tutorials from http://win32assembly.online.fr/ and download the masm32 packages from http://www.masm32.com/

This is the way I started asm programming :)

Best regards,
Sami
Posted on 2006-06-01 08:28:49 by SamiP
masm32 would be my suggestion as well.
It has a C-like call syntaxis by using its macros, which makes code very easy to read.
the tutorials of iczelion are great for GUI's (graphical user interfaces), but if you aren't interested in GUI's, like i was when starting with assembly, you might find these tutorials a bit useless.

It's not much, but take a look at a small program i have written which changes the homepage of internet explorer here. The sourcecode is there for both C and assembly (masm32). If you hold the sources next to eachother you will see that it's pretty similar.

in the masm package there are tutorials as well which should get you started.
And of course there's always a great forum here where you can ask your questions!

Posted on 2006-06-01 11:36:56 by white scorpion
www.madwizard.org , download this: http://www.madwizard.org/dl.php?file=tutors.win32asm . It's a good introduction to the basics of 32bit assembly. Iczelion's tutorials are about windows programming with assembly, not about assembly itself.

Your C experience will translate pretty neatly to assembly, by the way. Charles Petzold's "programming windows" is thus a very good book as well. If you're using Microsoft Visual C++, you can do "cl /O1 /FAs source.c", which will give you a size-optimized .asm file (which is much easier to read than the speed-optimized /Ox).
Posted on 2006-06-01 13:55:32 by f0dder
One more thing! Download radasm now!
It's code completion dll was the difference between me learning asm/programming and just giving up!
It takes the weight off learning the WinApi leaving you free to learn the nitty gritty of opcodes etc....


I love RadAsm to death simply cos its so open to its users via its plugin system.

We (enduser) end up using the program we want instead of 'a programmers idea of what we want'

sorry if this turned into an advert - I am in no way affiliated with the RadAsm project  :D
Posted on 2006-06-01 15:04:23 by asmrixstar
hmm .... everyone seems to have pretty much the same suggestion ..., that bieng do win32 programming .... i wanna be able to do win32 in Asm but would that not pose a greater difficulty to a beginner ?? learning the API is one thing .....learning the API by using Asm is another :) .... I was thikin along the lines of making cute little console executables and then after mastering the language itself , moving on to win32 programing ....is that possible ??

I did download ur files white scorpion and i  gotta say the C version and the asm version look remarkably simillar ..... :) thank u for that .

Anyways , thnx for the links and the suggestions !! I'm getting a feeling that I'll be asking alot of questions in here :) Anymore  suggestions on how to do this are always welcome .

thank you .

Posted on 2006-06-01 19:26:23 by dmesgPy
The primary purpose in learning the Win32 API with assembly language, in a case like yours, is association. You can easily write something in C, then write it in assembly language utilizing the same API calls, and compare the differences. You can take something you know, and use it to learn something else, since you have an expectation of results.

Here is a simple example in C, which you already know.


// Simple Command Line "Hello World" in C
int main(){
printf("Hello, C World!!!\n");
return 0;}


Here is the same basic example in ASM (using NASM32 with LIBC.mac in this case)


; Simple Command Line "Hello World" in ASM

entry main
libc printf


proc main
  invoke printf, "Hello, ASM World!!!"
  xor eax,eax    ;Return 0 (in Win32, EAX holds the return value)
  ret            ;Exit Program
endproc


If you dig deeper into MASM32 or NASM32, you will find that MACROS such as "proc", "endproc", and "invoke" automatically fill in some instructions for you, in the same way C would. You can examine these MACROS to find out that the above NASM32 example basically looks like this in regular NASM...


GLOBAL _main
EXTERN _printf


_main:

push DWORD HELLO_MSG  ;Push the Address of the Message onto the Stack
call _printf  ;Call the LIBC "printf" routine
add esp,4  ;Clean-up the Stack after the Call

xor eax,eax ;Set the Return Value to 0
ret ;Return (exit program)


HELLO_MSG DB 'Hello, ASM World!!!',13,0


Comparing C to ASM when getting into deeper into the Win32 API gets more messy than this idealistic example, but I hope this gives you some insight in how things are when working with pre-established APIs.
Posted on 2006-06-01 20:37:20 by SpooK
thank u for that SpooK ..... much appreciated . :)
Posted on 2006-06-01 22:10:54 by dmesgPy
With a little patience and the will to learn, you can easily grasp the language. I myself, didn't have "heavy" programming experience when I tried to learn, but now, I can do some useful applications that I use everyday.

This is a tip (from a newbie): Research and read a lot. Start by building small and simple applications, then add to it, add more... and so on. Don't forget to comment your code. Also, don't hesitate or be afraid to ask other people for help.

Well, good luck to you! Hope to hear more from you again. Cheers!
Posted on 2006-06-02 02:19:19 by modchip
Hi dmesgPy

I started by using masm, I built tiny programs and got out ollydbg debugger and watched my program work .

For me the hardest part to grasp was the stack so as said earlier just read read read and You everything will start to come together.
Wish you luck.

Gavin
Posted on 2006-06-02 13:24:39 by gavin_
gee thnxs guys , for ur encouragement and support !!...... this forum really is a community effort ..... :) I hope this forum will give back alot to the asm community and asm newbies like meh ......

thnx .
Posted on 2006-06-03 02:38:15 by dmesgPy