flat assembler
Message board for the users of flat assembler.

Index > Compiler Internals > small exe?

Author
Thread Post new topic Reply to topic
daluca



Joined: 05 Nov 2005
Posts: 86
daluca 05 Nov 2005, 07:29
hello:
the situation is this:
under windows ME, when i doubleclick the EXEDEMO icon( the source is this:
; fasm example of writing simple EXE program
format mz

push cs
pop ds

mov ah,9
mov dx,hello
int 21h

mov ax,4C00h
int 21h
hello db 'Hello world!',24h)
I get a "EXEDEMO.EXE is not a valid win32 aplication" error
so I think: "well off course is not a win32 aplication" but I dont get that
error in other dos programs, not even in the com's.
so I change de messege to 'Hello wooooooooooooooooooooorld!',24h
and after that when I doubleclick the icon the dosbox apears with the
messege on it.
I try several values and I get to 'Hello woooooorld!',24h that makes
the file 64bytes long, if I take a byte,then I get the problem again
is fasm generating a small file? maybe a small header?(sorry inglish)
I also notice that this problem do not hapen in winXP.
is it a bug?
Post 05 Nov 2005, 07:29
View user's profile Send private message Reply with quote
Reverend



Joined: 24 Aug 2004
Posts: 408
Location: Poland
Reverend 05 Nov 2005, 09:24
Imho it is a bug - in Windows ME .exe loader.
Post 05 Nov 2005, 09:24
View user's profile Send private message Visit poster's website Reply with quote
decard



Joined: 11 Sep 2003
Posts: 1092
Location: Poland
decard 05 Nov 2005, 15:30
Indeed it is some kind of error - I met it some time ago. Seems that windows doesn't wan't to load EXE files smaler than 64 bytes (IIRC).
Post 05 Nov 2005, 15:30
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8356
Location: Kraków, Poland
Tomasz Grysztar 15 Nov 2005, 10:02
Note that it always works when you execute that program from command line window - only trying to execute very small executables from the explorer directly doesn't work in some Windows versions.
Post 15 Nov 2005, 10:02
View user's profile Send private message Visit poster's website Reply with quote
Raedwulf



Joined: 13 Jul 2005
Posts: 375
Location: United Kingdom
Raedwulf 22 Nov 2005, 07:39
I think this is due to the fact that windows explorer checks the size of the executable file and it can't 'believe' it's so small Razz
Microsoft has got too used to its own bloatware Smile

_________________
Raedwulf
Post 22 Nov 2005, 07:39
View user's profile Send private message MSN Messenger Reply with quote
Adam Kachwalla



Joined: 01 Apr 2006
Posts: 150
Adam Kachwalla 25 Apr 2006, 00:20
You could do this:
Code:
format mz

push cs
pop ds

mov ah,9
mov dx,hello
int 21h

mov ax,4C00h
int 21h
hello db 'Hello world!',24h
RB 64    


The RB 64 will make sure the EXE is longer than 64 bytes.
Post 25 Apr 2006, 00:20
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.