- 论坛徽章:
- 9
|
回复 5# guoyuexiangying
不能用了, int 10h是BIOS 16位模式下的操作,进入32位保护模式就不能再用了。建议用等效的Linux系统调用代替。
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).
完整的文章见:http://docs.cs.up.ac.za/programming/asm/derick_tut/
如果你一定要用BIOS或DOS的功能,可以试试DOSBOX或DOSEMU。
兄弟,都什么年代了,把BIOS和DOS忘了吧。BIOS都被UEFI取缔了。{:3_183:}
|
|