At 38 characters, is this the smallest source producing a properly working
Windows console program? It uses _cputs from the C runtime library. The
POPF is needed to restore the stack ready for RET to Windows.

Assuming the file is called t.asm, assemble using
GoAsm t
and link using
GoLink /console /entry _ t.obj crtdll.dll
or
GoLink /console /entry _ t.obj msvcrt.dll

BTW, the exe comes out at 1,536 bytes

Here is the source code:-

CODE
_:
INVOKE _cputs,"HelloWorld"
POPF
RET
Posted on 2002-10-22 17:13:46 by jorgon
Jeremy,

Sounds slick and looks like you are getting some good results.

I wonder if there is a way for you to combine sections to get a mini app like this down to 2 sections 1024 bytes ?

Regards,

hutch@movsd.com
Posted on 2002-10-22 19:49:14 by hutch--
a 1024 bytes win32 app? i've the source for MSVC6 that yield only 1024 bytes.
Posted on 2002-10-22 21:16:37 by dion
jorgon: it doesnt work :(


GoAsm.Exe Version 0.38 - Copyright Jeremy Gordon 2001/2 - JG@JGnet.co.uk

Error!
Line 2 of assembler source file (t.asm):-
Declare a section using DATA SECTION ["name"],
CODE SECTION ["name"] or CONST SECTION ["name"]


if i put CODE SECTION it GPF with "privileged instruction" (because AddressOfEntryPoint is 1000 instead
of 100Bh)
Posted on 2002-10-23 01:01:11 by TBD
It only works with GoAsm 0.40!
I had to alter GoAsm to accept just "CODE" instead of CODE SECTION to get down to 38 characters!
Posted on 2002-10-23 01:26:31 by jorgon
iupee ... works now.

jorgon: would be nice that GoLink can merge section as Masm Link
/MERGE:.text=MASM32 /SECTION:MASM32,RWE /MERGE:.rdata=MASM32 /MERGE:.data=MASM32
Posted on 2002-10-23 01:32:22 by TBD
The elfdemo for FAsm produces a 128 byte Hello World executable.
Posted on 2002-10-23 02:07:31 by eet_1024