News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

About Linkers(32-bit, 16-bit...) :)

Started by spec00, January 01, 2006, 06:43:53 AM

Previous topic - Next topic

spec00

Hi everyone!!

I was thinking...well....
I just can't understand much about these linkers, compilers...A 32-bit Linker (like MASM32) cannot link 16-bit applications? why?! and another question that shades my mind is: I know that the DOS executables and Windows executables have some differences, like the header and all that stuff...But...where it is differentiated? in the linker(i think that is the right answer)? in the compiler?
The last one: All GUI programs start at a console right? Where are this console, when i run my Win32 application?!

Sorry about my english, i'll improve him...
Thanks for your patience  :8)

skywalker

Quote from: spec00 on January 01, 2006, 06:43:53 AM
Hi everyone!!

I was thinking...well....
I just can't understand much about these linkers, compilers...A 32-bit Linker (like MASM32) cannot link 16-bit applications? why?! and another question that shades my mind is: I know that the DOS executables and Windows executables have some differences, like the header and all that stuff...But...where it is differentiated? in the linker(i think that is the right answer)? in the compiler?
The last one: All GUI programs start at a console right? Where are this console, when i run my Win32 application?!

Sorry about my english, i'll improve him...
Thanks for your patience  :8)

I am no expert on this. I think they could write a linker that would do both 16 and 32 bit.

With 16 bit code on older OSes, you could directly control the hardware. With Win95+, the OS can't just let code have complete control of the hardware for safety's sake and keep from writing over other applications memory space.

Your english is very good.

Take care.



zooba

Quote from: spec00 on January 01, 2006, 06:43:53 AM
All GUI programs start at a console right?

Not entirely right  :wink
The Microsoft linker has a '/SUBSYSTEM' option which lets you specify whether the application is console based or GUI based. If it is console based the operating system automatically allocates a console, whereas for a GUI application a console must be created manually.

Quote from: spec00 on January 01, 2006, 06:43:53 AM
Where are this console, when i run my Win32 application?!

Chances are it's been linked with '/SUBSYSTEM:WINDOWS' rather than '/SUBSYSTEM:CONSOLE'. To get a console you'll need to call 'AllocConsole' before you can use one (and FreeConsole at the end too).  :U