This is the current working IMP compiler (PASS1) source. PASS1.IMP should compile and link with the CSKIMP86 tool chain, and should run correctly. Note that the simple CSKIMP runtime environment means that to run the compiler you should type: pass1 ,stdinc.imp/, The STDINC.IMP file in this zip is the same as the one supplied by CSKIMP86, with one subtle difference - real IMP compilers MUST have the line %endofperm, whilst CSKIMP prefers the non-standard %endofinclude. There is another critical restriction in the CSKIMP86 world, which is that currently all files are "cooked" by the DOS I/O library. In particular, is turned into . This is fine for the input files and the listing file, but until I fix it, the binary ICODE files produced by this PASS1 are a bit broken :-) Changes from Original PASS1.IMP =============================== Although a "diff" shows up dozens of changes, many of these are mechanical and are due to syntax limitations in CSKIMP: * The largest number of changes is from b'nnn' and x'nnn' forms of constants into the 2_nnn and 16_nnn forms recognised by CSKIMP. * The next largest number of changes is that CSKIMP does not allow hanging comments on a line with a label. Thus: fred: ! here is fred was converted throughout (by adding a semicolon) into: fred: ; ! here is fred * The largest lumps of change - although actually only a handful of places - are because CSKIMP doesn't recognise the () or (*) forms of array initialisation, so in the grammar tables, for instance, which have a thousand trailing zeroes, there now really are a thousand zeroes in the source. Thank goodness for cut-and-paste editors! Actual technical changes are limited to a handful of places: * The Mouses compiler (which this is derived from) had a very racy hash algorithm which relied on (a) 32 bit maths (b) in-line assembler and (c) "magic" constants. I have made no attempt to reproduce the algorithm - as an expedient solution I have implemented the very clunky "not really a hash at all" algorithm of just AND-ing a number with the table size. * Copying strings into and out of the dictionary was done by mapping addresses through string maps - these have been replaced with little copy loops because CSKIMP doesn't do maps. * The source had been "improved" with some direct address calculations and byteinteger maps to enter items into the GLINK array - presumably as a performance tweak. I reversed these out, again primarily because CSKIMP doesn't do maps. * The original version handles unexpected EOF by catching event 9. CSKIMP doesn't do events, but returns "-1" as an EOF on READSYMBOL, so a couple of checks for that were added. Andy Davis