Actually, you can. The mechanism used to switch from 32 to 64-bit mode (which, obviously, must exist on a 64-bit OS capable of running 32-bit code) is in no way protected and can be used from user code. On Windows, this is called Heaven Gate, and it's pretty simple: just a long-distance call with a 33h segment selector.
So how to run 64 bit code?
call 33h:your64bitcode
...
your64bitcode:
; do something
retf
There are, of course, some restrictions on what you can do from the 64-bit code entered in this way, because you really are not running the 64-bit process.
source
share