Mail Archives: djgpp/1997/05/05/20:31:23
Gautam N. Lad wrote:
>
> Hi,
> Can someone tell me what Segment (FP_SEG) and Offset (FP_OFF)?
If you use DJGPP those things don't exist because DJGPP has a flat
memory model. But in 16 bit compilers you have other memory models
(representations) : tiny, small, medium ,large, huge.
In all those memory models the memory you have (RAM) is partitioned in
64K segments (because of DOS's stupidity). So you can't have something
bigger than 64K in the same segments. If you need more data, you
allocate it in a new segment. The FP_SEG gives you the address where the
segment starts. Now, in this segment, your data has a relative (to the
segment start address) adress called the offset. FP_OFF gives you the
offset of the data relative to the address that FP_SEG gives you.
to find the actual address in memory you add the two adresses.
you usually use these with pointers.
Again, in DJGPP these don't exist. You shouldn't bother with them.
> Thanks!
> Bye!
--
tudor 'at' cam 'dot' org
http://www.cam.org/~tudor
'This is Scott Nudds of the Borg. C is irrelevant.'
- Raw text -