How would you obtain a far address from segment and offset address of a memory location? |
[Edit] |
Answer
Pointers to far objects are stored using four bytes (32 bits). The bytes are stored little endian or low to high order. The first word contains the 14-bit memory offset (bits 14 and 15 are always 0). The second word contains the page number (or segment number for function pointers). The memory address is calculated as follows:
Variable Address = (Page * 0x4000L) + Offset
Function Address = (Segment * 0x10000L) + Offset
First answer by Sw sy. Last edit by Sw sy. Contributor trust: 18 [recommend contributor]. Question popularity: 21 [recommend question]
|
Research your answer: |



