I have written some boot strap code such that the source code is almost entirely written in C. However, working strictly from Intel Architecture Programmer's Manual, I seem to create code that causes the computer to reboot when I switch to protected mode. Even though Intel 64 is backwards compatible with 80386 architecture, the published instructions for switching to protected mode differ in the published documentation corresponding to the respective architectures. In the attached file, you will find the source code. Is there something that I am misreading, or is it in fact the case that the formal architecture definition documents are in error.
For more complete information about compiler optimizations, see our Optimization Notice.