Solved

DOS Overlay file (.ovl) in C++ and DOS relocation table

Posted on 1998-03-21
2
224 Views
Last Modified: 2010-04-10
Hi all,
1)
    I would like to create .ovl files for my C/C++ programs like .ovr's in PASCAL because I would like to seperate the main code with the subcode such as the setup program. Do you know how to do?

2)
Also, i'm checking out the usage of the relocation table in dos header and i'm not quite sure why the first relocation table item (offset) contains 01 00 and segment contains 00 00, my program actually starts at 200h, and the second relocation item is also set to 8c 00 00 00. does it mean that thesecond segment starts at 00 8c (offset) with a displacement of 8c hex from the start of the file?
here is a dump of my program:
4D 5A 5E 00 88 00 38 00 20 00 C8 05 FF FF 8D 14
00 20 00 00 00 00 00 00 3E 00 00 00 01 00 FB 30
6A 72 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00
00 00 8C 00 00 00 7A 01 00 00 29 5D 00 00 30 5D
00 00 37 5D 00 00 3E 5D 00 00 5D 5D 00 00 6F 5D
00 00 8F 5D 00 00 A2 5D 00 00 BE 5D 00 00 C5 5D
00 00 CE 5D 00 00 FA 5D 00 00 09 5E 00 00 35 5E
00 00 3C 5E 00 00 43 5E 00 00 5E 5E 00 00 7D 5E
00 00 8D 5E 00 00 A2 94 00 00 A4 99 00 00 C1 99
00 00 40 00 37 0D 5B 00 37 0D 75 00 37 0D 7C 00
37 0D F7 00 3F 0D 0B 01 3F 0D 16 01 3F 0D B0 00
51 0D BB 00 51 0D 4F 01 51 0D 5D 01 51 0D C0 00
6E 0D C8 00 6E 0D D7 00 6E 0D E4 00 6E 0D 1C 02
6E 0D 5F 09 6E 0D 1B A6 00 00 20 A6 00 00 3D A6
00 00 42 A6 00 00 51 A6 00 00 89 A6 00 00 53 AB
00 00 60 AB 00 00 65 AB 00 00 AF AB 00 00 F6 AB
00 00 EA AC 00 00 77 B5 00 00 2A B7 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
B8 6B 0F 8E D8 FA 8E D0 BC 20 72 FB FC 8C 06 AE
15 E8 E3 06 BF B4 15 B9 07 02 33 C0 1E 07 F3 AB
1E BA 79 01 0E 1F B8 23 25 CD 21 FC 1F BB 00 00
E8 88 06 8E 06 AE 15 26 8A 1E 80 00 32 FF 26 C6




0
Comment
Question by:whluk
2 Comments
 
LVL 22

Expert Comment

by:nietod
ID: 1183681
It is up to your C++ compiler and linker as to whether or not you can have overlays.  I've never seen a C++ compiler that supports overlays.  The other option is to do it yourself, but that is a bit of work (I've done it).  However, you seem to like to look into the nasty stuff.
0
 
LVL 15

Accepted Solution

by:
Tommy Hui earned 100 total points
ID: 1183682
Borland C++ supports overlay for DOS.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

808 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