Assembler learning

Hi there.

I know this is off topic so apologies, but there have been plenty of programming questions asked here before.

I want to learn assembler. i am an experienced C/C++ programmer but have little to no assembler experience. does anybody know of any good documents to learn from?

i’m not just interested in the commands and syntax of assembler i also want detailed info on the operations it performs and register control.

It was my intention to use the __asm commands in Visual studio but i’d actually prefer to use a dedicated assembler compiler as the dont really want the abstraction VS gives you.

Anybody?

Cheers

Allan

compiler wise all you need is TASM.exe and TLINK.exe. They should come with your VC++ compiler. I know that they came with my borland compiler. VC++ may have MASM.exe and MLINK.exe Other than that I wish you the best of luck.

My last ASM program that read in 4 values and took the sum of the first two, product of the second two, and divided the sum and product together… the result turned out to be a random number generator which only produced multiples of 128 even when the input was the same for each run. I thought that I was pushing and popping the right values into the stack but it still was producing random results.

You may wish to dump your C/C++ code generated by VC++ to a listing file (I think that is what they call it) and it will show you C code, then the asm code… and that is a nice way to learn, but turn debug on, or you will see some optimised stuff (which isn’t what you want when you learn)

I’m rewriting right now, my 3d math classes (vectors,matrices,planes,spheres,ray intersections…blah…blah…) using inline assembly in VC++.
And I must say in SOME case the code generated by the compiler isn’ìt that bad.
Anyway there is a lot of space for optimizations if you plan to use ASM in your C sources (Just bare in mind it isn’t that easy that replacing the ANSI C sqrt function with FPU’s fsqrt will be faster).

My solution is to have both Microsoft compiler and Intel compiler (get it from intel site), plus all the Microsoft service packs and processor packs (just to have MMX,SSE and SSE2 instruction set available)

If you want a good book to learn ASM from, well IMHO the best one is “Art of Assembly Programming”, you can find it on-line in PDF or PS format, just do a search.

It’s a good book, and it doesn’t only explain commands, but also deeper optimizations explaining the structure of a CPU. Everything starting from the bases and numerical systems.

rIO.sK http://www.spinningkids.org

I have some links.For i too am looking into assembly(small) www.grc.com/smgassembly.htm
scroll down bottom for the links.

Look at www.intel.com

There is complete documentation about
IA32,IA64,MMX,SSE,SSE2.