1,105,416 Community Members

Compiler option for FLAT address compilation of pointers

Member Avatar
tumstech
Newbie Poster
2 posts since Nov 2007
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

Hi friends, i have a doubt, in most of the 16 bit compiler like MSVC1.5,

all the far pointers are 32 bit address but they are converted to 20 bit

address when accessing data and writing data, how do i tell my compiler

to use the 32 bit address as a flat address and not as (base:segment). i

have a program in which i would like to hardcode the address greater than

1MB, after enabling A20, and ask the compiler to use all the pointers

that i hardcode the address above 1MB to access directly with out

considering it as base:offset.

Member Avatar
Ancient Dragon
Achieved Level 70
27,656 posts since Aug 2005
Reputation Points: 5,234 [?]
Q&As Helped to Solve: 3,038 [?]
Skill Endorsements: 115 [?]
Team Colleague
Featured
Sponsor
 
0
 

>>how do i tell my compiler to use the 32 bit address as a flat address and not as (base:segment).

You don't

>>have a program in which i would like to hardcode the address greater than 1MB, after enabling A20, and ask the compiler to use all the pointers that i hardcode the address above 1MB to access directly with out considering it as base:offset.

You can't do that directly either. But you are in luck because you can use an EMS driver if you are running true MS-DOS Version 6.X or earlier. Otherwise if you are using Windows XP you might consider using the XP Ramdisk

Another option if you are using Windows 2000 or newer is to upgrade your program to use modern 32-bit compiler then your program will not have the memory restrictions that VC1.52C has. Nice compiler -- I used it for several years. But its an old ancient fossel that doesn't work well on modern computers.

Member Avatar
tumstech
Newbie Poster
2 posts since Nov 2007
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

Thanks for the reply Ancient Dragon

but the thing is, the program is running in a dos environment and need to build the file for 386 machine type.. and i have dos 622 running in the machine.. and i do use the MSVC1.5 which is the known last 16 bit compiler.. do i have any option in MSVC for the same..

or else, which other compiler do i need to use if i still want to be in DOS and use every code of my own instead of using XMS.

the running environment do not have any 3rd party application other than my own application

Member Avatar
Salem
Posting Sage
7,177 posts since Dec 2005
Reputation Points: 5,138 [?]
Q&As Helped to Solve: 970 [?]
Skill Endorsements: 41 [?]
Team Colleague
 
0
 

http://www.delorie.com/djgpp/
This will get you a nice flat address space, and still be able to access DOS.

The next bit depends on how portable your code actually is as to how much work it would take to compile with a new compiler.

You
This article has been dead for over three months: Start a new discussion instead
Post:
Start New Discussion
Tags Related to this Article