home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / sys / mac / programm / 13278 < prev    next >
Encoding:
Text File  |  1992-07-31  |  1.3 KB  |  47 lines

  1. Path: sparky!uunet!sun-barr!ames!agate!dog.ee.lbl.gov!csa2.lbl.gov!sichase
  2. From: sichase@csa2.lbl.gov (SCOTT I CHASE)
  3. Newsgroups: comp.sys.mac.programmer
  4. Subject: Easy inline assembly question (Think C)
  5. Date: 31 Jul 92 20:04:25 GMT
  6. Organization: Lawrence Berkeley Laboratory - Berkeley, CA, USA
  7. Lines: 33
  8. Distribution: na
  9. Message-ID: <25120@dog.ee.lbl.gov>
  10. Reply-To: sichase@csa2.lbl.gov
  11. NNTP-Posting-Host: 128.3.254.197
  12. News-Software: VAX/VMS VNEWS 1.3-4   
  13.  
  14. I am trying to write my first simple piece of inline assembly, and 
  15. was surprised (having *thought* I understood the documentation) that 
  16. the following piece of code won't compile.  I get a "illegal pointer 
  17. arithmetic" error message. 
  18.  
  19. #define NMAX 64
  20.  
  21. unsigned long power[NMAX+1][3];
  22.  
  23. main()
  24. {
  25. int i,j,k;
  26.  
  27.     for (i=0;i<=NMAX;i++) {
  28.         for (j=0;j<NMAX;j++) {
  29.             asm {
  30. /* comiler doesn't like this -> */    MOVE.L    power[j][2], D0    
  31.                 ... more asm code deleted to save bandwidth
  32.                 }
  33.             }
  34.         }
  35.             
  36. }
  37.  
  38. What's the poop?
  39.  
  40. -Scott
  41. --------------------
  42. Scott I. Chase            "The question seems to be of such a character
  43. SICHASE@CSA2.LBL.GOV        that if I should come to life after my death
  44.                 and some mathematician were to tell me that it
  45.                 had been definitely settled, I think I would
  46.                 immediately drop dead again."      - Vandiver
  47.