From: pete AT duchess DOT compulink DOT co DOT uk Newsgroups: comp.os.msdos.djgpp Subject: BEGINNER - DJGPP array addresses!!! HELP Date: Thu, 02 Oct 1997 22:47:57 GMT Message-ID: <875803348.236.0.nnrp-08.9e9889d0@news.demon.co.uk> NNTP-Posting-Host: mythinc.demon.co.uk Lines: 31 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk I am working on the BT848 chip and with the sample code comes the DJGPP compiler etc. There are various routines to talk to the PCI-based chip and one requires sending the address of mode 13 graphics. The routine simply says: risc_main[i*2+1]=bt848.GetScreenPhysAdr() + i * width * 2; No problems, anoth routine SetScreenPhyAdr accepts 0xa0000 which we all know is the base address for mode 113h graphics. No other info is passed, so as a Borland small model programmer I figured this is a simple 32-bit address. BUT I wanted the card to write to memory instead of Video memory, so I created an array char m[80000]; which is WAY oversize. Then I altered the code to read: risc_main[i*2+1]=(unsigned int) &m + i * width * 2; And all manner of variations, but the program when running just goes away for a walk. Obviously I'm missing something, all I want to do is pass the address of the local array to the routine. (I want to work on the graphics instead of simply displaying them). Comments please, and be delicate, never done 32 bit flat programming, Always used Borland small model. Regards, pete AT duchess DOT cix DOT co DOT uk