home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / sys / amiga / programm / 12921 < prev    next >
Encoding:
Internet Message Format  |  1992-08-31  |  2.3 KB

  1. Path: sparky!uunet!elroy.jpl.nasa.gov!usc!news
  2. From: addison@pollux.usc.edu (Richard Addison)
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: Re: Yet Another SAS/C thread
  5. Date: 31 Aug 1992 15:36:48 -0700
  6. Organization: University of Southern California, Los Angeles, CA
  7. Lines: 51
  8. Sender: addison@pollux.usc.edu (Richard Addison)
  9. Message-ID: <la57o0INNrfn@pollux.usc.edu>
  10. References: <la2ipoINNsk6@pollux.usc.edu> <Btuno8.L61@unx.sas.com>
  11. NNTP-Posting-Host: pollux.usc.edu
  12.  
  13. In <Btuno8.L61@unx.sas.com> walker@twix.unx.sas.com (Doug Walker) writes:
  14. >In article <la2ipoINNsk6@pollux.usc.edu>, addison@pollux.usc.edu (Richard Addison) writes:
  15. >|> Does the builtin memcmp() work in all cases?  It generally creates code
  16.  
  17. >Yes, it does.  This sounds like something that should have been reported
  18. >to technical support; did you do this?
  19.  
  20. Sorry for the confusion.  I was typing this from memory, and it didn't come
  21. out just right.
  22.  
  23. The bug no longer exists in 5.10b.  It did exist in 5.05, however.
  24.  
  25. Just for the curious, here is a call to memcmp() and the code generated by
  26. 5.05 as reported by omd:
  27.  
  28. ; 916:     if (memcmp(mid, mend->P, mlen) >= 0)
  29.        | 0EA6  2006                  MOVE.L    D6,D0
  30.        | 0EA8  2B48 FFFC              MOVE.L    A0,FFFC(A5)
  31.        | 0EAC  2252                  MOVEA.L    (A2),A1
  32.        | 0EAE  6004                  BRA.B    0EB4
  33.        | 0EB0  1218                  MOVE.B    (A0)+,D1
  34.        | 0EB2  B219                  CMP.B    (A1)+,D1
  35.        | 0EB4  56C8 FFFA              DBNE    D0,0EB0
  36.        | 0EB8  6D04                  BLT.B    0EBE
  37.  
  38. Here is the same call and the code generated by 5.10b as reported by omd:
  39.  
  40. ; 916:     if (memcmp(mid, mend->P, mlen) >= 0)
  41.        | 0EBA  2006                  MOVE.L    D6,D0
  42.        | 0EBC  2B48 FFFC              MOVE.L    A0,FFFC(A5)
  43.        | 0EC0  2252                  MOVEA.L    (A2),A1
  44.        | 0EC2  B341                  EOR.W    D1,D1
  45.        | 0EC4  6004                  BRA.B    0ECA
  46.        | 0EC6  1218                  MOVE.B    (A0)+,D1
  47.        | 0EC8  B219                  CMP.B    (A1)+,D1
  48.        | 0ECA  56C8 FFFA              DBNE    D0,0EC6
  49.        | 0ECE  6D04                  BLT.B    0ED4
  50.  
  51. Note that 5.10b includes "EOR.W D1,D1" in order to set the zero flag so that
  52. when "DBNE D0,..." is first executed, it does not exit the loop early.  Those
  53. of you with sharp eyes will notice that I had "DBEQ" in my earlier post by
  54. accident.
  55.  
  56. Anyway, that bug is no longer, it has shuffled off this mortal coil, it is
  57. pushing up the daisies, it is an ex-bug.
  58.  
  59. Sorry for dragging it up unnecessarily.
  60.  
  61. -- 
  62. Richard
  63.  
  64.