• Forum
  • Lounge
  • best tutorials/resources for learning x8

 
best tutorials/resources for learning x86 ASM

as long as its intel dialect, Im cool with FASM, NASM or MASM.
So far Ive screwed with FASM and MASM since im on windows right now, but nasm or tasm would work too.

im having a really hard time finding good documentation and resources on this subject - a lot of it is either REALLY outdated, or not descriptive at all.

tutorials I can find quickly blow over whole topics without ever breaking things down line by line and explaining the why of everything.
unfortunately not only am I attempting to re-invent the wheel (for good reason in this case), but I also have to learn the theories of why whilst doing it. Learning the theory first isnt an option at the moment.

tutorials will tell me say, EAX is the register for doing math operations and storing results or whatever. that ECX is the count (I believe its for loops)
but they never really go in depth explaining how to use these things and why, assuming you can just copy some code and get it all the sudden.

So I read through a MASM tutorial, made a silly hello world, and even modified things so I understood what everything did. great. just like learning C or BASIC.

that is, until I sit myself down and say Im going to port over some simple math code I wrote in C or C++. it is at this point that I realize, yes, I know how to push a number onto the stack, or even a variable, BARELY, and I might do it wrong, because im just copying other code without full understanding, but I can do it.

but how to take input? and when I take that input, how do I not overload the stack?

having only 32 bits per register is a pretty strong limitation - obviously even C++ has this, but C++ automatically works around the issue for you by dynamically controlling the stack and registers for you.

and what about loops, if statements and conditionals? storing variables and typing?

basically, what I ran into is there are seemingly almost no functional ASM tutorials that actually get you up and running and ready to write whole programs the way there are C resources (because C is simpler to explain probably) And even LESS functional ASM examples when you get into 32/64 bit.

not to mention OS-specific code that COULD easily be ported - but youd have to already have a grasp on several dialects of x86 to do so.

so where should I start with this?

I know what I want to accomplish -- however, switching GCC to output intel code and watching what my compiler does isnt going to be very helpful, and im not really sure how to go about finding examples similar enough to what I want to achieve to really get a foothold starting out in ASM coding.

I can't really choose much of an easier starting project (gonna straight up copy a sieve of eratosthenes I wrote in C++ -- not even a great one, just one that works) and even if I did, id run into the same problems.

Im positive that once im up and running I can understand this, its just getting there thats key
Last edited on
books are totally an option. I can either bootleg them or go to a library...
Have you looked at the intel manuals? They're free and have tons of good resources.

http://www.intel.com/content/www/us/en/processors/architectures-software-developer-manuals.html
thanks much, btu it has to wait until tomorrow or the next day. I mustve drank bad milk in my coffee this morning or soemthing because ive been vomiting all day, not a good day to learn
Topic archived. No new replies allowed.