def seg - define the current segment


def seg [= NumExpr]


Def seg is used to set the "segmentation register" variable seg for use by peek and pokeSeg is a pre-defined variable which holds the current 16 high-order address bits.  If the NumExpr argument is not specified, def seg sets the seg variable to reference the data segment.  NumExpr may be any numeric expression.  Def and seg must be separated by a space or a tab. 


To assign 42 to absolute memory location 1234AB78 (hexadecimal):
	def seg = &H1234
	poke &HAB78, 42


peek, poke, varptr, varptr$, seg


In most Basmark QuickBASIC implementations, 32 bit addresses are assumed.  Def seg is used to set the high-order 16 bits of an address for future peeks and pokes (although these have questionable utility in a UNIX environment).  Seg is a variable provided to obtain the high-order 16 bits from a prior invocation of varptr or varptr$.  In Microsoft BASIC, "pointers" (or addresses) are customarily stored in integer variables.  This works out nicely on systems with 16-bit addresses because integer variables are also 16-bits.  In Basmark QuickBASIC implementations with 32-bit addresses, the high-order 16 bits must be correctly set before using peek or poke

from The Basmark QuickBASIC Programmerís Manual by Lawrence Leinweber