🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.msdos.programmer
Article #3049

Re: .com and .exe files

#3049
From: Bob Davis
Date: Thu, 15 Nov 1990 04:23
51 lines
2723 bytes
In article <773@fnx.UUCP> del@fnx.UUCP (Dag Erik Lindberg) writes:
>In article <27016@cs.yale.edu> buddington-paul@cs.yale.edu (Paul Buddington) writes:
>>convert it to a .COM file and run it.  (The reverse is also true - you cannot
>>run the .EXE file from which you generate a .COM file either.)  The problem
>
>I just posted a contradiction of this in another newsgroup, isn't that
>a coincidence?  Fact is, if the EXE file is produced correctly, it will
>run as either an EXE or as a COM.  Zortech C, for example, generates
>programs up to 64k which will run as either EXE or can be converted to
>COM and run in that format.  See the end of this article for a small
>example generated by Zortech C.
>
	Okay. I must be doing something wrong. For the following simple
assembly language program, if I MASM it and LINK it to produce HELLO.EXE
and then run HELLO.EXE, my system prints some garbage with the desired
"HELLO, WORLD." message embedded in it. And then my system hangs, requiring
reboot.
	If I EXE2BIN the HELLO.EXE file into HELLO.COM, then HELLO.COM
runs fine.
	Why won't my .EXE file run as well as my .COM file?

	Thanks.
;**************************************************************************
;
CodeSeg		segment
		assume cs:CodeSeg,ds:CodeSeg
;
		org	100h		;ORG for all COM programs.
;
;	Print Message:
Entry:		mov	dx,Offset Msg		;dx points to message.
		mov	ah,09h			;DOS Fcn. 09h=Display String.
		int	21h			;Display String via DOS.
;
;	Terminate program:
		int	20h
;
Msg:
		db	0Dh,0Ah
		db	'HELLO, WORLD.'
		db	0Dh,0Ah
		db	0Dh,0Ah,'$'
;
CodeSeg		ends
		end	Entry
______________________________________________________________________________
Bob Davis, UofALA'66   \\ INTERNET : sonny@trantor.harris-atd.com  |  _   _  |
Harris Corporation, ESS \\    UUCP : ...!uunet!x102a!trantor!sonny |_| |_| | |
Advanced Technology Dept.\\ AETHER : K4VNO          |==============|_/\/\/\|_|
PO Box 37, MS 3A/1912     \\ VOICE : (407) 727-5886 | I SPEAK ONLY | |_| |_| |
Melbourne, FL 32902        \\  FAX : (407) 729-2537 | FOR MYSELF.  |_________|
Technical Details
Message-ID: <4880@trantor.harris-atd.com>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!wuarchive!udel!haven!uflorida!mlb.semi.harris.com!trantor.harris-atd.com!charybdis!sonny
References: <6919@hub.ucsb.edu> <4725@trantor.harris-atd.com> <27016@cs.yale.edu> <772@fnx.UUCP> <773@fnx.UUCP>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!wuarchive!udel!haven!uflorida!mlb.semi.harris.com!trantor.harris-atd.com!charybdis!sonny
From: sonny@charybdis.harris-atd.com (Bob Davis)
Newsgroups: comp.os.msdos.programmer
Subject: Re: .com and .exe files
Message-ID: <4880@trantor.harris-atd.com>
Date: 15 Nov 90 04:23:10 GMT
References: <6919@hub.ucsb.edu> <4725@trantor.harris-atd.com> <27016@cs.yale.edu> <772@fnx.UUCP> <773@fnx.UUCP>
Sender: news@trantor.harris-atd.com
Reply-To: sonny@trantor.harris-atd.com (Bob Davis)
Distribution: alt
Organization: Advanced Technology Dept., Harris ESS, Melbourne, FL
Lines: 51