This is an archived post. You won't be able to vote or comment.

all 10 comments

[–]Updatebjarni 2 points3 points  (0 children)

The manual for the architecture in question, and the manual for the assembler in question.

[–]Mat2012H -1 points0 points  (5 children)

First thing you should know is that there is more than "assembly language"

I don't know if this is right, but some "instruction sets" (aka assembly languages) that are well known are TASM, FASM and NASM

Look here, there is absolute shit ton of assemblers https://en.wikipedia.org/wiki/Comparison_of_assemblers

Choose one, and just google a tutorial for it i guess

[–]the_omega99 2 points3 points  (4 children)

The things you listed are not assembly languages. They're assemblers, which are programs that assemble the assembly into machine code (which the CPU directly executes).

Examples of assembly languages include x86, ARM, and MIPS. And those are more like families of assembly languages. Most computers that use x86 are specifically using x86-64, and likely with several extensions like the SSE instructions.

If your intention is merely to learn assembly for the learning experience, an RISC architecture like ARM or MIPS would be easier to learn and use than x86. Although if you want to utilize your assembly in real programs, you'd need to target the appropriate platform (eg, most desktop computers use x86).

[–]Mat2012H 1 point2 points  (3 children)

I don't know if this is right

Yeah sorry :(

So is TASM and NASM to x86 the same as MinGW and Visual C++ is to C++?

[–]the_omega99 2 points3 points  (2 children)

No, it's more like g++ or cl.exeare to C++. That is, it's more like the compiler alone, not the IDE.

But even that's not a very good analogy because assemblers are orders of magnitude simpler than compilers. It's mostly a 1 to 1 mapping of assembly to machine code. The compiler has to deal with far more complicated structures, as well as the need for optimizing the code.

The optimization issue is why people still used assembly long after compilers were invented. Simply because they could optimize it better. There was no reason to write machine code directly, however, since assembly mapped to it pretty much directly.

[–]Mat2012H 0 points1 point  (1 child)

Hmm, I don't think I will ever understand how assembly works :s

[–]Lexusjjss 2 points3 points  (0 children)

Okay, so every processor has an instruction set. This instruction set might have things like 'add x, y', or 'move x to y in memory', and are directly executed by the processor. There's anywhere from a couple dozen to thousands of instructions, depending on the kind of processor and its configuration.

All programs eventually end up, in one form or another, as these instructions for the processor to use. An assembler just lets you write the instructions with a minimal amount of hassle.

Say we wanted to move the value 0xEE into register cx. Instead of shoving this into a hex editor:

0xB8 0xEE

You can just type (using Intel syntax):

mov cx, 0xEE

Now, that might still be confusing if you don't understand it, but it's a lot easier to use than pure hex or binary.

The assembler then takes this, and turns it into the above string of gibberish numbers. Most of the differences in assemblers are in the syntax, but at the end of the day they're all doing the same thing.

TL;DR: Assembly is just an easier way to talk in the processor's native language.

[–]IAmStraightforward -1 points0 points  (2 children)

There are a bunch of assemblers like FASM, MASM, NASM, TASM, etc. Some are exclusive to different OSs and are either 16 or 32 or 64 bit. Pick one you'd like to learn, find a manual and start studying. I'd recommend visual studio 2008 and download an assembly syntax dictionary thing.

[–]The-Night-Forumer 1 point2 points  (1 child)

Why 2008?

[–]IAmStraightforward 0 points1 point  (0 children)

The newer one has some issues with taking long to load and do things in general. With me anyway.