LOW LEVEL C - What else?

Started by frktons, June 03, 2010, 09:26:13 AM

Previous topic - Next topic

frktons

Ok I think I found something, with a little flaw:

After compiling, I used Polink with /SUBSYSTEM:console /ALIGN:4096 Console1kRed
and the size is now  1,536 bytes, and it runs.
The flaw is it doesn't allocate a new console, and it writes on previous console stuff.
Strange enough the source code has got the:
invoke AllocConsole
to allocate the new one  ::)

The two examples you posted work fine both of them. What option did you use?

P.S. Well I forgot to use /SUBSYSTEM:windows, so when I start from the command
line it doesn't create a new console.
Mind is like a parachute. You know what to do in order to use it :-)

Vortex

Merging the sections with the linker option /MERGE can produce smaller executables :

\masm32\bin\polink /SUBSYSTEM:WINDOWS /MERGE:.data=.text Demo.obj

frktons

Quote from: Vortex on June 05, 2010, 10:59:01 AM
Merging the sections with the linker option /MERGE can produce smaller executables :

\masm32\bin\polink /SUBSYSTEM:WINDOWS /MERGE:.data=.text Demo.obj

Thanks Vortex. One more to try.  :P

JJ posted this code in his Console1kRed  example:

end start
OPT_Res 0
OPT_DebugL /Subsystem:CONSOLE /merge:.text=.data /align:512
OPT_Linker polink
OPT_tmp2asm 1


after the end of the program.

It is the same thing I suppose  ::)
Mind is like a parachute. You know what to do in order to use it :-)

jj2007

Quote from: frktons on June 05, 2010, 11:17:08 AM
JJ posted this code in his Console1kRed  example:

end start
OPT_Res 0
OPT_DebugL /Subsystem:CONSOLE /merge:.text=.data /align:512
OPT_Linker polink
OPT_tmp2asm 1


after the end of the program.

It is the same thing I suppose  ::)
Sorry, I forgot to take away the RichMasm options. They do the same thing indeed.
I wonder whether /merge:.text=.data is the same as /merge:.data=.text ::)

frktons

Quote
Sorry, I forgot to take away the RichMasm options. They do the same thing indeed.

OK, thanks  :U
Mind is like a parachute. You know what to do in order to use it :-)