Assembly
From DmWiki
Assembly language is the most basic form of programming language still in use today. Even though it is occasionally used, it has been superceded by higher level languages.
| Table of contents |
History
After very early methods of programming involving punched cards - essentially manual binary code - Assembly language was created as a way of creating more human readable code. This meant that instead of a series of numbers, programmers would see acronyms and parameters which are easier to understand, write and maintain. It must be borne in mind however that this code is still much more difficult to read than modern languages such as Java. Languages such as java are also very abstracted from the Machine and the low-level hardware, whereas Assembly translates directly into machine code.
Here is some example Assembly code:
movl $1,%eax movl $0xff,%ebx int $0x80
Uses
In modern times Assembly isn't used very often. Generally the only use it would find would be in embedded devices where the hardware prevents anything higher level. Even so, it's often still possible to use a language such as C. However it is still used sometimes even while programming for powerful computers. Writing a bootloader, for example, must be written in assembly. The other major use is when optimising code - some people still prefer to use Assembly, although its benefits are questionable.
Portability
One issue with Assembly is that its code isn't portable. Assembly language is specific to the processor that it is written for and must be rewritten for other architecture. Because Assembly is very close to the hardware, issues such as endian-ness often become more problematic.
There are various syntaxes for Assembly, two common ones being Intel and AT&T. Depending on the assembler, it will likely use one of these two syntaxes.
Learning Assembly
A good getting started resource for the Intel based chipsets is 32 Bit Protected Mode Assembly by Dr. Paul Carter (http://www.drpaulcarter.com/pcasm/).
There is an online book geared towards the *nix user at http://www.int80h.org/.
Multiple online books can be found on Webster (http://webster.cs.ucr.edu/) covering assembly language programming for both *nix and windows systems.
Information on using the Windows API can be found at http://win32asm.cjb.net.
