Art of Assembly? plus some questions on x86 Assembly

Started by
6 comments, last by Triglav 19 years, 7 months ago
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?
"Go on get out last words are for fools who have not said enough already." -- Karl Marx
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.
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.
[size="2"]Don't talk about writing games, don't write design docs, don't spend your time on web boards. Sit in your house write 20 games when you complete them you will either want to do it the rest of your life or not * Andre Lamothe
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
Triglav - Member of TAJGA Team
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
This site (or rather, the pdf-book on it) was invaluable to me when I learnt x86 assembler programming.
-LuctusIn the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move - Douglas Adams
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!
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].
Triglav - Member of TAJGA Team

This topic is closed to new replies.

Advertisement