{eris}work>microtest>microtest.tedit 24 mar 86 m herring notes as we develop microtest -- what is missing, conjectures on what stuff is for, ... taking package-prefix "TUT.", so pkg is TUT & outermost entrypoint is TUT vs DIAGNOSE (which is both cumbersome & misleading). *************** ..COMS (VARS DIAGNOSTICS) (E (PUTD (FUNCTION DIAGNOSTICS ...)) seems to build the function DIAGNOSTICS from the var DIAGNOSTICS. Defer for now. EVAL@COMPILE DONTCOPY section -- so the stuff won't be loaded with the object code. 1) assorted funny DOPVALprops, records, & macros. We don't want to do this; we want the stuff loaded. So I'll use names starting with "TUT." instead. 2) (P (RESETSAVE OPTIMIZATIONSOFF T)) -- yes! Does this mean I can only compile this as a file ?? DONTEVAL@LOAD section -- 1) globalvars ?? 2) (FILES (LOADCOMP) LLSTK) ?? 3) (P (CHECKIMPORTS '(MODARITH LLPARAMS))) -- qv below -- I'll drop this as we are running with exports.all loaded. Would be appropriate to a real diagnostic-type test that would be used forever, which this is not, as yet. MODARITH has the macros like CEIL that do mod arithmetic; the constants like BYTESPERWORD; the integer-size constants like MIN.FIXP LLPARAMS has lots of \-type contant definitions; some fns for (I think) exporting parameter files to BCPL; some internal page-layout-like record definitions. 4) fns, macros, vars ?? I add a global var TUT.GVAR for TUT to read & set. *************** DIAGNOSE fn what you actually run from the top level. it does a bunch of stuff then calls other guys. comes in 4 parts-- 1) "run thru all simple opcodes once", all inside a NOP NOP is a DOPVAL that says use the NOP opcode "taking one argument". This means all the apparent arguments are evaluated, then all but the first popped, then a NOP opcode is executed. Thus it is a kind of PROG1. Why? (It does get NOP into the instruction stream; it does exercise the stack some.) We'll have to do these expressions a few at a time, quantity calculated to barely avoid stack overflow. What is the criterion for an expression getting into this list? I'll use TUT.NOP instead -- it evals all its arguments, pops all of them, then does a NOP. I'll do stack-fulls. This may be fragile e.g. if D2T changes its strategy for var allocation. The total stack space I have to use, given that hdr is 6 cells & TASM reserves 8 for ivars, is (26 - # p/fvars). I change some of the numeric expressions to make them fit our machine better. Defer \DTEST \HILOC-\LOLOC-\VAG2, \ADDBASE, \..BASE... . Drop IPLUS.N. Defer finding other opcodes to add. Change name of global variable read-&-set & add to COMS. 2) do same expressions again but wrapping each in CHECKSTACK (all inside a NOP as before). CHECKSTACK is a macro that evals its expression over a random integerp then checks that that integerp is still there. Uses RAND for the integerp. I'll call it TUT.CHECKSTACK. RAND is is limited to 0..177777q? Defer fix RAND. 3) run DIAGNOSTICS fn, with the stack starting at 4 different positions. Defer DIAGNOSTICS. Will have to tune/adapt stack positioning. 4) enable interrupts & run DIAGNOSTICLOOP fn. Probably uses interrupt to stop DIAGNOSTICLOOP. Presumably we don't have to run diagnostics overnight until we're testing hardware. Defer all this for now..0($GACHA GACHA ?1(DEFAULTFONT 1 (GACHA 10) (GACHA 8) (TERMINAL 8)) .XT  ?™a  á~˜3o6Ó¼< -{rPDY0  r! H'³ ¤zº