Jump to content
  • Advertisement
Sign in to follow this  
choffstein

Recommended Assembly Language?

This topic is 5037 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

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
Advertisement
No experience in either of those, but common sense says that your choice should be influenced by the hardware and tools you have handy.

shmoove

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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!