Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!apple!sun-barr!newstop!sun!pepper!cmcmanis From: cmcmanis%pepper@Sun.COM (Chuck McManis) Newsgroups: comp.sys.amiga.tech Subject: Re: HELP!!! - C bug? Keywords: HELP C Message-ID: <114478@sun.Eng.Sun.COM> Date: 10 Jul 89 06:14:49 GMT References: <596@lehi3b15.csee.Lehigh.EDU> Sender: news@sun.Eng.Sun.COM Reply-To: cmcmanis@sun.UUCP (Chuck McManis) Organization: Sun Microsystems, Mountain View Lines: 39 In article <596@lehi3b15.csee.Lehigh.EDU> (William Dimm) writes: > ... I think I found the line causing the problem (dissasembled by > CPR underneath): > bytes -= (unsigned int)(op.count - result->ops); > The variables being subtracted are pointers of the same type. Hmmm, What do you hope to gain by subtracting two pointers? Since you seem to be assigning a variable "bytes" to be some number minus this number I get the impression you want the size of something? Unfortunately, the above statement won't cut it. The other interesting things that come to light. Why is one of your pointers called "count" and one of them called "ops" ? Variables named 'count' usually contain an integer. The code that CPR spit out seems to think one is an integer as well. > MOVE.L 056A(A4),D0 * Move the global 32 bit variable at $056A+A4 to D0 > MOVE.L D0,D1 * Copy it into D1 > MOVEA.L FFF8(A5),A0 * Move the local Pointer (probably "result" into A0) > SUB.L (A0),D1 * Subtract result->ops from op.count > MOVEQ #0A,D2 > DIVS.W D2,D1 * Divide the result by 10. This would indicate * that sizeof(*(result->ops)) == 10 > SUB.L D0,FFAA(A5) * Subtract result from "bytes" Random questions, what are you trying to do? What are the types of result->ops and op.count (how about the structures or unions defining them). Then you can get a real answer. --Chuck McManis uucp: {anywhere}!sun!cmcmanis BIX: cmcmanis ARPAnet: cmcmanis@sun.com These opinions are my own and no one elses, but you knew that didn't you. "A most excellent barbarian ... Genghis Kahn!"