• Advertisement
Sign in to follow this  

Art of Assembly? plus some questions on x86 Assembly

This topic is 4920 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I want to start learning some Assembly in order to better understand the system and what I am actually doing when I program. I don't really have much interest in really using to a great extent(maybe some optimization here and there). I was looking at the ebook Art of Assembly but they have 2 versions. One for Linux and one for Windows. I want to write code that is cross platform(a definite must since I use both Linux and Windows). Which book will be better for that. I also have another question. Is x86 compatible with different operating systems or will I have to write different code for each version of my programs?

Share this post


Link to post
Share on other sites
Advertisement
Well,I think an assembly program is not even compiled by all assemblers,let alone for different OS.It's not the instructions,they're all the same,but the conventions each assembler use.

Share this post


Link to post
Share on other sites
yeah getting assembly programs to compile is a pain!
Most assembly books I've seen lately use a custom library for writing output etc and don't start out from scratch having you write you own output and input functions,etc.
You should be able to compile your assembly programs in linux or windows without change as long as you are using the same compiler since your cpu is the same.
now if you try to use them on macos that uses a powerpc cpu it won't work since you'll need to learn a different assembly language altogether.

Share this post


Link to post
Share on other sites
Quote:
Original post by QzarBaron
Is x86 compatible with different operating systems or will I have to write different code for each version of my programs?


see NASM and asmutils

Share this post


Link to post
Share on other sites
Your best shot may be using C and inline assembly, that way you can compile everywhere but can adjust your optimizations as you wish.

Luck!
Guimo

Share this post


Link to post
Share on other sites
This site (or rather, the pdf-book on it) was invaluable to me when I learnt x86 assembler programming.

Share this post


Link to post
Share on other sites
Quote:
Original post by daviangel
You should be able to compile your assembly programs in linux or windows without change as long as you are using the same compiler since your cpu is the same.


The Linux assembler was written originally for AT&T chips which is why its different to the "normal" Intel code found in most Windows assemblers.

For a good assembler, I recommend NASM as many have said above. You can also get NASMIDE as well. Its a handy IDE with syntax highlighting. [grin]

I actually wanted to do the same thing as you.. learn a bit of assembly for optimizations etc, and ended up stubbling on some OS development tutorials and now I'm hooked!

Share this post


Link to post
Share on other sites
Quote:
Original post by drkpriest
For a good assembler, I recommend NASM as many have said above. You can also get NASMIDE as well. Its a handy IDE with syntax highlighting. [grin]


a lot of hard-core assemblerists moved to FASM because of last NASM release is old for about one year [dead]. FASM is for them more powerful and its development is getting lightning speed [cool].

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement