flat assembler
Message board for the users of flat assembler.

Index > DOS > Error message - 'It isn't a valid Windows application'

Author
Thread Post new topic Reply to topic
avcaballero



Joined: 02 Feb 2004
Posts: 203
Location: Madrid - Spain
avcaballero 19 Jul 2005, 12:35
Hello

Compiling this code:

--------------- begin here -----------
FORMAT MZ
STACK 30h
MOV AX, CS
MOV DS, AX
MOV AH, 9
MOV DX, msg
INT 21h
MOV AX, 4C00h
INT 21h
msg DB "Hello world!$"
-------------- ends here -------------

I obtain an exe that works right into an MS-DOS windows, but gives me an error message if I click twice on it: "It isn't a valid Windows application".

Does anyone know why?

Thank you
Post 19 Jul 2005, 12:35
View user's profile Send private message Visit poster's website Reply with quote
coconut



Joined: 02 Apr 2004
Posts: 326
Location: US
coconut 19 Jul 2005, 13:29
dos programs cannot be run as normal thru windows. try running your program thru the command prompt or command.com

which version of windows are you running anyways?
Post 19 Jul 2005, 13:29
View user's profile Send private message Reply with quote
avcaballero



Joined: 02 Feb 2004
Posts: 203
Location: Madrid - Spain
avcaballero 19 Jul 2005, 14:21
Well, I believe we can run real memory programs normally. On msdos command prompt it goes well, not if i run clicking twice.

Nevertheless If i code:

---------------------- begin -------------------------
FORMAT MZ

ENTRY Principal:START
STACK 30h

SEGMENT Principal
START:
MOV AX, Datos
MOV DS, AX
MOV DX, msg
MOV AH, 9
INT 21h
MOV AX, 4C00h
INT 21h

SEGMENT Datos
msg DB "Hello world!$"
--------------------- ends here ---------------

It runs well on command ms-dos prompt and clicking twice
Very Happy


Postdata: I'm sorry for my english, it seems not very good... Confused
Post 19 Jul 2005, 14:21
View user's profile Send private message Visit poster's website Reply with quote
avcaballero



Joined: 02 Feb 2004
Posts: 203
Location: Madrid - Spain
avcaballero 19 Jul 2005, 14:23
By the way, my windows version is Windows 98, and if i don't remember wrong i probed it too on Windows XP
Post 19 Jul 2005, 14:23
View user's profile Send private message Visit poster's website Reply with quote
Bitdog



Joined: 18 Jan 2004
Posts: 97
Bitdog 23 Jul 2005, 08:18
MOV AH,8 ;get key with out echo = pause
INT 21h

Windoze will run a DOS program but normally leaves DOS running after.
You then have to type EXIT at the prompt to end the DOS session.
The PAUSE code above is usefull for DOS programs running in Win.
Just insert it at the end of your code before AX=4C00h
Then a shortcut on your desktop to the program, change properties on the short cut to exit out of DOS when program finishes.
If you have Win98 it has a great DOS onboard that you can get to run with out runnin Windoze. I change MSDOS.SYS AUTOEXEC.BAT & CONFIG.SYS then reboot. (I made a batch file that swaps/renames files.) MSDOS.SYS for DOS just has ;FORMAT in it. The AUTOEXEC.BAT & CONFIG.SYS are just DOS type files for std DOS. MSDOS.SYS is a systems file so you need to remove it's attributes to rename/alter it.
ATTRIB -h -s -r +a msdos.sys
changes it to alterable.
ATTRIB +h +s +r msdos.sys
changes it to runable.
+Hidden +System +Readonly
Any way, you might try that, cuz asm programming for DOS in Windoze didn't work for me, but programming Windoze in DOS did.
Post 23 Jul 2005, 08:18
View user's profile Send private message Reply with quote
T&K(r)



Joined: 10 Jul 2005
Posts: 18
Location: Poland - > Krakow
T&K(r) 23 Jul 2005, 20:02
BitDog:
Quote:

I made a batch file that swaps/renames files.

Why don't you use the [menu] labels in config.sys

If you change you MsDos.sys file ( ;FORMAT line only ) you can do this

Config.sys File:

[menu]
menuitem=normal,Start Windows98 GUI
menuitem=dos,Start DOS
menudefault=normal,1
; ^ This lines tell IO.SYS loader that after 1s of displaying this menu it
;begin runing from [normal] label


[normal]

device=c:\windows\himem.sys /testmem:off
device=c:\windows\ifshlp.sys
; ^ Very important line if you have modyfied MsDos.sys file

;there add rest of your config.sys


[dos]

;there add this what you normaly have in your DOS version of Config.sys

End of Config.sys File


In autoexec.bat you can also specify config using the labels:

if %config%==normal goto normal
if %config%==dos goto dos
goto exit

:normal
rem there add Win98 version of your Autoexec


c:\windows\win.com
;^ without this line WinDows GUI will can't start
goto exit

: dos
There add you DOS standard autoexec.bat file




:exit


End of Autoexec.bat


Remember to backup your's MSDOS.SYS, CONFIG.SYS and AUTOEXEC.BAT files !!

If you have a problem - simple as


Sorry for my not perfect ENglish Smile
Post 23 Jul 2005, 20:02
View user's profile Send private message Reply with quote
MCD



Joined: 21 Aug 2004
Posts: 602
Location: Germany
MCD 26 Jul 2005, 13:58
I'm just wondering if anybody here nows what an "error massage" is Very Happy

just kidding
Post 26 Jul 2005, 13:58
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8354
Location: Kraków, Poland
Tomasz Grysztar 28 Jul 2005, 16:15
Some versions of Windows refuse to run executables smaller than 512 bytes from the explorer - though they can still be executed from command line.
Post 28 Jul 2005, 16:15
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 05 Aug 2005, 18:27
hmmm can only think of one explanation for this....maybe explorer checks the validatity of the exe file before it executes it?....and it just has a bad validator Very Happy

_________________
Raedwulf
Post 05 Aug 2005, 18:27
View user's profile Send private message MSN Messenger 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.