[comp.sys.amiga] Correction for A68k

petersen@uicsrd.csrd.uiuc.edu (05/04/88)

I was trying out the PD assembler A68k on fish disk 110, and ran into a bug
in it.  I tracked it down to expressions of the form "add.l 8(a3),d3" which
were incorrectly be changed into "addq.l 8(a3),d3" and confusing the
assembler. So........

Here is the fix for A68k: CodeGen.c around line 119

NEW-----------------------------------------------------------------
    if ((Src.Mode == Imm)               /* Immediate instructions */
        && ((Src.Hunk == ABSHUNK) && (Src.Defn <= LineCount)
     ------^
        && ((EA611 IN AdrModeB) && (Dest.Mode == DReg)  /* MOVE */
        && (Src.Value >= -128) && (Src.Value <= 127))
        || ((EA05y IN AdrModeB)                         /* ADD/SUB */
        && (Src.Value > 0) && (Src.Value <= 8)))) {
                                         ------^
            strcat (OpCode, "Q");       /* Make it ADDQ/SUBQ/MOVEQ */
            Instructions (OpLoc);
    }

***NOTE the added parenthesis around the expression following the
(Src.Mode == Imm).  This optimization is ONLY to be performed if
the instructions mode is "Imm".

------------ 
University of Illinois, Urbana-Champaign
Center for Supercomputing Research and Development

    UUCP:    {ihnp4,uunet,convex}!uiucuxc!uicsrd!petersen
    ARPANET: petersen%uicsrd@uxc.cso.uiuc.edu
    BITNET:  petersen@uicsrd.csrd.uiuc.edu