Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

Help me with C++ (Developers)

posted by marcov, 06.06.2010, 19:49

> I am trying to re-writing my program Explorer PC (graphical file manager
> for DOS).Before it was written in Turbo Assembler but now I am using Turbo
> C++.
> My problem is that need making to ensure to me that several variables
> remain together in the executable file (.exe) or when running are located
> together in the same segment.
> For example:
> int a; SEG=0 OFFSET=0
> int b; SEG=0 OFFSET=2
> int c; SEG=0 OFFSET=4
> In assembler I can control this but in C++ is possible?

Something that I have seen in FreeBSD headers was something like this:

struct {
int ___prefix_a;
int ___prefix_b;
int ___prefix_c;
#define a __prefix_a
#define b __prefix_b
#define c __prefix_c
} a;

IOW make a record with dummy names, and then use #defines to access them.

Costs a bit of error message clarity though (and C/C++ doesn't have that much of that already)

 

Complete thread:

Back to the forum
Board view  Mix view
22049 Postings in 2034 Threads, 396 registered users, 223 users online (1 registered, 222 guests)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum