In assembly? You can (maybe) but is it worth the effort you'll need to write the loader?
The OS exists to make complicated things simple. Just use the OS functions.
Duoas
Postaholic
2,043 posts since Oct 2007
Reputation Points: 1,140
Solved Threads: 229
Ah, well, then you've got yourself in a ball of mud.
One of the primary functions of the OS is to load and execute a program. How this happens is typically and entirely dependent on the OS.
For example, Win32 cannot execute a Mac program. As far as old DOS and Win16 programs, Win32 was specifically engineered to support legacy applications, but the next generation will scrub the old DOS subsystem anyway...
If you intend to execute PE32 (Win32) programs, then you'll have to do some serious reading over at MSDN and around the net.
Otherwise, you'll have to roll your own exe format, or borrow one from another OS, and write your own loader.
Good luck.
Duoas
Postaholic
2,043 posts since Oct 2007
Reputation Points: 1,140
Solved Threads: 229