🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.utils.bug
Article #226

Bug in GAS v1.37 found

#226
From: Winston Edmond
Date: Sat, 08 Aug 1992 06:30
44 lines
1952 bytes
To all 68020 developers using the GNU assembler (GAS):

** There is a bug in GAS version 1.37 that causes it to incorrectly
** assemble the MOVEM instruction in some cases.

The bug occurs when:
  (1) the instruction is being assembled in the TEXT segment;
  (2) the transfer is memory --> register(s)  (memory is the data source);
  (3) the Effective Address (EA) is known (not an external reference);
  (4) the EA is in the TEXT segment; and
  (5) the EA is absolute (no indirection or indexing).

Why it breaks:
   GAS has a special test for absolute address references to text
   segment locations, and it converts them into PC-relative addresses.
   Although the GAS code in m68k.c and m68k-opcodes.h looks like it
   ought to work, it clearly doesn't.

What you get:
   GAS produces <instruction> <offset>  <reglist>
   instead of   <instruction> <reglist> <offset>  as it ought to.

Work-around:
   Use data segment memory.  It's a bit odd to be using text segment
   locations to save register values anyway.

Comparison of v1.37 and v1.38 GAS source code files indicates that
v1.38 has the bug, too.
 -WBE

Other notes for bug-gnu:
* running on SunOS 4.1, cross assembling for Sun3
* assemble the following with "gas -mc68020 -o bug bug.s"

---------------------------------------------------------------------------
.text
foo:	.skip	0x50

	moveml	foo,d0-d7/a0-a7
---------------------------------------------------------------------------

* assembles: 0x50/  4cfa ffae ffff, but should have ffff as second word,
  not third.
 -WBE
Technical Details
Message-ID: <9208080634.AA15548@life.ai.mit.edu>
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!bbn.com!wbe

Show Full Headers
Complete Article Headers
Newsgroups: gnu.utils.bug
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!bbn.com!wbe
From: wbe@bbn.com (Winston Edmond)
Subject: Bug in GAS v1.37 found
Message-ID: <9208080634.AA15548@life.ai.mit.edu>
Sender: gnulists@ai.mit.edu
Organization: GNUs Not Usenet
Distribution: gnu
Date: Sat, 8 Aug 1992 06:30:00 GMT
Approved: bug-gnu-utils@prep.ai.mit.edu
Lines: 45