The MASM Forum Archive 2004 to 2012

General Forums => The Workshop => Topic started by: Persona on June 07, 2006, 07:12:58 AM

Title: Willing to learn MASM
Post by: Persona on June 07, 2006, 07:12:58 AM
Good day all

Wanted to ask a question, hoping to get sueful answers from members.
I am a 44 yr old Engineer, I program in C, and never ever tried to program in assembly. I have heard it is a bit hard to find the starting "place".

Is it hard to learn MASM for C programmers?
For a total newbie in assembly, where to start?

Hoping ur answers will be informative.
/cheers and respect

note: I did not read much in this forum, so excuse me.
Title: Re: Willing to learn MASM
Post by: hutch-- on June 07, 2006, 07:24:46 AM
Persona,

Welcome on board, glad to see a few of you young fellas willing to hit the big time.  :bg

Have a look at the MASM32 project, with a bit of practice you write it about as fast as C in most instances but you have a lot more freedom in architecture when you need it and it is capable of some very fast code if you learn it properly.
Title: Re: Willing to learn MASM
Post by: Ossa on June 07, 2006, 10:17:54 AM
Hi there,

welcome to the board! ASM might seem a bit hard from the start, but after a short period of messing around, you will find that it's just as easy (if not easier) than C/C++.

As hutch says, the MASM32 package is a great starting place. http://masm32.com/

It comes with Iczelion's Windows 32-bit Assembly tutorials, but they are also online at: http://spiff.tripnet.se/~iczelion/tutorials.html

As for other resources, I wrote a small tutorial a few years ago which some liked and some didn't: http://ossa.the-wot.co.uk/tutorial_asm1_tex.htm

For reference, you will want to download a copy of the Intel manuals (or the AMD manuals - they cover the same stuff and, yes, anything you write for one will work on the other*): http://developer.intel.com/design/Pentium4/documentation.htm (scroll down to the "manuals" section).

Of course, if you have any other questions, the great people will be able to help.

Hope some of that helps,
Ossa

* unless you use the MMX\SSE features, but you'll find out about that much later - don't worry about it for now
Title: Re: Willing to learn MASM
Post by: Mark Jones on June 07, 2006, 06:59:31 PM
Hello Persona and welcome aboard. Be sure to see the documentation in the \help folder also. ASMINTRO.HLP contains critical information to code assembly properly.

Ossa, great work with your tutorial! :U
Title: Re: Willing to learn MASM
Post by: Ossa on June 07, 2006, 08:48:05 PM
Thanks, Mark.

Actually there are several (very small) mistakes in it that I've been meaning to correct for a while (~1 year) but have never gotten around to. I had the site piggybacked off a friend's website which went down a few months ago, but I've just (see signature) switched to a new host that I pay for and thus have control over. I'm in the process of remaking the website and I will try to add more tutorials in the next few months (as I have now finished my degree).

Thanks for the encouragement,
Ossa
Title: Re: Willing to learn MASM
Post by: Persona on June 08, 2006, 10:25:00 AM
thank you gents. I will keep my fingers crossed as I delve into MASM.
Hoping to find rescuers if I drown.

/respect
Title: Re: Willing to learn MASM
Post by: Mark_Larson on June 08, 2006, 04:22:19 PM

Welcome on board!  You have a very fun journey ahead of you.  I am also a C programmer.  I program in C and assembly language for a living.  I think transitioning from C to assembly language is easier than other high level languages to assembler.  If you use VC++, you can also tell the compiler to generate .asm files that are compatible with MASM.  This is a great learning tool since you can see how the compiler converts C code into ASM code.  It's the /Fa switch.

One of the things Hutch-- mentioned was making code run fast.  I don't recommend looking at code optimization now, but file it away later when you get better at assembly language.

Agner Fog's optimization manual - Agner has had an optimization manual since the Pentium, which came out in the early 1990's
http://www.agner.org/assem/pentopt.pdf

Mark Larson's optimization webpage - This is my optimzation webpage.  Most people have optimization manuals for older processors.  I include stuff for the newer processors.
   I also cover a lot of tips not found on other webpages for optimization.
http://www.mark.masmcode.com/

Both AMD and Intel publish optimization manuals on their websites.  If you search the forum you should find lots of links to them.