Introduction to Linux Assembly
- In DOS assembly, most things get done with the DOS services interrupt int 21h, and the BIOS
service interrupts like int 10h and int 16h. In Linux, all these functions are handled by the
kernel. Everything gets done with "kernel system calls", and you call the kernel with int 80h. One of
the wonderful things about Linux system calls are that there are fewer of them (about 190) than DOS, but they
are far more practical (you don't have obsolete crap like functions that load casette BASIC and things left over
from DOS 1.0). Linux system calls create files, handle processes and other such useful stuff - no strings attached
(mmm, bad pun ;-)
- Linux is a true, 32-bit protected mode operating system, so this enables us to do real, up-to-date 32-bit
assembly. This 32-bit code runs in the flat memory model, which basically means you don't have to worry
about segments at all. This makes life a lot easier, because you never need to use a segment override or modify
any segment register, and every address is 32 bits long and contains only an offset part. (If this is just a lot of
waffling to you, don't worry, just know that it's good and will simplify things for you.)
- In 32-bit assembly, you use the extended 32-bit registers EAX, EBX, ECX and so on instead of the normal
16-bit registers AX, BX, CX etc.
- DOS is dead. It's 16-bit. It's obsolete. The only people that still write DOS assembly are crazy old hackers that
are too attached to their 386s to throw them away. Linux assembly has practical applications (parts of the OS are
written in assembler, hardware drivers are often coded in assembler).
|