See below, please.

regards,

Richard Erlacher

----- Original Message ----- 
From: "Dave McGuire" <[EMAIL PROTECTED]>
To: <sdcc-user@lists.sourceforge.net>
Sent: Saturday, September 06, 2008 7:05 PM
Subject: Re: [Sdcc-user] documentation & open source generally


> On Sep 6, 2008, at 8:32 PM, Richard Erlacher wrote:
>>> The assembler generates relocatable object files.  The linker
>>> translates those relocatable addresses into absolute addresses, and
>>> writes the resulting memory image to the output file.
>>>
>> I know what a linker does for a living.  I just don't know why I'd
>> have to
>> use one when my object code is probably going to be no larger than
>> 64 kB.
>> That would probably only amount to about 25-30 k-lines of code,
>> depending on
>> tables sizes, etc, and that shouldn't require a linker be involved
>> at all.
>
> Because the assembler outputs relocatable object files, not
> absolute binaries.  Nearly all assemblers do this, whether their
> inputs are absolutely-addressed or not.
>
>>> If all of your addresses are explicitly defined, then the linker
>>> has very little to do other than generate the memory image to the
>>> output file.  No modern assembler that I'm aware of generates binary
>>> (or hex-ified binary) files directly; asx8051 is no exception.
>>>
>> Most of the assemblers I've used over the years do exactly that, as
>> they're
>> processor-specific and not intended for use together with other tools.
>
>   This is actually rather rare.  Yes, it does happen (CP/M's
> assembler comes to mind) but it's not the norm.

There were several assemblers associated with CP/M, namely ASM, MASM, M80, 
MAC, and RMAC.  IIRC, RMAC produced rel files that fed L80, the linker. 
Wasn't it kind-of similar in the PC-DOS environment?  I didn't use TASM 
(BORLAND) more than once or twice.  What did it do? I think all its outputs 
were page-relocatable based on segment boundaries.  All that stuff was so 
automated that one didn't have to "know" anything.

>
>> So
>> you're saying this one isn't able to generate .hex and .omf files
>> directly, is that right?
>
>   The assembler?  No, it's not.  That's the linker's job.
>
That surprises me only because the ASEM-51 that I've been using generates 
the hex and debug (OMF) files directly.  It's newer than the SDCC assembler.
>
>>   Do you know of any assemblers, not associated with one
>> compiler or another, that behave in this way?  I've not encounterd
>> them,
>> though I've used numerous compiler/assembler/linker/debugger
>> suites.  I'm
>> sure I've got at least a half-dozen assemblers that simply take a
>> source
>> file and produce .hex or, in the case of MOT processors, .s19 output.
>
>   I've got a few myself.  None that are at all recent, though.
>
I doubt any new instructions will be added, since there are only one or two 
empty spaces in the instruction map.  It's been like that for decades, so 
there's been no need for "new" assemblers.  SDCC has been around since the 
mid-'90's hasn't it?  The assembler SDCC uses is older than SDCC, isn't it?

There's an assembler that came with the Dunfield compiler dating back to the 
early '90's.  I don't believe it relies on the linker, even though one is 
included.
>
>> Since I'd see no need for a linker in this context, I'd never have
>> looked at
>> the linker doc's to find out how to drive the assembler and
>> generate the
>> necessary output.  This is useful information.
>
> Understood.  I can see how that'd be particularly confusing.  Just
> think of what you're used to as being the "assembler" as being split
> into two components; that's probably the easiest way to envision this
> setup.
>
It's certainly understandable, considering the context.
>
>             -Dave
>
> --
> Dave McGuire
> Port Charlotte, FL
>
> 

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Sdcc-user mailing list
Sdcc-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sdcc-user

Reply via email to