Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!lll-lcc!styx!ames!ucbcad!ucbvax!renoir.Berkeley.EDU!robinson From: robinson@renoir.Berkeley.EDU (Michael Robinson) Newsgroups: comp.sys.amiga Subject: Re: 64k tables & Manx? (Summary) Message-ID: <18703@ucbvax.BERKELEY.EDU> Date: Mon, 4-May-87 22:20:27 EDT Article-I.D.: ucbvax.18703 Posted: Mon May 4 22:20:27 1987 Date-Received: Tue, 5-May-87 07:02:45 EDT References: <18567@ucbvax.BERKELEY.EDU> <1799@cbmvax.cbmvax.cbm.UUCP> Sender: usenet@ucbvax.BERKELEY.EDU Reply-To: robinson@renoir.Berkeley.EDU.UUCP (Michael Robinson) Distribution: na Organization: University of California, Berkeley Lines: 50 In article <1799@cbmvax.cbmvax.cbm.UUCP> carolyn@cbmvax.UUCP (Carolyn Scheppner CATS) writes: >In article <18567@ucbvax.BERKELEY.EDU> I (Michael Robinson) write: >>I have a program I am writing as a C/assembly hybrid for which I have need >>of a 64k (2^16, 65536) byte table. >> >>I would like to get the whole table loaded cleanly into the final executable >>with a symbol pointing at the center so I can access all 65536 bytes using >>register indirect with index addressing (small style). >>[] > > Not sure if this is appropriate, but my suggestion is to use AllocMem() >to allocate the memory for the table. You can then set up whatever kind >of pointer you want to point at whatever spot you want. Except for one message suggesting I get Lattice, this is the only response I received. But I managed to figure it out on my own, anyway. Because the table in question contains data that will always be needed by the program (the program will not run without it), I did not want to keep it in a separate file, and load it in at run time. To much possibility for user error. My solution was to create an assembly language program containing only 256 "dcb.b 256, 42" statements (see note below), and labels at the first and 128th block. I then assembled this program, and, after some experimentation, I was able to determine enough of the structure of the linker format that I was able to modify the program that generates the table to do fseeks into the existing .o file, and replace the 42's with the actual data. >Carolyn Scheppner -- CBM >>Amiga Technical Support<< Note below: The Manx assembler limits the size of a dcb (Define constant block) to 256 bytes, but does not check that the value you specified is equal or less than that. Consequently, you can specify a block 257 bytes long, and the assembler will merrily produce a 256 byte block without informing you that you are not getting what you asked for. If you specify a number large enough, the assembler will crash (guru). I would guess that this constitutes a bug. It is especially annoying, because the manual makes no mention of the 256 byte limit in the manual. ------------------------------------------------------------------------------ "If you study the logistics and heuristics of the mystics, You will find that their minds rarely move in a line" "The Ranger isn't going to like it, Yogi." Mike Robinson USENET: ucbvax!ernie!robinson ARPA: robinson@ernie.berkeley.edu