memory offset and segment

Is it possible to get the corresponing memory segment and memory offset of
a variable in the program?
Thank you.

waity <waity@hongkong.com> wrote:

Is it possible to get the corresponing memory segment and memory offset of
a variable in the program?

If you’re using Neutrino - the segment registers don’t mean the same thing
as in the 16-bit realmode. Everything is in a flat 32-bit addressing space
so you don’t need a segment/offset pair.

If you want to know what the virtual address of a variable is, in C - just
grab the address and save it in a pointer. Eg:

char *a = &mychar;

If you wish to know the physical location of the variable, you should check
out the documentation http://qdn.qnx.com/support/docs/neutrino/lib_ref/m/mem_offset.html
for more information.

-Adam

“Operating System for Tech Supp” <os@qnx.com> ¼¶¼g©ó¶l¥ó
news:9p02ap$oab$4@nntp.qnx.com

waity <> waity@hongkong.com> > wrote:
Is it possible to get the corresponing memory segment and memory offset
of
a variable in the program?

If you’re using Neutrino - the segment registers don’t mean the same thing
as in the 16-bit realmode. Everything is in a flat 32-bit addressing
space
so you don’t need a segment/offset pair.

If you want to know what the virtual address of a variable is, in C - just
grab the address and save it in a pointer. Eg:

char *a = &mychar;

If you wish to know the physical location of the variable, you should
check
out the documentation
http://qdn.qnx.com/support/docs/neutrino/lib_ref/m/mem_offset.html
for more information.

-Adam