# Count your megs of RAM. Needs a $megs variable elsewhere.
#  Should assemble USE16 or USE32, but not both, due to the labels.
# Any Ha3sm will have a use32 init though.

L yermegs
	zero C
	1+ C
	1+ C			# count of megs.
	zero A
	NOT A
	downshift A
	1- A			# some unusual number
   L nextmeg
	= C to DI
	upshift 20 to DI	# times a meg. 4 gig max. How did that work?
	1-  DI
	1-  DI
	1-  DI
	1-  DI
	1-  DI
	= A to @ DI
	zero B
	= @ DI to B
	-test A to B
		when	not	zero	short thatmanymeg
	1+ C
		when zero short nextmeg		# short jump

 L thatmanymeg

= C to @ $((megs))

