Introduction
From ASM Book
Contents |
Why do people learn Assembly Language?
Speed
It is possible to hand-optimize your code by using assembly language instead of relying on the generic optimization techniques of a High Level Language compiler. A well crafted assembly language routine can usually beat the one generated by a compiler (Even the better optimizing compilers such as Intel C++ or Visual C++ .NET). Optimizing for speed is a skill that is difficult to master. Such optimization usually requires writing code that is specifically geared towards the target architecture.
A good place to start learning how to optimize code is Agner Fog's website [1]
Size
As a result of generic optimization methods, High Level Languages tend to bloat the executable file with useless code. When coding in Assembly, you have total control over what ends-up in the actual executable file, thus the capability to optimize and eliminate all unnecessary instructions.
Understanding
Learning Assembly Language is the stepping stone to learning general Computer Architecture. This learning process is accelerated when you approach subjects such as Operating System Development.
Necessity
Certain code cannot be conceived when using a High Level Language. Such "Low-Level" Code is usually available only through the use of Assembly Language. A big example is during Operating System Development, where you need to design Interrupt Handlers that have no other dependencies.
Assemblers?
You can take your pick from the List of Assemblers.
In general, Intel-based Assembly Language syntax will be used. If you learn the syntax of one Assembler, it is pretty easy to learn another.
Debuggers
DEBUG is a DOS/Windows command-line utility program that you can use to debug MS-DOS (16-bit) programs. We will use DEBUG initially for our 16-bit examples, but for the 32-bit examples, we will use an open-source command-line debugger called GRDB (Get Real Debugger), which is available for download at [2].
Disassemblers
A disassembler is a program designed to create an assembly listing from a compiled Executable. They tend to be used by hackers and such for any reason from bypassing software protection, to getting rid of pesky bugs that they've tracked down themselves. These can be powerful resources in the hands of someone who knows how to use them, but they are certainly not a beginner's choice to learn assembly from. Though they can help if you know enough assembly to wade through everything that a higher level language gets compiled into.
Emulators
The need
"Eek! Why should I know this stuff?", you might ask. Well, here are some reasons:
- It's extremely simple
- This is what you will need in order to learn and program in assembly language.
