assembly

Started by
11 comments, last by intransigent-seal 18 years, 7 months ago
I was on a job shadow with a computer programer who suggested i try to learn assembly that is would be a difficult task but would suit my ambitions i know assembly is like clymbing everist but i am dedicated but does any one know a good book to start in??
Advertisement
The Art of Assembly is widely recommended for learning assembly language. Though assembly isn't that hard, just tedious. Also, if you can get an assembly reference you can learn quite a bit from just looking at the generated assembly that your compiler produces for C or C++ code. The -S switch for gcc and /FA family of switches for MSVC.
I wouldn't bother learning assembly language at this point. It might be interesting to a degree, but it won't be very useful. Learning some English language would be a good idea, though.
AP has a point as to the question of usefulness of learning assembler.

However, it will give you great insight into what really goes on at the bare metal, and with this understanding you will be more able to use, rather than abuse, features of higher level languages.
games are one of the last refuges of the assembly programmer.
games are one of the few single pieces of software that challenge a modern machine.

i would consider it useless in almost any other section i care to think of.

i don't touch the stuff, but i imagine it could be fun to play around with - provided your definition of fun includes debugging.
The point of learning assemble these days really isn't too make something huge like a game. The reason he probably wants you to learn it is so you have a better understanding of how the machine works. Plus if you're doing anything like OS/Driver/Emulator/Robot programming you pretty much have to know at least how to read assembler.
It might be easier trying to learn ASM on a low-end platform where ASM is actually needed, and thus is still used exclusively.
I develop games for Texas Instruments calculators and am currently working on a Game Gear game, all in Z80 assembly. It's quite fun.

[Website] [+++ Divide By Cucumber Error. Please Reinstall Universe And Reboot +++]

I'd beg to differ.

Sure general assembly may not be nearly as useful these days, but there are some great tricks you can apply with it. As reference to the [Game Programming Gems] series, stack winding is mentioned. I use this for a speed boost on my heaviest data-tree traversal functions where the goal is to find a single leaf.

Sure you could do this through C/C++, but odds are someone who didn't know assembly wouldn't think of it nor know how to implement it.

I'll agree with rip-off, though, that outside of the video game world assembly is a dying art. A shame in my opinion because its like having a mechanic that can fix your car by looking at the computer codes, but doesn't understand what they mean on the deepest level.

It can also help with some PITA bugs that could cause a submission to be rejected. I recall working on a project where our only demo cycle crash bug was actually inside the render(ware) library we licensed. One of our most senior programmers was able to fish it out by disassembling their library, and directly re-writing it in machine code.

Do you need to know assembly to become a good programmer? No.
Does knowing assembly help in becoming a great video game programmer? Yes.

Just my 2cp

EDIT: Two posts between when I hit reply and submit. I agree with Scet and benry.
-------------------------------Sometimes I ~self();
Fair enough, but bear in mind you are learning something completely devoted to a single chip! - not even a single platform

that is when future improvements are added to the chip (e.g. MMX) your code will have to be modified by hand to use them - with a C compiler or other high level language, you just update your compiler to get the benefits of a new chip into your program.

and just to warn you, the assembly I learnt 8 years ago is next to useless now, all 16-bit registers and DOS calls and things which just aren't really used anymore. The C++ I learnt on the other hand still serves me today.

for tiny bits of code assembly can be very useful, but its unmaintainable - hence best to avoid doing entire projects in it.

Also it takes a very skilled programmer to make an assembly program that runs appreciably faster than a C program.

Still, if you're curious then fair enough -- be sure to look into good coding practise for assembly, its very easy to make a complete mess that you can't unravel
that said, interfacing directly with the chip, which is what you're doing in assembly can be kind-of exciting. There is very little difference between assembler and machine-code. Every assembly instruction generally maps to a single machine instruction. (God, I can still remember 4C00CD21 - which is machine code for: mov ax,00; int 21; which is a program that simply exits (without this it will just crash the computer) - Assembler's just readable (or is that more readable).

This topic is closed to new replies.

Advertisement