LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 02-20-2008, 02:38 AM   #1
khaos83
Member
 
Registered: Dec 2007
Posts: 97

Rep: Reputation: 15
How to de-com a dos com file


I have a com file for DOS.

Is there a way to de-com it?
 
Old 02-20-2008, 02:48 AM   #2
khaos83
Member
 
Registered: Dec 2007
Posts: 97

Original Poster
Rep: Reputation: 15
Pls offer your brain juice for the above qns.

*off-topic*

I am trying to find out because I have a dos machine. It will run a program. If some how it exits, a com file will run to reboot and with a countdown timer for user intervention. The thing is, if the countdown .com file is run before the program, the countdown time will run/countdown. But if the program is run first, then the countdown time will NOT run/countdown.

I have absolutely no idea why, so I am trying to find out how the .com does the countdown, then from there find out what is wrong.
 
Old 02-20-2008, 02:56 AM   #3
khaos83
Member
 
Registered: Dec 2007
Posts: 97

Original Poster
Rep: Reputation: 15
*off topic*

or why wait commond is unable to countdown
 
Old 02-20-2008, 04:20 AM   #4
ronlau9
Senior Member
 
Registered: Dec 2007
Location: In front of my LINUX OR MAC BOX
Distribution: Mandriva 2009 X86_64 suse 11.3 X86_64 Centos X86_64 Debian X86_64 Linux MInt 86_64 OS X
Posts: 2,369

Rep: Reputation: Disabled
Question ho de-com a dos com file

What do you mean by de-com
The most normal files in dos are 1) sys.com = system file without this dos don,t boot
2) Autoexec.bat = auto startup
3) Config.sys = system config
4) exe files =
5) devices drivers


So what is decom


good luck
 
Old 02-20-2008, 04:50 AM   #5
cicorino
Member
 
Registered: May 2006
Location: Italy
Distribution: Slackware, Slackware64
Posts: 31

Rep: Reputation: 16
it's very hard...com files run in real mode, live inside a single segment and have no relocation.
If you use 'ndisasm' (found as tool inside the 'nasm' assembler distribution) you can
de-assemble the small amount of code of your file and try to read/rewrite it.
 
Old 02-20-2008, 04:56 AM   #6
rupertwh
Member
 
Registered: Sep 2006
Location: Munich, Germany
Distribution: Debian / Ubuntu
Posts: 293

Rep: Reputation: 47
What you are looking for is a disassembler. Which basically means any debugger.

ronlau9: .com are dos (small) executables. Only tiny memory model, iirc. None of that new fangled .exe stuff...
 
Old 02-20-2008, 06:14 AM   #7
AnanthaP
Member
 
Registered: Jul 2004
Location: Chennai, India
Distribution: UBUNTU 5.10 since Jul-18,2006 on Intel 820 DC
Posts: 621

Rep: Reputation: 136Reputation: 136
I can think that the calling program is not really calling your countdown program when it exits. So one way is to bundle them in a batch file like so.
Calling.exe
Countdon.com

This wil tell you clearly what is the problem.
End
 
Old 02-20-2008, 12:57 PM   #8
ronlau9
Senior Member
 
Registered: Dec 2007
Location: In front of my LINUX OR MAC BOX
Distribution: Mandriva 2009 X86_64 suse 11.3 X86_64 Centos X86_64 Debian X86_64 Linux MInt 86_64 OS X
Posts: 2,369

Rep: Reputation: Disabled
Lightbulb how to de-com a dos com file

O I know what a com file is I was one the old people who did programming under dos in fortran, Pascal, C in basic After that we get more power full
machines we use Cobol But that were the old days


best wishes
 
Old 02-20-2008, 08:56 PM   #9
sundialsvcs
Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 5,330

Rep: Reputation: 1100Reputation: 1100Reputation: 1100Reputation: 1100Reputation: 1100Reputation: 1100Reputation: 1100Reputation: 1100Reputation: 1100
Believe it or not, COBOL still does most of the "heavy lifting" in the business world... and FORTRAN is still the language of choice in the scientific community.
 
Old 02-21-2008, 07:53 PM   #10
Dan04
Member
 
Registered: Jun 2006
Location: Texas
Distribution: Ubuntu
Posts: 207

Rep: Reputation: 37
Yeah, the company I work for still does a lot of COBOL. I'm fortunate enough to be in another department, though.
 
  


Reply

Tags
dos


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
about detecting dos file in linux OS yubemen Linux - General 6 05-31-2007 11:14 PM
Howto convert bin file to a executable DOS file lilzz Linux - Newbie 5 08-04-2006 12:03 AM
Rename a dos file - how to? flyboy320 Linux - Newbie 3 07-26-2005 07:13 PM
How to compile a executable dos file by g++? Xiangbuilder Programming 7 09-23-2003 08:56 AM
Like MS-DOS batch file but for Linux? rverlander Programming 2 06-23-2002 02:51 PM


All times are GMT -5. The time now is 01:11 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration