AUTOHIT 2003 !!!!!!!!!!!!!!! DESIGN DOCUMENTATION !!!!!!!!!!!!!!!!!!!!!!! SIMLANGUAGE DESIGN !!!!!!!!!!!!!!! DESIGN DOCUMENTATION !!!!!!!!!!!!!!!!!!!!!!! Copyright Erich P Gatejen (c) 1989,1997,2003 ALL RIGHTS RESERVED. See license for details. ============================================================================== loader(name) . String ----> core new(local var2/1) . String ----> core new(local var/2) . VMExecutable ----> >> loader(called) . Integer ----> Instruction pointer 9 ----> core new(i.subr.return) // create return reference 8 String ----> core new(varZ/2) // Parameters 7 String ----> core new(param/1) 6 5 String ----> core new(local varZ/1) 4 String ----> core new(local var/1) 3 2 String ----> core new(system global var') 1 String ----> core new(system global var) 0 --- SUBR CALL FRAME -------------------------------------------------- ENTRY 1- Hit i.scope (emitted) 2- Instantiate parameters (emitted) 3- Instantiate return variable as defined in i.subr instruction 4- Toss i.subr instruction on the stack 5- Toss reference to currently running executable (VMExec.) on stack 6- Load new SUBR and let run 1, 2 are emitted instructions, as such: i.scope // do 1 (SET)* // do 2 i.subr(name) // do 3 through 13 i.rscope // do 14 if (result exist) i.store(result) // do 15 EXIT 8- Hit instruction out of bounds 9- Pop stack, for each a) VMExecutable - hit end of call, go to step 3- b) - end of execution. Die. c) String - remove from core, continue 2- 10- Make popped VMExecutable the running executable 11- Pop the IP (in the Integer) 12- Pop the i.subr. Read the i.subr.return, put in left, remove from core. 13- Continue execution... 14- Hit i.rscope (emitted) and unravel the parameter variables. 15- Hit i.store (optional/emitted) --- MICROCODE -------------------------------------------------------- no instructions no instructions no instructions if (eval exists) i.eval(eval) else if (ref exists) i.fetch(ref) else if (value exists) i.load(value) else (buffer exists) i.reduce(buffer) else !!ERROR if (new exists) i.new(name) else i.store(name) if (eval exists) i.eval(eval) else if (value exists) i.load(value) else if (buffer exists)i.reduce(buffer) else !!ERROR i.new(name) if (clear exists) i.clear(name), ALREADY = true if (eval exists) i.eval(eval), i.merge(name) else if (value exists) i.load(value), i.merge(name) else if (buffer exists)i.reduce(buffer), i.merge(name) else CLEAR = true if (cdata exists) i.load(cdata), i.merge(name) else if (CLEAR true, ALREADY false) i.clear(name) if (eval exists) i.eval(eval) else if (value exists) i.load(value) else i!!ERROR i.right() i.fetch(left) i.math(oper) if (output exists) i.store(output) else i.store(left) if (oper exists) OP = oper else OP = '=' (default) if (eval exists) i.eval(eval) else if (value exists) i.load(value) else !!ERROR i.right i.fetch(item) i.math(operation) i.if(OUTER,OP) INNER: i.scope ANY i.rscope OUTER: continue if (oper NOT exists) OP = NOT else OP = EQ i.fetch(item) i.assert(OUTER,OP) INNER: i.scope ANY i.rscope OUTER: continue TOP: i.scope if (eval exists) i.eval(eval) else if (value exists) i.load(value) else !!ERROR i.new(item) LOOP: i.if(DONE) DO: ANY i.load("1") i.right i.fetch(item) i.math("-") // LEFT RESULT will stay in LEFT i.store(item) i.jump(LOOP) DONE: i.rscope i.scope DO: i.load(value) i.right i.fetch(name) i.math("=") i.if(DONE) (ANY)* i.jump(DO) DONE: i.rscope i.scope ANY i.rscope i.scope (SET)* i.call(name) i.rscope if (result exist) i.store(result) i.scope (SET)* i.eval(name) i.method(method) i.rscope if (result exist) i.store(result) i.scope (INPUT)* i.exec(name) i.rscope if (result exist) i.store(result) i.scope (SET)* i.subr(name) i.rscope if (result exist) i.store(result) i.fault Lots of goatly information. To be had here.