Solved

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

Posted on 1998-03-21
2
227 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Errors will happen. It is a fact of life for the programmer. How and when errors are detected have a great impact on quality and cost of a product. It is better to detect errors at compile time, when possible and practical. Errors that make their wa…
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

739 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