home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / sys / mac / programm / 20969 < prev    next >
Encoding:
Internet Message Format  |  1993-01-08  |  3.3 KB

  1. Path: sparky!uunet!spool.mu.edu!enterpoop.mit.edu!eru.mt.luth.se!lunic!sunic!ugle.unit.no!mac-df04.er.sintef.no!user
  2. From: Arne.Venstad@DELAB.SINTEF.no (Arne Venstad)
  3. Newsgroups: comp.sys.mac.programmer
  4. Subject: THINK C 5.04 bug, or is it me?
  5. Message-ID: <Arne.Venstad-080193101130@mac-df04.er.sintef.no>
  6. Date: 8 Jan 93 09:40:06 GMT
  7. Sender: news@ugle.unit.no (NetNews Administrator)
  8. Followup-To: comp.sys.mac.programmer
  9. Organization: SINTEF DELAB
  10. Lines: 90
  11.  
  12. Dear net friends,
  13.  
  14. After going from THINK C 4.05 to THINK C 5.04 my XFCN started to execute
  15. erroneously. Parts of my code:
  16.  
  17. ...
  18. typedef struct irow {
  19.     long iPtr;
  20.     short length;
  21. } Row;
  22. ...
  23.     Row *source,*target;
  24.     ...
  25.     source=...;
  26.     target=...;
  27.     ...
  28.                 while (source!=target)  /* As somebody may guess, this is an attempt to
  29. */
  30.                      *target--=*target;    /* make a block move on overlapping areas. */
  31.     ...
  32.  
  33. When disassembling this I get respectively for
  34. THINK C 4.05:
  35. =============
  36. +0698  0066A51A  *BRA.S      UPDATEIN+06AA              ; 0066A52C   | 6010
  37. +069A  0066A51C   MOVEA.L    -$003C(A6),A0                           | 206E
  38. FFC4
  39. +069E  0066A520   SUBQ.L     #$6,-$003C(A6)                          | 5DAE
  40. FFC4
  41. +06A2  0066A524   MOVEA.L    -$003C(A6),A1                           | 226E
  42. FFC4
  43. +06A6  0066A528   MOVE.L     (A1)+,(A0)+                             | 20D9
  44. +06A8  0066A52A   MOVE.W     (A1)+,(A0)+                             | 30D9
  45. +06AA  0066A52C   MOVE.L     -$0038(A6),D0                           | 202E
  46. FFC8
  47. +06AE  0066A530   CMP.L      -$003C(A6),D0                           | B0AE
  48. FFC4
  49. +06B2  0066A534   BNE.S      UPDATEIN+069A              ; 0066A51C   | 66E6
  50. +06B4  0066A536   MOVEA.L    -$0038(A6),A0                           | 206E
  51. FFC8
  52. +06B8  0066A53A   MOVE.L     -$0094(A6),(A0)                         | 20AE
  53. FF6C
  54. +06BC  0066A53E   MOVEA.L    -$0038(A6),A0                           | 206E
  55. FFC8
  56. +06C0  0066A542   MOVE.W     -$009E(A6),$0004(A0)                    | 316E
  57. FF62 0004
  58. +06C6  0066A548   BRA        UPDATEIN+076E              ; 0066A5F0   | 6000
  59. 00A6
  60.  
  61. which seems to work ok.
  62.  
  63. For
  64. THINK C 5.04:
  65. =============
  66. +37AE  0072F30E  *BRA.S      'XFCN 0190 0816 checI+37C0 ; 0072F320   | 6010
  67. +37B0  0072F310   MOVEA.L    -$0082(A6),A0                           | 206E
  68. FF7E
  69. +37B4  0072F314   SUBQ.L     #$6,-$0082(A6)                          | 5DAE
  70. FF7E
  71. +37B8  0072F318   MOVE.L     (A0),(A0)                               | 2090
  72. +37BA  0072F31A   MOVE.W     $0004(A0),$0004(A0)                     | 3168
  73. 0004 0004
  74. +37C0  0072F320   MOVE.L     -$00D6(A6),D0                           | 202E
  75. FF2A
  76. +37C4  0072F324   CMP.L      -$0082(A6),D0                           | B0AE
  77. FF7E
  78. +37C8  0072F328   BNE.S      'XFCN 0190 0816 checI+37B0 ; 0072F310   | 66E6
  79. +37CA  0072F32A   MOVEA.L    -$00D6(A6),A0                           | 206E
  80. FF2A
  81. +37CE  0072F32E   MOVE.L     -$00DA(A6),(A0)                         | 20AE
  82. FF26
  83. +37D2  0072F332   MOVE.W     -$00E4(A6),$0004(A0)                    | 316E
  84. FF1C 0004
  85. +37D8  0072F338   BRA        'XFCN 0190 0816 checI+385A ; 0072F3BA   | 6000
  86. 0080
  87.  
  88. This code does not work in certain cases.
  89.  
  90. I am neither an C expert nor an MC68 ASM expert, so I am not able to
  91. resolve
  92. this myself. So if anybody could tell what is wrong and what to do about
  93. it,
  94. I would be very glad!
  95.  
  96. Thanks,
  97.  
  98. Arne Venstad    E-mail: Arne.Venstad@delab.sintef.no
  99. SINTEF DELAB
  100. N-7034 Trondheim,
  101. Norway.
  102.