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 RayeR Homepage, CZ, 31.05.2010, 10:13

AFAIK C should place all global variables into one segment one by one so you only need to get pointer to the first variable and data segment. But there may be some problem with aligning where some dummy bytes are placed between Byte variables - e.g.
int a; - 0x1100
Byte b; - 0x1102
int c; - 0x1104 (instead of 0x1103)

Aligning may be turned off by some compiler option but you are not sure if another compiler can disable it. May be better use some kind of attribute packed and put all vars into a packed structue. Then you will be safe that any extra bytes was added.

---
DOS gives me freedom to unlimited HW access.

 

Complete thread:

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