[comp.sys.amiga] Generating ROMable downloads for embedded 680x0 type machines

jbn@glacier.STANFORD.EDU (John B. Nagle) (03/22/88)

     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?
I'd like to be able to take an assembly-code file, assemble it, link
it, and generate a file of S-records or other form suitable for download
or ROM creation.  (Understand that the target system is not an Amiga, but
a single-board special-purpose computer with no useful peripherals.)
I have Lattice C 4.0.

					John Nagle

bryce@eris (Bryce Nesbitt) (03/22/88)

[A perfect .tech question]

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?

Three assemblers can produce direct binary output (with no AmigaDOS junk
in the middle):

HiSoft DevPac		;Good, small, fast.  No direct 68010 support
Inovatronics CAPE	;Great.  (Might not be out yet) (will do 68010)
Abacus AssemPro		;Terrible.  Forget it.  (Will do 68010)

You can write an easy converter to change the plain binary file into
S-file records suitable for download to a prom programmer.

Note that this just converts assembly code into absolute binary, it
won't link.


You probably want to link up Lattice code, assembly and then produce
a binary for a specified target address.  This requires a version of the dos
"LoadSeg()" that can use a specified target address.  You could
write such a utility using the information in the AmigaDOS technical
reference manual.

Such a utility exists for Commodore to use in creating Kickstarts.  It is not
PD, and as far as I know, not available.  You'll need to roll your own.

|\_/|  . ACK!, NAK!, EOT!, SOH!
{O_o} .     Bryce Nesbitt
 (")        BIX: mleeds (temporarily)
  U	    USENET: bryce@eris.berkeley.EDU -or- ucbvax!eris!bryce

louie@trantor.umd.edu (Louis A. Mamakos) (03/22/88)

You may want to look at a Fish Disk #26, for the UNHUNK program.  This takes
and Amiga load file, collects the various hunk types together, than produces
a file similar to an a.out.  I believe that there is another program that
can make motorola S records from the intermediate file.

I looked at this a while ago for a project that I was working on, but the
project evaporated, and I lost interest.


Louis A. Mamakos  WA3YMH    Internet: louie@TRANTOR.UMD.EDU
University of Maryland, Computer Science Center - Systems Programming

john13@garfield.UUCP (John Russell) (03/23/88)

In article <7894@agate.BERKELEY.EDU> bryce@eris.berkeley.EDU (Bryce Nesbitt) writes:
]
]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?
]
]Three assemblers can produce direct binary output (with no AmigaDOS junk
]in the middle):
]
]HiSoft DevPac			(descriptions omitted)
]Inovatronics CAPE
]Abacus AssemPro

From a while ago the name "Quelo" rings a bell. Don't they produce an Amiga
version of a 680X0 cross development system?

John

ericb@athertn.Atherton.COM (Eric Black) (04/02/88)

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

rchampe@hubcap.UUCP (Richard Champeaux) (04/05/88)

In article <178@mango.athertn.Atherton.COM>, ericb@athertn.Atherton.COM (Eric Black) writes:
> 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.
> 
> 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.
> 
> -- 
> 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

Eric,
     Could you please mail the code you mentioned.  I'm building a 68000
based system, and that program would save me alot of time.  I had started
looking into writing my own, but it looked like a nightmare I didn't want
to deal with.

Thanks.

Rich Champeaux
Clemson University

P.S.  I tried to mail this to you, but unless I know the exact path to route
my mail through, all of my mail is returned with "Host Unknown".  This makes
it difficult to use vnews or mail to reply to sender.  However, appearently
no one else has such problems when they send mail to me.

P.P.S.  It seems that eventhough my computer can receive Amiga.Tech, when I
try to follow up an article, it claims that I didn't give it a newsgroup to
post to.