home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!sun-barr!ames!agate!dog.ee.lbl.gov!csa2.lbl.gov!sichase
- From: sichase@csa2.lbl.gov (SCOTT I CHASE)
- Newsgroups: comp.sys.mac.programmer
- Subject: Easy inline assembly question (Think C)
- Date: 31 Jul 92 20:04:25 GMT
- Organization: Lawrence Berkeley Laboratory - Berkeley, CA, USA
- Lines: 33
- Distribution: na
- Message-ID: <25120@dog.ee.lbl.gov>
- Reply-To: sichase@csa2.lbl.gov
- NNTP-Posting-Host: 128.3.254.197
- News-Software: VAX/VMS VNEWS 1.3-4
-
- I am trying to write my first simple piece of inline assembly, and
- was surprised (having *thought* I understood the documentation) that
- the following piece of code won't compile. I get a "illegal pointer
- arithmetic" error message.
-
- #define NMAX 64
-
- unsigned long power[NMAX+1][3];
-
- main()
- {
- int i,j,k;
-
- for (i=0;i<=NMAX;i++) {
- for (j=0;j<NMAX;j++) {
- asm {
- /* comiler doesn't like this -> */ MOVE.L power[j][2], D0
- ... more asm code deleted to save bandwidth
- }
- }
- }
-
- }
-
- What's the poop?
-
- -Scott
- --------------------
- Scott I. Chase "The question seems to be of such a character
- SICHASE@CSA2.LBL.GOV that if I should come to life after my death
- and some mathematician were to tell me that it
- had been definitely settled, I think I would
- immediately drop dead again." - Vandiver
-