Path: utzoo!mnetor!uunet!husc6!bbn!mit-eddie!bloom-beacon!gatech!purdue!i.cc.purdue.edu!j.cc.purdue.edu!pur-ee!uiucdcs!uxc.cso.uiuc.edu!uicsrd.csrd.uiuc.edu!petersen From: petersen@uicsrd.csrd.uiuc.edu Newsgroups: comp.sys.amiga Subject: Correction for A68k Message-ID: <42600015@uicsrd.csrd.uiuc.edu> Date: 4 May 88 03:12:00 GMT Lines: 32 Nf-ID: #N:uicsrd.csrd.uiuc.edu:42600015:000:1330 Nf-From: uicsrd.csrd.uiuc.edu!petersen May 3 22:12:00 1988 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