anchor.diff:  \			$0000 #, 5 +fp!,
   \			fillRect
   
  -			256 #, 1 +fp!,
  +			256 #, memsiz !,
   			getmem
  -			3 +fp@,
  +			rsn @,
   			if,	$F640 #, crash halt,
   			then,
  -			2 +fp@, 0=
  +			memptr @, 0=
   			if,	$F642 #, crash halt,
   			then,
  -			2 +fp@, -3 +fp!,
  -			256 #, 1 +fp!,
  +			memptr @, -1 +fp!,
  +			256 #, memsiz !,
   			getmem
  -			3 +fp@,
  +			rsn @,
   			if,	$F644 #, crash halt,
   			then,
  -			2 +fp@, -3 +fp@, xor, 0=
  +			memptr @, -1 +fp@, xor, 0=
   			if,	$F646 #, crash halt,
   			then,
   
  -			2 +fp@, 1 +fp!, relmem
  -			-3 +fp@, 1 +fp!, relmem
  -
  -			512 #, 1 +fp!,
  +			relmem
  +			-1 +fp@, memptr !, relmem
  +
  +			512 #, memsiz !,
   			getmem
  -			3 +fp@,
  +			rsn @,
   			if,	$F740 #, crash halt,
   			then,
   
  -			2 +fp@,  poolbase @, /node +, xor, crash
  +			memptr @,  mplsta @, /node +, xor, crash
   		8 fp+!,
   
   		
  
positive.code: \	+3	undefined
  \	+4	Reason code (non-zero)
  
  sub: findTag
  	2 +fp@, -1 #, xor, 1 #, +,  1 +fp@, +, $8000 #, and,
  	if,	1 +fp@, 0 #, +, @,
  		1 +fp@, 2 #, +, @, +,
  		1 +fp@, 4 #, +, @, +,
  		1 +fp@, 6 #, +, @, +,
  		$FFFF #, xor,
  		if,  1 +fp@, 2 #, +, 1 +fp!,  ' findTag >BODY @ #, go,
  		then,
  
  		1 +fp@, @,  $C0DE #, xor,
  		if,  1 +fp@, 2 #, +, 1 +fp!,  ' findTag >BODY @ #, go,
  		then,
  
  		1 +fp@, 2 #, +, @,  1 +fp@,  xor,
  		if,  1 +fp@, 2 #, +, 1 +fp!,  ' findTag >BODY @ #, go,
  		then,
  
  		1 +fp@, 4 #, +, @,  $DA7A #, xor,
  		if,  1 +fp@, 2 #, +, 1 +fp!,  ' findTag >BODY @ #, go,
  		then,
  
  		1 +fp@, 3 +fp!,  0 #, 4 +fp!,
  		rfs,
  	then,
  	0 #, 3 +fp!,  ENOTFOUND 4 +fp!,
  	rfs,
  
  \ fmtmem formats a memory pool with the required metadata to support allocation requests.
  \ Arguments:
  
negative.code:  4 const, /node
   3 const, roundup
  
  int, mplsta
  int, mplsiz
  
  :, fmtmem
  	mplsta @, mplsta @, !,
  	mplsiz @, -/node and, -/node +, mplsta @, 2 #, +, !,  ;,
  
  \ getmem allocates a block of memory from a formatted memory pool.  The mplsta
  \ variable must point to the pool to allocate from.
  
  int, p
  int, q
  
  int, memptr
  int, memsiz
  
  :, gm2
  	memptr @, /node +, memsiz @, +, p !,  memptr @, @,  p @, !,
  	memptr @, /node +, memsiz @, +,   memptr @, !,
  	memsiz @, /node +, -1 #, xor, 1 #, +,  memptr @, 2 #, +, @, +,  memptr @, @, 2 #, +, !,
  	memsiz @, 1 #, xor, memptr @, 2 #, +, !,
  	memptr @, /node +, memptr !,  0 #, rsn !,
  	rfs,
  
  :, gmCombine
  	memptr @, @, 2 #, +, @, 1 #, and, if, exit, then,
  	memptr @, @, mplsta @, xor, if,
  		memptr @, 2 #, +, q !,
  		memptr @, @, 2 #, +, @, /node +, q @, @, +, q @, !,
  		memptr @, @, @, memptr @, !,
  	then, ;,
  
  :, gm1
  	memptr @, 2 #, +, @, 1 #, and,
  	if,	memptr @, @, memptr !,
  		memptr @, mplsta @, xor, if, again, then,
  		0 #, memptr !,  ESIZE $100 #, +, rsn !, rfs,
  	then,
  
  	gmCombine
  
  	memptr @, 2 #, +, @, q !,
  
  	memsiz @,  -1 #, xor, 1 #, +,  q @, +,  $8000 #, and,
  	if,	memptr @, @, memptr !,
  		memptr @, mplsta @, xor, if, again, then,
  		0 #, memptr !,  ESIZE $500 #, +, rsn !, rfs,
  	then,
  
  	/node /node +, memsiz @, +, -1 #, xor, 1 #, +,  q @, +, $8000 #, and, $8000 #, xor,
  	if,	gm2
  	then,
  
  	q @, 1 #, xor, memptr @, 2 #, +, !,
  	memptr @, /node +, memptr !,  0 #, rsn !,
  	rfs, ;,
  
  sub: getmem
  	mplsta @,
  	if,	mplsta @, memptr !,
  		memsiz @, roundup +, -/node and, memsiz !,
  		gm1
  	then,
  	0 #, memptr !,  EBASE rsn !,
  	rfs,
  
  \ relmem is used to release previously allocated memory, as returned by getmem.
  \ Nothing is returned.
  
  :, relmem
  	memptr @,  -/node +,  memptr !,
  	memptr @, 2 #, +, @,  -/node and,  memptr @, 2 #, +, !,  ;,
  
  \ First instruction of STS starts here.  coldstart vectors here.
  
  :, cold		$4000 #, %fp !,			( Initialize the STS frame pointer )
  		-8 fp+!,			( Let user know we're running )
  			$C000 #, bitmapptr !,
  			40 #, wrdperrow !,
  			80 #, rowendres !,
  			100 #, rowperbox !,
  			$0000 #, bitmapdat !,
  			fillRect
  
  			0 #, fndtagsta !,	( locate free memory pool and initialize it. )
  			$3000 #, fndtagend !,
  			findTag
  			rsn @, if,		( If not found... )
  				$C000 #, bitmapptr !,	( indicate error to user and halt )
  				40 #, wrdperrow !,
  				0 #, rowendres !,
  				200 #, rowperbox !,
  				$FFFF #, bitmapdat !,
  				fillRect
  				halt,
  			then,
  			fndtagsta @, $C000 #, +, mplsta !,
  			fndtagsta @, -1 #, xor, 1 #, +, $4000 #, +, mplsiz !,
  			fmtmem
  
  \			$C000 #, 1 +fp!,	( Memory pool updated.  Time to mount our filesystem. )
  