Eliot Miranda wrote:
I wonder if anyone has any 32-bit processor implementations,
either in Smalltalk or in some other, preferrably easy-to-parse, formal semantics.
I thought about this several times, but never came down to implement it: The Intel manuals do have a very concrete pseudocode for every instruction, and it does look quite parsable. I did start once, but the need for it disappeared, and I never finished...
the description for ADD is:
DEST ← DEST + SRC + CF;
and for AAA (Ascii adjust after addition) is more complex: IF 64-Bit Mode THEN #UD; ELSE IF ((AL AND 0FH) > 9) or (AF = 1) THEN AL ← AL + 6; AH ← AH + 1; AF ← 1; CF ← 1; AL ← AL AND 0FH; ELSE AF ← 0; CF ← 0; AL ← AL AND 0FH; FI; FI;
I think it really is an option to write a compiler from PDF to Smalltalk :)
richie