"To build the spurreader or spurreader-64 images used in the examples below run one of
	buildspurtrunkreaderimage.sh
	buildspurtrunkreader64image.sh
The reader images include a simple REPL loop that reads a chunk-format expression from stdin, evaluates it and writes the printString of the result to stdout.  In the simulator you are prompted for input via an input widget and writes output to the Transcript.  e.g. try 3+4!.  On the Transcript you should see
squeak> 7
squeak> "
	
"Run the Cog VM simulator on a Spur image (by default the Spur trunk 4.6 image, complex options are in the Cog example below)"
[| cos |
cos := CogVMSimulator newWithOptions: #(Cogit StackToRegisterMappingCogit "SimpleStackBasedCogit"
										ObjectMemory Spur32BitCoMemoryManager
										"ISA ARMv5" "ISA IA32").
"cos initializeThreadSupport."
cos desiredNumStackPages: 8.
cos openOn: 'spurreader.image'.
cos openAsMorph; run].

"Run the Stack VM simulator on a Spur image (by default the Spur trunk 4.6 image, complex options are in the Cog example below)"
[| cos |
cos := StackInterpreterSimulator newWithOptions: #(ObjectMemory Spur32BitMemoryManager).
cos desiredNumStackPages: 8.
cos openOn: 'spurreader.image'.
cos openAsMorph; run].

"Run the Cog VM simulator on a Cog image (by default the Squeak 4.5 image:).  Note the plethora of optional debug features in comments."
[| cos proc opts |
cos := CogVMSimulator newWithOptions: #(Cogit StackToRegisterMappingCogit "SimpleStackBasedCogit").
"cos initializeThreadSupport."
cos desiredNumStackPages: 8.
cos openOn: 'Squeak-4.5-All-in-One.app/Contents/Resources/Squeak4.5-13680.image'.
false ifTrue:
	[cos systemAttributes
		at: 2 put: '-doit';
		at: 3 put:	'ShootoutTests runAllToTranscript.  Smalltalk quitPrimitive'].
"cos cogit breakPC: 16r2697."
"cos cogit traceStores: true."
"cos cogit sendTrace: 6." "trace prims & print"
"cos cogit singleStep: true."
"cos cogit printInstructions: true."
"cos linkSends: false."
"cos enableCog: false."
"cos setBreakSelector: 'standardIOStreamNamed:forWrite:'."
"cos cogit setBreakMethod: 16rCE1630."
"cos cogit
	cog: 16rAB0B28 + cos startOfMemory
	selector: 16r31F280 + cos startOfMemory." "e.g. jit a specific method without simulating"
cos openAsMorph; run].

"Run the Stack VM simulator on a 64-bit Spur image (by default the Spur trunk 4.6 image, complex options are in the Cog example below)"
[| cos |
cos := StackInterpreterSimulator newWithOptions: #(ObjectMemory Spur64BitMemoryManager).
cos desiredNumStackPages: 8.
cos openOn: 'spurreader-64.image'.
cos openAsMorph; run].

"Run the Cog VM simulator on a 64-bit Spur image (by default the Spur trunk 4.6 image, complex options are in the Cog example below)"
[| cos |
cos := CogVMSimulator newWithOptions: #(Cogit StackToRegisterMappingCogit "SimpleStackBasedCogit"
										ObjectMemory Spur64BitCoMemoryManager
										"ISA ARMv5" "ISA IA32").
"cos initializeThreadSupport."
cos desiredNumStackPages: 8.
cos openOn: 'spurreader-64.image'.
cos openAsMorph; run]