分享

Introduction to Linux Assembly 4.1 Main Differences Between DOS and Linux Assembly In DOS assem

 迎风初开 2013-12-06

Introduction to Linux Assembly

4.1 Main Differences Between DOS and 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).

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多