🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.amiga.tech
Article #426

HELP!!! - C bug?

#426
From: William Dimm
Date: Sun, 09 Jul 1989 00:04
31 lines
1756 bytes
I just pulled out some routines that I wrote with Lattice 4.0
and tried to compile them with 5.02.  And, well, remember the
black screen with the red letters....  I think I found the line causing the
problem (dissasembled by CPR underneath):
	bytes -= (unsigned int)(op.count - result->ops);
		MOVE.L  056A(A4),D0
		MOVE.L  D0,D1
		MOVEA.L FFF8(A5),A0
		SUB.L   (A0),D1
		MOVEQ   #0A,D2
		DIVS.W  D2,D1
		SUB.L   D0,FFAA(A5)

I don't know 68000 assembler, so I don't know if the compiler
is generating correct code above.  The variables being subtracted
are pointers of the same type.  I set a breakpoint, and found that
the pointers were the same.  But, rather than the value of 'bytes' 
remaining the same after executing this line, it becomes a VERY large
number.  I changed 'bytes' to type 'int' and found that it became a large
negative number after this line.  I tried compiling with the '-b0' option, 
but it didn't help.  Can anybody tell me if the above Assembly is correct?
A quick response would be greatly appreciated.  Also, if anyone has
the 5.03.20 patches mentioned earlier on this list, I would appreciate
it if you could mail them to me - I can't call the Lattice BBS right now
(no modem). 
 
	 Thanks,
			Bill Dimm     wdimm@lehi3b15.csee.Lehigh.EDU     wcd0@lehigh.BITNET

P.S.  The troublesome line was of course followed by a memcpy() - just my
luck!
Technical Details
Message-ID: <596@lehi3b15.csee.Lehigh.EDU>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!cs.utexas.edu!usc!polyslo!vlsi3b15!lehi3b15!wdimm

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!cs.utexas.edu!usc!polyslo!vlsi3b15!lehi3b15!wdimm
From: wdimm@lehi3b15.csee.Lehigh.EDU (William Dimm)
Newsgroups: comp.sys.amiga.tech
Subject: HELP!!! - C bug?
Keywords: HELP C
Message-ID: <596@lehi3b15.csee.Lehigh.EDU>
Date: 9 Jul 89 00:04:37 GMT
Organization: CSEE Dept. Lehigh University, Bethlehem, PA
Lines: 31