📄 basedptr.gml
字号:
.beglevel
.*
.pp
Near pointers are generally the most efficient type of pointer because
they are small, and the compiler can assume knowledge about what
segment of the computer's memory the pointer (offset) refers to.
Far pointers are the most flexible because they allow the programmer
to access any part of the computer's memory, without limitation to
a particular segment.
However, far pointers are bigger and slower
because of the additional flexibility.
.pp
Based pointers are a compromise between the efficiency of near pointers
and the flexibility of far pointers.
With based pointers, the programmer takes responsibility to tell
the compiler which segment a near pointer (offset) belongs to, but may
still access segments of the computer's memory outside of the normal data
segment (DGROUP).
The result is a pointer type which is as small as and almost as efficient as
a near pointer, but with most of the flexibility of a far pointer.
.pp
An object declared as a based pointer falls into one of the following
categories:
.begbull $compact
.* .bull
.* the based pointer is in the same segment as another named object,
.bull
the based pointer is in the segment described by another object,
.bull
the based pointer, used as a pointer to another object of the same
type (as in a linked list), refers to the same segment,
.bull
the based pointer is an offset to no particular segment, and must
be combined explicitly with a segment value to produce a valid pointer.
.endbull
.pp
To support based pointers, the following keywords are provided:
..sk 1 c
.ix keyword
..tb set
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -