[virtmach] Test, Hello

Stephen Pelc sfp@mpeltd.demon.co.uk
Thu, 20 Apr 2000 11:21:54 +0100


> > Do you want to dynamically link bytecode modules? 
> Yes.  The VM is for an agent based system, and the agents are loaded into a
> running system, so some name resolution has to be done at load time.
See the OTA specs at www.europay.com

> > using multi-byte opcodes for infrequently-used 
> > (but otherwise essential) primitives. 
> 
> Yes, I'm going to be doing that.  I'll have a think about the hufman
> encoding, but I don't think it would be fast enough.  My current plan is to
> have a look up table for the op-code implementations, something like this:
> 
> 	while (pc!=end){
> 		//...
> 		instruction = *pc;
> 		(fnLookup[instruction.opcode])();
> 		// ...
> 	}

The OTA system reserves a number of single byte opcodes for the 
most frequently used procedure calls. When a modules is linked 
the linker/optimiser profiles the static call frequency, and 
turns these procedure calls into one byte opcodes. If your 
source code is well factored, and avoids the C tendency to cut 
and paste programming, this can have a big impact on code 
density. The use of quoting, also in OTA, will deal with cut and 
paste programming by identifying repeated byte code sequences 
and and replacing them by references to the original "quotation".

--
Stephen Pelc, sfp@mpeltd.demon.co.uk
MicroProcessor Engineering Ltd - More Real, Less Time
133 Hill Lane, Southampton SO15 5AF, England
tel: +44 1703 631441, fax: +44 1703 339691
web: http://www.mpeltd.demon.co.uk