Anonymous user
C: Difference between revisions
no edit summary
[unchecked revision] | [unchecked revision] |
No edit summary |
|||
Line 22:
The canonical example of code that must be written in pure Assembly is the first-stage bootloader. If you choose to write your own instead of using an existing solution such as GRUB, it must be written in Assembly, as it requires direct manipulation of certain registers; specifically, the segment selectors and the stack pointer, which would not be possible in C itself.
Other functions, such as loading the Global Descriptor Table (on the IA32 architecture), also require special opcodes which are not available within C language (but can be implemented in
[[Interrupt Service Routines]] (ISRs) also require some special handling, because they are called directly by the CPU, not by the C environment.
|