Sign in to follow this  
choffstein

Recommended Assembly Language?

Recommended Posts

Hey all, I am currently looking into seriously studying an assembly programming language. As a general concept, I understand assembly. However, I have no actual practice in the language, which is what I am looking for. The two languages I have broken my choice into are x86 ASM and ARM ASM (as these two seem to be the most popular in development...x86 for PC, ARM for mobile development). My question is, which would you recommend I learn first (I plan on learning both)? Would it make sense to learn x86 first, because I can more easily test it on my PC? Conceptually, they two are fairly similar, right? So making the switch from x86 to ARM shouldn't be too difficult. Does anyone have any experience in either of these that could recommend which I learn first, and good tutorials for both? Thanks! visage

Share this post


Link to post
Share on other sites
I don't have any experience in assembly programming either. I'm taking a class on it next semester so I decided to wait until then to learn it (rather than teach myself.. although I'll probably go above and beyond the class myself).

shmoove is right though, learn the assembly language for the architecture that you work with most. If you work on x86 computers, learn x86. Assembly programming is just like high level languages, it's relatively easy to learn others once you know one.

Optionally, you could learn basic computer architecture first, and then move on to assembly. A good book on computer architecture that I have read is: "Code: The Hidden Language of Computer Hardware and Software".

I'd search amazon.com for good books on assembly. Assembly is complicated and it's best if you have hard copy to learn from rather than relying tutorials online.

Ryan

Share this post


Link to post
Share on other sites
I recommend getting NASM (nasm.sourceforge.net) and programming something simple. Also learn about the ABI of your compiler to call assembler functions from C/C++.

If you understood asm in general, switching to other assemblers should be very easy (e.g. the AT&T-syntax of the inline-assembler of gcc expects the operand order as src, dst whereas nasm/masm/tasm expects it as dst, src).

Use assembler !only! where it really matters. Keeping your coder in C/C++ allows easier maintenance and switching to other systems. Use asm for direct hardware programming, atomic operations when not supported by the OS (or is a bottleneck), optimisation (i.e. gcc's inline assembler allows you to inline assembler functions, whereas other assemblers just create a function you can call).

Share this post


Link to post
Share on other sites
Quote:
Would it make sense to learn x86 first, because I can more easily test it on my PC?

Yes, it would. Finding an ARM emulation environment isn't hard though.

Quote:
Conceptually, they two are fairly similar, right?

They're very similar. Both have all the operations you'd expect of an assembly language.

Quote:
So making the switch from x86 to ARM shouldn't be too difficult.

Nope, it won't be.

Quote:
Does anyone have any experience in either of these that could recommend which I learn first, and good tutorials for both?

I suggest x86 first, because you can write programs in C and see how your computer translates the assembly.

Also, nmi's comments are sound:

Quote:
Use assembler !only! where it really matters. Keeping your coder in C/C++ allows easier maintenance and switching to other systems. Use asm for direct hardware programming, atomic operations when not supported by the OS (or is a bottleneck), optimisation (i.e. gcc's inline assembler allows you to inline assembler functions, whereas other assemblers just create a function you can call).

Ultimately, assembly's just another tool in your programming toolbox, much like a carpenter's got hammers and saws. Picking the right tool for the job is part of being a good programmer. Good carpenters don't craft intricate woodwork with chainsaws and flamethrowers, and neither should you use assembly for every program you do.

Share this post


Link to post
Share on other sites
I'd recommend something 8-bit, as it will be much easier to learn as there are not nearly as many instructions (although the principles are the same).

Plus there are heaps of emulators for just about every 8-bit device out there.

Popular 8-bit CPUs were

6502
z80
6800
6809
8051 (Yes, I realise this is rather a lot like x86)

Probably the easiest to program of the above is 6809, although it's also the rarest in genuine antique machines.

A lot of vintage arcade machines and home systems used one or more of the above (some used more than one CPU)

For assembly courses in general, I think z80 is probably the most popular.

Mark

Share this post


Link to post
Share on other sites
Thanks for the info guys. I dont plan on writing anything major in them, but I would like to have both ARM and x86 as tools in my toolbox for possible later use...and also just to better my general understanding of computers. Never hurts to learn more :)

Thanks guys.
-visage

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this