Path: utzoo!mnetor!uunet!lll-winken!lll-tis!ames!ucsd!sdcsvax!ucsdhub!hp-sdd!ncr-sd!crash!pnet01!haitex From: haitex@pnet01.cts.com (Wade Bickel) Newsgroups: comp.sys.amiga Subject: Re: Copying to chip RAM Message-ID: <2749@crash.cts.com> Date: 30 Mar 88 11:40:46 GMT Sender: news@crash.cts.com Organization: People-Net [pnet01], El Cajon CA Lines: 29 papa@pollux.usc.edu (Marco Papa) writes: >In article <2210@phoenix.Princeton.EDU| kenchiu@phoenix.Princeton.EDU (Kenneth Chiu) writes: >|In article <442@lamont.Columbia.edu| adam@lamont.Columbia.edu (adam levin) writes: >||I have a 'C' array which needs to be in chip RAM. The examples I have found >||declare the array, AllocMem some chip RAM, and copy the array into it. >| >|I'm not sure of all the details, but I'm assuming that you have a lot of >|static data. Two solutions come to mind: (1) keep the data in a file, >|allocate a chip array, initialize from the file. (2) create a static >|data segment, forcing everything into chip, then LoadSeg() it. Neither >|solution is very elegant. Compilers need another storage class. > >Both Lattice C and MANX C have link-time switches that allow you pto ut all >or some of the data in a hunk that will be loaded in CHIP memory. Details >in the manuals. In Modula-2 I handle this kind of problem as follows. First create a pointer to an ARRAY of the type you want, then use the Alloc function of your choice to create the memory allocation on the end of your pointer. Works great for me. I do it all the time and I know this works in C because I used to do it with MANX as well. Good Luck, Wade. UUCP: {cbosgd, hplabs!hp-sdd, sdcsvax, nosc}!crash!pnet01!haitex ARPA: crash!pnet01!haitex@nosc.mil INET: haitex@pnet01.CTS.COM