Xref: utzoo comp.sys.amiga.tech:170 comp.sys.amiga:17141 Path: utzoo!mnetor!uunet!lll-winken!lll-tis!ames!ucsd!sdcsvax!ucsdhub!hp-sdd!hplabs!hpda!athertn!ericb From: ericb@athertn.Atherton.COM (Eric Black) Newsgroups: comp.sys.amiga.tech,comp.sys.amiga Subject: Re: Generating ROMable downloads for embedded 680x0 type machines Message-ID: <178@mango.athertn.Atherton.COM> Date: 2 Apr 88 01:48:13 GMT References: <17369@glacier.STANFORD.EDU> Reply-To: ericb@mango.UUCP (Eric Black) Organization: Atherton Technology, Sunnyvale, CA Lines: 58 Keywords: ROM, embedded, 68000, 68010 In article <> jbn@glacier.STANFORD.EDU (John B. Nagle) writes: > > I need to generate ROMable code for an embedded 68010-like machine. >Are there any programs available for the Amiga that will help with this? There is a set of programs on Fish disk #26 (I believe; I'm not sure which one), which take Amiga load files and "de-hunk" them to create ROM-able download files. There is a utility to create the S-records that many PROM-bombers understand. This allows you to write code using whatever assembler or compiler you want, as long as you follow the rules for creating ROM-able code. These rules are much easier to follow if you are writing in assembler, but you can do it in C if you try hard (I've done it successfully with both Lattice and Manx). If you're asking the question, then I will assume that you know how to write ROM-able code... Anyway, if you are using an Amiga compiler or assembler, be careful not to use any routines (or C functions, even ones the compiler may reference for you) that are Amiga-specific. Obvious ones are the Amiga libraries loaded on demand at runtime. Allowable ones are runtime library routines such as string handling which are linked in. Make sure you tell the compiler or assembler to generate position-independent code (this is easy to to [usually] on the Amiga tools). Here's where your coding technique is important. You must EXPLICITLY set variables to initial values in your code. The initial values will be in ROM. Your variables will end up in BSS. You must make sure that you keep them straight. Make sure that your BSS is origined wherever your RAM turns out to be, and explicitly copy values from the defined constants in ROM into the variables. It's easy in assembler, not quite so easy but still quite doable in C. Once you have generated your load module, use the "unhunk" program on the Fish disk to create a file which is quite similar to a Unix a.out-format file, containing three separate segments -- text, data, and bss. You can set the origin for each of the three segments separately to whatever physical address you need, based on your machine with the embedded 68010. Put the initialized data segment right after the text segment (this is the default). These will be burned into ROM. Pass the file thus created through the separate program to create S-records, and download them to your PROM-bomber. If you can't get hold of the correct Fish disk (I think it's #26, but I'm not sure), I can mail you the code, since I am the author. I have used it successfully for generating ROM-resident code for 68000-based hardware using my Amiga. Hope this helps! -- Eric Black "Garbage in, Gospel out" Atherton Technology, 1333 Bordeaux Dr., Sunnyvale, CA, 94089 UUCP: {sun!sunncal,decwrl,hpda}!athertn!ericb Domainist: ericb@Atherton.COM