Stack overflow in old DOS program under Windows XP

Posted on 2009-02-18
Last Modified: 2012-05-06
I use an old DOS based engineering calculation program named ESTRUCT.EXE using the DOS console under Windows XP professional SP2/3.

If I reinstall WIndows XP the application runs fine. But after some time, perhaps after doing something else, the program returns an error:

(C) Copyright 1985-2001 Microsoft Corp.


? Error: stack overflow
  Error Code 2000
PC = 25AC: 122E; SS = 23A8, FP = 000C, SP = 2580


I already modified the CONFIG.NT and AUTOEXEC.NT. Also, I tried restoring the files from c:\WINDOWS\REPAIR.

It seems to me that something changes in Windows. So far only a reinstall works for me but that is too much work.

Any ideas on what could possibly be happening?
Question by:gato-san
    LVL 6

    Expert Comment

    1) Right click, properties, compatibility tab, enable compatibility mode
    2) Try running the application with the 16bit COMMAND.EXE command interpreter.
    3) Install MSDOS or Windows 9x on a virtual machine (MS Virtual Machine and Sun Virtual Box are both free)
    LVL 63

    Expert Comment

    Other options, turn on restore points in XP, and restore to a previous point that worked OK.

    Also there is a program called apcompat that helps with DOS settings.

    I hope this helps !
    LVL 63

    Expert Comment


    Accepted Solution

    After much diggin' and trying I fixed the problem.

    The program worked fine in VirtualBox with WinXP but it was too much of a mess to run all the system there.

    I used exehdr.exe which is included in MASM 6 and changed the "initial stack location" value.
    Originally it was 0x0800 and first changed it to 0x0c00 as suggested in the link below.

    With that setting the program worked (no error messages) but the results returned were garbage. So I changed it again, this time to 0x0900 and KAZAAAAM!!! it all worked very well.

    Thanks for pointing me to VirtualBox and VPC I heard of those but had no clue that were free.

    Now, can I put those points to myself??

    Thanks and bye

    RCZ La Paz - Bolivia
    LVL 6

    Expert Comment

    I hope that by modifying the memory pointers you do not skew the required results. If it turns out that this was the appropriate solution then congratulations and good job!

    Author Comment

    I compared with several old outputs. All features seem to be ok.
    LVL 6

    Expert Comment

    Good job, nice find

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Free Trending Threat Insights Every Day

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Can you find a fax from a vendor you saved a decade ago in seconds? Have you ever cursed your PC under your breath during an audit because you couldn’t find the requested statement or driver history?  If you answered no to the first question or yes …
    It is only natural that we all want our PCs to be in good working order, improved system performance, so that is exactly how programs are advertised to entice. They say things like:            •      PC crashes? Get registry cleaner to repair it!    …
    Need more eyes on your posted question? Go ahead and follow the quick steps in this video to learn how to Request Attention to your question. *Log into your Experts Exchange account *Find the question you want to Request Attention for *Go to the e…
    To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now