We help IT Professionals succeed at work.

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

whluk
whluk asked
on
268 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




Comment
Watch Question

Commented:
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.
Engineer
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION

Gain unlimited access to on-demand training courses with an Experts Exchange subscription.

Get Access
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Empower Your Career
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.