🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.utils.bug
Article #1093

possible bug in gas-1.38 (m68k configuration)

#1093
From: Scott Hammond
Date: Fri, 13 Nov 1992 01:34
76 lines
2406 bytes
Configuration:  gas-1.38(.1?) m68k.h->m-generic.h
                assember is used for cross-assembly
                host: sun4, sunos4.1.2
                gas run with no options.

It appears there is a bug in gas.  In this hand coded routine, the
'movw' and 'jmp' instructions show the wrong address for 'jtab' in the
disassembly.

||| This does not work, in the disassembly following, the references to
||| jtab do not refer to the correct address.
        .text
fun:
        bfextu  sp@(20){#0:#4},d0
        movw    pc@(jtab,d0:w:2),d0
        jmp     pc@(jtab,d0:w)

jtab:
        .word   badframe-jtab
        .word   threeword-jtab
        .word   fourword-jtab
        .word   fpcp-jtab
        .word   busfault-jtab
        .word   badframe-jtab

badframe:
        illegal
threeword:
        rtr
fourword:
        illegal
fpcp:
        illegal
busfault:
        illegal

Disassembly of section .text:
00000000 (jtab-)0016 bfextu sp@(20),0,4,d0
00000006 (jtab-)0010 movew 0x10[d0.w*2],d0      ||| 0x10 should be 0x16
0000000e (jtab-)0008 jmp 0x10[d0.w]             ||| 0x10 should be 0x16
00000016 (jtab+)0000 orb #14,a4
0000001a (jtab+)0004 orb #18,a0@
0000001e (jtab+)0008 orb #12,a4@
00000022 (badframe+)0000 illegal
00000024 (threeword+)0000 rtr
00000026 (fourword+)0000 illegal
00000028 (fpcp+)0000 illegal
0000002a (busfault+)0000 illegal

||| Noting that the addresses were off by 6 bytes the following 
||| is an evil workaround
        .text
fun:
        bfextu  sp@(20){#0:#4},d0
        movw    pc@(jtab2,d0:w:2),d0
        jmp     pc@(jtab2,d0:w)

jtab:
        .word   badframe-jtab
        .word   threeword-jtab
        .word   fourword-jtab
jtab2:
        .word   fpcp-jtab
        .word   busfault-jtab
        .word   badframe-jtab

badframe:
        illegal
threeword:
        rtr
fourword:
        illegal
fpcp:
        illegal
busfault:
        illegal
Technical Details
Message-ID: <9211130134.AA19259@SCTC.COM>
Path: arc1-ca.pugleaf.net!sparky!uunet!convex!news.utdallas.edu!wupost!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!sctc.com!scott

Show Full Headers
Complete Article Headers
Newsgroups: gnu.utils.bug
Path: arc1-ca.pugleaf.net!sparky!uunet!convex!news.utdallas.edu!wupost!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!sctc.com!scott
From: scott@sctc.com (Scott Hammond)
Subject: possible bug in gas-1.38 (m68k configuration)
Message-ID: <9211130134.AA19259@SCTC.COM>
Sender: gnulists@ai.mit.edu
Organization: GNUs Not Usenet
Distribution: gnu
Date: Fri, 13 Nov 1992 01:34:11 GMT
Approved: bug-gnu-utils@prep.ai.mit.edu
Lines: 77